This question has been flagged
2 Replies
5395 Views

Hi,

We are a consultancy and all of our work is on projects for clients. We often buy parts to build prototypes for our customers. When I write a purchase order for the parts, how do I include a reference to the project I am working on? I'd eventually like to see all of the purchase orders written for a given project.

Thanks for your help.

Avatar
Discard
Best Answer

Hi Anthony,

you have to define a many2one or selection or a text fields with default value contains your project reference in the purchase.order class and also defines it in xml view.It helps you every time if you create a purchase order, you can select you project reference also

for example:

for selection field:

'project_ref': fields.selection([('ref1','Reference1'),('ref2','Reference2')], 'Project Reference',),

_defaults = {

'project_ref': 'ref1', 

}

for text or char field:

'project_ref':fields.char('Project Reference', size=64),

_defaults = {

'project_ref': 'Reference1',

}


Avatar
Discard
Author Best Answer

Thanks for your help. It took me quite a while to learn enough of odoo to understand your answer. I think I get it now!

Avatar
Discard