i made a new field in account form and it work well i calculated on it as well but when i save it, my new field was reset to 0.
I cant save the form with my field information and i dont know why?
from openerp import models, fields, api, exceptions
class ColombianTaxes(models.Model):
""" Model to create and manipulate personal taxes"""
_description= "Model to create own taxes"
_name = 'account.invoice'
_inherit = 'account.invoice'
# Define rfuente as new tax.
rfuente = fields.Monetary('Retencion en la fuente:',store="True" , compute = "rfuente_pc")
# Calculate rfuente and total amount
@api.onchange('amount_untaxed', 'amount_total')
def rfuente_pc(self):
self.rfuente = self.amount_untaxed * 0.025
self.amount_total = self.amount_total + self.rfuente