Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

Where can I find standard_price in postgreSQL table?

By
Allen Xu
on 12/8/15, 3:03 AM 1,781 views

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?

3

Temur

--Temur--
2894
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 12/8/15, 5:22 AM

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.

thank you, this works.

Allen Xu
on 12/8/15, 6:19 PM

You're welcome

Temur
on 12/9/15, 1:46 AM
0
Bas
On 12/8/15, 5:10 AM

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.

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

Qamar Soft
on 12/12/15, 5:23 AM
0

Jignesh Mehta

--Jignesh Mehta--
2081
| 6 4 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 12/8/15, 3:27 AM

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,

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.
Temur
on 12/8/15, 8:03 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/8/15, 3:03 AM
Seen: 1781 times
Last updated: 12/19/15, 11:08 PM