Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1076 Visualizzazioni

Hello, i have a little big problem

i want to show only the purchase taxes in purchase account move and sale taxes in sale account move, this is my code

Someone help me pls :(((

def _get_tax_domain(self):
for rec in self:
if rec.move_type in ['in_invoice', 'in_refund', 'in_receipt']:
domain = [('type_tax_use', '=', 'sale'), ('tax_group_id.name', 'in', ['Retención RENTA', 'Retención IVA'])]
else:
domain = [('type_tax_use', '=', 'purchase'), ('tax_group_id.name', 'in', ['Retención RENTA', 'Retención IVA'])]
return domain

new_taxes = fields.Many2many('account.tax', domain=_get_tax_domain)


Avatar
Abbandona
Risposta migliore

You can follow this: https://youtu.be/XGqXEL2qQmE 

Hope it helps, Thanks

Avatar
Abbandona