Help

4

Where can I find standard_price in postgreSQL table?

Avatar
Allen Xu

By using PgAdmin III, I was able to find list_price in product_template table, but there is no standard_price in any of the tables.

By activating the developer mode in odoo,  standard_price is shown to be under product.template object,

and going to the database structure, under "product_template", there is a "standard_price" field.

The question is, where in PgAdmin, under table product_template, there is no column with the name standard_price? Is the value of this field stored somewhere else?

Avatar
Discard
6 Answers
7
Avatar
Temur
Best Answer

standard_price is not a normal field, but it's a property field, so it's values are stored in  ir_property  table. run this in your PgAdmin:

SELECT id, value_float, name, res_id

FROM ir_property

WHERE name='standard_price';

- here res_id column shows to which "Model, ID" combination the value belongs to.

4 Comments
Avatar
Discard
Avatar
Allen Xu
-

thank you, this works.

Avatar
Temur
-

You're welcome

Avatar
LaoThai
-

Nice answer Temur

Avatar
Mohamed Fouad
-

so , how can i import standard price via postgres with product paramaters

0
Avatar
Bas
Best Answer

I believe cost_price is stored, but when using real price or average price these are computed values and therefor not stored in the database but computed.

1 Comment
Avatar
Discard
Avatar
Rachid
-

it's stored in the case of product_template on the ir_property table

0
Avatar
Jignesh Mehta
Best Answer

Hello Allen Xu,


standard_price field of product.template class is the property field and property field can't store in the database.


If in filed, store=True then it will store but in the product module there is no define store=True at field so it can't be store.


Thanks,

1 Comment
Avatar
Discard
Avatar
Temur
-

It is NOT a functional field, but it's a property field. See the field's definition in the code: https://github.com/odoo/odoo/blob/83a4a582faab9a6efb3afed2af5d68e4ffb4a21d/addons/product/product.py#L539-L542 you should notice

'standard_price': fields.property
part. and as a property field, it's saved in ir_property table as it's explained in my answer.