Odoo Help

7
1
class procurement_order(osv.osv):
_inherit = 'procurement.order'
def create_procurement_purchase_order(self, cr, uid, procurement, po_vals, line_vals, context=None):
    po_vals.update({'order_line': [(0,0,line_vals)]})
    obj_po = self.pool.get('purchase.order')
    order_id = obj_po.search(cr,uid,[('partner_id','=',po_vals['partner_id']),('origin','=',po_vals['origin'])],context=context)
    if order_id:
        old_po = order_id[0]
        obj_po.write(cr, uid, [old_po], {'order_line': [(0,0,line_vals)]},context=context)
        return old_po
    else:
        return obj_po.create(cr, uid, po_vals, context=context)

I am not a programmer, so I don't understand your answer. Could you, or someone else, give an answer for a non programmer?

Robert Nicholls
on 3/19/14, 2:22 PM
0
TidyWay
On 12/29/14, 5:35 AM

Hello Endian,

It will auto merge in odoo v8, this may help you http://tidyway.blogspot.in/2014/12/single-purchase-quotation-from-multiple.html

Thanks

Rohan Nayani(www.tidyway.in)

About This Community

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

Question tools

4 follower(s)

Stats

Asked: 6/26/13, 10:30 AM
Seen: 5131 times
Last updated: 3/23/16, 12:30 AM