Hi!
product.product vs product.template
I have already search quite a lot about this subject and studied the source code, but still cant wrap my head around it.
Example from the POS source code:class ProductTemplate(models.Model):
_inherit = 'product.template'
available_in_pos = fields.Boolean(string='Available in Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=True)
to_weight = fields.Boolean(string='To Weigh With Scale', help="Check if the product should be weighted using the hardware scale integration")
pos_categ_id = fields.Many2one(
'pos.category', string='Point of Sale Category',
help="Those categories are used to group similar products for point of sale.")
Ok, so POS inherits from product.template, but still in the data files (point_of_sale_demo.xml) it uses product.product like so:
<record id="boni_orange" model="product.product">
<field name="available_in_pos">True</field>
<field name="list_price">1.98</field>
<field name="name">Boni Oranges</field>
<field name="to_weight">True</field>
<field name="barcode">2100002000003</field>
<field name="taxes_id">False</field>
<field name="pos_categ_id" ref="fruits_vegetables"/>
<field name="uom_id" ref="product.product_uom_kgm" />
<field name="uom_po_id" ref="product.product_uom_kgm" />
<field name="image" type="base64" file="point_of_sale/static/img/boni_orange-image.jpg"/>
</record>
What is the difference?
Whats really going on here?
Which of the models should I use?
This is very confusing and I can't find a good explanation anywhere, someone care to try?
Thanks! :)
PS. I know there are answers out there trying to expain this, but I still don't get it. Example:
https://www.odoo.com/forum/help-1/question/product-template-vs-product-product-94430
Hi,
Refer to this forum
https://www.odoo.com/pt_BR/forum/ajuda-1/product-template-vs-product-product-94430
Hope it helps