2
votes

I have an issue in Odoo 10. I change name of a given product.template by using:

my_product_template_id.name = 'ISO4028 M 1.4 S1max 0.65 t1 1 dp 21 z2max 31 t2 A'

In database the name is actually changed:

select id,name from product_template where id=226;

id | name -----+---------------------------------------------------
226 | ISO4028 M 1.4 S1max 0.65 t1 1 dp 21 z2max 31 t2 A
(1 row)

As shown in the image, the ID 226 appears with the following name:

ID 226, incorrect name

I have tried to refresh browser, restart server, etc. but the old name is still there.

It happens the same if the name is updated directly in database:

update product_template set name = 'New Name' where id=226;

Database name is updated but when you read again the record in web the old name is still there.

I guess I am missing something important, could someone help me to understand how to change the name of a product_template?

Regarding product_product, I am not using variants and hence there is no column name in that table

2
You did right code and query as well. Please check database did you update the right database if you have more than one database. OR If you installed external custom modules in your odoo. check for anything that override or replaced name field of product_template with any other field.Vishal Khichadiya

2 Answers

1
votes

Odoo basically manages the products in 2 tables.

  • product_template: template information

  • product_product: product information. It has the reference to product_template using the field product_tmpl_id.

I think you should change the name to product_product. I hope this help you ;)

-1
votes

You have to rewrite _name_get method, inheriting it.