[FIX] edi: override __import_model for SO/PO lines too

bzr revid: odo@openerp.com-20111105015631-ox7gma2i5v9b3hjm
This commit is contained in:
Olivier Dony
2011-11-05 02:56:31 +01:00
parent bb3d2a59d5
commit 90dd7cb5df
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -79,13 +79,13 @@ class purchase_order(osv.osv, EDIMixin):
'__import_module': 'sale',
'company_address': res_company.edi_export_address(cr, uid, order.company_id, context=context),
'company_paypal_account': order.company_id.paypal_account,
'partner_address': res_partner_address.edi_export(cr, uid, [order.partner_address_id], context=context)[0],
'currency': self.pool.get('res.currency').edi_export(cr, uid, [order.pricelist_id.currency_id],
context=context)[0],
#'company_logo': #TODO
})
if edi_doc.get('order_line'):
for line in edi_doc['order_line']:
line['__import_model'] = 'sale.order.line'
edi_doc_list.append(edi_doc)
return edi_doc_list
+1 -1
View File
@@ -82,7 +82,6 @@ class sale_order(osv.osv, EDIMixin):
'__import_module': 'purchase',
'company_address': res_company.edi_export_address(cr, uid, order.company_id, context=context),
'company_paypal_account': order.company_id.paypal_account,
'partner_address': res_partner_address.edi_export(cr, uid, [order.partner_order_id], context=context)[0],
'currency': self.pool.get('res.currency').edi_export(cr, uid, [order.pricelist_id.currency_id],
@@ -206,6 +205,7 @@ class sale_order_line(osv.osv, EDIMixin):
edi_doc_list = []
for line in records:
edi_doc = super(sale_order_line,self).edi_export(cr, uid, [line], edi_struct, context)[0]
edi_doc['__import_model'] = 'purchase.order.line'
edi_doc['product_qty'] = line.product_uom_qty
if line.product_uos:
edi_doc.update(product_uom=line.product_uos,