How is it possible to create the attributes and attribute avalues of the corresponding product in the product_id
in the sale.order.line?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How is it possible to create the attributes and attribute avalues of the corresponding product in the product_id
in the sale.order.line?
first create attribute and attribute values in the product.product model like
class ProductProduct(models.Model):
_inherit = 'product.product'
attribute = fields.Char()
attribute_value = fields.Char()
Then add attribute and attribute value to the sale.order.line
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
attribute = fields.Char(related='product_id.attribute')
attribute_value = fields.Char(related='product_id.attribute_value')
Then add the attribute and attribute value in the sale order line via xml
<xpath expr="//field[@name='order_line']/tree" position="inside">
<field name="attribute"/>
<field name="attribute_value"/>
</xpath>
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Check this module and see whether it helps in your use case: https://github.com/pledra/odoo-product-configurator