Skip to content

Commit

Permalink
[12.0] [ADD] Payment return block move_lines
Browse files Browse the repository at this point in the history
  • Loading branch information
qgroulard authored and sbejaoui committed Jul 14, 2020
1 parent a9dea9c commit 9003681
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions account_payment_return/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
5 changes: 5 additions & 0 deletions account_payment_return/models/payment_return_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 9003681

Please sign in to comment.