Hi,
I've created a module that link Sales Quotation with Purchase Quotation. Basically with this module after I create a Sale Quotation, I can choose in Purchase Quotation the Sale Quotation associated for this Purchase Quotation.
So, after select the correct Sale Quotation on Purchase Quotation, I would like that item of product on tab "Purchase Order" be automatically filled with all products that Sale Quotation selected previously have.
Someone knows resolve this problem?
thanks,

My module:
[my_module].py:
class purchase_order(osv.osv):
_inherit = 'purchase.order'
_name = 'purchase.order'
_columns = {
'asd_pquotation_id': fields.many2one('sale.order','Sale Quotation', domain=[('state','in',('draft','sent'))]),
}
_defaults = {
'asd_pquotation_id': lambda self, cr, uid, context: context.get('asd_pquotation_id', False),
}
purchase_order()
class sale_order(osv.osv):
_inherit = "sale.order"
_name = "sale.order"
_columns = {
'asd_squotation': fields.one2many('purchase.order','asd_pquotation_id', 'Purchase Quotation'),
}
sale_order()
[my_module]_view.xml:
purchase.order.form.change purchase.order sale.order.form.changed sale.order
↧