I am working i on a project which goal is:
Project have two tables (account_invoice_tax and new_computed_stored)
I created a Class but is not working, please forgive my gross coding, I am newbie :)
class account_invoice_tax(models.Model):
_inherits = {'new.computed.stored':'new_id'}
_inherit = 'account.invoice.tax'
retencion_id = fields.Many2one('new.computed.stored',ondelete='cascade',required=True)
computed = fields.Char(string='Some_help', compute='_compute_new', help='Insert_Something', store=True)
@api.one
@api.depends('account_invoice_tax.amount')
def _compute_new(self):
for record in self:
record.computed = record.calculado * 2
# not relevant which formula used