Skip to content

Commit

Permalink
[FIX] sale_invoice_plan: fix duplicate Create Invoice button
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dreispt committed Dec 20, 2023
1 parent e65e72e commit 8899940
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion sale_invoice_plan/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 0 additions & 16 deletions sale_invoice_plan/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,6 @@
attrs="{'invisible': [('invoice_plan_process', '=', False)]}"
/>
</xpath>
<xpath
expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][1]"
position="attributes"
>
<attribute
name="attrs"
>{'invisible': ['|', ('invoice_plan_process', '=', True), ('invoice_status', '!=', 'to invoice')]}</attribute>
</xpath>
<xpath
expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][2]"
position="attributes"
>
<attribute
name="attrs"
>{'invisible': ['|', ('invoice_plan_process', '=', True), '|', ('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}</attribute>
</xpath>
<xpath expr="/form/sheet/notebook/page" position="after">
<page
string="Invoice Plan"
Expand Down

0 comments on commit 8899940

Please sign in to comment.