~camptocamp/magentoerpconnect/oerp61-oldstable-import-partners-pagination-2013-02-12

« back to all changes in this revision

Viewing changes to magerp_osv.py

  • Committer: Sharoon Thomas
  • Date: 2009-09-30 19:30:11 UTC
  • Revision ID: sharoonthomas@sharoonthomas-laptop-20090930193011-38vsjfgm59e1gzg3
[REF]Upgrade to magento_id instead of independetn mage key fields in OE

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
class magerp_osv(osv.osv):
5
5
    _MAGE_FIELD = 'magento_id'
 
6
    _MAGE_P_KEY = False
6
7
    _LIST_METHOD = False
7
8
    _GET_METHOD = False
8
9
    _CREATE_METHOD = False
74
75
                magento_record = self.cast_string(magento_record)
75
76
                #Check if record exists
76
77
                if mage2oe_filters:
77
 
                    rec_id = self.mage_to_oe(cr, uid, magento_record[self._MAGE_FIELD], instance, mage2oe_filters)
 
78
                    rec_id = self.mage_to_oe(cr, uid, magento_record[self._MAGE_P_KEY], instance, mage2oe_filters)
78
79
                else:
79
 
                    if self._MAGE_FIELD:
80
 
                        rec_id = self.mage_to_oe(cr, uid, magento_record[self._MAGE_FIELD], instance)
 
80
                    if self._MAGE_P_KEY:
 
81
                        rec_id = self.mage_to_oe(cr, uid, magento_record[self._MAGE_P_KEY], instance)
81
82
                    else:
82
83
                        rec_id = False
83
84
                #Generate Vals