[FIX] Account edi import parent_id

bzr revid: jam@tinyerp.com-20120306100743-562ep2q3lr9ylt36
This commit is contained in:
Jigar Amin - OpenERP 2012-03-06 15:37:43 +05:30
parent 0bc6a57c97
commit 92420a78f3
3 changed files with 3 additions and 19 deletions

View File

@ -146,7 +146,7 @@ module named account_voucher.
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
# 'test/test_edi_invoice.yml', it will be need to check
'test/test_edi_invoice.yml',
'test/account_report.yml',
'test/account_fiscalyear_close_state.yml', #last test, as it will definitively close the demo fiscalyear
],

View File

@ -141,7 +141,7 @@ class account_invoice(osv.osv, EDIMixin):
# imported company_address = new partner address
address_info = edi_document.pop('company_address')
address_info['partner_id'] = (src_company_id, src_company_name)
address_info['parent_id'] = (src_company_id, src_company_name)
address_info['type'] = 'invoice'
address_id = res_partner.edi_import(cr, uid, address_info, context=context)

View File

@ -25,27 +25,11 @@ from edi import EDIMixin
from openerp import SUPERUSER_ID
from tools.translate import _
RES_PARTNER_ADDRESS_EDI_STRUCT = {
'name': True,
'email': True,
'street': True,
'street2': True,
'zip': True,
'city': True,
'country_id': True,
'state_id': True,
'phone': True,
'fax': True,
'mobile': True,
}
RES_PARTNER_EDI_STRUCT = {
'name': True,
'ref': True,
'lang': True,
'website': True,
# 'address': RES_PARTNER_ADDRESS_EDI_STRUCT
# 'name': True,
'email': True,
'street': True,
'street2': True,
@ -92,7 +76,7 @@ class res_partner(osv.osv, EDIMixin):
if edi_bank_ids:
contacts = self.browse(cr, uid, contact_id, context=context)
import_ctx = dict((context or {}),
default_partner_id=contacts.id,
default_partner_id=contacts.parent_id.id,
default_state=self._get_bank_type(cr, uid, context))
for ext_bank_id, bank_name in edi_bank_ids:
try: