[IMP]pms: list_price product property dependent with default value

This commit is contained in:
Darío Lodeiros
2022-09-24 20:17:24 +02:00
parent 8726e8c630
commit 6c3f0380d2

View File

@@ -108,3 +108,20 @@ class ProductTemplate(models.Model):
self.env["ir.pms.property"].set_field_value(
pms_property_id, self._name, "list_price", record.id, record.list_price
)
# Set default value in other properties
other_properties = self.env["pms.property"].search([])
for other_property in other_properties.ids:
if not self.env["ir.pms.property"].get_field_value(
other_property,
self._name,
"list_price",
record.id,
type(record.list_price),
):
self.env["ir.pms.property"].set_field_value(
other_property,
self._name,
"list_price",
record.id,
record.list_price,
)