Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
3311 Lượt xem
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
Ảnh đại diện
Huỷ bỏ

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.

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hello

Thank you for everyone! :) .

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 18
4641
2
thg 8 18
3667
1
thg 7 18
7986
2
thg 10 17
6894
2
thg 7 19
2886