Odoo Help

0

how to get attribue from other object

By
samir Guesmi
on 6/1/13, 7:06 AM 1,189 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 .

0
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
0
Dharmesh Rathod
On 6/1/13, 10:47 AM

Hi,

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

0
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.

Register

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)

Stats

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