Dear All,
Odoo V16
I try to inherit a wizard but I have the below error:
TypeError: transforms the transient model 'sale.advance.payment.inv' into a non-transient model. That class should either inherit from TransientModel, or set a different '_name'.
I don't inherit XML file, I want only to override the function.
I try to inherit this code:
class SaleAdvancePaymentInv(models.TransientModel):
_name = 'sale.advance.payment.inv'
_description = "Sales Advance Payment Invoice"
def create_invoices(self):
self._create_invoices(self.sale_order_ids)
...
return {'type': 'ir.actions.act_window_close'}
My code:
class SaleAdvancePaymentInvInherited(models.TransientModel):
# Also, I try without using _name
_name = 'sale.advance.payment.inv.inherited'
_inherit = "sale.advance.payment.inv"
def create_invoices(self):
self._create_invoices(self.sale_order_ids)
logging.info('Hello function')
...
return {'type': 'ir.actions.act_window_close'}