Odoo Help

0

0
1 Answer
1
Avatar

Odoo

--Odoo --

1454
| 5 2 7
India
--Odoo --

Working in Odoo TEchnologies

Odoo
3/23/15, 2:37 AM

Try Below code.......................it may help .If u want calculate values from differen class use self.pool.get() method.Upvote my answer if it resolve

def _get_model(self, cr, uid, ids, field_name, arg, context=None):*

res = {}

for val in self.pool.get('sale.order').browse(cr, uid, ids, context):

res[val.id] = (val.flat_per_sq_price or 0.0) * (val.flat_area or 0.0) 

return res


_columns = {


'model_name': fields.function(_get_model, string="Sub Model", type='char', store=True)


}


otherwise just check below link---------


https://www.odoo.com/forum/help-1/question/function-fields-in-open-erp-35789

Ask a Question
Writer
Keep Informed
1 follower(s)
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