~magentoerpconnect-core-editors/magentoerpconnect/oerp6.1-stable

« back to all changes in this revision

Viewing changes to magentoerpconnect/product.py

  • Committer: Sébastien Beau
  • Date: 2013-06-06 18:09:24 UTC
  • mfrom: (685.3.1 magentoerpconnect-6.1)
  • Revision ID: sebastien.beau@akretion.com-20130606180924-lc9cr8z060tqq7nz
[MERGE] merge fix from Stefan Rijnhart (Therp). Fix extid_to_oeid arguments

Show diffs side-by-side

added added

removed removed

Lines of Context:
726
726
    _order = "sort_order"
727
727
    def _get_set(self, cr, uid, ids, prop, unknow_none, context=None):
728
728
        res = {}
 
729
        external_sessions = {}
 
730
        set_obj = self.pool.get('magerp.product_attribute_set')
729
731
        for attribute_group in self.browse(cr, uid, ids, context):
730
 
            res[attribute_group.id] = self.pool.get('magerp.product_attribute_set').extid_to_oeid(cr, uid, attribute_group.attribute_set_id, attribute_group.referential_id.id)
 
732
            if attribute_group.referential_id.id not in external_sessions:
 
733
                external_sessions[attribute_group.referential_id.id] = ExternalSession(
 
734
                    attribute_group.referential_id)
 
735
            res[attribute_group.id] = set_obj.extid_to_oeid(
 
736
                cr, uid,
 
737
                external_sessions[attribute_group.referential_id.id],
 
738
                attribute_group.attribute_set_id)
731
739
        return res
732
740
 
733
741
    def _get_filter(self, cr, uid, external_session, step, previous_filter=None, context=None):