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

Hello,

I want to change the tittle of PO and other bills to include personalized informations. For example instead of PO-0001 I would like to have Company Name - Number of the PO - Small explanation of the project.

I don't mind if it's not automatized and if I need to change the title manually, but I can't find any option to do it. 

Can someone help?

Thanks !

Avatar
Discard
Author Best Answer

Hello, thank you for your kind answer! 

Avatar
Discard
Best Answer

Hello Camille k ,

You can override the create function of the purchase order. and add the company name and Small explanation of the project in the reference.

Please find Code in comment. 

I hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

@api.model
def create(self, vals):
if vals.get('name', 'New') == 'New':
vals['name'] = self.env['ir.sequence'].next_by_code('purchase.order') or '/'

# Inherit this function and add company name and project explanation as a string before the sequence.
# then change the new PO reference to the vals['name']. last return the vals, you can recreate the complete reference.
return super(PurchaseOrder, self).create(vals)