From 4c3c8e50db02bb09578d30628a3a9486ae047e99 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 8 Mar 2017 00:31:23 +0100 Subject: [PATCH] Remove show_account_move_form because of the fact that the context is kept from the account.move.line form view, so it triggers a crash when creating a line from the account.move form Fix domain on analytic account on move lines --- account_usability/account.py | 14 ++------------ account_usability/account_view.xml | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/account_usability/account.py b/account_usability/account.py index 63a7bf5..1488a56 100644 --- a/account_usability/account.py +++ b/account_usability/account.py @@ -197,18 +197,8 @@ class AccountMoveLine(models.Model): else: self.credit = amount_company_currency - @api.multi - def show_account_move_form(self): - self.ensure_one() - action = self.env['ir.actions.act_window'].for_xml_id( - 'account', 'action_move_line_form') - action.update({ - 'res_id': self.move_id.id, - 'view_id': False, - 'views': False, - 'view_mode': 'form,tree', - }) - return action + analytic_account_id = fields.Many2one( + domain=[('type', 'not in', ('view', 'template'))]) class AccountBankStatement(models.Model): diff --git a/account_usability/account_view.xml b/account_usability/account_view.xml index 2b57b1f..61323fd 100644 --- a/account_usability/account_view.xml +++ b/account_usability/account_view.xml @@ -234,7 +234,6 @@ module --> -