Merge lp:~camptocamp/magentoerpconnect/oerp6.1-oldstable-fix-1100293 into lp:magentoerpconnect/oerp6.1-oldstable

Proposed by Alexandre Fayolle - camptocamp on 2013-01-16
Status: Merged
Merge reported by: Alexandre Fayolle - camptocamp
Merged at revision: not available
Proposed branch: lp:~camptocamp/magentoerpconnect/oerp6.1-oldstable-fix-1100293
Merge into: lp:magentoerpconnect/oerp6.1-oldstable
Diff against target: 103 lines (+30/-18)
5 files modified
magentoerpconnect/__openerp__.py (+1/-1)
magentoerpconnect/settings/1.3.2.4/external.mappinglines.template.csv (+7/-4)
magentoerpconnect/settings/1.4.0.0/external.mappinglines.template.csv (+7/-4)
magentoerpconnect/settings/1.4.2.0/external.mappinglines.template.csv (+7/-4)
magentoerpconnect/settings/1.5.0.0/external.mappinglines.template.csv (+8/-5)
To merge this branch: bzr merge lp:~camptocamp/magentoerpconnect/oerp6.1-oldstable-fix-1100293
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp 2013-01-16 Approve on 2013-01-17
Alexandre Fayolle - camptocamp test Approve on 2013-01-16
Review via email: mp+143516@code.launchpad.net

Description of the change

fix mapping.

To post a comment you must log in.

We would miss the 4th and later lines but I don't think that's even possible on Magento, so: LGTM

review: Approve

arg... syntax error in the mapping... I hate writing Python code in a CSV file.

(unbalanced parenthesis...)

review: Needs Fixing
667. By Alexandre Fayolle - camptocamp on 2013-01-16

[FIX] fix previous changeset: missing closing parenthesis

> arg... syntax error in the mapping... I hate writing Python code in a CSV
> file.
>
> (unbalanced parenthesis...)

branch updated with the fix

review: Approve (test)
668. By Alexandre Fayolle - camptocamp on 2013-01-16

[FIX] index error in prev. commit

669. By Alexandre Fayolle - camptocamp on 2013-01-16

incr. version number

also fixed the > 3 lines of address issue+ incremented version number of the addon

LGTM

review: Approve

