Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


[9.0] How to generate PO when a SO is confirmed ?

on 3/21/16, 4:37 AM 316 views

Hi, I have to migrate a custom module from V8 to V9 but I've a problem: I have this sample code (procurement.py) in version 8.0 to automaticaly generate a PO when a Sale Order is confirmed but I don't know how to edit it to work in version 9.0

class procurement_order(osv.osv):

_inherit = 'procurement.order'

_columns = {

'analytic_account_id' : fields.many2one('account.analytic.account','Compte Analytique'),


def make_po(self, cr, uid, ids, context=None):

res = super(procurement_order,self).make_po(cr, uid, ids, context)


if po_line:

for procurement in self.browse(cr, uid, ids, context):


return res


In advance, thanks.

On 3/29/16, 4:08 AM

The problem is that I overwrited the function make_po.

If not, the PO is automatically created after the confirmation of a PO.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/21/16, 4:37 AM
Seen: 316 times
Last updated: 3/29/16, 4:08 AM