Merge lp:~unifield-team/unifield-server/US-5343-5790-6099 into lp:unifield-server
- US-5343-5790-6099
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5432 |
Proposed branch: | lp:~unifield-team/unifield-server/US-5343-5790-6099 |
Merge into: | lp:unifield-server |
Diff against target: |
585 lines (+194/-62) (has conflicts) 8 files modified
bin/addons/msf_doc_import/purchase_order.py (+3/-4) bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako (+1/-1) bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py (+97/-33) bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen_view.xml (+2/-2) bin/addons/msf_profile/i18n/fr_MF.po (+79/-12) bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako (+10/-2) bin/addons/msf_tools/automated_export_job.py (+1/-4) bin/addons/msf_tools/automated_import_job.py (+1/-4) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/US-5343-5790-6099 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+368521@code.launchpad.net |
Commit message
Description of the change
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 'bin/addons/msf_doc_import/purchase_order.py' | |||
2 | --- bin/addons/msf_doc_import/purchase_order.py 2019-05-17 09:46:15 +0000 | |||
3 | +++ bin/addons/msf_doc_import/purchase_order.py 2019-06-07 07:31:09 +0000 | |||
4 | @@ -427,19 +427,18 @@ | |||
5 | 427 | # create tmp file | 427 | # create tmp file |
6 | 428 | tmp_file = tempfile.NamedTemporaryFile(mode='w', delete=False) | 428 | tmp_file = tempfile.NamedTemporaryFile(mode='w', delete=False) |
7 | 429 | tmp_file.write(base64.decodestring(file_res['result'])) | 429 | tmp_file.write(base64.decodestring(file_res['result'])) |
8 | 430 | tmpname = tmp_file.name | ||
9 | 430 | tmp_file.close() | 431 | tmp_file.close() |
10 | 431 | new_tmp_file_name = os.path.join(os.path.dirname(tmp_file.name), filename) | ||
11 | 432 | os.rename(tmp_file.name, new_tmp_file_name) | ||
12 | 433 | 432 | ||
13 | 434 | # transfer tmp file on SFTP server | 433 | # transfer tmp file on SFTP server |
14 | 435 | try: | 434 | try: |
15 | 436 | with sftp.cd(export_wiz.dest_path): | 435 | with sftp.cd(export_wiz.dest_path): |
17 | 437 | sftp.put(new_tmp_file_name, preserve_mtime=True) | 436 | sftp.put(tmpname, filename, preserve_mtime=True) |
18 | 438 | except: | 437 | except: |
19 | 439 | raise osv.except_osv(_('Error'), _('Unable to write on SFTP server at location %s') % export_wiz.dest_path) | 438 | raise osv.except_osv(_('Error'), _('Unable to write on SFTP server at location %s') % export_wiz.dest_path) |
20 | 440 | 439 | ||
21 | 441 | # now we can remove tmp file | 440 | # now we can remove tmp file |
23 | 442 | os.remove(new_tmp_file_name) | 441 | os.remove(tmpname) |
24 | 443 | else: | 442 | else: |
25 | 444 | # write export in local file | 443 | # write export in local file |
26 | 445 | with open(path_to_file, 'w') as fich: | 444 | with open(path_to_file, 'w') as fich: |
27 | 446 | 445 | ||
28 | === modified file 'bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako' | |||
29 | --- bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2018-08-10 09:51:23 +0000 | |||
30 | +++ bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2019-06-07 07:31:09 +0000 | |||
31 | @@ -323,7 +323,7 @@ | |||
32 | 323 | 323 | ||
33 | 324 | <Row> | 324 | <Row> |
34 | 325 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Information (Line numbers refer to the line numbers of the PO confirmation import file)')}</Data></Cell> | 325 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Information (Line numbers refer to the line numbers of the PO confirmation import file)')}</Data></Cell> |
36 | 326 | <Cell ss:StyleID="line" MergeAcross="3" ><Data ss:Type="String">${(o.message or '')|x}</Data></Cell> | 326 | <Cell ss:StyleID="line" ss:MergeAcross="2" ><Data ss:Type="String">${(o.message or '')|x}</Data></Cell> |
37 | 327 | </Row> | 327 | </Row> |
38 | 328 | 328 | ||
39 | 329 | </Table> | 329 | </Table> |
40 | 330 | 330 | ||
41 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py' | |||
42 | --- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2019-05-28 07:30:48 +0000 | |||
43 | +++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2019-06-07 07:31:09 +0000 | |||
44 | @@ -734,7 +734,9 @@ | |||
45 | 734 | lines_to_ignored = [] # Bad formatting lines | 734 | lines_to_ignored = [] # Bad formatting lines |
46 | 735 | file_format_errors = [] | 735 | file_format_errors = [] |
47 | 736 | values_header_errors = [] | 736 | values_header_errors = [] |
48 | 737 | values_header_warnings = [] | ||
49 | 737 | values_line_errors = [] | 738 | values_line_errors = [] |
50 | 739 | values_line_warnings = [] | ||
51 | 738 | message = '' | 740 | message = '' |
52 | 739 | header_values = {} | 741 | header_values = {} |
53 | 740 | 742 | ||
54 | @@ -803,10 +805,10 @@ | |||
55 | 803 | message = '''## IMPORT STOPPED ## | 805 | message = '''## IMPORT STOPPED ## |
56 | 804 | 806 | ||
57 | 805 | LINE 1 OF THE IMPORTED FILE: THE ORDER REFERENCE \ | 807 | LINE 1 OF THE IMPORTED FILE: THE ORDER REFERENCE \ |
59 | 806 | IN THE FILE IS NOT THE SAME AS THE ORDER REFERENCE OF THE SIMULATION SCREEN.\ | 808 | IN THE FILE IS NOT THE SAME AS THE ORDER REFERENCE OF THE SIMULATION SCREEN. \ |
60 | 807 | 809 | ||
63 | 808 | YOU SHOULD IMPORT A FILE THAT HAS THE SAME ORDER REFERENCE THAN THE SIMULATION\ | 810 | YOU SHOULD IMPORT A FILE THAT HAS THE SAME ORDER REFERENCE THAN THE SIMULATION \ |
64 | 809 | SCREEN !''' | 811 | SCREEN !''' |
65 | 810 | self.write(cr, uid, [wiz.id], {'message': message, 'state': 'error'}, context) | 812 | self.write(cr, uid, [wiz.id], {'message': message, 'state': 'error'}, context) |
66 | 811 | res = self.go_to_simulation(cr, uid, [wiz.id], context=context) | 813 | res = self.go_to_simulation(cr, uid, [wiz.id], context=context) |
67 | 812 | cr.commit() | 814 | cr.commit() |
68 | @@ -941,7 +943,10 @@ | |||
69 | 941 | for manda_field in LINES_COLUMNS: | 943 | for manda_field in LINES_COLUMNS: |
70 | 942 | if manda_field[2] == 'mandatory' and not values.get(x, [])[manda_field[0]]: | 944 | if manda_field[2] == 'mandatory' and not values.get(x, [])[manda_field[0]]: |
71 | 943 | not_ok = True | 945 | not_ok = True |
73 | 944 | err1 = _('The column \'%s\' mustn\'t be empty%s') % (manda_field[1], manda_field[0] == 0 and ' - Line not imported' or '') | 946 | if manda_field[0] == 4: # Product Qty |
74 | 947 | err1 = _('You can not have an order line with a negative or zero quantity. Updated quantity is ignored') | ||
75 | 948 | else: | ||
76 | 949 | err1 = _('The column \'%s\' mustn\'t be empty%s') % (manda_field[1], manda_field[0] == 0 and ' - Line not imported' or '') | ||
77 | 945 | err = _('Line %s of the PO: %s') % (line_number, err1) | 950 | err = _('Line %s of the PO: %s') % (line_number, err1) |
78 | 946 | values_line_errors.append(err) | 951 | values_line_errors.append(err) |
79 | 947 | file_line_error.append(err1) | 952 | file_line_error.append(err1) |
80 | @@ -976,9 +981,6 @@ | |||
81 | 976 | if not ext_ref and line_number and line_number in EXT_REF_BY_LN[wiz.id].keys(): | 981 | if not ext_ref and line_number and line_number in EXT_REF_BY_LN[wiz.id].keys(): |
82 | 977 | ext_ref = EXT_REF_BY_LN[wiz.id][line_number][0] | 982 | ext_ref = EXT_REF_BY_LN[wiz.id][line_number][0] |
83 | 978 | 983 | ||
84 | 979 | if not_ok: | ||
85 | 980 | not_ok_file_lines[x] = ' - '.join(err for err in file_line_error) | ||
86 | 981 | |||
87 | 982 | # if not line_number and not ext_ref: | 984 | # if not line_number and not ext_ref: |
88 | 983 | # continue | 985 | # continue |
89 | 984 | 986 | ||
90 | @@ -1005,12 +1007,20 @@ | |||
91 | 1005 | uom_id = uom_ids[0] | 1007 | uom_id = uom_ids[0] |
92 | 1006 | UOM_NAME_ID.setdefault(vals[5], uom_id) | 1008 | UOM_NAME_ID.setdefault(vals[5], uom_id) |
93 | 1007 | # Qty | 1009 | # Qty |
94 | 1010 | qty = 0 | ||
95 | 1008 | if vals[4]: | 1011 | if vals[4]: |
97 | 1009 | qty = float(vals[4]) | 1012 | try: |
98 | 1013 | qty = float(vals[4]) | ||
99 | 1014 | except Exception: | ||
100 | 1015 | qty = 0 | ||
101 | 1010 | 1016 | ||
102 | 1011 | # AD on line | 1017 | # AD on line |
103 | 1012 | file_lines[x] = (line_number, product_id, uom_id, qty, ext_ref, vals[20:]) | 1018 | file_lines[x] = (line_number, product_id, uom_id, qty, ext_ref, vals[20:]) |
104 | 1013 | 1019 | ||
105 | 1020 | # If error(s) | ||
106 | 1021 | if not_ok: | ||
107 | 1022 | not_ok_file_lines[x] = ' - '.join(err for err in file_line_error) | ||
108 | 1023 | |||
109 | 1014 | ''' | 1024 | ''' |
110 | 1015 | Get the best matching line : | 1025 | Get the best matching line : |
111 | 1016 | 1/ Within lines with same line number, same product, same UoM and same qty | 1026 | 1/ Within lines with same line number, same product, same UoM and same qty |
112 | @@ -1117,7 +1127,7 @@ | |||
113 | 1117 | 'percent_completed': percent_completed}, context=context) | 1127 | 'percent_completed': percent_completed}, context=context) |
114 | 1118 | vals = values.get(file_line[0], []) | 1128 | vals = values.get(file_line[0], []) |
115 | 1119 | if file_line[1] == 'match': | 1129 | if file_line[1] == 'match': |
117 | 1120 | err_msg = wl_obj.import_line(cr, uid, po_line, vals, cc_cache, context=context) | 1130 | err_msg, warn_msg = wl_obj.import_line(cr, uid, po_line, vals, cc_cache, context=context) |
118 | 1121 | if file_line[0] in not_ok_file_lines: | 1131 | if file_line[0] in not_ok_file_lines: |
119 | 1122 | wl_obj.write(cr, uid, [po_line], {'type_change': 'error', 'error_msg': not_ok_file_lines[file_line[0]]}, context=context) | 1132 | wl_obj.write(cr, uid, [po_line], {'type_change': 'error', 'error_msg': not_ok_file_lines[file_line[0]]}, context=context) |
120 | 1123 | elif file_line[1] == 'split': | 1133 | elif file_line[1] == 'split': |
121 | @@ -1127,7 +1137,7 @@ | |||
122 | 1127 | 'parent_line_id': po_line, | 1137 | 'parent_line_id': po_line, |
123 | 1128 | 'imp_dcd': False, | 1138 | 'imp_dcd': False, |
124 | 1129 | 'po_line_id': False}, context=context) | 1139 | 'po_line_id': False}, context=context) |
126 | 1130 | err_msg = wl_obj.import_line(cr, uid, new_wl_id, vals, cc_cache, context=context) | 1140 | err_msg, warn_msg = wl_obj.import_line(cr, uid, new_wl_id, vals, cc_cache, context=context) |
127 | 1131 | if file_line[0] in not_ok_file_lines: | 1141 | if file_line[0] in not_ok_file_lines: |
128 | 1132 | wl_obj.write(cr, uid, [new_wl_id], {'type_change': 'error', 'error_msg': not_ok_file_lines[file_line[0]]}, context=context) | 1142 | wl_obj.write(cr, uid, [new_wl_id], {'type_change': 'error', 'error_msg': not_ok_file_lines[file_line[0]]}, context=context) |
129 | 1133 | # Commit modifications | 1143 | # Commit modifications |
130 | @@ -1135,8 +1145,12 @@ | |||
131 | 1135 | 1145 | ||
132 | 1136 | if err_msg: | 1146 | if err_msg: |
133 | 1137 | for err in err_msg: | 1147 | for err in err_msg: |
135 | 1138 | err = 'Line %s of the PO: %s' % (file_line[2], err) | 1148 | err = _('Line %s of the PO: %s') % (file_line[2], err) |
136 | 1139 | values_line_errors.append(err) | 1149 | values_line_errors.append(err) |
137 | 1150 | if warn_msg: | ||
138 | 1151 | for warn in warn_msg: | ||
139 | 1152 | warn = _('Line %s of the PO: %s') % (file_line[2], warn) | ||
140 | 1153 | values_line_errors.append(warn) | ||
141 | 1140 | 1154 | ||
142 | 1141 | 1155 | ||
143 | 1142 | # Create new lines | 1156 | # Create new lines |
144 | @@ -1153,7 +1167,7 @@ | |||
145 | 1153 | 'in_line_number': values.get(po_line, [])[0] and int(values.get(po_line, [])[0]) or False, | 1167 | 'in_line_number': values.get(po_line, [])[0] and int(values.get(po_line, [])[0]) or False, |
146 | 1154 | 'in_ext_ref': values.get(po_line, [])[1] or False, | 1168 | 'in_ext_ref': values.get(po_line, [])[1] or False, |
147 | 1155 | 'simu_id': wiz.id}, context=context) | 1169 | 'simu_id': wiz.id}, context=context) |
149 | 1156 | err_msg = wl_obj.import_line(cr, uid, new_wl_id, vals, cc_cache, context=context) | 1170 | err_msg, warn_msg = wl_obj.import_line(cr, uid, new_wl_id, vals, cc_cache, context=context) |
150 | 1157 | if po_line in not_ok_file_lines: | 1171 | if po_line in not_ok_file_lines: |
151 | 1158 | wl_obj.write(cr, uid, [new_wl_id], {'type_change': 'error', 'error_msg': not_ok_file_lines[po_line]}, context=context) | 1172 | wl_obj.write(cr, uid, [new_wl_id], {'type_change': 'error', 'error_msg': not_ok_file_lines[po_line]}, context=context) |
152 | 1159 | 1173 | ||
153 | @@ -1161,10 +1175,17 @@ | |||
154 | 1161 | if err_msg: | 1175 | if err_msg: |
155 | 1162 | for err in err_msg: | 1176 | for err in err_msg: |
156 | 1163 | if line_n: | 1177 | if line_n: |
158 | 1164 | err = 'Line %s of the PO: %s' % (line_n, err) | 1178 | err = _('Line %s of the PO: %s') % (line_n, err) |
159 | 1165 | else: | 1179 | else: |
161 | 1166 | err = 'Line %s of the file: %s' % (po_line, err) | 1180 | err = _('Line %s of the file: %s') % (po_line, err) |
162 | 1167 | values_line_errors.append(err) | 1181 | values_line_errors.append(err) |
163 | 1182 | if warn_msg: | ||
164 | 1183 | for warn in warn_msg: | ||
165 | 1184 | if line_n: | ||
166 | 1185 | warn = _('Line %s of the PO: %s') % (line_n, warn) | ||
167 | 1186 | else: | ||
168 | 1187 | warn = _('Line %s of the file: %s') % (po_line, warn) | ||
169 | 1188 | values_line_warnings.append(warn) | ||
170 | 1168 | # Commit modifications | 1189 | # Commit modifications |
171 | 1169 | cr.commit() | 1190 | cr.commit() |
172 | 1170 | 1191 | ||
173 | @@ -1176,27 +1197,41 @@ | |||
174 | 1176 | 1197 | ||
175 | 1177 | ''' | 1198 | ''' |
176 | 1178 | We generate the message which will be displayed on the simulation | 1199 | We generate the message which will be displayed on the simulation |
178 | 1179 | screen. This message is a merge between all errors. | 1200 | screen. This message is a merge between all errors and warnings. |
179 | 1180 | ''' | 1201 | ''' |
180 | 1181 | # Generate the message | 1202 | # Generate the message |
181 | 1182 | import_error_ok = False | 1203 | import_error_ok = False |
182 | 1204 | import_warning_ok = False | ||
183 | 1183 | if len(values_header_errors): | 1205 | if len(values_header_errors): |
184 | 1184 | import_error_ok = True | 1206 | import_error_ok = True |
186 | 1185 | message += '\n## Error on header values ##\n\n' | 1207 | message += _('\n## Error on header values ##\n\n') |
187 | 1186 | for err in values_header_errors: | 1208 | for err in values_header_errors: |
188 | 1187 | message += '%s\n' % err | 1209 | message += '%s\n' % err |
189 | 1188 | 1210 | ||
190 | 1211 | if len(values_header_warnings): | ||
191 | 1212 | import_warning_ok = True | ||
192 | 1213 | message += _('\n## Warning on header values ##\n\n') | ||
193 | 1214 | for warn in values_header_warnings: | ||
194 | 1215 | message += '%s\n' % warn | ||
195 | 1216 | |||
196 | 1189 | if len(values_line_errors): | 1217 | if len(values_line_errors): |
197 | 1190 | import_error_ok = True | 1218 | import_error_ok = True |
199 | 1191 | message += '\n## Error on line values ##\n\n' | 1219 | message += _('\n## Error on line values ##\n\n') |
200 | 1192 | for err in values_line_errors: | 1220 | for err in values_line_errors: |
201 | 1193 | message += '%s\n' % err | 1221 | message += '%s\n' % err |
202 | 1194 | 1222 | ||
203 | 1223 | if len(values_line_warnings): | ||
204 | 1224 | import_warning_ok = True | ||
205 | 1225 | message += _('\n## Warning on line values ##\n\n') | ||
206 | 1226 | for warn in values_line_warnings: | ||
207 | 1227 | message += '%s\n' % warn | ||
208 | 1228 | |||
209 | 1195 | header_values.update({ | 1229 | header_values.update({ |
210 | 1196 | 'message': message, | 1230 | 'message': message, |
211 | 1197 | 'state': 'simu_done', | 1231 | 'state': 'simu_done', |
212 | 1198 | 'percent_completed': 100.0, | 1232 | 'percent_completed': 100.0, |
213 | 1199 | 'import_error_ok': import_error_ok, | 1233 | 'import_error_ok': import_error_ok, |
214 | 1234 | 'import_warning_ok': import_warning_ok, | ||
215 | 1200 | }) | 1235 | }) |
216 | 1201 | self.write(cr, uid, [wiz.id], header_values, context=context) | 1236 | self.write(cr, uid, [wiz.id], header_values, context=context) |
217 | 1202 | 1237 | ||
218 | @@ -1504,6 +1539,7 @@ | |||
219 | 1504 | 'change_ok': fields.function(_get_line_info, method=True, multi='line', | 1539 | 'change_ok': fields.function(_get_line_info, method=True, multi='line', |
220 | 1505 | type='boolean', string='Change', store=False), | 1540 | type='boolean', string='Change', store=False), |
221 | 1506 | 'error_msg': fields.text(string='Error message', readonly=True), | 1541 | 'error_msg': fields.text(string='Error message', readonly=True), |
222 | 1542 | 'warning_msg': fields.text(string='Warning message', readonly=True), | ||
223 | 1507 | 'parent_line_id': fields.many2one('wizard.import.po.simulation.screen.line', | 1543 | 'parent_line_id': fields.many2one('wizard.import.po.simulation.screen.line', |
224 | 1508 | string='Parent line id', | 1544 | string='Parent line id', |
225 | 1509 | help='Use to split the good PO line', | 1545 | help='Use to split the good PO line', |
226 | @@ -1522,6 +1558,19 @@ | |||
227 | 1522 | 1558 | ||
228 | 1523 | for line in self.browse(cr, uid, ids, context=context): | 1559 | for line in self.browse(cr, uid, ids, context=context): |
229 | 1524 | if line.error_msg: | 1560 | if line.error_msg: |
230 | 1561 | raise osv.except_osv(_('Error'), line.error_msg) | ||
231 | 1562 | |||
232 | 1563 | return True | ||
233 | 1564 | |||
234 | 1565 | def get_warning_msg(self, cr, uid, ids, context=None): | ||
235 | 1566 | ''' | ||
236 | 1567 | Display the warning message | ||
237 | 1568 | ''' | ||
238 | 1569 | if isinstance(ids, (int, long)): | ||
239 | 1570 | ids = [ids] | ||
240 | 1571 | |||
241 | 1572 | for line in self.browse(cr, uid, ids, context=context): | ||
242 | 1573 | if line.error_msg: | ||
243 | 1525 | raise osv.except_osv(_('Warning'), line.error_msg) | 1574 | raise osv.except_osv(_('Warning'), line.error_msg) |
244 | 1526 | 1575 | ||
245 | 1527 | return True | 1576 | return True |
246 | @@ -1538,6 +1587,7 @@ | |||
247 | 1538 | ids = [ids] | 1587 | ids = [ids] |
248 | 1539 | 1588 | ||
249 | 1540 | errors = [] | 1589 | errors = [] |
250 | 1590 | warnings = [] | ||
251 | 1541 | 1591 | ||
252 | 1542 | for line in self.browse(cr, uid, ids, context=context): | 1592 | for line in self.browse(cr, uid, ids, context=context): |
253 | 1543 | write_vals = {} | 1593 | write_vals = {} |
254 | @@ -1545,10 +1595,9 @@ | |||
255 | 1545 | # Comment | 1595 | # Comment |
256 | 1546 | write_vals['imp_comment'] = values[15] and values[15].strip() | 1596 | write_vals['imp_comment'] = values[15] and values[15].strip() |
257 | 1547 | 1597 | ||
262 | 1548 | if line.po_line_id.state in ('confirmed', 'done') or ( line.po_line_id.state in ('cancel', 'cancel_r') and write_vals['imp_comment'] != '[DELETE]'): | 1598 | if line.po_line_id.state in ('confirmed', 'done') or (line.po_line_id.state in ('cancel', 'cancel_r') and write_vals['imp_comment'] != '[DELETE]'): |
263 | 1549 | write_vals['type_change'] = 'error' | 1599 | write_vals['type_change'] = 'warning' |
264 | 1550 | errors.append(_('PO line has been confirmed or cancelled and consequently is not editable')) | 1600 | warnings.append(_('PO line has been confirmed or cancelled and consequently is not editable')) |
261 | 1551 | |||
265 | 1552 | 1601 | ||
266 | 1553 | # External Ref. | 1602 | # External Ref. |
267 | 1554 | write_vals['imp_external_ref'] = values[1] | 1603 | write_vals['imp_external_ref'] = values[1] |
268 | @@ -1556,17 +1605,17 @@ | |||
269 | 1556 | if line.in_line_number: | 1605 | if line.in_line_number: |
270 | 1557 | pol_ids = self.pool.get('purchase.order.line').search(cr, uid, [('order_id', '=', line.simu_id.order_id.id), ('line_number', '=', line.in_line_number)], context=context) | 1606 | pol_ids = self.pool.get('purchase.order.line').search(cr, uid, [('order_id', '=', line.simu_id.order_id.id), ('line_number', '=', line.in_line_number)], context=context) |
271 | 1558 | if not pol_ids and not (write_vals['imp_comment'] and write_vals['imp_comment'] == '[DELETE]'): | 1607 | if not pol_ids and not (write_vals['imp_comment'] and write_vals['imp_comment'] == '[DELETE]'): |
273 | 1559 | errors.append(_('Line no is not consistent with validated PO.')) | 1608 | warnings.append(_('Line no is not consistent with validated PO.')) |
274 | 1560 | write_vals['in_line_number'] = False | 1609 | write_vals['in_line_number'] = False |
275 | 1561 | write_vals['type_change'] = 'warning' | 1610 | write_vals['type_change'] = 'warning' |
276 | 1562 | 1611 | ||
278 | 1563 | if (write_vals['imp_comment'] and write_vals['imp_comment'] == '[DELETE]'): | 1612 | if write_vals['imp_comment'] and write_vals['imp_comment'] == '[DELETE]': |
279 | 1564 | if not pol_ids: | 1613 | if not pol_ids: |
280 | 1565 | write_vals['type_change'] = 'warning' | 1614 | write_vals['type_change'] = 'warning' |
281 | 1566 | if line.in_line_number: | 1615 | if line.in_line_number: |
283 | 1567 | errors.append(_('The import file is inconsistent. Line no. %s is not existing or was previously deleted') % line.in_line_number) | 1616 | warnings.append(_('The import file is inconsistent. Line no. %s is not existing or was previously deleted') % line.in_line_number) |
284 | 1568 | else: | 1617 | else: |
286 | 1569 | errors.append(_('The import file is inconsistent. The matching line is not existing or was previously deleted')) | 1618 | warnings.append(_('The import file is inconsistent. The matching line is not existing or was previously deleted')) |
287 | 1570 | else: | 1619 | else: |
288 | 1571 | if line.po_line_id.state in ('validated', 'validated_n'): | 1620 | if line.po_line_id.state in ('validated', 'validated_n'): |
289 | 1572 | write_vals['type_change'] = 'del' | 1621 | write_vals['type_change'] = 'del' |
290 | @@ -1617,12 +1666,19 @@ | |||
291 | 1617 | write_vals['ad_info'] = ad_info | 1666 | write_vals['ad_info'] = ad_info |
292 | 1618 | 1667 | ||
293 | 1619 | # Qty | 1668 | # Qty |
300 | 1620 | err_msg = _('Incorrect float value for field \'Product Qty\'') | 1669 | if values[4]: |
301 | 1621 | try: | 1670 | try: |
302 | 1622 | qty = float(values[4]) | 1671 | qty = float(values[4]) |
303 | 1623 | write_vals['imp_qty'] = qty | 1672 | write_vals['imp_qty'] = qty |
304 | 1624 | except Exception: | 1673 | if qty <= 0: |
305 | 1625 | errors.append(err_msg) | 1674 | errors.append(_('You can not have an order line with a negative or zero quantity. Updated quantity is ignored')) |
306 | 1675 | write_vals['type_change'] = 'error' | ||
307 | 1676 | write_vals['imp_qty'] = 0.00 | ||
308 | 1677 | except Exception: | ||
309 | 1678 | errors.append(_('Incorrect float value for field \'Product Qty\'')) | ||
310 | 1679 | write_vals['type_change'] = 'error' | ||
311 | 1680 | write_vals['imp_qty'] = 0.00 | ||
312 | 1681 | else: | ||
313 | 1626 | write_vals['type_change'] = 'error' | 1682 | write_vals['type_change'] = 'error' |
314 | 1627 | write_vals['imp_qty'] = 0.00 | 1683 | write_vals['imp_qty'] = 0.00 |
315 | 1628 | 1684 | ||
316 | @@ -1776,18 +1832,26 @@ | |||
317 | 1776 | 1832 | ||
318 | 1777 | if line.error_msg: | 1833 | if line.error_msg: |
319 | 1778 | write_vals['type_change'] = 'error' | 1834 | write_vals['type_change'] = 'error' |
320 | 1835 | if line.warning_msg and write_vals.get('type_change') != 'error': | ||
321 | 1836 | write_vals['type_change'] = 'warning' | ||
322 | 1779 | 1837 | ||
324 | 1780 | if write_vals.get('type_change') in ['error', 'warning']: | 1838 | if write_vals.get('type_change') in ['warning', 'error']: |
325 | 1781 | err_msg = line.error_msg or '' | 1839 | err_msg = line.error_msg or '' |
326 | 1782 | for err in errors: | 1840 | for err in errors: |
327 | 1783 | if err_msg: | 1841 | if err_msg: |
328 | 1784 | err_msg += ' - ' | 1842 | err_msg += ' - ' |
329 | 1785 | err_msg += err | 1843 | err_msg += err |
330 | 1786 | write_vals['error_msg'] = err_msg | 1844 | write_vals['error_msg'] = err_msg |
331 | 1845 | warn_msg = line.error_msg or '' | ||
332 | 1846 | for warn in warnings: | ||
333 | 1847 | if warn_msg: | ||
334 | 1848 | warn_msg += ' - ' | ||
335 | 1849 | warn_msg += warn | ||
336 | 1850 | write_vals['warn_msg'] = warn_msg | ||
337 | 1787 | 1851 | ||
338 | 1788 | self.write(cr, uid, [line.id], write_vals, context=context) | 1852 | self.write(cr, uid, [line.id], write_vals, context=context) |
339 | 1789 | 1853 | ||
341 | 1790 | return errors | 1854 | return errors, warnings |
342 | 1791 | 1855 | ||
343 | 1792 | def update_po_line(self, cr, uid, ids, context=None): | 1856 | def update_po_line(self, cr, uid, ids, context=None): |
344 | 1793 | ''' | 1857 | ''' |
345 | 1794 | 1858 | ||
346 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen_view.xml' | |||
347 | --- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2019-03-29 17:02:16 +0000 | |||
348 | +++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2019-06-07 07:31:09 +0000 | |||
349 | @@ -33,7 +33,7 @@ | |||
350 | 33 | <button name="print_simulation_report" string="Print report" icon="gtk-print" type="object" states="simu_done,import_progress,done" /> | 33 | <button name="print_simulation_report" string="Print report" icon="gtk-print" type="object" states="simu_done,import_progress,done" /> |
351 | 34 | </group> | 34 | </group> |
352 | 35 | <notebook colspan="4"> | 35 | <notebook colspan="4"> |
354 | 36 | <page string="Error" attrs="{'invisible': [('import_error_ok', '=', False), ('state', '!=', 'error')]}"> | 36 | <page string="Errors/Warnings" attrs="{'invisible': [('import_error_ok', '=', False), ('state', '!=', 'error')]}"> |
355 | 37 | <field name="message" nolabel="1" colspan="4" readonly="1" widget="full_text" /> | 37 | <field name="message" nolabel="1" colspan="4" readonly="1" widget="full_text" /> |
356 | 38 | </page> | 38 | </page> |
357 | 39 | <page string="Purchase Order"> | 39 | <page string="Purchase Order"> |
358 | @@ -80,7 +80,7 @@ | |||
359 | 80 | <page string="Details"> | 80 | <page string="Details"> |
360 | 81 | <!-- LINES --> | 81 | <!-- LINES --> |
361 | 82 | <field name="simu_line_ids" nolabel="1" colspan="4"> | 82 | <field name="simu_line_ids" nolabel="1" colspan="4"> |
363 | 83 | <tree string="Lines" colors="grey: type_change == 'del'; red: type_change in ('warning', 'error'); orange: change_ok==True and type_change not in ('del', 'ignore', 'error', 'warning'); blue: type_change=='split'; green: type_change=='new'"> | 83 | <tree string="Lines" colors="grey: type_change == 'del'; red: type_change == 'error'; orange: type_change == 'warning'; darkgreen: change_ok==True and type_change not in ('del', 'ignore', 'error', 'warning'); green:type_change=='new'; blue: type_change=='split'"> |
364 | 84 | <field name="in_product_id" /> | 84 | <field name="in_product_id" /> |
365 | 85 | <field name="in_nomen" /> | 85 | <field name="in_nomen" /> |
366 | 86 | <field name="in_comment" /> | 86 | <field name="in_comment" /> |
367 | 87 | 87 | ||
368 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
369 | --- bin/addons/msf_profile/i18n/fr_MF.po 2019-06-04 19:13:17 +0000 | |||
370 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2019-06-07 07:31:09 +0000 | |||
371 | @@ -28224,11 +28224,11 @@ | |||
372 | 28224 | msgstr "Chercher champs" | 28224 | msgstr "Chercher champs" |
373 | 28225 | 28225 | ||
374 | 28226 | #. module: msf_doc_import | 28226 | #. module: msf_doc_import |
380 | 28227 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:690 | 28227 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:728 |
381 | 28228 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:698 | 28228 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:736 |
382 | 28229 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:810 | 28229 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:964 |
383 | 28230 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:820 | 28230 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1172 |
384 | 28231 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:827 | 28231 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1179 |
385 | 28232 | #, python-format | 28232 | #, python-format |
386 | 28233 | msgid "Line %s of the file: %s" | 28233 | msgid "Line %s of the file: %s" |
387 | 28234 | msgstr "Ligne %s du fichier: %s" | 28234 | msgstr "Ligne %s du fichier: %s" |
388 | @@ -28386,12 +28386,13 @@ | |||
389 | 28386 | msgid "Determines the percentage which will be applied on field price from the product form." | 28386 | msgid "Determines the percentage which will be applied on field price from the product form." |
390 | 28387 | msgstr "Détermine le pourcentage qui sera appliqué sur le champ du prix à partir du formulaire de produits." | 28387 | msgstr "Détermine le pourcentage qui sera appliqué sur le champ du prix à partir du formulaire de produits." |
391 | 28388 | 28388 | ||
393 | 28389 | #. modules: stock_override, kit | 28389 | #. modules: stock_override, kit, msf_doc_import |
394 | 28390 | #: field:kit.mass.import,warning_import:0 | 28390 | #: field:kit.mass.import,warning_import:0 |
395 | 28391 | #: field:kit.mass.import,warning_message:0 | 28391 | #: field:kit.mass.import,warning_message:0 |
396 | 28392 | #: field:wizard.import.po.simulation.screen.line,warning_msg:0 | ||
397 | 28392 | #: field:change.dest.location,warn_msg:0 | 28393 | #: field:change.dest.location,warn_msg:0 |
398 | 28393 | msgid "Warning message" | 28394 | msgid "Warning message" |
400 | 28394 | msgstr "Warning message" | 28395 | msgstr "Message d'avertissement" |
401 | 28395 | 28396 | ||
402 | 28396 | #. modules: product_attributes, product | 28397 | #. modules: product_attributes, product |
403 | 28397 | #: selection:product.price.type,field:0 | 28398 | #: selection:product.price.type,field:0 |
404 | @@ -41986,10 +41987,10 @@ | |||
405 | 41986 | msgstr "Nom de modèle facultatif des objets pour lesquels cette action doit être visible" | 41987 | msgstr "Nom de modèle facultatif des objets pour lesquels cette action doit être visible" |
406 | 41987 | 41988 | ||
407 | 41988 | #. module: msf_doc_import | 41989 | #. module: msf_doc_import |
409 | 41989 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1381 | 41990 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1600 |
410 | 41990 | #, python-format | 41991 | #, python-format |
411 | 41991 | msgid "Line no is not consistent with validated PO." | 41992 | msgid "Line no is not consistent with validated PO." |
413 | 41992 | msgstr "Line no is not consistent with validated PO." | 41993 | msgstr "Le num de ligne n'est pas cohérent avec le BC validé." |
414 | 41993 | 41994 | ||
415 | 41994 | #. module: unifield_setup | 41995 | #. module: unifield_setup |
416 | 41995 | #: view:field.orders.setup:0 | 41996 | #: view:field.orders.setup:0 |
417 | @@ -74683,7 +74684,6 @@ | |||
418 | 74683 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:329 | 74684 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:329 |
419 | 74684 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:331 | 74685 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:331 |
420 | 74685 | #: view:wizard.import.in.simulation.screen:0 | 74686 | #: view:wizard.import.in.simulation.screen:0 |
421 | 74686 | #: view:wizard.import.po.simulation.screen:0 | ||
422 | 74687 | #: code:addons/msf_instance/account.py:57 | 74687 | #: code:addons/msf_instance/account.py:57 |
423 | 74688 | #: code:addons/msf_instance/account.py:60 | 74688 | #: code:addons/msf_instance/account.py:60 |
424 | 74689 | #: code:addons/msf_instance/add_instance.py:590 | 74689 | #: code:addons/msf_instance/add_instance.py:590 |
425 | @@ -101894,8 +101894,12 @@ | |||
426 | 101894 | msgstr "Vous ne pouvez avoir qu'une seule Expédition en brouillon pour la même adresse, veuillez vérifier %s " | 101894 | msgstr "Vous ne pouvez avoir qu'une seule Expédition en brouillon pour la même adresse, veuillez vérifier %s " |
427 | 101895 | 101895 | ||
428 | 101896 | #. module: msf_doc_import | 101896 | #. module: msf_doc_import |
431 | 101897 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:811 | 101897 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:947 |
432 | 101898 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:827 | 101898 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:971 |
433 | 101899 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1140 | ||
434 | 101900 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1144 | ||
435 | 101901 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1170 | ||
436 | 101902 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1177 | ||
437 | 101899 | #, python-format | 101903 | #, python-format |
438 | 101900 | msgid "Line %s of the PO: %s" | 101904 | msgid "Line %s of the PO: %s" |
439 | 101901 | msgstr "Ligne %s du BC: %s" | 101905 | msgstr "Ligne %s du BC: %s" |
440 | @@ -106784,6 +106788,59 @@ | |||
441 | 106784 | msgstr "Montant Estimé:" | 106788 | msgstr "Montant Estimé:" |
442 | 106785 | 106789 | ||
443 | 106786 | #. module: msf_doc_import | 106790 | #. module: msf_doc_import |
444 | 106791 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1199 | ||
445 | 106792 | #, python-format | ||
446 | 106793 | msgid "\n" | ||
447 | 106794 | "## Error on header values ##\n" | ||
448 | 106795 | "\n" | ||
449 | 106796 | "" | ||
450 | 106797 | msgstr "\n" | ||
451 | 106798 | "## Erreur sur les valeurs de l'entête ##\n" | ||
452 | 106799 | "\n" | ||
453 | 106800 | "" | ||
454 | 106801 | |||
455 | 106802 | #. module: msf_doc_import | ||
456 | 106803 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1205 | ||
457 | 106804 | #, python-format | ||
458 | 106805 | msgid "\n" | ||
459 | 106806 | "## Warning on header values ##\n" | ||
460 | 106807 | "\n" | ||
461 | 106808 | "" | ||
462 | 106809 | msgstr "\n" | ||
463 | 106810 | "## Avertissement sur les valeurs de l'entete ##\n" | ||
464 | 106811 | "\n" | ||
465 | 106812 | "" | ||
466 | 106813 | |||
467 | 106814 | #. module: msf_doc_import | ||
468 | 106815 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1211 | ||
469 | 106816 | #, python-format | ||
470 | 106817 | msgid "\n" | ||
471 | 106818 | "## Error on line values ##\n" | ||
472 | 106819 | "\n" | ||
473 | 106820 | "" | ||
474 | 106821 | msgstr "\n" | ||
475 | 106822 | "## Erreur sur les valeurs des lignes ##\n" | ||
476 | 106823 | "\n" | ||
477 | 106824 | "" | ||
478 | 106825 | |||
479 | 106826 | #. module: msf_doc_import | ||
480 | 106827 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1217 | ||
481 | 106828 | #, python-format | ||
482 | 106829 | msgid "\n" | ||
483 | 106830 | "## Warning on line values ##\n" | ||
484 | 106831 | "\n" | ||
485 | 106832 | "" | ||
486 | 106833 | msgstr "\n" | ||
487 | 106834 | "## Avertissement sur les valeurs des lignes ##\n" | ||
488 | 106835 | "\n" | ||
489 | 106836 | "" | ||
490 | 106837 | |||
491 | 106838 | #. module: msf_doc_import | ||
492 | 106839 | #: view:wizard.import.po.simulation.screen:0 | ||
493 | 106840 | msgid "Errors/Warnings" | ||
494 | 106841 | msgstr "Erreurs/Avertissements" | ||
495 | 106842 | |||
496 | 106843 | #. module: msf_doc_import | ||
497 | 106787 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1705 | 106844 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1705 |
498 | 106788 | #, python-format | 106845 | #, python-format |
499 | 106789 | msgid "A PO with a Loan, Donation before expiry, Standard donation or In Kind Donation Order Type can't have an Source Document in its lines" | 106846 | msgid "A PO with a Loan, Donation before expiry, Standard donation or In Kind Donation Order Type can't have an Source Document in its lines" |
500 | @@ -106795,6 +106852,7 @@ | |||
501 | 106795 | #, python-format | 106852 | #, python-format |
502 | 106796 | msgid "You can't change the Order Type to Loan, Donation before expiry, Standard donation or In Kind Donation if a line has a Source Document" | 106853 | msgid "You can't change the Order Type to Loan, Donation before expiry, Standard donation or In Kind Donation if a line has a Source Document" |
503 | 106797 | msgstr "Vous ne pouvez pas changer le Type de Commande en Prêt, Donation avant expiration, Donation normale ou Donation en Nature si une des lignes a un Document d'Origine" | 106854 | msgstr "Vous ne pouvez pas changer le Type de Commande en Prêt, Donation avant expiration, Donation normale ou Donation en Nature si une des lignes a un Document d'Origine" |
504 | 106855 | <<<<<<< TREE | ||
505 | 106798 | 106856 | ||
506 | 106799 | #. module: stock | 106857 | #. module: stock |
507 | 106800 | #: report:addons/stock/report/products_situation_report_xls.mako:217 | 106858 | #: report:addons/stock/report/products_situation_report_xls.mako:217 |
508 | @@ -106827,3 +106885,12 @@ | |||
509 | 106827 | msgid "Stop report" | 106885 | msgid "Stop report" |
510 | 106828 | msgstr "Arrêter le rapport" | 106886 | msgstr "Arrêter le rapport" |
511 | 106829 | 106887 | ||
512 | 106888 | ======= | ||
513 | 106889 | |||
514 | 106890 | #. module: msf_doc_import | ||
515 | 106891 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:947 | ||
516 | 106892 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:1674 | ||
517 | 106893 | #, python-format | ||
518 | 106894 | msgid "You can not have an order line with a negative or zero quantity. Updated quantity is ignored" | ||
519 | 106895 | msgstr "Vous ne pouvez pas avoir de ligne de commande avec une quantité négative ou nulle. La quantité mise à jour est ignorée" | ||
520 | 106896 | >>>>>>> MERGE-SOURCE | ||
521 | 106830 | 106897 | ||
522 | === modified file 'bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako' | |||
523 | --- bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2018-08-10 10:21:43 +0000 | |||
524 | +++ bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2019-06-07 07:31:09 +0000 | |||
525 | @@ -12,7 +12,11 @@ | |||
526 | 12 | % endif | 12 | % endif |
527 | 13 | <field name="partner_ref">${o.partner_ref or ''|x}</field> | 13 | <field name="partner_ref">${o.partner_ref or ''|x}</field> |
528 | 14 | <field name="details">${o.details or ''|x}</field> | 14 | <field name="details">${o.details or ''|x}</field> |
530 | 15 | <field name="stock_take_date">${o.stock_take_date or ''|x}</field> | 15 | % if o.stock_take_date and o.stock_take_date not in (False, 'False'): |
531 | 16 | <field name="stock_take_date">${o.stock_take_date|n}</field> | ||
532 | 17 | % else: | ||
533 | 18 | <field name="stock_take_date"></field> | ||
534 | 19 | % endif | ||
535 | 16 | % if o.delivery_requested_date and o.delivery_requested_date not in (False, 'False'): | 20 | % if o.delivery_requested_date and o.delivery_requested_date not in (False, 'False'): |
536 | 17 | <field name="delivery_requested_date">${o.delivery_requested_date or ''|n}</field> | 21 | <field name="delivery_requested_date">${o.delivery_requested_date or ''|n}</field> |
537 | 18 | % else: | 22 | % else: |
538 | @@ -77,7 +81,11 @@ | |||
539 | 77 | <field name="name">${l.currency_id and l.currency_id.name or ''|x}</field> | 81 | <field name="name">${l.currency_id and l.currency_id.name or ''|x}</field> |
540 | 78 | </field> | 82 | </field> |
541 | 79 | <field name="origin">${l.origin or ''|x}</field> | 83 | <field name="origin">${l.origin or ''|x}</field> |
543 | 80 | <field name="stock_take_date">${l.stock_take_date or ''|x}</field> | 84 | % if l.stock_take_date and l.stock_take_date not in (False, 'False'): |
544 | 85 | <field name="stock_take_date">${l.stock_take_date|n}</field> | ||
545 | 86 | % else: | ||
546 | 87 | <field name="stock_take_date"></field> | ||
547 | 88 | % endif | ||
548 | 81 | % if l.date_planned and l.date_planned not in (False, 'False'): | 89 | % if l.date_planned and l.date_planned not in (False, 'False'): |
549 | 82 | <field name="date_planned">${l.date_planned|n}</field> | 90 | <field name="date_planned">${l.date_planned|n}</field> |
550 | 83 | % else: | 91 | % else: |
551 | 84 | 92 | ||
552 | === modified file 'bin/addons/msf_tools/automated_export_job.py' | |||
553 | --- bin/addons/msf_tools/automated_export_job.py 2019-03-21 11:29:45 +0000 | |||
554 | +++ bin/addons/msf_tools/automated_export_job.py 2019-06-07 07:31:09 +0000 | |||
555 | @@ -242,12 +242,9 @@ | |||
556 | 242 | if not rep.startswith('2'): | 242 | if not rep.startswith('2'): |
557 | 243 | raise osv.except_osv(_('Error'), _('Unable to write report on FTP server')) | 243 | raise osv.except_osv(_('Error'), _('Unable to write report on FTP server')) |
558 | 244 | elif on_ftp and job_brw.export_id.ftp_protocol == 'sftp': | 244 | elif on_ftp and job_brw.export_id.ftp_protocol == 'sftp': |
559 | 245 | new_tmp_file_name = os.path.join(os.path.dirname(temp_path), filename) | ||
560 | 246 | os.rename(temp_path, new_tmp_file_name) | ||
561 | 247 | temp_path = new_tmp_file_name | ||
562 | 248 | try: | 245 | try: |
563 | 249 | with sftp.cd(job_brw.export_id.report_path): | 246 | with sftp.cd(job_brw.export_id.report_path): |
565 | 250 | sftp.put(new_tmp_file_name, preserve_mtime=True) | 247 | sftp.put(temp_path, filename, preserve_mtime=True) |
566 | 251 | except: | 248 | except: |
567 | 252 | raise osv.except_osv(_('Error'), _('Unable to write report on SFTP server')) | 249 | raise osv.except_osv(_('Error'), _('Unable to write report on SFTP server')) |
568 | 253 | 250 | ||
569 | 254 | 251 | ||
570 | === modified file 'bin/addons/msf_tools/automated_import_job.py' | |||
571 | --- bin/addons/msf_tools/automated_import_job.py 2019-04-15 12:49:45 +0000 | |||
572 | +++ bin/addons/msf_tools/automated_import_job.py 2019-06-07 07:31:09 +0000 | |||
573 | @@ -622,12 +622,9 @@ | |||
574 | 622 | if not rep.startswith('2'): | 622 | if not rep.startswith('2'): |
575 | 623 | raise osv.except_osv(_('Error'), _('Unable to write report on FTP server')) | 623 | raise osv.except_osv(_('Error'), _('Unable to write report on FTP server')) |
576 | 624 | elif on_ftp and job_brw.import_id.ftp_protocol == 'sftp': | 624 | elif on_ftp and job_brw.import_id.ftp_protocol == 'sftp': |
577 | 625 | new_tmp_file_name = os.path.join(os.path.dirname(temp_path), filename) | ||
578 | 626 | os.rename(temp_path, new_tmp_file_name) | ||
579 | 627 | temp_path = new_tmp_file_name | ||
580 | 628 | try: | 625 | try: |
581 | 629 | with sftp.cd(job_brw.import_id.report_path): | 626 | with sftp.cd(job_brw.import_id.report_path): |
583 | 630 | sftp.put(new_tmp_file_name, preserve_mtime=True) | 627 | sftp.put(temp_path, filename, preserve_mtime=True) |
584 | 631 | except: | 628 | except: |
585 | 632 | raise osv.except_osv(_('Error'), _('Unable to write report on SFTP server')) | 629 | raise osv.except_osv(_('Error'), _('Unable to write report on SFTP server')) |
586 | 633 | 630 |