Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
5 Vastaukset
3375 Näkymät
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
Avatar
Hylkää

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.

Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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.

Avatar
Hylkää
Tekijä Paras vastaus

Hello

Thank you for everyone! :) .

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
lokak. 18
4717
2
elok. 18
3717
1
heinäk. 18
8078
2
lokak. 17
6967
2
heinäk. 19
2936