openerp - Edit compute_amount -
i had edit funtion of compute_amount okay problem when pay invoice i'm still getting old amount before change has work on this??? new compute_amount
@api.one @api.depends('invoice_line.price_subtotal', 'tax_line.amount','timbre','partner_id') def _compute_amount(self): if self.type == 'out_invoice': if self.partner_id.rs == true: print'rs',self.partner_id.rs self.amount_untaxed = sum(line.price_subtotal line in self.invoice_line) self.amount_tax = sum(line.amount line in self.tax_line) self.amount_rs = (self.amount_untaxed + self.amount_tax) * 0.01 self.amount_total = self.amount_untaxed + self.amount_tax + self.amount_rs + self.timbre else : self.amount_untaxed = sum(line.price_subtotal line in self.invoice_line) self.amount_tax = sum(line.amount line in self.tax_line) self.amount_total = self.amount_untaxed + self.amount_tax + self.timbre else : self.amount_untaxed = sum(line.price_subtotal line in self.invoice_line) self.amount_tax = sum(line.amount line in self.tax_line) self.amount_total = self.amount_untaxed + self.amount_tax
if on_change method , field has readonly attribute, write method won't new value.
problem solution may if create invisible mirror function field.
Comments
Post a Comment