product_usability: ondelete=restrict on supplierinfo/partner_id

Add tracking on uom fields on product.template
This commit is contained in:
Alexis de Lattre
2022-12-12 20:43:33 +00:00
parent a86f90b382
commit 03d045be1c
2 changed files with 3 additions and 1 deletions

View File

@@ -9,4 +9,4 @@ from odoo import fields, models
class ProductSupplierinfo(models.Model): class ProductSupplierinfo(models.Model):
_inherit = 'product.supplierinfo' _inherit = 'product.supplierinfo'
partner_id = fields.Many2one(domain=[('parent_id', '=', False)]) partner_id = fields.Many2one(domain=[('parent_id', '=', False)], ondelete='restrict')

View File

@@ -21,6 +21,8 @@ class ProductTemplate(models.Model):
# are only shown in the form view of product.template, not in the form # are only shown in the form view of product.template, not in the form
# view of product.product # view of product.product
name = fields.Char(tracking=10) name = fields.Char(tracking=10)
uom_id = fields.Many2one(tracking=15)
uom_po_id = fields.Many2one(tracking=15)
barcode = fields.Char(tracking=20) barcode = fields.Char(tracking=20)
default_code = fields.Char(tracking=30) default_code = fields.Char(tracking=30)
categ_id = fields.Many2one(tracking=40) categ_id = fields.Many2one(tracking=40)