From cf983bf0ce86e68ed5bfbc7830a90bbef0644752 Mon Sep 17 00:00:00 2001 From: Quentin Groulard Date: Thu, 6 Feb 2020 16:40:35 +0100 Subject: [PATCH] [12.0] [ADD] Payment return block move_lines --- account_payment_return/models/account_move.py | 2 ++ account_payment_return/models/payment_return_reason.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/account_payment_return/models/account_move.py b/account_payment_return/models/account_move.py index 38773a16eeee..940b4106ce20 100644 --- a/account_payment_return/models/account_move.py +++ b/account_payment_return/models/account_move.py @@ -28,3 +28,5 @@ class AccountMoveLine(models.Model): @api.multi def _payment_returned(self, return_line): self.mapped('invoice_id')._payment_returned(return_line) + if return_line.reason_id.block_move_lines: + self.write({"blocked": True}) diff --git a/account_payment_return/models/payment_return_reason.py b/account_payment_return/models/payment_return_reason.py index b6d5a4b7d159..656f4802fae0 100644 --- a/account_payment_return/models/payment_return_reason.py +++ b/account_payment_return/models/payment_return_reason.py @@ -10,6 +10,11 @@ class PaymentReturnReason(models.Model): code = fields.Char() name = fields.Char(string='Reason', translate=True) + block_move_lines = fields.Boolean( + company_dependent=True, + help="Check 'No Follow-up' on journal items that used to be " + "reconciled with a payment returned with this code.", + ) @api.model def name_search(self, name, args=None, operator='ilike', limit=100):