Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
20307 Zobrazení

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



Avatar
Zrušit
Nejlepší odpověď
  • product.template(Products Menu): Actually it is not a product it is Product template whenever you are creating Product (product.template) than same will be created in also (product.product) it contains the main product and with list of product variant (attributes)

  • product.product (Product Variants): Here there are actual products with their variants as a separate products.Whenever you are creating SO or PO than actually you are using Product variants not Products.


Avatar
Zrušit

Thank you for being so kind 🙏, I posted what I felt was a need.

Nejlepší odpověď

Hello 

you can get more idea from below link. https://www.odoo.com/documentation/user/9.0/inventory/settings/products/variants.html

let me give you one example.

you have one product name is " Iphone6 " so this product.template. but the Iphone6 is available in different different  attribute like color, memory. and attribute value like color: red, black,   memory like 16gb, 32gb. 

so the Iphone6 product is like

   1. Iphone6 - 16gb, red

   2. Iphone6 - 16gb, black

   3. Iphone6 - 32gb, red

   4. Iphone6 - 32gb, black.

this above 4 Iphone6 is the variants and store into the product.product.

so the Iphone6 product store is exist into the product.template but the above variants store into the product.product.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 25
1526
0
kvě 23
448
1
srp 21
4841
2
pro 19
4105
2
srp 23
4454