|
@@ -92,7 +92,7 @@ class product_template(models.Model):
|
|
def dump(self):
|
|
def dump(self):
|
|
return {
|
|
return {
|
|
'id': self.id,
|
|
'id': self.id,
|
|
- 'company_id': self.company_id.id,
|
|
|
|
|
|
+ 'company_id': self.company_id.id if self.company_id.id else None,
|
|
'attribute_line_ids': [line.id for line in self.attribute_line_ids] if self.attribute_line_ids else [],
|
|
'attribute_line_ids': [line.id for line in self.attribute_line_ids] if self.attribute_line_ids else [],
|
|
'default_code': self.default_code if self.default_code else None,
|
|
'default_code': self.default_code if self.default_code else None,
|
|
'description': self.description if self.description else None,
|
|
'description': self.description if self.description else None,
|
|
@@ -118,12 +118,12 @@ class product_attribute_line(models.Model):
|
|
|
|
|
|
def dump(self):
|
|
def dump(self):
|
|
return {
|
|
return {
|
|
- 'attribute_id': self.attribute_id if self.attribute_id else None,
|
|
|
|
|
|
+ 'attribute_id': self.attribute_id.id if self.attribute_id.id else None,
|
|
'create_date': self.create_date,
|
|
'create_date': self.create_date,
|
|
'display_name': self.display_name,
|
|
'display_name': self.display_name,
|
|
'id': self.id,
|
|
'id': self.id,
|
|
- 'product_tmpl_id': self.product_tmpl_id,
|
|
|
|
- 'value_ids': [value.id for value in self.value_ids] if value_ids else []
|
|
|
|
|
|
+ 'product_tmpl_id': self.product_tmpl_id.id if self.product_tmpl_id.id else None,
|
|
|
|
+ 'value_ids': [value.id for value in self.value_ids] if self.value_ids else []
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -134,8 +134,8 @@ class product_attribute_value(models.Model):
|
|
|
|
|
|
def dump(self):
|
|
def dump(self):
|
|
return {
|
|
return {
|
|
- 'attribute_id': self.attribute_id if self.attribute_id else None,
|
|
|
|
- 'color': self.color,
|
|
|
|
|
|
+ 'attribute_id': self.attribute_id.id if self.attribute_id.id else None,
|
|
|
|
+ 'color': self.color if self.color else None,
|
|
'create_date': self.create_date,
|
|
'create_date': self.create_date,
|
|
'display_name': self.display_name,
|
|
'display_name': self.display_name,
|
|
'id': self.id,
|
|
'id': self.id,
|
|
@@ -153,10 +153,10 @@ class product_product(models.Model):
|
|
def dump(self):
|
|
def dump(self):
|
|
return {
|
|
return {
|
|
'active': self.active,
|
|
'active': self.active,
|
|
- 'alternative_product_ids': [alternative.id for alternative in self.alternative_product_ids] if alternative_product_ids else [],
|
|
|
|
- 'description': self.description,
|
|
|
|
|
|
+ 'alternative_product_ids': [alternative.id for alternative in self.alternative_product_ids] if self.alternative_product_ids else [],
|
|
|
|
+ 'description': self.description if self.description else None,
|
|
'display_name': self.display_name,
|
|
'display_name': self.display_name,
|
|
- 'ean13': self.ean13,
|
|
|
|
|
|
+ 'ean13': self.ean13 if self.ean13 else None,
|
|
'id': self.id,
|
|
'id': self.id,
|
|
'is_product_variant': self.is_product_variant,
|
|
'is_product_variant': self.is_product_variant,
|
|
'list_price': self.list_price,
|
|
'list_price': self.list_price,
|