From 89d3293158c8e19084b958c06393ca45b05dda1b Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Tue, 8 Oct 2019 17:53:10 +0000 Subject: [PATCH] [IMP] account: Don't allow Invoice creation from Payment Fixes https://github.com/odoo/odoo/issues/38233 New Invoices shouldn't be created from Payment screen. closes odoo/odoo#38687 X-original-commit: 44226ec450e09d7893c5c3ca0d0d8e6533ccc246 Signed-off-by: Quentin De Paoli (qdp) --- addons/account/models/account_payment.py | 1 + addons/account/views/account_payment_view.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 70773401d7e..2b5d528637b 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -428,6 +428,7 @@ class account_payment(models.Model): 'views': [(self.env.ref('account.view_move_tree').id, 'tree'), (self.env.ref('account.view_move_form').id, 'form')], 'type': 'ir.actions.act_window', 'domain': [('id', 'in', [x.id for x in self.reconciled_invoice_ids])], + 'context': {'create': False}, } def unreconcile(self): diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index 58860ec464b..ea7ff8b48c3 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -135,7 +135,7 @@ groups="account.group_account_user" attrs="{'invisible':[('move_line_ids','=',[])]}" icon="fa-bars"/> -