-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] sale_restricted_qty: Migration to 16.0
- Loading branch information
1 parent
765f093
commit 24be3f2
Showing
11 changed files
with
66 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
# generated from manifests external_dependencies | ||
openupgradelib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Sale order min quantity | |
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:9d34c5ce0bf0071dd40afa3f708f0f3d3f2098e4ca0d4b26d65bb1a8a40a23e0 | ||
!! source digest: sha256:11c109b03c7404989c3814a5675fcc5ae0cb3088674059b409bc202355156177 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
|
@@ -17,13 +17,13 @@ Sale order min quantity | |
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/sale-workflow/tree/14.0/sale_restricted_qty | ||
:target: https://github.com/OCA/sale-workflow/tree/16.0/sale_restricted_qty | ||
:alt: OCA/sale-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_restricted_qty | ||
:target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_restricted_qty | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=14.0 | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
@@ -64,7 +64,7 @@ Bug Tracker | |
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_restricted_qty%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_restricted_qty%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
|
@@ -84,6 +84,9 @@ Contributors | |
* `Ooops <https://www.ooops404.com/>`_: | ||
|
||
* Ashish Hirpara <https://ashish-hirpara.com> | ||
* `Aion Tech <https://aiontech.company/>`_: | ||
|
||
* Simone Rubino <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -106,6 +109,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | |
|
||
|maintainer-ashishhirapara| | ||
|
||
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/14.0/sale_restricted_qty>`_ project on GitHub. | ||
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.0/sale_restricted_qty>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from . import models | ||
from .hooks import rename_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
# Copyright 2019 Akretion (<http://www.akretion.com>) | ||
# Copyright 2023 Simone Rubino - Aion Tech | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Sale order min quantity", | ||
"version": "14.0.1.1.1", | ||
"version": "16.0.1.0.0", | ||
"category": "Sales Management", | ||
"author": "Akretion, Odoo Community Association (OCA)", | ||
"contributors": ["Ashish Hirpara"], | ||
"maintainers": ["ashishhirapara"], | ||
"website": "https://github.com/OCA/sale-workflow", | ||
"license": "AGPL-3", | ||
"external_dependencies": { | ||
"python": ["openupgradelib"], | ||
}, | ||
"depends": ["sale_management"], | ||
"data": [ | ||
"views/product_category_views.xml", | ||
"views/product_template_views.xml", | ||
"views/product_product_views.xml", | ||
"views/sale_views.xml", | ||
], | ||
"pre_init_hook": "rename_module", | ||
"installable": True, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
* `Ooops <https://www.ooops404.com/>`_: | ||
|
||
* Ashish Hirpara <https://ashish-hirpara.com> | ||
* `Aion Tech <https://aiontech.company/>`_: | ||
|
||
* Simone Rubino <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright 2019 Akretion | ||
# Update (Migration) 2022 Ooops - Ashish Hirpara <[email protected]> | ||
# Copyright 2023 Simone Rubino - Aion Tech | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
import odoo.tests.common as common | ||
|
@@ -49,31 +50,18 @@ def setUp(self): | |
} | ||
) | ||
|
||
def refrech_sale_values(self, sale_order): | ||
sale_order.order_line._compute_sale_restricted_qty() | ||
sale_order.order_line.product_id_change() | ||
sale_order.order_line._compute_is_qty_less_min_qty() | ||
sale_order.order_line._compute_is_qty_bigger_max_qty() | ||
sale_values = sale_order._convert_to_write(sale_order._cache) | ||
return sale_values | ||
|
||
def test_check_sale_order_min_qty_required(self): | ||
line_values = {"product_id": self.product.id, "product_uom_qty": 5.0} | ||
self.product.manual_sale_min_qty = 10 | ||
# Create sale order line with Qty less than min Qty | ||
with self.assertRaises(ValidationError): | ||
sale_order = self.sale_order_model.new( | ||
{"partner_id": self.partner.id, "order_line": [(0, 0, line_values)]} | ||
) | ||
sale_values = self.refrech_sale_values(sale_order) | ||
sale_values.update( | ||
self.sale_order_model.create( | ||
{ | ||
"partner_shipping_id": sale_values["partner_id"], | ||
"partner_invoice_id": sale_values["partner_id"], | ||
"partner_id": self.partner.id, | ||
"order_line": [(0, 0, line_values)], | ||
"pricelist_id": 1, | ||
} | ||
) | ||
self.sale_order_model.create(sale_values) | ||
line_values["product_uom_qty"] = 12.0 | ||
# Create sale order line with Qty great then min Qty | ||
self.sale_order = self.sale_order_model.create( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters