In the account.invoice.refund which is a wizard I had added a boolean field 'is_refund' how could I get the value of this field from wizard to the invoice forum when creating a refund from the invoice form
Help me please
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
In the account.invoice.refund which is a wizard I had added a boolean field 'is_refund' how could I get the value of this field from wizard to the invoice forum when creating a refund from the invoice form
Help me please
Hello Jihen,
Try below code.
class AccountInvoice(models.Model):
_inherit = "account.invoice"
is_refund = fields.Boolean('Is Refund')
class AccountInvoiceRefund(models.Model):
_inherit = "account.invoice.refund"
is_refund = fields.Boolean('Is Refund')
@api.multi
def invoice_refund(self):
result = super(AccountInvoiceRefund, self).invoice_refund()
invoice_obj = self.env['account.invoice'].browse(self._context.get('active_id'))
invoice_obj.is_refund = self.is_refund
return result
Hope it will helps you.
Thanks,
Thanks a lot
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up