summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwan <wan@odoo.com>2021-02-08 16:15:19 +0000
committerwan <wan@odoo.com>2021-03-24 09:42:56 +0000
commitd44dfff647939022b8fe8d091bc1f6562cc47d86 (patch)
treec25951f14a990b422de4260d137a436cb19ed4b4
parentcdb7a8ad7647649ad8f595454aa9dc0464117568 (diff)
[FIX] account: restrict product deletion if used
Fixes #65445 closes odoo/odoo#68268 X-original-commit: 0138a33cd0fbf1d1d6e5fee08dce515d2e084d54 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com> Signed-off-by: William André (wan) <wan@odoo.com>
-rw-r--r--addons/account/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index b54f5c67e3c..67cd65c4248 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -2969,7 +2969,7 @@ class AccountMoveLine(models.Model):
currency_id = fields.Many2one('res.currency', string='Currency', required=True)
partner_id = fields.Many2one('res.partner', string='Partner', ondelete='restrict')
product_uom_id = fields.Many2one('uom.uom', string='Unit of Measure', domain="[('category_id', '=', product_uom_category_id)]")
- product_id = fields.Many2one('product.product', string='Product')
+ product_id = fields.Many2one('product.product', string='Product', ondelete='restrict')
product_uom_category_id = fields.Many2one('uom.category', related='product_id.uom_id.category_id')
# ==== Origin fields ====