Skip to Content
Menu
This question has been flagged
1 Reply
2491 Views

Hello, is there a way to make invoices' date be the same as sales orders' date? I am using odoo 13

the link no longer aplly to Odoo 13. Help

https://www.odoo.com/forum/help-1/invoice-date-same-as-sales-order-date-110292#


Avatar
Discard

Theirs the manual method .... just enter the invoice date manually before Validating the Invoice.

Author

i know this, but is there a way to do it automatically, that some changes in sale.py code thanks

Best Answer

Hi,

You may try this code,

class SaleOrder(models.Model):
_inherit = 'sale.order'
def _prepare_invoice(self):
res = super(SaleOrder, self)._prepare_invoice()
res['invoice_date'] = self.date_order
return res
Regards
Avatar
Discard