跳至内容
菜单
此问题已终结
5 回复
3306 查看
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
10月 18
4639
2
8月 18
3667
1
7月 18
7982
2
10月 17
6889
2
7月 19
2885