Merge lp:~akretion-team/magentoerpconnect/Multi-website-fix into lp:~magentoerpconnect-core-editors/magentoerpconnect/magentoerpconnect_generic
- Multi-website-fix
- Merge into magentoerpconnect_generic
Proposed by
Raphaël Valyi - http://www.akretion.com
Status: | Merged |
---|---|
Merge reported by: | Raphaël Valyi - http://www.akretion.com |
Merged at revision: | not available |
Proposed branch: | lp:~akretion-team/magentoerpconnect/Multi-website-fix |
Merge into: | lp:~magentoerpconnect-core-editors/magentoerpconnect/magentoerpconnect_generic |
Diff against target: |
376 lines (+97/-70) 6 files modified
magerp_core.py (+10/-20) magerp_core_view.xml (+5/-11) product.py (+49/-19) sale.py (+25/-14) sale_view.xml (+5/-1) settings/external.mappinglines.template.csv (+3/-5) |
To merge this branch: | bzr merge lp:~akretion-team/magentoerpconnect/Multi-website-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Valyi - http://www.akretion.com | Pending | ||
Review via email: mp+21639@code.launchpad.net |
Commit message
Description of the change
multi's fixes
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'magerp_core.py' |
2 | --- magerp_core.py 2009-12-11 15:04:11 +0000 |
3 | +++ magerp_core.py 2010-03-18 13:54:19 +0000 |
4 | @@ -31,8 +31,9 @@ |
5 | _inherit = "external.referential" |
6 | |
7 | _columns = { |
8 | - 'attribute_sets':fields.one2many('magerp.product_attribute_set', 'referential_id', 'Attribute Sets'), |
9 | - 'default_pro_cat':fields.many2one('product.category','Default Product Category',required=True, help="Products imported from magento may have many categories.\nOpenERP requires a specific category for a product to facilitate invoicing etc.") |
10 | + 'attribute_sets':fields.one2many('magerp.product_attribute_set', 'referential_id', 'Attribute Sets'), |
11 | + 'default_pro_cat':fields.many2one('product.category','Default Product Category',required=True, help="Products imported from magento may have many categories.\nOpenERP requires a specific category for a product to facilitate invoicing etc."), |
12 | + 'default_lang_id':fields.many2one('res.lang', 'Default Language',required=True, help="Choose the language which will be used for the Default Value in Magento"), |
13 | } |
14 | |
15 | |
16 | @@ -172,12 +173,13 @@ |
17 | class external_shop_group(magerp_osv.magerp_osv): |
18 | _inherit = "external.shop.group" |
19 | #Return format of API:{'code': 'base', 'name': 'Main', 'website_id': '1', 'is_default': '1', 'sort_order': '0', 'default_group_id': '1'} |
20 | + # default_group_id is the default shop of the external_shop_group (external_shop_group = website) |
21 | |
22 | def _get_default_shop_id(self, cr, uid, ids, prop, unknow_none, context): |
23 | res = {} |
24 | for shop_group in self.browse(cr, uid, ids, context): |
25 | - if shop_group.default_group_id: |
26 | - rid = self.pool.get('sale.shop').extid_to_oeid(cr, uid, shop_group.default_group_id, shop_group.referential_id.id) |
27 | + if shop_group.default_shop_integer_id: |
28 | + rid = self.pool.get('sale.shop').extid_to_oeid(cr, uid, shop_group.default_shop_integer_id, shop_group.referential_id.id) |
29 | res[shop_group.id] = rid |
30 | else: |
31 | res[shop_group.id] = False |
32 | @@ -187,9 +189,9 @@ |
33 | 'code':fields.char('Code', size=100), |
34 | 'is_default':fields.boolean('Is Active?'), |
35 | 'sort_order':fields.integer('Sort Order'), |
36 | - 'default_group_id':fields.integer('Default Store Group'), #Many 2 one? |
37 | - 'default_shop_id':fields.function(_get_default_shop_id, type="many2one", relation="sale.shop", method=True, string="Default Store (Group)"), |
38 | - 'default_lang_id':fields.many2one('res.lang', 'Default Language', help="Magento website wise default locale if different from English"), |
39 | + 'default_shop_integer_id':fields.integer('Default Store'), #This field can't be a many2one because shop_group field will be mapped before creating Shop (Shop = Store, shop_group = website) |
40 | + 'default_shop_id':fields.function(_get_default_shop_id, type="many2one", relation="sale.shop", method=True, string="Default Store"), |
41 | + 'referential_type' : fields.related('referential_id', 'type_id', type='many2one', relation='external.referential.type', string='External Referential Type'), |
42 | } |
43 | |
44 | external_shop_group() |
45 | @@ -197,28 +199,16 @@ |
46 | |
47 | class magerp_storeviews(magerp_osv.magerp_osv): |
48 | _name = "magerp.storeviews" |
49 | - _description = "The magento store views information" |
50 | + _description = "The magento store views information" |
51 | |
52 | - def _get_default_shop_id(self, cr, uid, ids, prop, unknow_none, context): |
53 | - res = {} |
54 | - for storeview in self.browse(cr, uid, ids, context): |
55 | - if storeview.magento_store_id: |
56 | - rid = self.pool.get('sale.shop').extid_to_oeid(cr, uid, storeview.magento_store_id, storeview.website_id.referential_id.id) |
57 | - res[storeview.id] = rid |
58 | - else: |
59 | - res[storeview.id] = False |
60 | - return res |
61 | - |
62 | _columns = { |
63 | 'name':fields.char('Store View Name', size=100), |
64 | 'code':fields.char('Code', size=100), |
65 | - 'magento_store_id':fields.integer('Store ID'), |
66 | 'website_id':fields.many2one('external.shop.group', 'Website', select=True, ondelete='cascade'), |
67 | 'is_active':fields.boolean('Default ?'), |
68 | 'sort_order':fields.integer('Sort Order'), |
69 | 'shop_id':fields.many2one('sale.shop', 'Shop', select=True, ondelete='cascade'), |
70 | 'lang_id':fields.many2one('res.lang', 'Language'), |
71 | - 'default_shop_id':fields.function(_get_default_shop_id, type="many2one", relation="sale.shop", method=True, string="Default Store (Group)"), |
72 | } |
73 | |
74 | #Return format of API:{'code': 'default', 'store_id': '1', 'website_id': '1', 'is_active': '1', 'sort_order': '0', 'group_id': '1', 'name': 'Default Store View'} |
75 | |
76 | === modified file 'magerp_core_view.xml' |
77 | --- magerp_core_view.xml 2009-12-11 15:04:11 +0000 |
78 | +++ magerp_core_view.xml 2010-03-18 13:54:19 +0000 |
79 | @@ -19,9 +19,9 @@ |
80 | <button name="sync_categs" string="2 - Import Product Categories" colspan="2" type="object" /> |
81 | <button name="sync_attribs" string="5 - Import Product Attributes" colspan="2" type="object" /> |
82 | <button name="sync_attrib_sets" string="3 - Import Product Attribute Sets" colspan="2" type="object" /> |
83 | - <newline /> |
84 | + <button name="sync_products" string="6 - Import Products" colspan="2" type="object" /> |
85 | <field name="default_pro_cat" /> |
86 | - <button name="sync_products" string="6 - Import Products" colspan="2" type="object" /> |
87 | + <field name="default_lang_id" /> |
88 | <!-- <button name="sync_customer_addresses" string="Sync Customer Addresses" colspan="2" type="object" />--> |
89 | <!-- <button name="export_products" string="Export Products" colspan="2" type="object" />--> |
90 | </page> |
91 | @@ -65,12 +65,10 @@ |
92 | <field name="is_default" readonly="1" /> |
93 | <field name="sort_order" readonly="1" /> |
94 | <field name="default_shop_id" readonly="1" /> |
95 | - <field name="default_group_id" readonly="1" /> |
96 | - <field name="default_lang_id" /> |
97 | - <field name="referential_id" /> |
98 | + <field name="referential_id" readonly="1" /> |
99 | </group> |
100 | <group col="4" colspan="4"> |
101 | - <field name="shop_ids" /> |
102 | + <field name="shop_ids" readonly="1"/> |
103 | </group> |
104 | </form> |
105 | </field> |
106 | @@ -86,7 +84,7 @@ |
107 | <field name="is_default" readonly="1" select="2" /> |
108 | <field name="sort_order" readonly="1" select="2" /> |
109 | <field name="default_shop_id" readonly="1" select="2" /> |
110 | - <field name="shop_ids" /> |
111 | + <field name="shop_ids" readonly="1" /> |
112 | </tree> |
113 | </field> |
114 | </record> |
115 | @@ -107,14 +105,12 @@ |
116 | <field name="arch" type="xml"> |
117 | <form string="Magento storeviews"> |
118 | <group col="4" colspan="4"> |
119 | - <field name="magento_store_id" readonly="1" /> |
120 | <field name="name" readonly="1" /> |
121 | <field name="code" readonly="1" /> |
122 | <field name="shop_id" readonly="1" /> |
123 | <field name="website_id" readonly="1" /> |
124 | <field name="is_active" readonly="1" /> |
125 | <field name="sort_order" readonly="1" /> |
126 | - <field name="default_shop_id" readonly="1" /> |
127 | <field name="lang_id" /> |
128 | </group> |
129 | </form> |
130 | @@ -126,13 +122,11 @@ |
131 | <field name="type">tree</field> |
132 | <field name="arch" type="xml"> |
133 | <tree string="Magento storeviews"> |
134 | - <field name="magento_store_id" readonly="1" select="1" /> |
135 | <field name="name" readonly="1" select="1" /> |
136 | <field name="code" readonly="1" select="1" /> |
137 | <field name="shop_id" readonly="1" select="1" /> |
138 | <field name="is_active" readonly="1" select="2" /> |
139 | <field name="sort_order" readonly="1" select="2" /> |
140 | - <field name="default_shop_id" readonly="1" select="2" /> |
141 | <field name="lang_id" /> |
142 | </tree> |
143 | </field> |
144 | |
145 | === modified file 'product.py' |
146 | --- product.py 2010-02-23 18:04:20 +0000 |
147 | +++ product.py 2010-03-18 13:54:19 +0000 |
148 | @@ -603,6 +603,7 @@ |
149 | 'set':fields.many2one('magerp.product_attribute_set', 'Attribute Set'), |
150 | 'tier_price':fields.one2many('product.tierprice', 'product', 'Tier Price'), |
151 | 'product_type': fields.selection(_product_type_get, 'Product Type'), |
152 | + 'websites_ids': fields.many2many('external.shop.group', 'magerp_product_shop_group_rel', 'product_id', 'shop_group_id', 'Websites', help='By defaut product will be exported on every website, if you want to exporte it only on some website select them here'), |
153 | } |
154 | |
155 | _defaults = { |
156 | @@ -725,6 +726,8 @@ |
157 | else: |
158 | break |
159 | xml+="</group></page>\n" |
160 | + if context.get('multiwebsite', False): |
161 | + xml+="""<page string='Websites'>\n<group colspan='4' col='4'>\n<field name='websites_ids'/>\n</group>\n</page>\n""" |
162 | xml+="</notebook>" |
163 | return xml |
164 | |
165 | @@ -739,6 +742,9 @@ |
166 | for field in self.pool.get('ir.model.fields').browse(cr, uid, ir_model_field_ids): |
167 | if str(field.name).startswith('x_'): |
168 | field_names.append(field.name) |
169 | + if len(self.pool.get('external.shop.group').search(cr,uid,[('referential_type', 'ilike', 'mag')])) >1 : |
170 | + context['multiwebsite'] = True |
171 | + field_names.append('websites_ids') |
172 | result['fields'].update(self.fields_get(cr, uid, field_names, context)) |
173 | view_part = self.redefine_prod_view(cr, uid, field_names, context) #.decode('utf8') It is not necessary, the translated view could be in UTF8 |
174 | result['arch'] = result['arch'].decode('utf8').replace('<page string="attributes_placeholder"/>', '<page string="'+_("Magento Information")+'"'+""" attrs="{'invisible':[('magento_exportable','!=',1)]}"><field name='product_type' attrs="{'required':[('magento_exportable','=',True)]}"/>\n""" + view_part + """\n</page>""") |
175 | @@ -806,6 +812,29 @@ |
176 | |
177 | def ext_export(self, cr, uid, ids, external_referential_ids=[], defaults={}, context={}): |
178 | ids = self.search(cr, uid, [('id', 'in', ids), ('magento_exportable', '=', True)]) #restrict export to only exportable products |
179 | + dates_2_ids = [] |
180 | + ids_2_dates = {} |
181 | + |
182 | + shop = self.pool.get('sale.shop').browse(cr, uid, context['shop_id']) |
183 | + |
184 | + last_exported_time = datetime.datetime.fromtimestamp(time.mktime(time.strptime(shop.last_products_export_date, '%Y-%m-%d %H:%M:%S'))) |
185 | + |
186 | + #strangely seems that on inherits structure, write_date/create_date are False for children |
187 | + cr.execute("select id, write_date, create_date from product_product where id in ("+ ','.join(map(lambda x: str(x),ids))+')') |
188 | + read = cr.fetchall() |
189 | + ids = [] |
190 | + context['force']=True |
191 | + for product_read in read: |
192 | + last_updated_product = product_read[1] and product_read[1].split('.')[0] or product_read[2] and product_read[2].split('.')[0] or False |
193 | + last_updated_time = datetime.datetime.fromtimestamp(time.mktime(time.strptime(last_updated_product, '%Y-%m-%d %H:%M:%S'))) |
194 | + if last_updated_time and last_exported_time: |
195 | + if last_exported_time + datetime.timedelta(seconds=1) > last_updated_time: |
196 | + continue |
197 | + dates_2_ids += [(last_updated_product, product_read[0])] |
198 | + ids_2_dates[product_read[0]] = last_updated_product |
199 | + |
200 | + dates_2_ids.sort() |
201 | + ids = [x[1] for x in dates_2_ids] |
202 | |
203 | #set the default_set_id in context and avoid extra request for each product upload |
204 | conn = context.get('conn_obj', False) |
205 | @@ -816,27 +845,28 @@ |
206 | default_set_id = set['set_id'] |
207 | break |
208 | context['default_set_id'] = default_set_id |
209 | + context_dic = {} |
210 | |
211 | - shop = self.pool.get('sale.shop').browse(cr, uid, context['shop_id']) |
212 | - no_local = context.copy() |
213 | - no_local['globalstoreview'] = True |
214 | - |
215 | - if shop.shop_group_id.default_lang_id: #default magento language might not be English |
216 | - no_local['lang'] = shop.shop_group_id.default_lang_id.code |
217 | - elif no_local.get('lang', False): |
218 | - del(no_local['lang']) |
219 | - result = super(magerp_osv.magerp_osv, self).ext_export(cr, uid, ids, external_referential_ids, defaults, no_local) |
220 | - ids = result['create_ids'] + result['write_ids'] |
221 | - |
222 | - #language wise update: |
223 | for storeview in shop.storeview_ids: |
224 | - if storeview.lang_id and not (shop.shop_group_id.default_lang_id and storeview.lang_id.code == shop.shop_group_id.default_lang_id.code): |
225 | - context.update({'storeview_code': storeview.code, 'lang': storeview.lang_id.code, 'force': True}) |
226 | - super(magerp_osv.magerp_osv, self).ext_export(cr, uid, ids, external_referential_ids, defaults, context) |
227 | - |
228 | - #inventory level updates: |
229 | - shop = self.pool.get('sale.shop').browse(cr, uid, context['shop_id']) |
230 | - stock_id = shop.warehouse_id.lot_stock_id.id |
231 | + if storeview.lang_id : |
232 | + context_dic[storeview] = context.copy() |
233 | + context_dic[storeview].update({'storeview_code': storeview.code, 'lang': storeview.lang_id.code}) |
234 | + if storeview.lang_id.code == shop.referential_id.default_lang_id.code: |
235 | + context_dic[storeview]['export_url'] = True # for the magento version 1.3.2.4, only one url is autorized by product, so we only export with the MAPPING TEMPLATE the url of the default language |
236 | + |
237 | + if len(shop.storeview_ids) > len(context_dic): |
238 | + context_dic['default_value'] = context.copy() |
239 | + context_dic['default_value']['export_url'] = True # for the magento version 1.3.2.4, only one url is autorized by product, so we only export with the MAPPING TEMPLATE the url of the default language |
240 | + context_dic['default_value']['lang'] = shop.referential_id.default_lang_id.code |
241 | + |
242 | + result = {'create_ids':[], 'write_ids':[]} |
243 | + for id in ids: |
244 | + for storeview in context_dic: |
245 | + temp_result = super(magerp_osv.magerp_osv, self).ext_export(cr, uid, [id], external_referential_ids, defaults, context_dic[storeview]) |
246 | + self.pool.get('sale.shop').write(cr, uid,context['shop_id'], {'last_products_export_date': ids_2_dates[id]}) |
247 | + result['create_ids'] += temp_result['create_ids'] |
248 | + result['write_ids'] += temp_result['write_ids'] |
249 | + |
250 | return result |
251 | |
252 | |
253 | |
254 | === modified file 'sale.py' |
255 | --- sale.py 2010-03-04 13:47:23 +0000 |
256 | +++ sale.py 2010-03-18 13:54:19 +0000 |
257 | @@ -34,6 +34,26 @@ |
258 | class sale_shop(magerp_osv.magerp_osv): |
259 | _inherit = "sale.shop" |
260 | |
261 | + def _get_exportable_product_ids(self, cr, uid, ids, name, args, context=None): |
262 | + res = super(sale_shop, self)._get_exportable_product_ids(cr, uid, ids, name, args, context=None) |
263 | + for shop_id in res: |
264 | + website_id = self.read(cr, uid, shop_id, ['shop_group_id']) |
265 | + if website_id.get('shop_group_id', False): |
266 | + res[shop_id] = self.pool.get('product.product').search(cr, uid, [('id', 'in', res[shop_id]), "|", ('websites_ids', 'in', [website_id['shop_group_id'][0]]) , ('websites_ids', '=', False)]) |
267 | + else: |
268 | + res[shop_id] = [] |
269 | + return res |
270 | + |
271 | + def _get_default_storeview_id(self, cr, uid, ids, prop, unknow_none, context): |
272 | + res = {} |
273 | + for shop in self.browse(cr, uid, ids, context): |
274 | + if shop.default_storeview_id: |
275 | + rid = self.pool.get('magerp.storeviews').extid_to_oeid(cr, uid, shop.default_storeview_integer_id, shop.referential_id.id) |
276 | + res[shop.id] = rid |
277 | + else: |
278 | + res[shop.id] = False |
279 | + return res |
280 | + |
281 | def export_images(self, cr, uid, ids, ctx): |
282 | for shop in self.browse(cr, uid, ids): |
283 | ctx['shop_id'] = shop.id |
284 | @@ -44,20 +64,11 @@ |
285 | res = True |
286 | self.write(cr,uid,ctx['shop_id'],{'last_images_export_date':datetime.now()}) |
287 | |
288 | - def _shop_group_get(self, cr, uid, ids, prop, unknow_none, context): |
289 | - res = {} |
290 | - for shop in self.browse(cr, uid, ids, context): |
291 | - if shop.website_id: |
292 | - rid = self.pool.get('external.shop.group').extid_to_oeid(cr, uid, shop.website_id, shop.referential_id.id) |
293 | - res[shop.id] = rid |
294 | - else: |
295 | - res[shop.id] = False |
296 | - return res |
297 | |
298 | def _get_rootcategory(self, cr, uid, ids, prop, unknow_none, context): |
299 | res = {} |
300 | for shop in self.browse(cr, uid, ids, context): |
301 | - if shop.website_id: |
302 | + if shop.root_category_id: |
303 | rid = self.pool.get('product.category').extid_to_oeid(cr, uid, shop.root_category_id, shop.referential_id.id) |
304 | res[shop.id] = rid |
305 | else: |
306 | @@ -72,14 +83,14 @@ |
307 | return res |
308 | |
309 | _columns = { |
310 | - 'default_store_id':fields.integer('Magento Store ID'), #Many 2 one ? |
311 | - 'website_id':fields.integer('Magento Website ID'), # Many 2 one ? |
312 | - 'group_id':fields.integer('Magento ID'), |
313 | - 'root_category_id':fields.integer('Root product Category'), |
314 | + 'default_storeview_integer_id':fields.integer('Magento default Storewiev ID'), #This field can't be a many2one because store field will be mapped before creating storeviews |
315 | + 'default_storeview_id':fields.function(_get_default_storeview_id, type="many2one", relation="magerp.storeviews", method=True, string="Default Storeview"), |
316 | + 'root_category_id':fields.integer('Root product Category'), #This field can't be a many2one because store field will be mapped before creating category |
317 | 'magento_root_category':fields.function(_get_rootcategory, type="many2one", relation="product.category", method=True, string="Root Category", store=True), |
318 | 'exportable_root_category_ids': fields.function(_get_exportable_root_category_ids, type="many2many", relation="product.category", method=True, string="Root Category"), #fields.function(_get_exportable_root_category_ids, type="many2one", relation="product.category", method=True, 'Exportable Root Categories'), |
319 | 'storeview_ids': fields.one2many('magerp.storeviews', 'shop_id', 'Store Views'), |
320 | 'payment_types': fields.one2many('magerp.sale.shop.payment.type', 'shop_id', 'Payment Type'), |
321 | + 'exportable_product_ids': fields.function(_get_exportable_product_ids, method=True, type='one2many', relation="product.product", string='Exportable Products'), |
322 | } |
323 | |
324 | def import_shop_orders(self, cr, uid, shop, defaults, ctx): |
325 | |
326 | === modified file 'sale_view.xml' |
327 | --- sale_view.xml 2010-02-26 21:03:53 +0000 |
328 | +++ sale_view.xml 2010-03-18 13:54:19 +0000 |
329 | @@ -13,7 +13,11 @@ |
330 | <field name="exportable_root_category_ids" position="replace"> |
331 | <field name="exportable_root_category_ids" invisible="1" /> |
332 | </field> |
333 | - <field name="shop_group_id" position="after"> |
334 | + <field name="referential_id" position="replace"> |
335 | + <field name="referential_id" readonly="1"/> |
336 | + </field> |
337 | + <field name="shop_group_id" position="replace"> |
338 | + <field name="shop_group_id" readonly="1"/> |
339 | <field name="magento_root_category" readonly="1" /> |
340 | <field name="storeview_ids" nolabel="1" colspan="4" /> |
341 | </field> |
342 | |
343 | === modified file 'settings/external.mappinglines.template.csv' |
344 | --- settings/external.mappinglines.template.csv 2010-02-26 21:03:53 +0000 |
345 | +++ settings/external.mappinglines.template.csv 2010-03-18 13:54:19 +0000 |
346 | @@ -4,10 +4,9 @@ |
347 | "mag_erp_s_web","magento1324","base_sale_multichannels.model_external_shop_group","website_id","in_out","int","result=[('website_id',ifield)]", |
348 | "mag_erp_s_isa","magento1324","base_sale_multichannels.model_external_shop_group","is_default","in_out","str","result=[('is_default',bool(eval(ifield)))]", |
349 | "mag_erp_s_stord","magento1324","base_sale_multichannels.model_external_shop_group","sort_order","in_out","int","result=[('sort_order',ifield)]", |
350 | -"mag_erp_s_gpid","magento1324","base_sale_multichannels.model_external_shop_group","default_group_id","in_out","int","result=[('default_group_id',ifield)]", |
351 | +"mag_erp_s_gpid","magento1324","base_sale_multichannels.model_external_shop_group","default_group_id","in_out","int","result=[('default_shop_integer_id',ifield)]", |
352 | "mag_erp_sv_name","magento1324","model_magerp_storeviews","name","in_out","str","result=[('name',ifield)]","result=[('name',record['name'])]" |
353 | "mag_erp_sv_code","magento1324","model_magerp_storeviews","code","in_out","str","result=[('code',ifield)]", |
354 | -"mag_erp_sv_sid","magento1324","model_magerp_storeviews","store_id","in_out","int","result=[('magento_store_id',ifield)]", |
355 | "mag_erp_sv_sg","magento1324","model_magerp_storeviews","website_id","in_out","int","result=[('website_id',self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ifield, external_referential_id))]", |
356 | "mag_erp_sv_isa","magento1324","model_magerp_storeviews","is_active","in_out","str","result=[('is_active',bool(eval(ifield)))]", |
357 | "mag_erp_sv_stord","magento1324","model_magerp_storeviews","sort_order","in_out","int","result=[('sort_order',ifield)]", |
358 | @@ -15,8 +14,7 @@ |
359 | "mag_erp_st_name","magento1324","sale.model_sale_shop","name","in_out","str","result=[('name',ifield)]","result=[('name',record['name'])]" |
360 | "mag_erp_st_gpid","magento1324","sale.model_sale_shop","group_id","in_out","int","result=[('group_id',ifield)]", |
361 | "mag_erp_st_grp","magento1324","sale.model_sale_shop","website_id","in_out","int","result=[('shop_group_id',self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ifield, external_referential_id))]", |
362 | -"mag_erp_st_web","magento1324","sale.model_sale_shop","website_id","in_out","int","result=[('website_id',ifield)]", |
363 | -"mag_erp_st_default_st","magento1324","sale.model_sale_shop","default_store_id","in_out","int","result=[('default_store_id',ifield)]", |
364 | +"mag_erp_st_default_st","magento1324","sale.model_sale_shop","default_store_id","in_out","int","result=[('default_storeview_integer_id',ifield)]", |
365 | "mag_erp_st_root_categ","magento1324","sale.model_sale_shop","root_category_id","in_out","int","result=[('root_category_id',ifield)]", |
366 | "mag_erp_so_name","magento1324","sale.model_sale_order","increment_id","in_out","str","result=[('magento_incrementid',str(ifield)), ('name','mag_' + str(ifield))]", |
367 | "mag_erp_so_custo","magento1324","sale.model_sale_order","customer_id","in_out","int","result=[('partner_id',self.pool.get('res.partner').extid_to_oeid(cr, uid, ifield, external_referential_id))]", |
368 | @@ -108,7 +106,7 @@ |
369 | "mag_erp_attr_23","magento1324","model_magerp_product_attributes","note","in_out","str","result=[('note', ifield)]","result=[('note', record['note'])]" |
370 | "mag_erp_attr_24","magento1324","model_magerp_product_attributes","entity_type_id","in_out","int","result=[('entity_type_id', ifield)]","result=[('entity_type_id', record['entity_type_id'])]" |
371 | "mag_erp_attr_25","magento1324","model_magerp_product_attributes","apply_to","in_out","str","result=[('apply_to', str(ifield))]","result=[('apply_to', eval(record['%s']))]" |
372 | -"mag_erp_prd_1","magento1324","product.model_product_product","url_key","in_out","str","result=[('x_magerp_url_key',ifield)]","if context.get('globalstoreview', False) : |
373 | +"mag_erp_prd_1","magento1324","product.model_product_product","url_key","in_out","str","result=[('x_magerp_url_key',ifield)]","if context.get('export_url', False) : |
374 | result=[('url_key',record['x_magerp_url_key'])]" |
375 | "mag_erp_prd_2","magento1324","product.model_product_product","name","in_out","str","result = [('name',ifield)]","result = [('name',record['name'])]" |
376 | "mag_erp_prd_3","magento1324","product.model_product_product","description","in_out","str","result = [('description',ifield)]", |