diff --git a/product_quick_bom/README.rst b/product_quick_bom/README.rst index 2697b28e9..1c012bd77 100644 --- a/product_quick_bom/README.rst +++ b/product_quick_bom/README.rst @@ -3,7 +3,7 @@ :alt: License: AGPL-3 ================= -product_quick_bom +Product Quick Bom ================= This module was written to create quickly the bom for your product. @@ -15,12 +15,12 @@ Usage To use this module, you need to: -* go to a product form, click on edit, add a line in the bom tab and see that a bom - linked to the product have been created +* Go to a product form, click on edit, add a line in the bom tab and see that a bom + linked to the product have been created. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/manufacture/10.0 + :target: https://runbot.odoo-community.org/runbot/129/10.0 .. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt .. branch is "8.0" for example @@ -36,8 +36,6 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - Credits ======= diff --git a/product_quick_bom/__init__.py b/product_quick_bom/__init__.py index e55d597f7..8ebf94e87 100644 --- a/product_quick_bom/__init__.py +++ b/product_quick_bom/__init__.py @@ -2,5 +2,4 @@ # Copyright (C) 2015 Akretion (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import product -from . import bom +from . import models diff --git a/product_quick_bom/__manifest__.py b/product_quick_bom/__manifest__.py index 5d7f04e59..a0f27800e 100644 --- a/product_quick_bom/__manifest__.py +++ b/product_quick_bom/__manifest__.py @@ -16,7 +16,7 @@ "mrp", ], "data": [ - "product_view.xml", + "views/product_view.xml", ], } diff --git a/product_quick_bom/models/__init__.py b/product_quick_bom/models/__init__.py new file mode 100644 index 000000000..e55d597f7 --- /dev/null +++ b/product_quick_bom/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2015 Akretion (http://www.akretion.com). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import product +from . import bom diff --git a/product_quick_bom/bom.py b/product_quick_bom/models/bom.py similarity index 100% rename from product_quick_bom/bom.py rename to product_quick_bom/models/bom.py diff --git a/product_quick_bom/product.py b/product_quick_bom/models/product.py similarity index 99% rename from product_quick_bom/product.py rename to product_quick_bom/models/product.py index 1517bcec9..4eca5dd82 100644 --- a/product_quick_bom/product.py +++ b/product_quick_bom/models/product.py @@ -54,7 +54,6 @@ class ProductTemplate(models.Model): ctx = self._context.copy() ctx.pop('default_type', None) self.with_context(ctx)._process_bom_vals(bom_vals) - return res @api.multi diff --git a/product_quick_bom/tests/__init__.py b/product_quick_bom/tests/__init__.py index 161d59021..7f893d1fe 100644 --- a/product_quick_bom/tests/__init__.py +++ b/product_quick_bom/tests/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015 Akretion (http://www.akretion.com). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from . import test_quick_bom \ No newline at end of file +from . import test_quick_bom diff --git a/product_quick_bom/tests/test_quick_bom.py b/product_quick_bom/tests/test_quick_bom.py index 101fa367d..4893a8bde 100644 --- a/product_quick_bom/tests/test_quick_bom.py +++ b/product_quick_bom/tests/test_quick_bom.py @@ -2,7 +2,7 @@ # Copyright (C) 2015 Akretion (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase import logging _logger = logging.getLogger(__name__) @@ -25,18 +25,14 @@ class TestQuickBom(TransactionCase): (0, 0, {'product_id': self.cpu.id, 'product_qty': 1, })]}) bom = self.computer.bom_ids self.assertEqual(self.computer.id, bom.product_tmpl_id.id) - self.assertEqual(bom.bom_line_ids[0].product_id.id, - self.ram.id) + self.assertEqual(bom.bom_line_ids[0].product_id.id, self.ram.id) self.assertEqual(bom.bom_line_ids[0].product_qty, 2) - self.assertEqual(bom.bom_line_ids[1].product_id.id, - self.hard_drive.id) + self.assertEqual(bom.bom_line_ids[1].product_id.id, self.hard_drive.id) self.assertEqual(bom.bom_line_ids[1].product_qty, 2) - self.assertEqual(bom.bom_line_ids[2].product_id.id, - self.cpu.id) + self.assertEqual(bom.bom_line_ids[2].product_id.id, self.cpu.id) self.assertEqual(bom.bom_line_ids[2].product_qty, 1) def test_read_bom(self): - bom = self.env['mrp.bom'].create({ 'type': 'normal', 'product_tmpl_id': self.computer.id}) diff --git a/product_quick_bom/product_view.xml b/product_quick_bom/views/product_view.xml similarity index 100% rename from product_quick_bom/product_view.xml rename to product_quick_bom/views/product_view.xml