From c2a48b12810e42dc140168694940ffa6fc5d4911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 25 Jun 2016 14:56:40 +0200 Subject: [PATCH] [IMP] prevent deleting a move-line that is linked to a payment order line --- account_payment_order/models/account_payment_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_payment_order/models/account_payment_line.py b/account_payment_order/models/account_payment_line.py index 5df4c2644..a938cc7c6 100644 --- a/account_payment_order/models/account_payment_line.py +++ b/account_payment_order/models/account_payment_line.py @@ -27,7 +27,8 @@ class AccountPaymentLine(models.Model): related='order_id.state', string='State', readonly=True, store=True) move_line_id = fields.Many2one( - 'account.move.line', string='Journal Item') + 'account.move.line', string='Journal Item', + ondelete='restrict') ml_maturity_date = fields.Date( related='move_line_id.date_maturity', readonly=True) currency_id = fields.Many2one(