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

I need to add the customer name to the sales order ..so SO0001 becomes SO001-JOHN DOE ... Thanks

Avatar
Discard
Best Answer

Hi,

The sequence number is generated when we save a record. You can check the sale.py file inside the sale module.

Below is the code which generates the sequence number for sale order,



As you want to add the customer name along with the sequence, you can change the above code like this,




Just add a the selected two lines to the code.


partner = self.env['res.partner'].browse(vals.get('partner_id'))
vals['name'] = str(vals['name']) + str(partner.name)


Either you can do it editing the original code or a custom module.


Thanks

Avatar
Discard
Best Answer

when we duplicate the sale order , it does not change the customer name field ,

how can we fix it ?


Avatar
Discard