تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5 الردود
3325 أدوات العرض
ello everyone,
I'm developing a personalized module that uses the table:

product.template

class productTestService(models.Model):
_name = 'product.template'
_inherit = 'product.template'
After I install the module I can no longer access any product previously registered, however if I drop the module I usually access the modules. One detail, I insert a line when I install the module in the table product.template
الصورة الرمزية
إهمال

Please change the name of the model you created. whe, you say _name = 'product.template' , it means , you are overriding the model product.template.By convention when you create a model the nomenclature is 'module_name.model_name'.So , just change the ' _name' attribute.Sorry for my english my dear , i am doing my best.

أفضل إجابة

The meaning of using inheritance here 
https://www.odoo.com/documentation/11.0/howtos/backend.html#inheritance

الصورة الرمزية
إهمال
أفضل إجابة

While giving a name to model at the same time inheriting, it treats as a new table.

الصورة الرمزية
إهمال
أفضل إجابة

Please change the name of the model you created. whe, you say _name = 'product.template' , it means , you are overriding the model product.template.By convention when you create a model the nomenclature is 'module_name.model_name'.So , just change the ' _name' attribute.Sorry for my english my dear , i am doing my best.

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Hello

Thank you for everyone! :) .

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
أكتوبر 18
4645
2
أغسطس 18
3669
1
يوليو 18
7994
2
أكتوبر 17
6904
2
يوليو 19
2892