From 8899940d2263afd0a229e584e065cfad10cb6782 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Mon, 18 Dec 2023 15:13:52 +0000 Subject: [PATCH] [FIX] sale_invoice_plan: fix duplicate Create Invoice button When installed along with sale_subscription, recurring order would show two "Create Invoice" buttons. This is because the Subscription app adds a "Create Invoice" button specific for recurring orders. The solution is to not force the Sales Order original "Create Invoice" button visible. Instead make the "Create Invoice By Plan" button available. --- sale_invoice_plan/models/sale.py | 1 - sale_invoice_plan/views/sale_view.xml | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/sale_invoice_plan/models/sale.py b/sale_invoice_plan/models/sale.py index 549de96851c..21e2aad54d9 100644 --- a/sale_invoice_plan/models/sale.py +++ b/sale_invoice_plan/models/sale.py @@ -50,7 +50,6 @@ def _compute_invoice_plan_process(self): and has_invoice_plan and to_invoice and rec.invoice_status in ["to invoice", "no"] - and "advance" in to_invoice.mapped("invoice_type") ) @api.constrains("invoice_plan_ids") diff --git a/sale_invoice_plan/views/sale_view.xml b/sale_invoice_plan/views/sale_view.xml index b7413115fec..869303e5524 100644 --- a/sale_invoice_plan/views/sale_view.xml +++ b/sale_invoice_plan/views/sale_view.xml @@ -88,22 +88,6 @@ attrs="{'invisible': [('invoice_plan_process', '=', False)]}" /> - - {'invisible': ['|', ('invoice_plan_process', '=', True), ('invoice_status', '!=', 'to invoice')]} - - - {'invisible': ['|', ('invoice_plan_process', '=', True), '|', ('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]} -