如何创建将在报告中显示的示例2 + 2的附加内容?我试过用:
num1:fields.integer('Number1', digits=16,2)),
num2:fields.float('Number2', digits=(16,2)),
result:fields.function(addition(char1,char2)),
答案 0 :(得分:0)
def _addition(self, cr, uid, ids, fields, arg, context):
r = {}
for record in self.browse(cr, uid, ids):
r[record.id] = record.num1 + record.num2
return r
'num1' : fields.integer('Num1'),
'num2' : fields.float('Num2'),
'total' : fields.function(_addition, string='Tot',type='float'),