diff --git a/account_payment_order/README.rst b/account_payment_order/README.rst index a0d8cb05a..291febbc1 100644 --- a/account_payment_order/README.rst +++ b/account_payment_order/README.rst @@ -47,19 +47,26 @@ You can create a Debit Order via the menu Accounting > Payments > Debit Orders a This module also adds a button *Add to Payment Order* on supplier invoices and a button *Add to Debit Order* on customer invoices. +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/173/9.0 + Known issues / Roadmap ====================== * no known issues - + Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. Credits ======= @@ -68,8 +75,8 @@ Contributors ------------ * Stéphane Bidoul -* Alexis de Lattre -* Pedro M. Baeza +* Alexis de Lattre +* Pedro M. Baeza * Adrien Peiffer * Stefan Rijnhart * Laurent Mignon diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index fe214b8d2..cccf28126 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -34,7 +34,7 @@ class AccountPaymentOrder(models.Model): bank_account_link = fields.Selection( related='payment_mode_id.bank_account_link', readonly=True) journal_id = fields.Many2one( - 'account.journal', string='Bank Journal', + 'account.journal', string='Bank Journal', ondelete='restrict', readonly=True, states={'draft': [('readonly', False)]}) allowed_journal_ids = fields.Many2many( 'account.journal', compute='_compute_allowed_journals', readonly=True, diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index b8769032e..f131db886 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -20,6 +20,8 @@ class AccountPaymentLineCreate(models.TransientModel): ('posted', 'All Posted Entries'), ('all', 'All Entries'), ], string='Target Moves') + allow_blocked = fields.Boolean( + string='Allow Litigation Move Lines') invoice = fields.Boolean( string='Linked to an Invoice or Refund') date_type = fields.Selection([ @@ -65,6 +67,8 @@ class AccountPaymentLineCreate(models.TransientModel): ('journal_id', 'in', journals.ids)] if self.target_move == 'posted': domain += [('move_id.state', '=', 'posted')] + if not self.allow_blocked: + domain += [('blocked', '!=', True)] if self.date_type == 'due': domain += [ '|', diff --git a/account_payment_order/wizard/account_payment_line_create_view.xml b/account_payment_order/wizard/account_payment_line_create_view.xml index e12034e75..de7d836d0 100644 --- a/account_payment_order/wizard/account_payment_line_create_view.xml +++ b/account_payment_order/wizard/account_payment_line_create_view.xml @@ -23,6 +23,7 @@ +