Odoo Help


how to get attribue from other object

samir Guesmi
on 6/1/13, 7:06 AM 1,323 views

hi amigos , if someone get hand ,

how can i get the value of field standard_price from product.product class i want to add , a new field in account.invoice.tax Class

'standard_price': fields.function(_get_standard_price , string='standard price', store=True)

if someone can help

thanks .


Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 6/1/13, 8:08 AM

You must browse the product record and get the field you want. In account.invoice.tax you haven't got a direct relation with product.product because account.invoice.tax is a many2many table.

so how can use , standard_price

samir Guesmi
on 6/1/13, 9:31 AM
Dharmesh Rathod
On 6/1/13, 10:47 AM


Change code like this :

price = ((line.price_unit or 0.0) - (produit.standard_price or 0.0))

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

samir Guesmi
On 6/1/13, 9:33 AM

i have try this ligne

produit = pro_obj.browse(cr, uid, line.product_id) price = 0.0 price = (line.price_unit - produit.standard_price)

but , i have an error message :

TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 6/1/13, 7:06 AM
Seen: 1323 times
Last updated: 3/16/15, 8:10 AM