I goofed the merge by using bzr rebase, but the code is in there.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/__openerp__.py'
2--- magentoerpconnect/__openerp__.py 2012-07-25 13:11:43 +0000
3+++ magentoerpconnect/__openerp__.py 2013-01-16 18:25:25 +0000
4@@ -18,7 +18,7 @@
5 #########################################################################
6 {
7 "name" : "Magento e-commerce",
8- "version" : "1.0.1",
9+ "version" : "1.0.2",
10 "depends" : ["base",
11 "product",
12 "product_m2mcategories",
13
14=== modified file 'magentoerpconnect/settings/1.3.2.4/external.mappinglines.template.csv'
15--- magentoerpconnect/settings/1.3.2.4/external.mappinglines.template.csv 2012-07-25 13:16:34 +0000
16+++ magentoerpconnect/settings/1.3.2.4/external.mappinglines.template.csv 2013-01-16 18:25:25 +0000
17@@ -242,10 +242,13 @@
18 result=[]
19 ",
20 magento_1324_prt_adr_8,magento1324,base.model_res_partner_address,street,,in_out,function,unicode,,"if ifield:
21- if len(ifield.split('\n')) ==2 :
22- result = [('street', ifield.split('\n')[0]) , ('street2', ifield.split('\n')[1])]
23- else :
24- result = [('street',ifield.replace('\\n',','))]
25+ lines = [line.strip() for line in ifield.split('\n') if line.strip()]
26+ if len(lines) == 1:
27+ result = [('street', lines[0]), ('street2', False)]
28+ elif len(lines) >= 2:
29+ result = [('street', lines[0]), ('street2', u' - '.join(lines[1:]))]
30+ else:
31+ result = []
32 else:
33 result = []",
34 magento_1324_prt_adr_9,magento1324,base.model_res_partner_address,postcode,,in_out,function,unicode,,"result=[('zip',ifield)]",
35
36=== modified file 'magentoerpconnect/settings/1.4.0.0/external.mappinglines.template.csv'
37--- magentoerpconnect/settings/1.4.0.0/external.mappinglines.template.csv 2012-07-25 13:16:34 +0000
38+++ magentoerpconnect/settings/1.4.0.0/external.mappinglines.template.csv 2013-01-16 18:25:25 +0000
39@@ -245,10 +245,13 @@
40 result=[]
41 ",
42 magento_1400_prt_adr_8,magento1400,base.model_res_partner_address,street,,in_out,function,unicode,,"if ifield:
43- if len(ifield.split('\n')) ==2 :
44- result = [('street', ifield.split('\n')[0]) , ('street2', ifield.split('\n')[1])]
45- else :
46- result = [('street',ifield.replace('\\n',','))]
47+ lines = [line.strip() for line in ifield.split('\n') if line.strip()]
48+ if len(lines) == 1:
49+ result = [('street', lines[0]), ('street2', False)]
50+ elif len(lines) >= 2:
51+ result = [('street', lines[0]), ('street2', u' - '.join(lines[1:]))]
52+ else:
53+ result = []
54 else:
55 result = []",
56 magento_1400_prt_adr_9,magento1400,base.model_res_partner_address,postcode,,in_out,function,unicode,,"result=[('zip',ifield)]",
57
58=== modified file 'magentoerpconnect/settings/1.4.2.0/external.mappinglines.template.csv'
59--- magentoerpconnect/settings/1.4.2.0/external.mappinglines.template.csv 2012-10-24 12:53:08 +0000
60+++ magentoerpconnect/settings/1.4.2.0/external.mappinglines.template.csv 2013-01-16 18:25:25 +0000
61@@ -242,10 +242,13 @@
62 result=[]
63 ",
64 magento_1420_prt_adr_8,magento1420,base.model_res_partner_address,street,,in_out,function,unicode,,"if ifield:
65- if len(ifield.split('\n')) ==2 :
66- result = [('street', ifield.split('\n')[0]) , ('street2', ifield.split('\n')[1])]
67- else :
68- result = [('street',ifield.replace('\\n',','))]
69+ lines = [line.strip() for line in ifield.split('\n') if line.strip()]
70+ if len(lines) == 1:
71+ result = [('street', lines[0]), ('street2', False)]
72+ elif len(lines) >= 2:
73+ result = [('street', lines[0]), ('street2', u' - '.join(lines[1:]))]
74+ else:
75+ result = []
76 else:
77 result = []",
78 magento_1420_prt_adr_9,magento1420,base.model_res_partner_address,postcode,,in_out,function,unicode,,"result=[('zip',ifield)]",
79
80=== modified file 'magentoerpconnect/settings/1.5.0.0/external.mappinglines.template.csv'
81--- magentoerpconnect/settings/1.5.0.0/external.mappinglines.template.csv 2012-12-06 08:06:31 +0000
82+++ magentoerpconnect/settings/1.5.0.0/external.mappinglines.template.csv 2013-01-16 18:25:25 +0000
83@@ -244,12 +244,15 @@
84 result=[]
85 ",
86 magento_1500_prt_adr_8,magento1500,base.model_res_partner_address,street,,in_out,function,unicode,,"if ifield:
87- if len(ifield.split('\n')) ==2 :
88- result = [('street', ifield.split('\n')[0]) , ('street2', ifield.split('\n')[1])]
89- else :
90- result = [('street',ifield.replace('\\n',','))]
91+ lines = [line.strip() for line in ifield.split('\n') if line.strip()]
92+ if len(lines) == 1:
93+ result = [('street', lines[0]), ('street2', False)]
94+ elif len(lines) >= 2:
95+ result = [('street', lines[0]), ('street2', u' - '.join(lines[1:]))]
96+ else:
97+ result = []
98 else:
99- result = []",
100+ result = []",
101 magento_1500_prt_adr_9,magento1500,base.model_res_partner_address,postcode,,in_out,function,unicode,,"result=[('zip',ifield)]",
102 magento_1500_prt_adr_10,magento1500,base.model_res_partner_address,telephone,,in_out,function,unicode,,"result=[('phone',ifield)]",
103 magento_1500_prt_adr_11,magento1500,base.model_res_partner_address,region,,in_out,function,unicode,,"if ifield: