forked from OCA/stock-logistics-warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] packaging_uom, purchase_packaging, sale_packaging: Migrated to …
…10.0
- Loading branch information
Showing
55 changed files
with
1,055 additions
and
1,201 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
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,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from . import models |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Packaging UOM", | ||
"version": "10.0.1.0.0", | ||
"author": 'ACSONE SA/NV, ' | ||
'Odoo Community Association (OCA)', | ||
"category": "Warehouse", | ||
"website": "http://www.acsone.eu", | ||
'summary': "Use uom in package", | ||
"depends": ["product", | ||
], | ||
"data": ["views/product_packaging_views.xml", | ||
], | ||
"license": "AGPL-3", | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import product_packaging |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_packaging | ||
from . import test_product_packaging |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
import odoo.tests.common as common | ||
|
||
|
||
class TestProductPackaging(common.TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestProductPackaging, self).setUp() | ||
self.uom_unit = self.env.ref('product.product_uom_unit') | ||
self.uom_dozen = self.env.ref('product.product_uom_dozen') | ||
self.product_tmpl_dozen = self.env[ | ||
'product.template'].new( | ||
{'uom_id': self.uom_dozen}) | ||
self.product_tmpl_unit = self.env[ | ||
'product.template'].new( | ||
{'uom_id': self.uom_unit}) | ||
|
||
def test_compute_quantity_by_package(self): | ||
""" Create a packagings with uom product_uom_dozen on | ||
* product_tmpl_dozen (uom is product_uom_dozen) | ||
* product_tmpl_unit (uom is product_uom_unit) | ||
Result should be : | ||
* product_tmpl_dozen -> qty by package : 1 | ||
* product_tmpl_unit -> qty by package : 12 | ||
Create product_uom_24 | ||
Update product_tmpl_dozen to set this new uom | ||
Result should be : | ||
* product_tmpl_dozen -> qty by package : 0.5 | ||
Update product_package_unit to set this new uom | ||
Result should be : | ||
* product_packaging_unit -> qty by package : 24 | ||
Create product_uom 6 | ||
Update product_tmpl_dozen to set this new uom | ||
Result should be : | ||
* product_packaging_dozen -> qty by package : 2 | ||
Update product_packaging_unit to set this new uom | ||
Result should be : | ||
* product_packaging_unit -> qty by package : 6 | ||
""" | ||
|
||
packaging_obj = self.env['product.packaging'] | ||
product_packaging_dozen = packaging_obj.new( | ||
{'product_tmpl_id': self.product_tmpl_dozen, | ||
'uom_id': self.uom_dozen}) | ||
self.assertAlmostEqual(product_packaging_dozen.qty, 1) | ||
product_packaging_unit = packaging_obj.new( | ||
{'product_tmpl_id': self.product_tmpl_unit, | ||
'uom_id': self.uom_dozen}) | ||
self.assertAlmostEqual(product_packaging_unit.qty, 12) | ||
product_uom_24 = self.env['product.uom'].create( | ||
{'category_id': self.env.ref('product.product_uom_categ_unit').id, | ||
'name': 'Double Dozens', | ||
'factor_inv': 24, | ||
'uom_type': 'bigger' | ||
}) | ||
self.product_tmpl_dozen.uom_id = product_uom_24 | ||
self.assertAlmostEqual(product_packaging_dozen.qty, 0.5) | ||
product_packaging_unit.uom_id = product_uom_24 | ||
self.assertAlmostEqual(product_packaging_unit.qty, 24) | ||
product_uom_6 = self.env['product.uom'].create( | ||
{'category_id': self.env.ref('product.product_uom_categ_unit').id, | ||
'name': 'Demi Dozens', | ||
'factor_inv': 6, | ||
'uom_type': 'bigger' | ||
}) | ||
self.product_tmpl_dozen.uom_id = product_uom_6 | ||
self.assertAlmostEqual(product_packaging_dozen.qty, 2) | ||
product_packaging_unit.uom_id = product_uom_6 | ||
self.assertAlmostEqual(product_packaging_unit.qty, 6) |
Oops, something went wrong.