From cb420ff0810e68bfd5d3d7cbbdf40fd532628c9d Mon Sep 17 00:00:00 2001 From: ronozoro Date: Sun, 10 Nov 2024 18:44:04 -0800 Subject: [PATCH] fix issue in the purchase rejoin --- .gitignore | 129 ++++++++++++++++++ .../models/purchase_order.py | 2 +- .../models/purchase_order.py | 4 +- 3 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..a6d3fcfee --- /dev/null +++ b/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +.vscode +.idea diff --git a/odex25_purchase/governmental_purchase/models/purchase_order.py b/odex25_purchase/governmental_purchase/models/purchase_order.py index 8e9cf1bad..e5656f1bc 100644 --- a/odex25_purchase/governmental_purchase/models/purchase_order.py +++ b/odex25_purchase/governmental_purchase/models/purchase_order.py @@ -33,7 +33,7 @@ class PurchaseOrderCustom(models.Model): def button_confirm(self): # res = super(PurchaseOrderCustom, self).button_confirm() for order in self: - if order.state not in ['draft', 'sent', 'sign']: + if order.state not in ['draft', 'sent', 'sign','wait']: continue order._add_supplier_to_product() # Deal with double validation process diff --git a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py index 1f70b6522..51c708a4f 100644 --- a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py +++ b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py @@ -351,7 +351,7 @@ class PurchaseOrderCustom(models.Model): def button_approve(self): for rec in self: - if rec.requisition_id and rec.requisition_id.state != 'approve': + if rec.requisition_id and rec.requisition_id.state not in ['approve','in_progress']: raise ValidationError(_("Purchase agreement not approved")) else: # You can Approve @@ -536,7 +536,7 @@ class PurchaseOrderCustom(models.Model): def button_confirm(self): for order in self: - if order.state not in ['draft']: + if order.state not in ['draft','wait']: continue order._add_supplier_to_product() # Deal with double validation process