diff --git a/account_payment_order/__manifest__.py b/account_payment_order/__manifest__.py index 5457e817a91f..4b6f4f5a9795 100644 --- a/account_payment_order/__manifest__.py +++ b/account_payment_order/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Account Payment Order", - "version": "16.0.1.6.1", + "version": "17.0.1.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV, " "Therp BV, " diff --git a/account_payment_order/hooks.py b/account_payment_order/hooks.py index 9db88f54f646..9e58d09527a3 100644 --- a/account_payment_order/hooks.py +++ b/account_payment_order/hooks.py @@ -1,7 +1,7 @@ from odoo.tools import sql -def pre_init_hook(cr): +def pre_init_hook(env): """Prepare new partner_bank_id computed field. Add column to avoid MemoryError on an existing Odoo instance @@ -12,5 +12,5 @@ def pre_init_hook(cr): (see AccountMoveLine._compute_partner_bank_id() in models/account_move_line.py and AccountMove._compute_payment_order_ok() in models/account_move.py) """ - if not sql.column_exists(cr, "account_move_line", "partner_bank_id"): - sql.create_column(cr, "account_move_line", "partner_bank_id", "int4") + if not sql.column_exists(env.cr, "account_move_line", "partner_bank_id"): + sql.create_column(env.cr, "account_move_line", "partner_bank_id", "int4") diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index d34c3974d117..a38fdf20fab0 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -24,7 +24,6 @@ class AccountMove(models.Model): reference_type = fields.Selection( selection=[("none", "Free Reference"), ("structured", "Structured Reference")], readonly=True, - states={"draft": [("readonly", False)]}, default="none", ) payment_line_count = fields.Integer(compute="_compute_payment_line_count") diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index 839c66c59141..247e53492588 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -24,7 +24,6 @@ class AccountPaymentOrder(models.Model): ondelete="restrict", tracking=True, readonly=True, - states={"draft": [("readonly", False)]}, check_company=True, ) payment_type = fields.Selection( @@ -57,7 +56,6 @@ class AccountPaymentOrder(models.Model): string="Bank Journal", ondelete="restrict", readonly=True, - states={"draft": [("readonly", False)]}, tracking=True, check_company=True, ) @@ -93,12 +91,10 @@ class AccountPaymentOrder(models.Model): default="due", tracking=True, readonly=True, - states={"draft": [("readonly", False)]}, ) date_scheduled = fields.Date( string="Payment Execution Date", readonly=True, - states={"draft": [("readonly", False)]}, tracking=True, help="Select a requested date of execution if you selected 'Due Date' " "as the Payment Execution Date Type.", @@ -118,7 +114,6 @@ class AccountPaymentOrder(models.Model): inverse_name="order_id", string="Transactions", readonly=True, - states={"draft": [("readonly", False)]}, ) payment_ids = fields.One2many( comodel_name="account.payment", diff --git a/account_payment_order/readme/CONFIGURE.rst b/account_payment_order/readme/CONFIGURE.rst new file mode 100644 index 000000000000..e19ef3baf79b --- /dev/null +++ b/account_payment_order/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +This module adds several options on Payment Modes, cf Invoicing/Accounting > +Configuration > Management > Payment Modes. diff --git a/account_payment_order/readme/CONTRIBUTORS.rst b/account_payment_order/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..c6d4d1c03d48 --- /dev/null +++ b/account_payment_order/readme/CONTRIBUTORS.rst @@ -0,0 +1,32 @@ +* Stéphane Bidoul +* Alexis de Lattre +* Adrien Peiffer +* Stefan Rijnhart +* Laurent Mignon +* Alexandre Fayolle +* Danimar Ribeiro +* Erwin van der Ploeg +* Raphaël Valyi +* Sandy Carter +* Angel Moya +* Jose María Alzaga +* Meyomesse Gilles +* Denis Roussel + +* `DynApps `_: + + * Raf Ven +* Andrea Stirpe +* `Jarsa `_: + + * Alan Ramos +* `Tecnativa `_: + + * Pedro M. Baeza + * Carlos Dauden + * Carlos Roca + +* `Open Source Integrators `_: + + * Ammar Officewala +* Marçal Isern diff --git a/account_payment_order/readme/DESCRIPTION.rst b/account_payment_order/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..11a1fe4cd750 --- /dev/null +++ b/account_payment_order/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds support for payment orders and debit orders. diff --git a/account_payment_order/readme/INSTALL.rst b/account_payment_order/readme/INSTALL.rst new file mode 100644 index 000000000000..2ea6c6ae6549 --- /dev/null +++ b/account_payment_order/readme/INSTALL.rst @@ -0,0 +1,7 @@ +This module depends on: + +* account_payment_partner +* base_iban +* document + +This modules is part of the OCA/bank-payment suite. diff --git a/account_payment_order/readme/USAGE.rst b/account_payment_order/readme/USAGE.rst new file mode 100644 index 000000000000..ec551e4cca4e --- /dev/null +++ b/account_payment_order/readme/USAGE.rst @@ -0,0 +1,7 @@ +You can create a Payment order via the menu Invoicing/Accounting > Vendors > Payment Orders and then select the move lines to pay. + +You can create a Debit order via the menu Invoicing/Accounting > Customers > Debit Orders and then select the move lines to debit. + +This module also adds an action *Add to Payment Order* on supplier invoices and *Add to Debit Order* on customer invoices. + +You can print a Payment order via the menu Invoicing/Accounting > Vendors > Payment Orders and then select the payment oder to print. diff --git a/account_payment_order/tests/test_payment_order_outbound.py b/account_payment_order/tests/test_payment_order_outbound.py index 6108a5775f52..5615e15c11f1 100644 --- a/account_payment_order/tests/test_payment_order_outbound.py +++ b/account_payment_order/tests/test_payment_order_outbound.py @@ -120,8 +120,6 @@ def _create_supplier_refund(self, move, manual=False): .with_context(active_model="account.move", active_ids=move.ids) .create( { - "date_mode": "entry", - "refund_method": "refund", "journal_id": move.journal_id.id, } ) @@ -422,7 +420,6 @@ def test_supplier_refund_reference(self): refund_line = self.refund.line_ids.filtered( lambda line: line.account_type == "liability_payable" ) - (invoice_line | refund_line).reconcile() self.env["account.invoice.payment.line.multi"].with_context( active_model="account.move", active_ids=self.invoice.ids diff --git a/account_payment_order/views/account_invoice_view.xml b/account_payment_order/views/account_invoice_view.xml index a9ceaf6ea705..308a56fb6958 100644 --- a/account_payment_order/views/account_invoice_view.xml +++ b/account_payment_order/views/account_invoice_view.xml @@ -21,29 +21,21 @@ type="object" string="Add to Debit Order" groups="account_payment_order.group_account_payment" - attrs="{'invisible': ['|', '|', - ('payment_order_ok', '=', False), - ('state', '!=', 'posted'), - ('move_type', 'not in', ('out_invoice', 'out_refund')) - ]}" + invisible="not payment_order_ok or state != 'posted' or move_type not in ('out_invoice', 'out_refund')" />