[FIX] sale,purchase: add totals to edi struct, used only for web preview
bzr revid: odo@openerp.com-20111013165600-7k3dvkc406hoog0t
This commit is contained in:
@@ -48,6 +48,11 @@ PURCHASE_ORDER_EDI_STRUCT = {
|
||||
'notes': True,
|
||||
'order_line': PURCHASE_ORDER_LINE_EDI_STRUCT,
|
||||
#custom: currency_id
|
||||
|
||||
# fields used for web preview only - discarded on import
|
||||
'amount_total': True,
|
||||
'amount_untaxed': True,
|
||||
'amount_tax': True,
|
||||
}
|
||||
|
||||
class purchase_order(osv.osv, EDIMixin):
|
||||
@@ -164,6 +169,11 @@ class purchase_order(osv.osv, EDIMixin):
|
||||
edi_document['pricelist_id'] = self._edi_get_pricelist(cr, uid, partner_id, order_currency, context=context)
|
||||
edi_document['location_id'] = self._edi_get_location(cr, uid, partner_id, context=context)
|
||||
|
||||
# discard web preview fields, if present
|
||||
edi_document.pop('amount_total', None)
|
||||
edi_document.pop('amount_tax', None)
|
||||
edi_document.pop('amount_untaxed', None)
|
||||
|
||||
for order_line in edi_document['order_line']:
|
||||
self._edi_requires_attributes(('date_planned', 'product_id', 'product_uom', 'product_qty', 'price_unit'), order_line)
|
||||
# original sale order contains unit price and discount, but not final line price
|
||||
|
||||
@@ -47,7 +47,12 @@ SALE_ORDER_EDI_STRUCT = {
|
||||
'partner_id': True,
|
||||
#custom: 'partner_address'
|
||||
#custom: 'notes'
|
||||
'order_line': SALE_ORDER_LINE_EDI_STRUCT
|
||||
'order_line': SALE_ORDER_LINE_EDI_STRUCT,
|
||||
|
||||
# fields used for web preview only - discarded on import
|
||||
'amount_total': True,
|
||||
'amount_untaxed': True,
|
||||
'amount_tax': True,
|
||||
}
|
||||
|
||||
class sale_order(osv.osv, EDIMixin):
|
||||
@@ -162,6 +167,12 @@ class sale_order(osv.osv, EDIMixin):
|
||||
edi_document['name'] = partner_ref or edi_document['name']
|
||||
edi_document['note'] = edi_document.pop('notes', False)
|
||||
edi_document['pricelist_id'] = self._edi_get_pricelist(cr, uid, partner_id, order_currency, context=context)
|
||||
|
||||
# discard web preview fields, if present
|
||||
edi_document.pop('amount_total', None)
|
||||
edi_document.pop('amount_tax', None)
|
||||
edi_document.pop('amount_untaxed', None)
|
||||
|
||||
order_lines = edi_document['order_line']
|
||||
for order_line in order_lines:
|
||||
self._edi_requires_attributes(('date_planned', 'product_id', 'product_uom', 'product_qty', 'price_unit'), order_line)
|
||||
|
||||
Reference in New Issue
Block a user