how can i override create_invoice funtion in sale.advance.payment.inv transient model
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hello Shibin,
Please update following code:
class CustomSaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
_description = "Custom Sales Advance Payment Invoice"
@api.multi
def _create_invoice(self, order, so_line, amount):
val = super(CustomSaleAdvancePaymentInv, self)._create_invoice(order, so_line, amount)
# Add Your operation here
return val
Hi,
Try like this,
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
@api.multi
def _create_invoice(self, order, so_line, amount):
res = super(SaleAdvancePaymentInv, self)._create_invoice(order, so_line, amount)
print("Test")
# Do necessary operations here
return res
Thanks
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
@api.multi
def _create_invoice(self, order, so_line, amount)
## update whatever you want here if any changes in order,line,amount
invoice = super(SaleAdvancePaymentInv, self)._create_invoice(order, so_line, amount)
## update whatever you want here
return invoice