From 00f6d370a21dae2b5e7f32c1fd82cc81468fdbe4 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Mon, 4 Feb 2019 11:36:35 +0100 Subject: [PATCH] [FIX] Errors in navigation to customer invoices / vendor bills --- contract/__manifest__.py | 2 +- contract/models/account_analytic_account.py | 11 +++++++++++ contract/views/account_analytic_account_view.xml | 9 +++++---- contract/views/account_invoice_view.xml | 15 +++++++++++++++ contract/views/res_partner_view.xml | 6 ++++-- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/contract/__manifest__.py b/contract/__manifest__.py index f065ff52..96879098 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -8,7 +8,7 @@ { 'name': 'Contracts Management - Recurring', - 'version': '11.0.4.0.0', + 'version': '11.0.4.1.0', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py index cd50b0ca..ef5d4667 100644 --- a/contract/models/account_analytic_account.py +++ b/contract/models/account_analytic_account.py @@ -354,3 +354,14 @@ class AccountAnalyticAccount(models.Model): 'target': 'new', 'context': ctx, } + + @api.multi + def button_show_recurring_invoices(self): + self.ensure_one() + if self.contract_type == 'sale': + action = self.env.ref( + 'contract.act_recurring_invoices') + else: + action = self.env.ref( + 'contract.act_purchase_recurring_invoices') + return action.read()[0] diff --git a/contract/views/account_analytic_account_view.xml b/contract/views/account_analytic_account_view.xml index 4e2bea42..4ef6991c 100644 --- a/contract/views/account_analytic_account_view.xml +++ b/contract/views/account_analytic_account_view.xml @@ -35,8 +35,8 @@ groups="base.group_no_one" args='0' /> -