mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[FIX] no need uom right anymore
This commit is contained in:
@@ -11,6 +11,7 @@ class MrpBomLine(models.Model):
|
||||
|
||||
# Returns mandatory for classic line thanks to _sql_constraints and view
|
||||
product_id = fields.Many2one(required=False)
|
||||
product_uom_id = fields.Many2one(required=False)
|
||||
|
||||
# New fields to handle section & note
|
||||
name = fields.Text(string="Description")
|
||||
@@ -23,10 +24,15 @@ class MrpBomLine(models.Model):
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
"bom_required_fields",
|
||||
"bom_required_fields_product_qty",
|
||||
"CHECK(display_type IS NOT NULL OR"
|
||||
"(product_id IS NOT NULL AND product_qty IS NOT NULL))",
|
||||
"Missing required fields on bom line.",
|
||||
"Missing required fields on bom line : product and quantity.",
|
||||
),
|
||||
(
|
||||
"bom_required_field_uom",
|
||||
"CHECK(display_type IS NOT NULL OR" "(product_uom_id IS NOT NULL))",
|
||||
"Missing required field on bom line : uom.",
|
||||
),
|
||||
(
|
||||
"non_bom_null_fields",
|
||||
|
||||
@@ -79,6 +79,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
options="{'no_open':True,'no_create':True}"
|
||||
groups="uom.group_uom"
|
||||
attrs="{
|
||||
'required': [('display_type', '=', False)],
|
||||
'invisible': [('display_type', '=', True)],
|
||||
}"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user