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.

0

how to get attribue from other object

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

--Francesco OpenCode--
3608
| 5 7 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
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
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'

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

0 follower(s)

Stats

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