Odoo Help

0

I ask if can set a float value in fields.function(_funct_total, ), without use cur_obj.round(cr, uid, cur, val) in my framework module ???

By
AKRAM
on 11/3/15, 10:09 AM 432 views

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

res = {}

for inter in self.browse(cr, uid, ids, context=context):

res[inter.id] = {

'amount_total': 0.0,

}

val = 0.0

for line in inter.ligneinter_ids:

val += line.total_line

res[inter.id]['amount_total'] = val

return res


'amount_total': fields.function(_amount_all, string='Total', type='float', digits_compute=dp.get_precision('Account'), help="The total amount."),

I resolve this problem by the modify in function: def _amount_all(self, cr, uid, ids, field_name, arg, context=None): res = {} for inter in self.browse(cr, uid, ids, context=context): val = 0.0 for line in inter.ligneinter_ids: val += line.total_line res[inter.id] = val return res this just for my framework module, thinks ;)

AKRAM
on 11/3/15, 10:38 AM

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

1 follower(s)

Stats

Asked: 11/3/15, 10:09 AM
Seen: 432 times
Last updated: 11/3/15, 10:38 AM