diff --git a/sale_whole_order_invoiced/README.rst b/sale_whole_order_invoiced/README.rst index ee32df75..b4d159ec 100644 --- a/sale_whole_order_invoiced/README.rst +++ b/sale_whole_order_invoiced/README.rst @@ -54,7 +54,11 @@ Release notes: -------------- Since the version 1.1.0, the option `Invoice whole order (deduct down payments)` is selected by default when using this module. +Even when creating invoice(s) from list view, using the `Create Invoice`. +.. image:: static/description/sale_order_list_view.png + +.. image:: static/description/create_invoice_wizard.png Contributors ------------ diff --git a/sale_whole_order_invoiced/__manifest__.py b/sale_whole_order_invoiced/__manifest__.py index fb662544..6001b7e2 100644 --- a/sale_whole_order_invoiced/__manifest__.py +++ b/sale_whole_order_invoiced/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Sale Whole Order Invoiced", - "version": "1.1.0", + "version": "1.1.1", "author": "Numigi", "maintainer": "Numigi", "website": "https://bit.ly/numigi-com", diff --git a/sale_whole_order_invoiced/static/description/create_invoice_wizard.png b/sale_whole_order_invoiced/static/description/create_invoice_wizard.png new file mode 100644 index 00000000..1574e8e4 Binary files /dev/null and b/sale_whole_order_invoiced/static/description/create_invoice_wizard.png differ diff --git a/sale_whole_order_invoiced/static/description/sale_order_list_view.png b/sale_whole_order_invoiced/static/description/sale_order_list_view.png new file mode 100644 index 00000000..79967c2e Binary files /dev/null and b/sale_whole_order_invoiced/static/description/sale_order_list_view.png differ diff --git a/sale_whole_order_invoiced/tests/test_sale_order.py b/sale_whole_order_invoiced/tests/test_sale_order.py index 156fe1db..3612baa2 100644 --- a/sale_whole_order_invoiced/tests/test_sale_order.py +++ b/sale_whole_order_invoiced/tests/test_sale_order.py @@ -89,3 +89,18 @@ def test_on_copy__whole_order_invoiced_not_propagated(self): self.sale_order.whole_order_invoiced = True new_order = self.sale_order.copy() assert not new_order.whole_order_invoiced + + def test_wizard_default_whole_order_invoiced(self): + def check_advance_payment_method(order_ids): + wizard_obj = self.env["sale.advance.payment.inv"].with_context( + active_ids=order_ids + ) + wizard = wizard_obj.create(wizard_obj.default_get(list(wizard_obj._fields))) + assert wizard.advance_payment_method == "whole_order" + + # Check on one record + check_advance_payment_method([self.sale_order.id]) + + # Check on more than one record + new_order = self.sale_order.copy() + check_advance_payment_method([self.sale_order.id, new_order.id]) diff --git a/sale_whole_order_invoiced/wizard/sale_make_invoice_advance.py b/sale_whole_order_invoiced/wizard/sale_make_invoice_advance.py index 1a0b681b..d8a887e4 100644 --- a/sale_whole_order_invoiced/wizard/sale_make_invoice_advance.py +++ b/sale_whole_order_invoiced/wizard/sale_make_invoice_advance.py @@ -8,9 +8,11 @@ class SaleAdvancePaymentInv(models.TransientModel): _inherit = "sale.advance.payment.inv" advance_payment_method = fields.Selection( - selection_add=[("whole_order", - _("Invoice whole order (deduct down payments)"))], + selection_add=[ + ("whole_order", _("Invoice whole order (deduct down payments)")) + ], ondelete={"whole_order": "cascade"}, + default="whole_order", ) def create_invoices(self):