diff --git a/product_contract/__manifest__.py b/product_contract/__manifest__.py index f2a3411c8..c495c7268 100644 --- a/product_contract/__manifest__.py +++ b/product_contract/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Recurring - Product Contract', - 'version': '12.0.1.0.0', + 'version': '12.0.2.0.0', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "LasLabs, " diff --git a/product_contract/migrations/12.0.2.0.0/pre-migration.py b/product_contract/migrations/12.0.2.0.0/pre-migration.py new file mode 100644 index 000000000..ca2542a4c --- /dev/null +++ b/product_contract/migrations/12.0.2.0.0/pre-migration.py @@ -0,0 +1,18 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import logging + +from openupgradelib import openupgrade + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + xmlids_to_rename = [ + ( + 'product_contract.account_analytic_account_recurring_form_form', + 'product_contract.contract_contract_customer_form_view', + ) + ] + openupgrade.rename_xmlids(cr, xmlids_to_rename) diff --git a/product_contract/models/sale_order.py b/product_contract/models/sale_order.py index bbc1345c8..d84b0a217 100644 --- a/product_contract/models/sale_order.py +++ b/product_contract/models/sale_order.py @@ -107,7 +107,7 @@ class SaleOrder(models.Model): def action_show_contracts(self): self.ensure_one() action = self.env.ref( - "contract.action_account_analytic_sale_overdue_all" + "contract.contract_contract_customer_form_view" ).read()[0] contracts = ( self.env['contract.line'] diff --git a/product_contract/tests/test_sale_order.py b/product_contract/tests/test_sale_order.py index 4d859c671..e16374395 100644 --- a/product_contract/tests/test_sale_order.py +++ b/product_contract/tests/test_sale_order.py @@ -294,3 +294,11 @@ class TestSaleOrder(TransactionCase): self.assertEqual( self.contract_line.termination_notice_rule_type, 'weekly' ) + + def test_action_show_contracts(self): + self.sale.action_confirm() + action = self.sale.action_show_contracts() + self.assertEqual( + self.env['contract.contract'].search(action['domain']), + self.sale.order_line.mapped('contract_id'), + ) diff --git a/product_contract/views/contract.xml b/product_contract/views/contract.xml index 95208855f..1762136ac 100644 --- a/product_contract/views/contract.xml +++ b/product_contract/views/contract.xml @@ -5,7 +5,7 @@ --> - contract.contract