From 685a73a7aae6a5f8066d589ef1753717d5f65f29 Mon Sep 17 00:00:00 2001 From: Reyes4711 Date: Fri, 14 May 2021 12:38:48 +0200 Subject: [PATCH] [14.0][MIG] product_analytic_purchase: Migration to 14.0 --- product_analytic_purchase/__manifest__.py | 6 ++-- .../models/purchase_order_line.py | 2 +- .../tests/test_purchase.py | 36 +++++++++++++++++-- .../odoo/__init__.py | 1 - .../odoo/addons/__init__.py | 1 - 5 files changed, 37 insertions(+), 9 deletions(-) delete mode 100644 setup/product_analytic_purchase/odoo/__init__.py delete mode 100644 setup/product_analytic_purchase/odoo/addons/__init__.py diff --git a/product_analytic_purchase/__manifest__.py b/product_analytic_purchase/__manifest__.py index 9bf3a67533..e04acd94b1 100644 --- a/product_analytic_purchase/__manifest__.py +++ b/product_analytic_purchase/__manifest__.py @@ -1,11 +1,11 @@ # Copyright 2017 Akretion (http://www.akretion.com/) - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). { "name": "Product Analytic Purchase", - "version": "10.0.1.0.0", + "version": "14.0.1.0.0", "category": "Purchases", - "license": "AGPL-3", + "license": "LGPL-3", "summary": "Glue module between purchase and product_analytic", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-analytic", diff --git a/product_analytic_purchase/models/purchase_order_line.py b/product_analytic_purchase/models/purchase_order_line.py index 257157da5c..fd3500b580 100644 --- a/product_analytic_purchase/models/purchase_order_line.py +++ b/product_analytic_purchase/models/purchase_order_line.py @@ -1,5 +1,5 @@ # Copyright 2017 Akretion (http://www.akretion.com/) - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import api, models diff --git a/product_analytic_purchase/tests/test_purchase.py b/product_analytic_purchase/tests/test_purchase.py index 9721df129a..d2014ea962 100644 --- a/product_analytic_purchase/tests/test_purchase.py +++ b/product_analytic_purchase/tests/test_purchase.py @@ -1,7 +1,7 @@ # © 2015 Antiun Ingenieria - Javier Iniesta # © 2017 Tecnativa - Luis Martínez # © 2017 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License lGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo.tests.common import TransactionCase @@ -9,8 +9,38 @@ class TestPurchaseOrderLine(TransactionCase): def setUp(self): super(TestPurchaseOrderLine, self).setUp() - self.product1 = self.env.ref("product.product_product_3") - self.product2 = self.env.ref("product.service_order_01") + self.analytic = self.env["account.analytic.account"].create( + { + "name": "Our Super Product Development", + } + ) + self.product1 = self.env["product.product"].create( + { + "name": "Computer SC234", + "categ_id": self.env.ref("product.product_category_all").id, + "list_price": 450.0, + "standard_price": 300.0, + "type": "consu", + "uom_id": self.env.ref("uom.product_uom_unit").id, + "uom_po_id": self.env.ref("uom.product_uom_unit").id, + "description_sale": "17 LCD Monitor Processor AMD", + } + ) + self.product2 = self.env["product.product"].create( + { + "name": "Prepaid Consulting", + "categ_id": self.env.ref("product.product_category_all").id, + "list_price": 90, + "standard_price": 40, + "type": "service", + "uom_id": self.env.ref("uom.product_uom_hour").id, + "uom_po_id": self.env.ref("uom.product_uom_hour").id, + "description": "Example of product to invoice on order.", + "default_code": "SERV_ORDER", + "expense_analytic_account_id": self.analytic.id, + "income_analytic_account_id": self.analytic.id, + } + ) self.assertTrue(self.product2.expense_analytic_account_id) self.po = self.env["purchase.order"].create( { diff --git a/setup/product_analytic_purchase/odoo/__init__.py b/setup/product_analytic_purchase/odoo/__init__.py deleted file mode 100644 index de40ea7ca0..0000000000 --- a/setup/product_analytic_purchase/odoo/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/product_analytic_purchase/odoo/addons/__init__.py b/setup/product_analytic_purchase/odoo/addons/__init__.py deleted file mode 100644 index de40ea7ca0..0000000000 --- a/setup/product_analytic_purchase/odoo/addons/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__)