Skip to Content
Menu
This question has been flagged
2 Replies
1903 Views

I would like to select the field customer reference that is set on the sale order and show this value on my invoice on the form view. 

Avatar
Discard
Best Answer

Find it on the Other Info Tab:


Invoice:


Sales Order:


Avatar
Discard
Best Answer

Hi,

The create _prepare_invoice in sale order creates the corresponding invoice. For passing any value from the sale order to the creating invoice inherit sale.order model and override the function. 

Try this example code

def _prepare_invoice(self):
   invoice_vals= super(SaleOrder, self)._prepare_invoice()
   invoice_vals['invoice_field_name'] = self.client_order_ref
   return invoice_vals

Regards

Avatar
Discard
Related Posts Replies Views Activity
3
Sep 24
2701
1
Aug 24
455
2
Feb 24
1886
2
Jan 24
16493
1
Oct 23
4197