İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
4147 Görünümler

I noticed that when I change a value in product.product or product.template while the template has only one variant product, values of the related record changes at the same time.

How's that happen? I debugged the code but I still have no clue.

Could any explain it?

Regards.

Avatar
Vazgeç
Üretici

Okay, thank you Jainesh.

It helps me.

Regards.

En İyi Yanıt

Hello Enish,


This behavior is due to the inheritance mechanism in Odoo. When you create a product variant (product.product), it inherits certain fields from the product template (product.template). These inherited fields are linked between the template and its variants, creating a relationship that keeps them synchronized.


You can check the product.product model and look for the "_inherits" dictionary in the Python code. It will specify the product.template model as the inherited model and the fields that are being inherited. As yer your question product.product and product.template.


Hope it will be helpful to you.

Thanks & Regards,
Email:  odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari 

Avatar
Vazgeç
En İyi Yanıt

Hi,

The relation between the models product.product and product.template is called delegation. For delegation inheritance, we make use of the _inherits attribute. Additionally, you can sink another model to your current model using this form of inheritance without altering the views. Consequently, your model's fields and a field for the inherited object will both be present in the database tables.
You can read more about inheritance in this blog:https://www.cybrosys.com/blog/different-types-of-inheritance-in-odoo-15

Hope it helps

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 21
1726
1
Eyl 19
5150
1
Haz 25
786
1
Şub 25
1324
2
Oca 24
19850