Merge lp:~unifield-team/unifield-server/us-792-v2 into lp:unifield-server
- us-792-v2
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 3929 |
Proposed branch: | lp:~unifield-team/unifield-server/us-792-v2 |
Merge into: | lp:unifield-server |
Diff against target: |
1814 lines (+1610/-5) (has conflicts) 15 files modified
bin/addons/base/ir/ir_translation.py (+1/-0) bin/addons/msf_doc_import/__openerp__.py (+2/-1) bin/addons/msf_doc_import/doc_import_report.xml (+11/-0) bin/addons/msf_doc_import/report/__init__.py (+2/-0) bin/addons/msf_doc_import/report/import_generic_template.mako (+104/-0) bin/addons/msf_doc_import/report/import_generic_template.py (+30/-0) bin/addons/msf_doc_import/wizard/__init__.py (+3/-0) bin/addons/msf_doc_import/wizard/abstract_wizard_import.py (+457/-0) bin/addons/msf_doc_import/wizard/wizard_import_batch.py (+303/-0) bin/addons/msf_doc_import/wizard/wizard_import_batch_view.xml (+83/-0) bin/addons/msf_profile/i18n/en_MF.po (+30/-0) bin/addons/msf_profile/i18n/fr_MF.po (+562/-2) bin/addons/purchase_override/purchase.py (+1/-1) bin/addons/report_webkit/webkit_report.py (+18/-1) bin/addons/spreadsheet_xml/spreadsheet_xml.py (+3/-0) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-792-v2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+303276@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/base/ir/ir_translation.py' | |||
2 | --- bin/addons/base/ir/ir_translation.py 2016-01-25 10:54:33 +0000 | |||
3 | +++ bin/addons/base/ir/ir_translation.py 2016-08-18 14:00:36 +0000 | |||
4 | @@ -182,6 +182,7 @@ | |||
5 | 182 | return u'' | 182 | return u'' |
6 | 183 | if isinstance(types, basestring): | 183 | if isinstance(types, basestring): |
7 | 184 | types = (types,) | 184 | types = (types,) |
8 | 185 | |||
9 | 185 | if source: | 186 | if source: |
10 | 186 | query = """SELECT value | 187 | query = """SELECT value |
11 | 187 | FROM ir_translation | 188 | FROM ir_translation |
12 | 188 | 189 | ||
13 | === modified file 'bin/addons/msf_doc_import/__openerp__.py' | |||
14 | --- bin/addons/msf_doc_import/__openerp__.py 2016-05-17 12:05:25 +0000 | |||
15 | +++ bin/addons/msf_doc_import/__openerp__.py 2016-08-18 14:00:36 +0000 | |||
16 | @@ -74,7 +74,8 @@ | |||
17 | 74 | 'workflow/sale_workflow.xml', | 74 | 'workflow/sale_workflow.xml', |
18 | 75 | 'workflow/tender_flow_workflow.xml', | 75 | 'workflow/tender_flow_workflow.xml', |
19 | 76 | 'workflow/procurement_request_workflow.xml', | 76 | 'workflow/procurement_request_workflow.xml', |
21 | 77 | 'doc_import_report.xml' | 77 | 'doc_import_report.xml', |
22 | 78 | 'wizard/wizard_import_batch_view.xml', | ||
23 | 78 | ], | 79 | ], |
24 | 79 | "demo_xml": [], | 80 | "demo_xml": [], |
25 | 80 | "test": [ | 81 | "test": [ |
26 | 81 | 82 | ||
27 | === modified file 'bin/addons/msf_doc_import/doc_import_report.xml' | |||
28 | --- bin/addons/msf_doc_import/doc_import_report.xml 2014-01-15 10:47:43 +0000 | |||
29 | +++ bin/addons/msf_doc_import/doc_import_report.xml 2016-08-18 14:00:36 +0000 | |||
30 | @@ -34,5 +34,16 @@ | |||
31 | 34 | auto="False" | 34 | auto="False" |
32 | 35 | string="PO Simulation screen" /> | 35 | string="PO Simulation screen" /> |
33 | 36 | 36 | ||
34 | 37 | <report | ||
35 | 38 | id="report_wizard_import_generic_template" | ||
36 | 39 | model="abstract.wizard.import" | ||
37 | 40 | name="wizard.import.generic.template" | ||
38 | 41 | file="msf_doc_import/report/import_generic_template.mako" | ||
39 | 42 | report_type="webkit" | ||
40 | 43 | header="False" | ||
41 | 44 | menu="False" | ||
42 | 45 | auto="False" | ||
43 | 46 | string="Import Generic template" /> | ||
44 | 47 | |||
45 | 37 | </data> | 48 | </data> |
46 | 38 | </openerp> | 49 | </openerp> |
47 | 39 | 50 | ||
48 | === modified file 'bin/addons/msf_doc_import/report/__init__.py' | |||
49 | --- bin/addons/msf_doc_import/report/__init__.py 2014-01-15 10:47:43 +0000 | |||
50 | +++ bin/addons/msf_doc_import/report/__init__.py 2016-08-18 14:00:36 +0000 | |||
51 | @@ -22,3 +22,5 @@ | |||
52 | 22 | import in_simulation_screen_report_xls | 22 | import in_simulation_screen_report_xls |
53 | 23 | import po_simulation_screen_report | 23 | import po_simulation_screen_report |
54 | 24 | import po_simulation_screen_report_xls | 24 | import po_simulation_screen_report_xls |
55 | 25 | |||
56 | 26 | import import_generic_template | ||
57 | 25 | \ No newline at end of file | 27 | \ No newline at end of file |
58 | 26 | 28 | ||
59 | === added file 'bin/addons/msf_doc_import/report/import_generic_template.mako' | |||
60 | --- bin/addons/msf_doc_import/report/import_generic_template.mako 1970-01-01 00:00:00 +0000 | |||
61 | +++ bin/addons/msf_doc_import/report/import_generic_template.mako 2016-08-18 14:00:36 +0000 | |||
62 | @@ -0,0 +1,104 @@ | |||
63 | 1 | <?xml version="1.0"?> | ||
64 | 2 | <?mso-application progid="Excel.Sheet"?> | ||
65 | 3 | <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | ||
66 | 4 | xmlns:o="urn:schemas-microsoft-com:office:office" | ||
67 | 5 | xmlns:x="urn:schemas-microsoft-com:office:excel" | ||
68 | 6 | xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | ||
69 | 7 | xmlns:html="http://www.w3.org/TR/REC-html40"> | ||
70 | 8 | |||
71 | 9 | <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> | ||
72 | 10 | <Author>MSFUser</Author> | ||
73 | 11 | <LastAuthor>MSFUser</LastAuthor> | ||
74 | 12 | <Created>2012-06-18T15:46:09Z</Created> | ||
75 | 13 | <Company>Medecins Sans Frontieres</Company> | ||
76 | 14 | <Version>11.9999</Version> | ||
77 | 15 | </DocumentProperties> | ||
78 | 16 | |||
79 | 17 | <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> | ||
80 | 18 | <WindowHeight>13170</WindowHeight> | ||
81 | 19 | <WindowWidth>19020</WindowWidth> | ||
82 | 20 | <WindowTopX>120</WindowTopX> | ||
83 | 21 | <WindowTopY>60</WindowTopY> | ||
84 | 22 | <ProtectStructure>False</ProtectStructure> | ||
85 | 23 | <ProtectWindows>False</ProtectWindows> | ||
86 | 24 | </ExcelWorkbook> | ||
87 | 25 | |||
88 | 26 | <Styles> | ||
89 | 27 | <Style ss:ID="header"> | ||
90 | 28 | <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> | ||
91 | 29 | <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> | ||
92 | 30 | <Font ss:Bold="1" ss:Color="#000000" /> | ||
93 | 31 | <Borders> | ||
94 | 32 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
95 | 33 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
96 | 34 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
97 | 35 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
98 | 36 | </Borders> | ||
99 | 37 | <Protection /> | ||
100 | 38 | </Style> | ||
101 | 39 | <Style ss:ID="String"> | ||
102 | 40 | <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> | ||
103 | 41 | <Borders> | ||
104 | 42 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
105 | 43 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
106 | 44 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
107 | 45 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
108 | 46 | </Borders> | ||
109 | 47 | <Protection ss:Protected="0" /> | ||
110 | 48 | </Style> | ||
111 | 49 | <Style ss:ID="Number"> | ||
112 | 50 | <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> | ||
113 | 51 | <Borders> | ||
114 | 52 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
115 | 53 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
116 | 54 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
117 | 55 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" /> | ||
118 | 56 | </Borders> | ||
119 | 57 | <NumberFormat ss:Format="Fixed" /> | ||
120 | 58 | <Protection ss:Protected="0" /> | ||
121 | 59 | </Style> | ||
122 | 60 | <Style ss:ID="DateTime"> | ||
123 | 61 | <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> | ||
124 | 62 | <Borders> | ||
125 | 63 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
126 | 64 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
127 | 65 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
128 | 66 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
129 | 67 | </Borders> | ||
130 | 68 | <NumberFormat ss:Format="Short Date" /> | ||
131 | 69 | <Protection ss:Protected="0" /> | ||
132 | 70 | </Style> | ||
133 | 71 | </Styles> | ||
134 | 72 | |||
135 | 73 | <ss:Worksheet ss:Name="${data.get('model_name', _('Sheet 1'))|x}" ss:Protected="0"> | ||
136 | 74 | |||
137 | 75 | <Table x:FullColumns="1" x:FullRows="1"> | ||
138 | 76 | |||
139 | 77 | % for col in data.get('header_columns', []): | ||
140 | 78 | <Column ss:AutoFitWidth="1" ss:Width="${col[2] or 70|x}" ss:StyleID="${col[1]|x}" /> | ||
141 | 79 | % endfor | ||
142 | 80 | |||
143 | 81 | <Row> | ||
144 | 82 | % for col in data.get('header_columns', []): | ||
145 | 83 | <Cell ss:StyleID="header"> | ||
146 | 84 | <Data ss:Type="String">${col[0]}</Data> | ||
147 | 85 | </Cell> | ||
148 | 86 | % endfor | ||
149 | 87 | </Row> | ||
150 | 88 | |||
151 | 89 | <Row> | ||
152 | 90 | % for col in data.get('header_columns', []): | ||
153 | 91 | <Cell ss:StyleID="${col[1]|x}" /> | ||
154 | 92 | % endfor | ||
155 | 93 | </Row> | ||
156 | 94 | </Table> | ||
157 | 95 | |||
158 | 96 | <x:WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> | ||
159 | 97 | <ProtectScenarios>False</ProtectScenarios> | ||
160 | 98 | <EnableSelection>UnlockedCells</EnableSelection> | ||
161 | 99 | <AllowInsertRows /> | ||
162 | 100 | </x:WorksheetOptions> | ||
163 | 101 | |||
164 | 102 | </ss:Worksheet> | ||
165 | 103 | |||
166 | 104 | </Workbook> | ||
167 | 0 | 105 | ||
168 | === added file 'bin/addons/msf_doc_import/report/import_generic_template.py' | |||
169 | --- bin/addons/msf_doc_import/report/import_generic_template.py 1970-01-01 00:00:00 +0000 | |||
170 | +++ bin/addons/msf_doc_import/report/import_generic_template.py 2016-08-18 14:00:36 +0000 | |||
171 | @@ -0,0 +1,30 @@ | |||
172 | 1 | # -*- coding: utf-8 -*- | ||
173 | 2 | ############################################################################## | ||
174 | 3 | # | ||
175 | 4 | # OpenERP, Open Source Management Solution | ||
176 | 5 | # Copyright (C) 2011 MSF, TeMPO Consulting | ||
177 | 6 | # | ||
178 | 7 | # This program is free software: you can redistribute it and/or modify | ||
179 | 8 | # it under the terms of the GNU Affero General Public License as | ||
180 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
181 | 10 | # License, or (at your option) any later version. | ||
182 | 11 | # | ||
183 | 12 | # This program is distributed in the hope that it will be useful, | ||
184 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
185 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
186 | 15 | # GNU Affero General Public License for more details. | ||
187 | 16 | # | ||
188 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
189 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
190 | 19 | # | ||
191 | 20 | ############################################################################## | ||
192 | 21 | |||
193 | 22 | from report_webkit.webkit_report import XlsWebKitParser | ||
194 | 23 | |||
195 | 24 | XlsWebKitParser( | ||
196 | 25 | 'report.wizard.import.generic.template', | ||
197 | 26 | 'abstract.wizard.import', | ||
198 | 27 | 'addons/msf_doc_import/report/import_generic_template.mako', | ||
199 | 28 | ) | ||
200 | 29 | |||
201 | 30 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
202 | 0 | 31 | ||
203 | === modified file 'bin/addons/msf_doc_import/wizard/__init__.py' | |||
204 | --- bin/addons/msf_doc_import/wizard/__init__.py 2016-05-17 12:05:25 +0000 | |||
205 | +++ bin/addons/msf_doc_import/wizard/__init__.py 2016-08-18 14:00:36 +0000 | |||
206 | @@ -137,3 +137,6 @@ | |||
207 | 137 | import wizard_import_supplier_catalogue | 137 | import wizard_import_supplier_catalogue |
208 | 138 | import wizard_po_simulation_screen | 138 | import wizard_po_simulation_screen |
209 | 139 | import wizard_in_simulation_screen | 139 | import wizard_in_simulation_screen |
210 | 140 | |||
211 | 141 | import abstract_wizard_import | ||
212 | 142 | import wizard_import_batch | ||
213 | 140 | 143 | ||
214 | === added file 'bin/addons/msf_doc_import/wizard/abstract_wizard_import.py' | |||
215 | --- bin/addons/msf_doc_import/wizard/abstract_wizard_import.py 1970-01-01 00:00:00 +0000 | |||
216 | +++ bin/addons/msf_doc_import/wizard/abstract_wizard_import.py 2016-08-18 14:00:36 +0000 | |||
217 | @@ -0,0 +1,457 @@ | |||
218 | 1 | # -*- coding: utf-8 -*- | ||
219 | 2 | ############################################################################## | ||
220 | 3 | # | ||
221 | 4 | # OpenERP, Open Source Management Solution | ||
222 | 5 | # Copyright (C) 2011 MSF, TeMPO Consulting. | ||
223 | 6 | # | ||
224 | 7 | # This program is free software: you can redistribute it and/or modify | ||
225 | 8 | # it under the terms of the GNU Affero General Public License as | ||
226 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
227 | 10 | # License, or (at your option) any later version. | ||
228 | 11 | # | ||
229 | 12 | # This program is distributed in the hope that it will be useful, | ||
230 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
231 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
232 | 15 | # GNU Affero General Public License for more details. | ||
233 | 16 | # | ||
234 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
235 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
236 | 19 | # | ||
237 | 20 | ############################################################################## | ||
238 | 21 | |||
239 | 22 | import base64 | ||
240 | 23 | import string | ||
241 | 24 | |||
242 | 25 | from mx import DateTime | ||
243 | 26 | |||
244 | 27 | from osv import osv | ||
245 | 28 | from osv import fields | ||
246 | 29 | from tools.translate import _ | ||
247 | 30 | |||
248 | 31 | from spreadsheet_xml.spreadsheet_xml import SpreadsheetXML | ||
249 | 32 | |||
250 | 33 | |||
251 | 34 | class UnifieldImportException(Exception): | ||
252 | 35 | pass | ||
253 | 36 | |||
254 | 37 | |||
255 | 38 | class ImportHeader(object): | ||
256 | 39 | """ | ||
257 | 40 | Class used to export Header template. | ||
258 | 41 | """ | ||
259 | 42 | type_ok = ['String', 'Number', 'DateTime'] | ||
260 | 43 | |||
261 | 44 | def __new__(cls, name, ftype='String', size=70, tech_name=None, required=False): | ||
262 | 45 | """ | ||
263 | 46 | Initialize a header column for template export. | ||
264 | 47 | :param name: Name of the field | ||
265 | 48 | :param ftype: Type of the field | ||
266 | 49 | :param size: Displayed size on Excel file | ||
267 | 50 | :param tech_name: Technical name of the field to compute | ||
268 | 51 | :param required: Is the field should be set or not ? | ||
269 | 52 | """ | ||
270 | 53 | if ftype not in ImportHeader.type_ok: | ||
271 | 54 | err_msg = _('''Defined type of header \'%s\' is not in the list of possible type: %s - Please contact | ||
272 | 55 | your support team and give us this message. | ||
273 | 56 | ''') % ( | ||
274 | 57 | name, ', '.join(t for t in ImportHeader.type_ok) | ||
275 | 58 | ) | ||
276 | 59 | raise osv.except_osv( | ||
277 | 60 | _('Error'), | ||
278 | 61 | err_msg, | ||
279 | 62 | ) | ||
280 | 63 | |||
281 | 64 | return _(name), ftype, size, tech_name, required | ||
282 | 65 | |||
283 | 66 | @classmethod | ||
284 | 67 | def get_date_from_str(cls, date_value): | ||
285 | 68 | """ | ||
286 | 69 | Try to construct a date from a string and return a formatted string date | ||
287 | 70 | :param date_value: String value to compute | ||
288 | 71 | :return: A datetime instance or False | ||
289 | 72 | """ | ||
290 | 73 | date_format = [ | ||
291 | 74 | '%Y-%m-%d', | ||
292 | 75 | '%Y-%m/%d', | ||
293 | 76 | '%d-%m-%Y', | ||
294 | 77 | '%d/%m/%Y', | ||
295 | 78 | '%d-%b-%Y', | ||
296 | 79 | '%d/%b-%Y', | ||
297 | 80 | ] | ||
298 | 81 | |||
299 | 82 | d = False | ||
300 | 83 | for dformat in date_format: | ||
301 | 84 | try: | ||
302 | 85 | d = str(DateTime.strptime(date_value, dformat)) | ||
303 | 86 | except ValueError: | ||
304 | 87 | continue | ||
305 | 88 | |||
306 | 89 | return d | ||
307 | 90 | |||
308 | 91 | @classmethod | ||
309 | 92 | def check_value(cls, header, value, vtype, context=None): | ||
310 | 93 | """ | ||
311 | 94 | Check the value of the column according to header | ||
312 | 95 | :param header: Header used to check if value is required or not | ||
313 | 96 | :param value: Value to check | ||
314 | 97 | :param vtype: Type of the data given | ||
315 | 98 | :return: A tuple with the result of the check, the formatted value and the error message if any | ||
316 | 99 | """ | ||
317 | 100 | if not value and header[4]: | ||
318 | 101 | return (-1, value, _('The column \'%s\' is required') % header[0]) | ||
319 | 102 | elif not value: | ||
320 | 103 | return (0, value, None) | ||
321 | 104 | elif header[1] == 'String': | ||
322 | 105 | if vtype == 'str': | ||
323 | 106 | return (0, value, None) | ||
324 | 107 | else: | ||
325 | 108 | try: | ||
326 | 109 | return (0, str(value), None) | ||
327 | 110 | except Exception as e: | ||
328 | 111 | return (-1, value, e) | ||
329 | 112 | elif header[1] == 'DateTime': | ||
330 | 113 | if vtype == 'datetime': | ||
331 | 114 | return (0, value, None) | ||
332 | 115 | elif vtype == 'str': | ||
333 | 116 | d = ImportHeader.get_date_from_str(value) | ||
334 | 117 | if d: | ||
335 | 118 | return (0, d, None) | ||
336 | 119 | else: | ||
337 | 120 | return (-1, value, _('The date format was not correct')) | ||
338 | 121 | else: | ||
339 | 122 | return (-1, value, _('The date format was not correct')) | ||
340 | 123 | elif header[1] == 'Integer': | ||
341 | 124 | if vtype == 'number': | ||
342 | 125 | return (0, value, None) | ||
343 | 126 | else: | ||
344 | 127 | try: | ||
345 | 128 | return (0, int(value), None) | ||
346 | 129 | except Exception as e: | ||
347 | 130 | return (-1, value, e) | ||
348 | 131 | elif header[1] == 'Float': | ||
349 | 132 | if vtype == 'number': | ||
350 | 133 | return (0, value, None) | ||
351 | 134 | else: | ||
352 | 135 | try: | ||
353 | 136 | return (0, float(value), None) | ||
354 | 137 | except Exception as e: | ||
355 | 138 | return (-1, value, e) | ||
356 | 139 | |||
357 | 140 | return (0, value, None) | ||
358 | 141 | |||
359 | 142 | |||
360 | 143 | class abstract_wizard_import(osv.osv_memory): | ||
361 | 144 | _name = 'abstract.wizard.import' | ||
362 | 145 | _description = 'Generic import wizard' | ||
363 | 146 | _auto = False | ||
364 | 147 | _order = 'start_date' | ||
365 | 148 | |||
366 | 149 | def _get_progression(self, cr, uid, ids, field_name, args, context=None): | ||
367 | 150 | """ | ||
368 | 151 | Return the percentage of progression | ||
369 | 152 | """ | ||
370 | 153 | if context is None: | ||
371 | 154 | context = {} | ||
372 | 155 | |||
373 | 156 | if isinstance(ids, (int, long)): | ||
374 | 157 | ids = [ids] | ||
375 | 158 | |||
376 | 159 | res = {} | ||
377 | 160 | |||
378 | 161 | for wiz in self.browse(cr, uid, ids, context=context): | ||
379 | 162 | if wiz.state == 'done': | ||
380 | 163 | res[wiz.id] = 100.00 | ||
381 | 164 | elif wiz.state == 'draft': | ||
382 | 165 | res[wiz.id] = 0.00 | ||
383 | 166 | else: | ||
384 | 167 | res[wiz.id] = float(wiz.total_lines_imported) / float(wiz.total_lines_to_import) * 100 | ||
385 | 168 | |||
386 | 169 | return res | ||
387 | 170 | |||
388 | 171 | _columns = { | ||
389 | 172 | 'model_name': fields.char( | ||
390 | 173 | size=64, | ||
391 | 174 | string='Model to import', | ||
392 | 175 | required=True, | ||
393 | 176 | readonly=True, | ||
394 | 177 | ), | ||
395 | 178 | 'parent_model_name': fields.char( | ||
396 | 179 | size=64, | ||
397 | 180 | string='Model of the parent', | ||
398 | 181 | readonly=True, | ||
399 | 182 | help="To go back to the parent when the window is closed", | ||
400 | 183 | ), | ||
401 | 184 | 'parent_record_id': fields.integer( | ||
402 | 185 | string='ID of the parent record', | ||
403 | 186 | readonly=True, | ||
404 | 187 | ), | ||
405 | 188 | 'template_file': fields.binary( | ||
406 | 189 | string='Template file', | ||
407 | 190 | readonly=True, | ||
408 | 191 | ), | ||
409 | 192 | 'template_filename': fields.char( | ||
410 | 193 | size=64, | ||
411 | 194 | string='Template filename', | ||
412 | 195 | readonly=True, | ||
413 | 196 | ), | ||
414 | 197 | 'import_file': fields.binary( | ||
415 | 198 | string='File to import', | ||
416 | 199 | ), | ||
417 | 200 | 'info_message': fields.text( | ||
418 | 201 | string='Information', | ||
419 | 202 | readonly=True, | ||
420 | 203 | ), | ||
421 | 204 | 'error_message': fields.text( | ||
422 | 205 | string='Errors', | ||
423 | 206 | readonly=True, | ||
424 | 207 | ), | ||
425 | 208 | 'show_error': fields.boolean( | ||
426 | 209 | string='Show error message ?', | ||
427 | 210 | readonly=True, | ||
428 | 211 | ), | ||
429 | 212 | 'warning_message': fields.text( | ||
430 | 213 | string='Warnings', | ||
431 | 214 | readonly=True, | ||
432 | 215 | ), | ||
433 | 216 | 'show_warning': fields.boolean( | ||
434 | 217 | string='Show warning message ?', | ||
435 | 218 | readonly=True, | ||
436 | 219 | ), | ||
437 | 220 | 'total_lines_to_import': fields.integer( | ||
438 | 221 | string='# of lines to import', | ||
439 | 222 | readonly=True, | ||
440 | 223 | ), | ||
441 | 224 | 'total_lines_imported': fields.integer( | ||
442 | 225 | string='# of lines imported', | ||
443 | 226 | readonly=True, | ||
444 | 227 | ), | ||
445 | 228 | 'progression': fields.function( | ||
446 | 229 | _get_progression, | ||
447 | 230 | method=True, | ||
448 | 231 | type='float', | ||
449 | 232 | digits=(16, 2), | ||
450 | 233 | string='Progression', | ||
451 | 234 | store=False, | ||
452 | 235 | readonly=False, | ||
453 | 236 | ), | ||
454 | 237 | 'state': fields.selection( | ||
455 | 238 | selection=[ | ||
456 | 239 | ('draft', 'Not started'), | ||
457 | 240 | ('progress', 'In progress'), | ||
458 | 241 | ('done', 'Done'), | ||
459 | 242 | ], | ||
460 | 243 | string='State', | ||
461 | 244 | readonly=True, | ||
462 | 245 | ), | ||
463 | 246 | 'start_date': fields.datetime( | ||
464 | 247 | string='Start date', | ||
465 | 248 | readonly=True, | ||
466 | 249 | ), | ||
467 | 250 | 'end_date': fields.datetime( | ||
468 | 251 | string='End date', | ||
469 | 252 | readonly=True, | ||
470 | 253 | ), | ||
471 | 254 | } | ||
472 | 255 | |||
473 | 256 | def default_get(self, cr, uid, fields, context=None): | ||
474 | 257 | """ | ||
475 | 258 | Return default values for some fields | ||
476 | 259 | :param cr: Cursor to the database | ||
477 | 260 | :param uid: ID of the res.users that calls this method | ||
478 | 261 | :param fields: Technical name of the fields on which system must put a default value | ||
479 | 262 | :param context: Context of the call | ||
480 | 263 | :return: A dictionary with field names as keys | ||
481 | 264 | """ | ||
482 | 265 | res = super(abstract_wizard_import, self).default_get(cr, uid, fields, context=context) | ||
483 | 266 | res.update({ | ||
484 | 267 | 'total_lines_to_import': 0, | ||
485 | 268 | 'total_lines_imported': 0, | ||
486 | 269 | 'state': 'draft', | ||
487 | 270 | 'info_message': _('Select a file to import and click on \'Run import\' button.'), | ||
488 | 271 | }) | ||
489 | 272 | return res | ||
490 | 273 | |||
491 | 274 | def update(self, cr, uid, ids, context=None): | ||
492 | 275 | return { | ||
493 | 276 | 'type': 'ir.actions.act_window', | ||
494 | 277 | 'res_model': self._name, | ||
495 | 278 | 'res_id': ids[0], | ||
496 | 279 | 'view_type': 'form', | ||
497 | 280 | 'view_mode': 'form,tree', | ||
498 | 281 | 'target': 'keep_same', # Just to keep reload of the page | ||
499 | 282 | 'context': context, | ||
500 | 283 | } | ||
501 | 284 | |||
502 | 285 | def exists(self, cr, uid, ids, context=None): | ||
503 | 286 | if self._name != 'abstract.wizard.import': | ||
504 | 287 | return super(abstract_wizard_import, self).exists(cr, uid, ids, context=context) | ||
505 | 288 | return False | ||
506 | 289 | |||
507 | 290 | def _get_template_file_data(self, context=None): | ||
508 | 291 | """ | ||
509 | 292 | Return values for the import template file report generation | ||
510 | 293 | """ | ||
511 | 294 | return { | ||
512 | 295 | 'model': self._name, | ||
513 | 296 | 'model_name': self._description, | ||
514 | 297 | 'header_columns': [], | ||
515 | 298 | } | ||
516 | 299 | |||
517 | 300 | def copy(self, cr, uid, old_id, defaults=None, context=None): | ||
518 | 301 | """ | ||
519 | 302 | Don't allow copy method | ||
520 | 303 | """ | ||
521 | 304 | raise osv.except_osv( | ||
522 | 305 | _('Not allowed'), | ||
523 | 306 | _('You cannot duplicate a %s document!') % self._description, | ||
524 | 307 | ) | ||
525 | 308 | |||
526 | 309 | def download_template_file(self, cr, uid, ids, context=None): | ||
527 | 310 | """ | ||
528 | 311 | Download the template file | ||
529 | 312 | """ | ||
530 | 313 | return { | ||
531 | 314 | 'type': 'ir.actions.report.xml', | ||
532 | 315 | 'report_name': 'wizard.import.generic.template', | ||
533 | 316 | 'datas': self._get_template_file_data(context=context), | ||
534 | 317 | } | ||
535 | 318 | |||
536 | 319 | def run_import(self, cr, uid, ids, context=None): | ||
537 | 320 | raise osv.except_osv( | ||
538 | 321 | _('Error'), | ||
539 | 322 | _('No \'run_import\' action is defined for the object \'%s\'!') % self._name, | ||
540 | 323 | ) | ||
541 | 324 | |||
542 | 325 | def check_utf8_encoding(self, import_file, base='base64'): | ||
543 | 326 | """ | ||
544 | 327 | Check if the given file is an good UTF-8 file | ||
545 | 328 | """ | ||
546 | 329 | if base == 'base64': | ||
547 | 330 | import_file = base64.decodestring(import_file) | ||
548 | 331 | |||
549 | 332 | try: | ||
550 | 333 | import_file.decode('utf-8') | ||
551 | 334 | return True | ||
552 | 335 | except UnicodeError: | ||
553 | 336 | return False | ||
554 | 337 | |||
555 | 338 | def read_file(self, wizard_brw, context=None): | ||
556 | 339 | """ | ||
557 | 340 | Open the Spreadsheet XML file | ||
558 | 341 | :param wizard_brw: browse_record of an import wizard | ||
559 | 342 | :return: An iterator on the rows of the file | ||
560 | 343 | """ | ||
561 | 344 | if not wizard_brw.import_file: | ||
562 | 345 | raise osv.except_osv( | ||
563 | 346 | _('Error'), | ||
564 | 347 | _('No file to import. Please select a file or download the template file and fill it.'), | ||
565 | 348 | ) | ||
566 | 349 | |||
567 | 350 | if wizard_brw.state != 'draft': | ||
568 | 351 | raise osv.except_osv( | ||
569 | 352 | _('Error'), | ||
570 | 353 | _('Import can be run only on draft wizard.'), | ||
571 | 354 | ) | ||
572 | 355 | |||
573 | 356 | if not self.check_utf8_encoding(wizard_brw.import_file): | ||
574 | 357 | raise osv.except_osv( | ||
575 | 358 | _('Error'), | ||
576 | 359 | _('The given file seems not to be encoding in UTF-8. Please check the encoding of the file and re-try.') | ||
577 | 360 | ) | ||
578 | 361 | |||
579 | 362 | file_obj = SpreadsheetXML(xmlstring=base64.decodestring(wizard_brw.import_file)) | ||
580 | 363 | |||
581 | 364 | file_obj.getNbRows() | ||
582 | 365 | # iterator on rows | ||
583 | 366 | return file_obj.getRows(), file_obj.getNbRows() | ||
584 | 367 | |||
585 | 368 | def check_headers(self, headers_row, headers_title, context=None): | ||
586 | 369 | """ | ||
587 | 370 | Check if the header in the first row of the file are the same as the expected headers | ||
588 | 371 | :param headers_row: Row that contains the header on the Excel file | ||
589 | 372 | :param headers_title: List of expected headers | ||
590 | 373 | :return: True or raise an error | ||
591 | 374 | """ | ||
592 | 375 | if len(headers_row) != len(headers_title): | ||
593 | 376 | raise osv.except_osv( | ||
594 | 377 | _('Error'), | ||
595 | 378 | _('The number of columns in the Excel file (%s) is different than the expected number '\ | ||
596 | 379 | 'of columns (%s).\nColumns should be in this order: %s') % ( | ||
597 | 380 | len(headers_row), | ||
598 | 381 | len(headers_title), | ||
599 | 382 | '\n * '.join(h[0] for h in headers_title), | ||
600 | 383 | ), | ||
601 | 384 | ) | ||
602 | 385 | |||
603 | 386 | errors = [] | ||
604 | 387 | headers_title_up = [_(x[0]).upper() for x in headers_title] | ||
605 | 388 | headers_row_up = [_(headers_row[i].data).upper() for i in range(0, len(headers_row))] | ||
606 | 389 | for h_index, h in enumerate(headers_title_up): | ||
607 | 390 | if h not in headers_row_up: | ||
608 | 391 | errors.append( | ||
609 | 392 | _('The column \'%s\' is not present in the file.') % _(headers_title[h_index][0]) | ||
610 | 393 | ) | ||
611 | 394 | elif headers_row_up[h_index] != h: | ||
612 | 395 | errors.append( | ||
613 | 396 | _('The column \'%s\' of the Excel file should be \'%s\', not \'%s\'.') % ( | ||
614 | 397 | string.uppercase[h_index], | ||
615 | 398 | _(headers_title[h_index][0]), | ||
616 | 399 | _(headers_row[h_index]), | ||
617 | 400 | ) | ||
618 | 401 | ) | ||
619 | 402 | if errors: | ||
620 | 403 | raise osv.except_osv( | ||
621 | 404 | _('Error'), | ||
622 | 405 | '\n'.join(err for err in errors), | ||
623 | 406 | ) | ||
624 | 407 | |||
625 | 408 | return True | ||
626 | 409 | |||
627 | 410 | def check_error_and_format_row(self, wizard_id, row, headers, context=None): | ||
628 | 411 | """ | ||
629 | 412 | Check if the required cells are set and if this the data are well formatted | ||
630 | 413 | :param wizard_id: ID of the import wizard | ||
631 | 414 | :param row: Row of the Excel file | ||
632 | 415 | :param headers: Required headers | ||
633 | 416 | :return: True | ||
634 | 417 | """ | ||
635 | 418 | try: | ||
636 | 419 | line_content = row.cells | ||
637 | 420 | except ValueError as e: | ||
638 | 421 | return (-1, _('Line is empty')) | ||
639 | 422 | |||
640 | 423 | if len(line_content) > len(headers): | ||
641 | 424 | return (-1, _('Number of columns (%s) in the line are larger than expected (%s).') % ( | ||
642 | 425 | len(line_content), len(headers) | ||
643 | 426 | )) | ||
644 | 427 | |||
645 | 428 | data = [] | ||
646 | 429 | errors = [] | ||
647 | 430 | for col_index, col_value in enumerate(line_content): | ||
648 | 431 | # Check data values according to expected type | ||
649 | 432 | chk_res = ImportHeader.check_value(headers[col_index], col_value.data, col_value.type, context=context) | ||
650 | 433 | data.append(chk_res[1]) | ||
651 | 434 | if chk_res[0] < 0: | ||
652 | 435 | errors.append(chk_res[2]) | ||
653 | 436 | |||
654 | 437 | return (len(errors) and -1 or 0, errors, data) | ||
655 | 438 | |||
656 | 439 | def get_product_by_default_code(self, cr, uid, default_code, context=None): | ||
657 | 440 | """ | ||
658 | 441 | Return the ID of the product.product related to the default_code parameter | ||
659 | 442 | :param cr: Cursor to the database | ||
660 | 443 | :param uid: ID of the res.users that calls this method | ||
661 | 444 | :param default_code: Code of the product to find | ||
662 | 445 | :param context: Context of the call | ||
663 | 446 | :return: The ID of the product.product | ||
664 | 447 | """ | ||
665 | 448 | p_obj = self.pool.get('product.product') | ||
666 | 449 | p_ids = p_obj.search(cr, uid, [ | ||
667 | 450 | ('default_code', '=', default_code), | ||
668 | 451 | ], limit=1, order='NO_ORDER', context=context) | ||
669 | 452 | if not p_ids: | ||
670 | 453 | raise UnifieldImportException(_('No product found for the code \'%s\'') % default_code) | ||
671 | 454 | |||
672 | 455 | return p_ids[0] | ||
673 | 456 | |||
674 | 457 | abstract_wizard_import() | ||
675 | 0 | \ No newline at end of file | 458 | \ No newline at end of file |
676 | 1 | 459 | ||
677 | === added file 'bin/addons/msf_doc_import/wizard/wizard_import_batch.py' | |||
678 | --- bin/addons/msf_doc_import/wizard/wizard_import_batch.py 1970-01-01 00:00:00 +0000 | |||
679 | +++ bin/addons/msf_doc_import/wizard/wizard_import_batch.py 2016-08-18 14:00:36 +0000 | |||
680 | @@ -0,0 +1,303 @@ | |||
681 | 1 | # -*- coding: utf-8 -*- | ||
682 | 2 | ############################################################################## | ||
683 | 3 | # | ||
684 | 4 | # OpenERP, Open Source Management Solution | ||
685 | 5 | # Copyright (C) 2011 MSF, TeMPO Consulting. | ||
686 | 6 | # | ||
687 | 7 | # This 7ogram is free software: you can redistribute it and/or modify | ||
688 | 8 | # it under the terms of the GNU Affero General Public License as | ||
689 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
690 | 10 | # License, or (at your option) any later version. | ||
691 | 11 | # | ||
692 | 12 | # This program is distributed in the hope that it will be useful, | ||
693 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
694 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
695 | 15 | # GNU Affero General Public License for more details. | ||
696 | 16 | # | ||
697 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
698 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
699 | 19 | # | ||
700 | 20 | ############################################################################## | ||
701 | 21 | |||
702 | 22 | import threading | ||
703 | 23 | import time | ||
704 | 24 | |||
705 | 25 | import pooler | ||
706 | 26 | |||
707 | 27 | from osv import osv | ||
708 | 28 | from tools.translate import _ | ||
709 | 29 | |||
710 | 30 | from msf_doc_import.wizard.abstract_wizard_import import ImportHeader | ||
711 | 31 | from msf_doc_import.wizard.abstract_wizard_import import UnifieldImportException | ||
712 | 32 | |||
713 | 33 | |||
714 | 34 | def get_import_batch_headers(context=None): | ||
715 | 35 | return [ | ||
716 | 36 | ImportHeader(name=_('get_import_batch_headers_name'), ftype='String', size=80, tech_name='name', required=False), | ||
717 | 37 | ImportHeader(name=_('get_import_batch_headers_type'), ftype='String', size=80, tech_name='type', required=True), | ||
718 | 38 | ImportHeader(name=_('get_import_batch_headers_life_date'), ftype='DateTime', size=60, tech_name='life_date', required=True), | ||
719 | 39 | ImportHeader(name=_('get_import_batch_headers_product_code'), ftype='String', size=80, tech_name='product_id', required=True), | ||
720 | 40 | ImportHeader(name=_('get_import_batch_headers_product_desc'), ftype='String', size=120, required=True), | ||
721 | 41 | ] | ||
722 | 42 | |||
723 | 43 | # Get header list and information | ||
724 | 44 | header_index_by_name = {} | ||
725 | 45 | for i, h in enumerate(get_import_batch_headers()): | ||
726 | 46 | header_index_by_name[h[3]] = i | ||
727 | 47 | |||
728 | 48 | |||
729 | 49 | def get_cell(line_data, field): | ||
730 | 50 | cell_data = line_data[header_index_by_name[field]] | ||
731 | 51 | if cell_data: | ||
732 | 52 | return cell_data | ||
733 | 53 | return None | ||
734 | 54 | |||
735 | 55 | |||
736 | 56 | class wizard_import_batch(osv.osv_memory): | ||
737 | 57 | _name = 'wizard.import.batch' | ||
738 | 58 | _description = 'Import batch numbers' | ||
739 | 59 | _inherit = 'abstract.wizard.import' | ||
740 | 60 | _auto = True | ||
741 | 61 | |||
742 | 62 | _defaults = { | ||
743 | 63 | 'model_name': 'stock.production.lot', | ||
744 | 64 | 'template_filename': 'Import_batch_number_tpl.csv', | ||
745 | 65 | } | ||
746 | 66 | |||
747 | 67 | def _get_template_file_data(self, context=None): | ||
748 | 68 | """ | ||
749 | 69 | Return values for the import template file report generation | ||
750 | 70 | """ | ||
751 | 71 | return { | ||
752 | 72 | 'model': 'stock.production.lot', | ||
753 | 73 | 'model_name': _('Batch numbers'), | ||
754 | 74 | 'header_columns': get_import_batch_headers(context=context), | ||
755 | 75 | } | ||
756 | 76 | |||
757 | 77 | def run_import(self, cr, uid, ids, context=None): | ||
758 | 78 | """ | ||
759 | 79 | Make checks on file to import and run the import in background. | ||
760 | 80 | :param cr: Cursor to the database | ||
761 | 81 | :param uid: ID of the res.users that calls this method | ||
762 | 82 | :param ids: List of ID of wizard.import.patch on which import should be made | ||
763 | 83 | :param context: Context of the call | ||
764 | 84 | :return: True | ||
765 | 85 | """ | ||
766 | 86 | if context is None: | ||
767 | 87 | context = {} | ||
768 | 88 | |||
769 | 89 | if isinstance(ids, (int, long)): | ||
770 | 90 | ids = [ids] | ||
771 | 91 | |||
772 | 92 | expected_headers = get_import_batch_headers(context=context) | ||
773 | 93 | |||
774 | 94 | for wiz in self.browse(cr, uid, ids, context=context): | ||
775 | 95 | rows, nb_rows = self.read_file(wiz, context=context) | ||
776 | 96 | |||
777 | 97 | head = rows.next() | ||
778 | 98 | self.check_headers(head, expected_headers, context=context) | ||
779 | 99 | |||
780 | 100 | self.write(cr, uid, [wiz.id], { | ||
781 | 101 | 'total_lines_to_import': nb_rows, | ||
782 | 102 | 'state': 'progress', | ||
783 | 103 | 'start_date': time.strftime('%Y-%m-%d %H:%M:%S'), | ||
784 | 104 | 'info_message': _('Import in progress, please leave this window open and press the button \'Update\' ' | ||
785 | 105 | 'to show the progression of the import. Otherwise, you can continue tu use Unifield'), | ||
786 | 106 | }, context=context) | ||
787 | 107 | wiz.total_lines_to_import = nb_rows | ||
788 | 108 | |||
789 | 109 | thread = threading.Thread( | ||
790 | 110 | target=self.bg_import, | ||
791 | 111 | args=(cr.dbname, uid, wiz, expected_headers, rows, context), | ||
792 | 112 | ) | ||
793 | 113 | thread.start() | ||
794 | 114 | |||
795 | 115 | return True | ||
796 | 116 | |||
797 | 117 | def bg_import(self, dbname, uid, import_brw, headers, rows, context=None): | ||
798 | 118 | """ | ||
799 | 119 | Run the import of lines in background | ||
800 | 120 | :param dbname: Name of the database | ||
801 | 121 | :param uid: ID of the res.users that calls this method | ||
802 | 122 | :param import_brw: browse_record of a wizard.import.batch | ||
803 | 123 | :param headers: List of expected headers | ||
804 | 124 | :param rows: Iterator on file rows | ||
805 | 125 | :param context: Context of the call | ||
806 | 126 | :return: True | ||
807 | 127 | """ | ||
808 | 128 | prodlot_obj = self.pool.get('stock.production.lot') | ||
809 | 129 | product_obj = self.pool.get('product.product') | ||
810 | 130 | sequence_obj = self.pool.get('ir.sequence') | ||
811 | 131 | |||
812 | 132 | if context is None: | ||
813 | 133 | context = {} | ||
814 | 134 | |||
815 | 135 | cr = pooler.get_db(dbname).cursor() | ||
816 | 136 | nb_imported_lines = 0 | ||
817 | 137 | |||
818 | 138 | # Manage errors | ||
819 | 139 | import_errors = {} | ||
820 | 140 | |||
821 | 141 | def save_error(errors): | ||
822 | 142 | if not isinstance(errors, list): | ||
823 | 143 | errors = [errors] | ||
824 | 144 | import_errors.setdefault(row_index+2, []) | ||
825 | 145 | import_errors[row_index+2].extend(errors) | ||
826 | 146 | |||
827 | 147 | # Manage warnings | ||
828 | 148 | import_warnings = {} | ||
829 | 149 | |||
830 | 150 | def save_warnings(warnings): | ||
831 | 151 | if not isinstance(warnings, list): | ||
832 | 152 | warnings = [warnings] | ||
833 | 153 | import_warnings.setdefault(row_index+2, []) | ||
834 | 154 | import_warnings[row_index+2].extend(warnings) | ||
835 | 155 | |||
836 | 156 | start_time = time.time() | ||
837 | 157 | nb_lines_ok = 0 | ||
838 | 158 | for row_index, row in enumerate(rows): | ||
839 | 159 | res, errors, line_data = self.check_error_and_format_row(import_brw.id, row, headers, context=context) | ||
840 | 160 | if res < 0: | ||
841 | 161 | save_error(errors) | ||
842 | 162 | continue | ||
843 | 163 | |||
844 | 164 | # Product | ||
845 | 165 | product_id = None | ||
846 | 166 | try: | ||
847 | 167 | product_id = self.get_product_by_default_code(cr, uid, get_cell(line_data, 'product_id'), | ||
848 | 168 | context=context) | ||
849 | 169 | except UnifieldImportException as e: | ||
850 | 170 | save_error(e) | ||
851 | 171 | |||
852 | 172 | # Batch number type | ||
853 | 173 | batch_type = get_cell(line_data, 'type') | ||
854 | 174 | if batch_type.upper() not in (_('Standard').upper(), _('Internal').upper()): | ||
855 | 175 | save_error( | ||
856 | 176 | _('The Type of the batch number should be \'Standard\' or \'Internal\''), | ||
857 | 177 | ) | ||
858 | 178 | batch_type = None | ||
859 | 179 | elif batch_type.upper() == _('Standard').upper(): | ||
860 | 180 | batch_type = 'standard' | ||
861 | 181 | elif batch_type.upper() == _('Internal').upper(): | ||
862 | 182 | batch_type = 'internal' | ||
863 | 183 | |||
864 | 184 | # Go to next line if all base data are not set | ||
865 | 185 | if not (product_id and batch_type): | ||
866 | 186 | continue | ||
867 | 187 | |||
868 | 188 | # Make consistency checks | ||
869 | 189 | name = get_cell(line_data, 'name') | ||
870 | 190 | life_date = get_cell(line_data, 'life_date') | ||
871 | 191 | product_brw = product_obj.read(cr, uid, product_id, ['batch_management', 'perishable'], context=context) | ||
872 | 192 | |||
873 | 193 | if not product_brw['batch_management'] and not product_brw['perishable']: | ||
874 | 194 | save_error( | ||
875 | 195 | _('You cannot create a batch number for a product that is not \'Perishable\'' | ||
876 | 196 | ' nor \'Batch mandatory\'') | ||
877 | 197 | ) | ||
878 | 198 | continue | ||
879 | 199 | elif product_brw['batch_management'] and batch_type == 'internal': | ||
880 | 200 | save_error( | ||
881 | 201 | _('You cannot create an \'Internal\' batch number for a \'Batch mandatory\' product') | ||
882 | 202 | ) | ||
883 | 203 | continue | ||
884 | 204 | elif not product_brw['batch_management'] and product_brw['perishable'] and batch_type == 'standard': | ||
885 | 205 | save_error( | ||
886 | 206 | _('You cannot create a \'Standard\' batch number for a non \'Batch mandatory\' product') | ||
887 | 207 | ) | ||
888 | 208 | continue | ||
889 | 209 | elif product_brw['batch_management'] and not name: | ||
890 | 210 | save_error( | ||
891 | 211 | _('For a \'Standard\' batch number, you have to define value in the \'Name\' column') | ||
892 | 212 | ) | ||
893 | 213 | continue | ||
894 | 214 | |||
895 | 215 | # Check no duplicate | ||
896 | 216 | prodlot_domain = [ | ||
897 | 217 | ('product_id', '=', product_id), | ||
898 | 218 | ('type', '=', batch_type), | ||
899 | 219 | ('life_date', '=', life_date), | ||
900 | 220 | ] | ||
901 | 221 | if product_brw['batch_management']: | ||
902 | 222 | prodlot_domain.append(('name', '=', name)) | ||
903 | 223 | |||
904 | 224 | prodlot_id = prodlot_obj.search(cr, uid, prodlot_domain, limit=1, order='NO_ORDER', context=context) | ||
905 | 225 | if prodlot_id: | ||
906 | 226 | save_error( | ||
907 | 227 | _('A batch number with the same parameters already exists in the system') | ||
908 | 228 | ) | ||
909 | 229 | continue | ||
910 | 230 | |||
911 | 231 | if batch_type == 'internal': | ||
912 | 232 | if name: | ||
913 | 233 | save_warnings( | ||
914 | 234 | _('Name of the batch will be ignored because the batch is \'Internal\' so ' | ||
915 | 235 | 'name is created by the system') | ||
916 | 236 | ) | ||
917 | 237 | name = sequence_obj.get(cr, uid, 'stock.lot.serial') | ||
918 | 238 | |||
919 | 239 | create_vals = { | ||
920 | 240 | 'name': name, | ||
921 | 241 | 'product_id': product_id, | ||
922 | 242 | 'life_date': life_date, | ||
923 | 243 | 'type': batch_type, | ||
924 | 244 | } | ||
925 | 245 | try: | ||
926 | 246 | prodlot_obj.create(cr, uid, create_vals, context=context) | ||
927 | 247 | nb_lines_ok += 1 | ||
928 | 248 | except Exception as e: | ||
929 | 249 | save_error(e) | ||
930 | 250 | cr.rollback() | ||
931 | 251 | |||
932 | 252 | nb_imported_lines += 1 | ||
933 | 253 | self.write(cr, uid, [import_brw.id], {'total_lines_imported': nb_imported_lines}, context=context) | ||
934 | 254 | |||
935 | 255 | warn_msg = '' | ||
936 | 256 | for lnum, warnings in import_warnings.iteritems(): | ||
937 | 257 | for warn in warnings: | ||
938 | 258 | warn_msg += _('Line %s: %s') % (lnum, warn) | ||
939 | 259 | warn_msg += '\n' | ||
940 | 260 | |||
941 | 261 | err_msg = '' | ||
942 | 262 | for lnum, errors in import_errors.iteritems(): | ||
943 | 263 | for err in errors: | ||
944 | 264 | err_msg += _('Line %s: %s') % (lnum, err) | ||
945 | 265 | err_msg += '\n' | ||
946 | 266 | |||
947 | 267 | if err_msg: | ||
948 | 268 | cr.rollback() | ||
949 | 269 | |||
950 | 270 | info_msg = _('''Processing of file completed in %s second(s)! | ||
951 | 271 | - Total lines to import: %s | ||
952 | 272 | - Total lines %s: %s %s | ||
953 | 273 | - Total lines with errors: %s %s | ||
954 | 274 | %s | ||
955 | 275 | ''') % ( | ||
956 | 276 | str(round(time.time() - start_time)), | ||
957 | 277 | import_brw.total_lines_to_import-1, | ||
958 | 278 | err_msg and _('without errors') or _('imported'), | ||
959 | 279 | nb_lines_ok, | ||
960 | 280 | warn_msg and _('(%s line(s) with warning - see warning messages below)') % ( | ||
961 | 281 | len(import_warnings.keys()) or '', | ||
962 | 282 | ), | ||
963 | 283 | err_msg and len(import_errors.keys()) or 0, | ||
964 | 284 | err_msg and _('(see error messages below)'), | ||
965 | 285 | err_msg and _("no data will be imported until all the error messages are corrected") or '', | ||
966 | 286 | ) | ||
967 | 287 | |||
968 | 288 | self.write(cr, uid, [import_brw.id], { | ||
969 | 289 | 'error_message': err_msg, | ||
970 | 290 | 'show_error': err_msg and True or False, | ||
971 | 291 | 'warning_message': warn_msg, | ||
972 | 292 | 'show_warning': warn_msg and True or False, | ||
973 | 293 | 'info_message': info_msg, | ||
974 | 294 | 'state': 'done', | ||
975 | 295 | 'end_date': time.strftime('%Y-%m-%d %H:%M:%S'), | ||
976 | 296 | }, context=context) | ||
977 | 297 | |||
978 | 298 | cr.commit() | ||
979 | 299 | cr.close() | ||
980 | 300 | |||
981 | 301 | return True | ||
982 | 302 | |||
983 | 303 | wizard_import_batch() | ||
984 | 0 | 304 | ||
985 | === added file 'bin/addons/msf_doc_import/wizard/wizard_import_batch_view.xml' | |||
986 | --- bin/addons/msf_doc_import/wizard/wizard_import_batch_view.xml 1970-01-01 00:00:00 +0000 | |||
987 | +++ bin/addons/msf_doc_import/wizard/wizard_import_batch_view.xml 2016-08-18 14:00:36 +0000 | |||
988 | @@ -0,0 +1,83 @@ | |||
989 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
990 | 2 | <openerp> | ||
991 | 3 | <data> | ||
992 | 4 | |||
993 | 5 | <record id="wizard_import_batch_tree_view" model="ir.ui.view"> | ||
994 | 6 | <field name="name">Import Batch Numbers</field> | ||
995 | 7 | <field name="model">wizard.import.batch</field> | ||
996 | 8 | <field name="type">tree</field> | ||
997 | 9 | <field name="arch" type="xml"> | ||
998 | 10 | <tree string="Import Batch Numbers" noteditable="True"> | ||
999 | 11 | <field name="start_date" /> | ||
1000 | 12 | <field name="end_date" /> | ||
1001 | 13 | <field name="progression" widget="progressbar" /> | ||
1002 | 14 | <field name="state" /> | ||
1003 | 15 | </tree> | ||
1004 | 16 | </field> | ||
1005 | 17 | </record> | ||
1006 | 18 | |||
1007 | 19 | <record id="view_wizard_import_batch" model="ir.ui.view"> | ||
1008 | 20 | <field name="name">Import Batch Numbers</field> | ||
1009 | 21 | <field name="model">wizard.import.batch</field> | ||
1010 | 22 | <field name="type">form</field> | ||
1011 | 23 | <field name="arch" type="xml"> | ||
1012 | 24 | <form string="Import Batch Number" hide_duplicate_button="1"> | ||
1013 | 25 | <field name="show_error" invisible="1" /> | ||
1014 | 26 | <field name="show_warning" invisible="1" /> | ||
1015 | 27 | |||
1016 | 28 | <group colspan="4" col="6"> | ||
1017 | 29 | <label string="Select a file to import: " align="1.0" /> | ||
1018 | 30 | <field name="import_file" nolabel="True" colspan="1" /> | ||
1019 | 31 | <label colspan="2" string="" /> | ||
1020 | 32 | <field name="start_date" /> | ||
1021 | 33 | <newline /> | ||
1022 | 34 | <label string="Or download a template: " align="1.0" /> | ||
1023 | 35 | <button name="download_template_file" string="" icon="gtk-save" help="Download template file" type="object" /> | ||
1024 | 36 | <label colspan="2" string="" /> | ||
1025 | 37 | <field name="end_date" /> | ||
1026 | 38 | <group colspan="6" col="4"> | ||
1027 | 39 | <field name="state" /> | ||
1028 | 40 | <field name="progression" widget="progressbar" /> | ||
1029 | 41 | </group> | ||
1030 | 42 | </group> | ||
1031 | 43 | |||
1032 | 44 | <separator colspan="4" string="Information" /> | ||
1033 | 45 | <field name="info_message" colspan="4" nolabel="1" /> | ||
1034 | 46 | |||
1035 | 47 | <group colspan="4" attrs="{'invisible': [('state', '=', 'done')]}"> | ||
1036 | 48 | <separator colspan="4" string="Actions" /> | ||
1037 | 49 | <button name="run_import" type="object" string="Run import" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'draft')]}" /> | ||
1038 | 50 | <button name="update" type="object" string="Update" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'progress')]}" /> | ||
1039 | 51 | </group> | ||
1040 | 52 | |||
1041 | 53 | <group colspan="4" attrs="{'invisible': [('show_warning', '=', False)]}"> | ||
1042 | 54 | <separator colspan="4" string="Warning messages" /> | ||
1043 | 55 | <field name="warning_message" nolabel="1" colspan="4" /> | ||
1044 | 56 | </group> | ||
1045 | 57 | |||
1046 | 58 | <group colspan="4" attrs="{'invisible': [('show_error', '=', False)]}"> | ||
1047 | 59 | <separator colspan="4" string="Error messages" /> | ||
1048 | 60 | <field name="error_message" nolabel="1" colspan="4" /> | ||
1049 | 61 | </group> | ||
1050 | 62 | </form> | ||
1051 | 63 | </field> | ||
1052 | 64 | </record> | ||
1053 | 65 | |||
1054 | 66 | <act_window | ||
1055 | 67 | name="Import Batch Numbers" | ||
1056 | 68 | res_model="wizard.import.batch" | ||
1057 | 69 | src_model="wizard.import.batch" | ||
1058 | 70 | view_mode="tree,form" | ||
1059 | 71 | target="current" | ||
1060 | 72 | key2="False" | ||
1061 | 73 | id="action_wizard_import_batch" /> | ||
1062 | 74 | |||
1063 | 75 | <menuitem | ||
1064 | 76 | action="action_wizard_import_batch" | ||
1065 | 77 | sequence="5" | ||
1066 | 78 | name="Import Batch Numbers" | ||
1067 | 79 | parent="stock.menu_action_production_lot_form" | ||
1068 | 80 | id="menu_action_wizard_import_batch" /> | ||
1069 | 81 | |||
1070 | 82 | </data> | ||
1071 | 83 | </openerp> | ||
1072 | 0 | 84 | ||
1073 | === modified file 'bin/addons/msf_profile/i18n/en_MF.po' | |||
1074 | --- bin/addons/msf_profile/i18n/en_MF.po 2013-01-31 13:07:22 +0000 | |||
1075 | +++ bin/addons/msf_profile/i18n/en_MF.po 2016-08-18 14:00:36 +0000 | |||
1076 | @@ -799,3 +799,33 @@ | |||
1077 | 799 | #: view:purchase.order:0 | 799 | #: view:purchase.order:0 |
1078 | 800 | msgid "Delivery & Invoicing" | 800 | msgid "Delivery & Invoicing" |
1079 | 801 | msgstr "Delivery" | 801 | msgstr "Delivery" |
1080 | 802 | |||
1081 | 803 | #. module: msf_doc_import | ||
1082 | 804 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:36 | ||
1083 | 805 | #, python-format | ||
1084 | 806 | msgid "get_import_batch_headers_name" | ||
1085 | 807 | msgstr "Batch number" | ||
1086 | 808 | |||
1087 | 809 | #. module: msf_doc_import | ||
1088 | 810 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:37 | ||
1089 | 811 | #, python-format | ||
1090 | 812 | msgid "get_import_batch_headers_product_code" | ||
1091 | 813 | msgstr "Product Code" | ||
1092 | 814 | |||
1093 | 815 | #. module: msf_doc_import | ||
1094 | 816 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:38 | ||
1095 | 817 | #, python-format | ||
1096 | 818 | msgid "get_import_batch_headers_product_desc" | ||
1097 | 819 | msgstr "Product Description" | ||
1098 | 820 | |||
1099 | 821 | #. module: msf_doc_import | ||
1100 | 822 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:39 | ||
1101 | 823 | #, python-format | ||
1102 | 824 | msgid "get_import_batch_headers_life_date" | ||
1103 | 825 | msgstr "Expiry date" | ||
1104 | 826 | |||
1105 | 827 | #. module: msf_doc_import | ||
1106 | 828 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:40 | ||
1107 | 829 | #, python-format | ||
1108 | 830 | msgid "get_import_batch_headers_type" | ||
1109 | 831 | msgstr "Type" | ||
1110 | 802 | 832 | ||
1111 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
1112 | --- bin/addons/msf_profile/i18n/fr_MF.po 2016-08-09 15:31:52 +0000 | |||
1113 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2016-08-18 14:00:36 +0000 | |||
1114 | @@ -14574,6 +14574,8 @@ | |||
1115 | 14574 | #. modules: msf_doc_import, register_accounting | 14574 | #. modules: msf_doc_import, register_accounting |
1116 | 14575 | #: field:msf.doc.import.accounting,progression:0 | 14575 | #: field:msf.doc.import.accounting,progression:0 |
1117 | 14576 | #: field:wizard.register.import,progression:0 | 14576 | #: field:wizard.register.import,progression:0 |
1118 | 14577 | #: field:abstract.wizard.import,progression:0 | ||
1119 | 14578 | #: field:wizard.import.batch,progression:0 | ||
1120 | 14577 | msgid "Progression" | 14579 | msgid "Progression" |
1121 | 14578 | msgstr "Progression" | 14580 | msgstr "Progression" |
1122 | 14579 | 14581 | ||
1123 | @@ -23497,6 +23499,54 @@ | |||
1124 | 23497 | #: code:addons/purchase_msf/purchase_msf.py:55 | 23499 | #: code:addons/purchase_msf/purchase_msf.py:55 |
1125 | 23498 | #: code:addons/purchase_msf/purchase_msf.py:87 | 23500 | #: code:addons/purchase_msf/purchase_msf.py:87 |
1126 | 23499 | #: field:stock.move,inactive_error:0 | 23501 | #: field:stock.move,inactive_error:0 |
1127 | 23502 | #: code:addons/msf_doc_import/account.py:72 | ||
1128 | 23503 | #: code:addons/msf_doc_import/account.py:201 | ||
1129 | 23504 | #: code:addons/msf_doc_import/account.py:234 | ||
1130 | 23505 | #: code:addons/msf_doc_import/account.py:480 | ||
1131 | 23506 | #: code:addons/msf_doc_import/stock_picking.py:60 | ||
1132 | 23507 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:60 | ||
1133 | 23508 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:296 | ||
1134 | 23509 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:321 | ||
1135 | 23510 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:327 | ||
1136 | 23511 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:333 | ||
1137 | 23512 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:352 | ||
1138 | 23513 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:379 | ||
1139 | 23514 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:77 | ||
1140 | 23515 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:254 | ||
1141 | 23516 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:258 | ||
1142 | 23517 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:785 | ||
1143 | 23518 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:788 | ||
1144 | 23519 | #: code:addons/msf_doc_import/wizard/wizard_delete_lines.py:78 | ||
1145 | 23520 | #: code:addons/msf_doc_import/wizard/wizard_delete_lines.py:612 | ||
1146 | 23521 | #: code:addons/msf_doc_import/wizard/wizard_import_auto_supply_line.py:140 | ||
1147 | 23522 | #: code:addons/msf_doc_import/wizard/wizard_import_auto_supply_line.py:157 | ||
1148 | 23523 | #: code:addons/msf_doc_import/wizard/wizard_import_order_cycle_line.py:141 | ||
1149 | 23524 | #: code:addons/msf_doc_import/wizard/wizard_import_order_cycle_line.py:154 | ||
1150 | 23525 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:165 | ||
1151 | 23526 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:174 | ||
1152 | 23527 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:183 | ||
1153 | 23528 | #: code:addons/msf_doc_import/wizard/wizard_import_product_list.py:81 | ||
1154 | 23529 | #: code:addons/msf_doc_import/wizard/wizard_import_stock_warehouse_order_point_line.py:162 | ||
1155 | 23530 | #: code:addons/msf_doc_import/wizard/wizard_import_stock_warehouse_order_point_line.py:170 | ||
1156 | 23531 | #: code:addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py:164 | ||
1157 | 23532 | #: code:addons/msf_doc_import/wizard/wizard_import_threshold_value_line.py:145 | ||
1158 | 23533 | #: code:addons/msf_doc_import/wizard/wizard_import_threshold_value_line.py:153 | ||
1159 | 23534 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:263 | ||
1160 | 23535 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:270 | ||
1161 | 23536 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:275 | ||
1162 | 23537 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:341 | ||
1163 | 23538 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:346 | ||
1164 | 23539 | #: selection:msf.doc.import.accounting,state:0 | ||
1165 | 23540 | #: field:purchase.import.xml.line,error_list:0 | ||
1166 | 23541 | #: field:purchase.line.import.xml.line,error_list:0 | ||
1167 | 23542 | #: view:sale.order:0 | ||
1168 | 23543 | #: view:sale.order.line:0 | ||
1169 | 23544 | #: field:tender.line,inactive_error:0 | ||
1170 | 23545 | #: selection:wizard.import.in.line.simulation.screen,type_change:0 | ||
1171 | 23546 | #: selection:wizard.import.in.simulation.screen,state:0 | ||
1172 | 23547 | #: selection:wizard.import.po.simulation.screen,state:0 | ||
1173 | 23548 | #: selection:wizard.import.po.simulation.screen.line,type_change:0 | ||
1174 | 23549 | #: selection:wizard.simu.import.po.line,change_type:0 | ||
1175 | 23500 | #, python-format | 23550 | #, python-format |
1176 | 23501 | msgid "Error" | 23551 | msgid "Error" |
1177 | 23502 | msgstr "Error" | 23552 | msgstr "Error" |
1178 | @@ -31105,6 +31155,16 @@ | |||
1179 | 31105 | #: model:ir.ui.menu,name:sync_client.update_menu | 31155 | #: model:ir.ui.menu,name:sync_client.update_menu |
1180 | 31106 | #: view:sync.client.update_entity:0 | 31156 | #: view:sync.client.update_entity:0 |
1181 | 31107 | #: view:wizard.register.import:0 | 31157 | #: view:wizard.register.import:0 |
1182 | 31158 | #: view:wizard.import.auto.supply.line:0 | ||
1183 | 31159 | #: view:wizard.import.batch:0 | ||
1184 | 31160 | #: view:wizard.import.in.simulation.screen:0 | ||
1185 | 31161 | #: view:wizard.import.order.cycle.line:0 | ||
1186 | 31162 | #: view:wizard.import.pick.line:0 | ||
1187 | 31163 | #: view:wizard.import.po.simulation.screen:0 | ||
1188 | 31164 | #: view:wizard.import.product.list:0 | ||
1189 | 31165 | #: view:wizard.import.stock.warehouse.orderpoint.line:0 | ||
1190 | 31166 | #: view:wizard.import.supplier.catalogue:0 | ||
1191 | 31167 | #: view:wizard.import.threshold.value.line:0 | ||
1192 | 31108 | msgid "Update" | 31168 | msgid "Update" |
1193 | 31109 | msgstr "Mettre à jour" | 31169 | msgstr "Mettre à jour" |
1194 | 31110 | 31170 | ||
1195 | @@ -40101,16 +40161,20 @@ | |||
1196 | 40101 | msgid "End Period" | 40161 | msgid "End Period" |
1197 | 40102 | msgstr "Période de fin" | 40162 | msgstr "Période de fin" |
1198 | 40103 | 40163 | ||
1200 | 40104 | #. module: account | 40164 | #. modules: account, msf_doc_import |
1201 | 40105 | #: report:pl.account.horizontal:0 | 40165 | #: report:pl.account.horizontal:0 |
1202 | 40106 | #: report:pl.account:0 | 40166 | #: report:pl.account:0 |
1203 | 40167 | #: field:abstract.wizard.import,start_date:0 | ||
1204 | 40168 | #: field:wizard.import.batch,start_date:0 | ||
1205 | 40107 | #, python-format | 40169 | #, python-format |
1206 | 40108 | msgid "Start Date" | 40170 | msgid "Start Date" |
1207 | 40109 | msgstr "Date de début" | 40171 | msgstr "Date de début" |
1208 | 40110 | 40172 | ||
1210 | 40111 | #. module: account | 40173 | #. modules: account, msf_doc_import |
1211 | 40112 | #: report:pl.account.horizontal:0 | 40174 | #: report:pl.account.horizontal:0 |
1212 | 40113 | #: report:pl.account:0 | 40175 | #: report:pl.account:0 |
1213 | 40176 | #: field:abstract.wizard.import,end_date:0 | ||
1214 | 40177 | #: field:wizard.import.batch,end_date:0 | ||
1215 | 40114 | #, python-format | 40178 | #, python-format |
1216 | 40115 | msgid "End Date" | 40179 | msgid "End Date" |
1217 | 40116 | msgstr "Date de fin" | 40180 | msgstr "Date de fin" |
1218 | @@ -43796,6 +43860,17 @@ | |||
1219 | 43796 | #: field:real.average.consumption,state:0 | 43860 | #: field:real.average.consumption,state:0 |
1220 | 43797 | #: field:msf.doc.import.accounting,state:0 | 43861 | #: field:msf.doc.import.accounting,state:0 |
1221 | 43798 | #: field:wizard.import.po,state:0 | 43862 | #: field:wizard.import.po,state:0 |
1222 | 43863 | #: field:abstract.wizard.import,state:0 | ||
1223 | 43864 | #: field:wizard.import.auto.supply.line,state:0 | ||
1224 | 43865 | #: field:wizard.import.batch,state:0 | ||
1225 | 43866 | #: field:wizard.import.in.simulation.screen,state:0 | ||
1226 | 43867 | #: field:wizard.import.order.cycle.line,state:0 | ||
1227 | 43868 | #: field:wizard.import.pick.line,state:0 | ||
1228 | 43869 | #: field:wizard.import.po.simulation.screen,state:0 | ||
1229 | 43870 | #: field:wizard.import.product.list,state:0 | ||
1230 | 43871 | #: field:wizard.import.stock.warehouse.orderpoint.line,state:0 | ||
1231 | 43872 | #: field:wizard.import.supplier.catalogue,state:0 | ||
1232 | 43873 | #: field:wizard.import.threshold.value.line,state:0 | ||
1233 | 43799 | msgid "State" | 43874 | msgid "State" |
1234 | 43800 | msgstr "État" | 43875 | msgstr "État" |
1235 | 43801 | 43876 | ||
1236 | @@ -54493,6 +54568,54 @@ | |||
1237 | 54493 | #: code:addons/register_accounting/wizard/wizard_register_import.py:258 | 54568 | #: code:addons/register_accounting/wizard/wizard_register_import.py:258 |
1238 | 54494 | #: code:addons/register_accounting/wizard/wizard_register_import.py:265 | 54569 | #: code:addons/register_accounting/wizard/wizard_register_import.py:265 |
1239 | 54495 | #: selection:wizard.register.import,state:0 | 54570 | #: selection:wizard.register.import,state:0 |
1240 | 54571 | #: code:addons/msf_doc_import/account.py:72 | ||
1241 | 54572 | #: code:addons/msf_doc_import/account.py:201 | ||
1242 | 54573 | #: code:addons/msf_doc_import/account.py:234 | ||
1243 | 54574 | #: code:addons/msf_doc_import/account.py:480 | ||
1244 | 54575 | #: code:addons/msf_doc_import/stock_picking.py:60 | ||
1245 | 54576 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:60 | ||
1246 | 54577 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:296 | ||
1247 | 54578 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:321 | ||
1248 | 54579 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:327 | ||
1249 | 54580 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:333 | ||
1250 | 54581 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:352 | ||
1251 | 54582 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:379 | ||
1252 | 54583 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:77 | ||
1253 | 54584 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:254 | ||
1254 | 54585 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:258 | ||
1255 | 54586 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:785 | ||
1256 | 54587 | #: code:addons/msf_doc_import/wizard/stock_partial_picking.py:788 | ||
1257 | 54588 | #: code:addons/msf_doc_import/wizard/wizard_delete_lines.py:78 | ||
1258 | 54589 | #: code:addons/msf_doc_import/wizard/wizard_delete_lines.py:612 | ||
1259 | 54590 | #: code:addons/msf_doc_import/wizard/wizard_import_auto_supply_line.py:140 | ||
1260 | 54591 | #: code:addons/msf_doc_import/wizard/wizard_import_auto_supply_line.py:157 | ||
1261 | 54592 | #: code:addons/msf_doc_import/wizard/wizard_import_order_cycle_line.py:141 | ||
1262 | 54593 | #: code:addons/msf_doc_import/wizard/wizard_import_order_cycle_line.py:154 | ||
1263 | 54594 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:165 | ||
1264 | 54595 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:174 | ||
1265 | 54596 | #: code:addons/msf_doc_import/wizard/wizard_import_picking_line.py:183 | ||
1266 | 54597 | #: code:addons/msf_doc_import/wizard/wizard_import_product_list.py:81 | ||
1267 | 54598 | #: code:addons/msf_doc_import/wizard/wizard_import_stock_warehouse_order_point_line.py:162 | ||
1268 | 54599 | #: code:addons/msf_doc_import/wizard/wizard_import_stock_warehouse_order_point_line.py:170 | ||
1269 | 54600 | #: code:addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py:164 | ||
1270 | 54601 | #: code:addons/msf_doc_import/wizard/wizard_import_threshold_value_line.py:145 | ||
1271 | 54602 | #: code:addons/msf_doc_import/wizard/wizard_import_threshold_value_line.py:153 | ||
1272 | 54603 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:263 | ||
1273 | 54604 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:270 | ||
1274 | 54605 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:275 | ||
1275 | 54606 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:341 | ||
1276 | 54607 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:346 | ||
1277 | 54608 | #: selection:msf.doc.import.accounting,state:0 | ||
1278 | 54609 | #: field:purchase.import.xml.line,error_list:0 | ||
1279 | 54610 | #: field:purchase.line.import.xml.line,error_list:0 | ||
1280 | 54611 | #: view:sale.order:0 | ||
1281 | 54612 | #: view:sale.order.line:0 | ||
1282 | 54613 | #: field:tender.line,inactive_error:0 | ||
1283 | 54614 | #: selection:wizard.import.in.line.simulation.screen,type_change:0 | ||
1284 | 54615 | #: selection:wizard.import.in.simulation.screen,state:0 | ||
1285 | 54616 | #: selection:wizard.import.po.simulation.screen,state:0 | ||
1286 | 54617 | #: selection:wizard.import.po.simulation.screen.line,type_change:0 | ||
1287 | 54618 | #: selection:wizard.simu.import.po.line,change_type:0 | ||
1288 | 54496 | #, python-format | 54619 | #, python-format |
1289 | 54497 | msgid "Error" | 54620 | msgid "Error" |
1290 | 54498 | msgstr "Erreur" | 54621 | msgstr "Erreur" |
1291 | @@ -61471,6 +61594,13 @@ | |||
1292 | 61471 | msgid "Information" | 61594 | msgid "Information" |
1293 | 61472 | msgstr "Information" | 61595 | msgstr "Information" |
1294 | 61473 | 61596 | ||
1295 | 61597 | #. module: msf_doc_import | ||
1296 | 61598 | #: field:abstract.wizard.import,info_message:0 | ||
1297 | 61599 | #: view:wizard.import.batch:0 | ||
1298 | 61600 | #: field:wizard.import.batch,info_message:0 | ||
1299 | 61601 | msgid "Information" | ||
1300 | 61602 | msgstr "Informations" | ||
1301 | 61603 | |||
1302 | 61474 | #. module: base | 61604 | #. module: base |
1303 | 61475 | #: code:addons/base/module/wizard/base_language_install.py:55 | 61605 | #: code:addons/base/module/wizard/base_language_install.py:55 |
1304 | 61476 | #, python-format | 61606 | #, python-format |
1305 | @@ -64599,6 +64729,11 @@ | |||
1306 | 64599 | #: field:wizard.import.stock.warehouse.orderpoint.line,file:0 | 64729 | #: field:wizard.import.stock.warehouse.orderpoint.line,file:0 |
1307 | 64600 | #: view:wizard.import.threshold.value.line:0 | 64730 | #: view:wizard.import.threshold.value.line:0 |
1308 | 64601 | #: field:wizard.import.threshold.value.line,file:0 | 64731 | #: field:wizard.import.threshold.value.line,file:0 |
1309 | 64732 | #: field:abstract.wizard.import,import_file:0 | ||
1310 | 64733 | #: field:wizard.import.batch,import_file:0 | ||
1311 | 64734 | #: field:wizard.import.in.simulation.screen,file_to_import:0 | ||
1312 | 64735 | #: view:wizard.import.supplier.catalogue:0 | ||
1313 | 64736 | #: field:wizard.import.supplier.catalogue,file:0 | ||
1314 | 64602 | msgid "File to import" | 64737 | msgid "File to import" |
1315 | 64603 | msgstr "Fichier à importer" | 64738 | msgstr "Fichier à importer" |
1316 | 64604 | 64739 | ||
1317 | @@ -73821,6 +73956,7 @@ | |||
1318 | 73821 | #, python-format | 73956 | #, python-format |
1319 | 73822 | msgid "Not Created" | 73957 | msgid "Not Created" |
1320 | 73823 | msgstr "Non Créé" | 73958 | msgstr "Non Créé" |
1321 | 73959 | <<<<<<< TREE | ||
1322 | 73824 | 73960 | ||
1323 | 73825 | #. module: account | 73961 | #. module: account |
1324 | 73826 | #: code:addons/account/wizard/account_subscription_generate.py:0 | 73962 | #: code:addons/account/wizard/account_subscription_generate.py:0 |
1325 | @@ -73859,3 +73995,427 @@ | |||
1326 | 73859 | #, python-format | 73995 | #, python-format |
1327 | 73860 | msgid "PatchFailed: A script during upgrade has failed. Synchronization is forbidden. Please contact your administrator" | 73996 | msgid "PatchFailed: A script during upgrade has failed. Synchronization is forbidden. Please contact your administrator" |
1328 | 73861 | msgstr "PatchFailed: Un script a échoué pendant la mise à jour. La synchronizsation est désactivée. Veuillez contacter votre administrateur" | 73997 | msgstr "PatchFailed: Un script a échoué pendant la mise à jour. La synchronizsation est désactivée. Veuillez contacter votre administrateur" |
1329 | 73998 | ======= | ||
1330 | 73999 | |||
1331 | 74000 | #. module: msf_doc_import | ||
1332 | 74001 | #: model:ir.actions.act_window,name:msf_doc_import.action_wizard_import_batch | ||
1333 | 74002 | #: model:ir.ui.menu,name:msf_doc_import.menu_action_wizard_import_batch | ||
1334 | 74003 | #: view:wizard.import.batch:0 | ||
1335 | 74004 | msgid "Import Batch Numbers" | ||
1336 | 74005 | msgstr "Importer Numéros de Lot" | ||
1337 | 74006 | |||
1338 | 74007 | #. module: msf_doc_import | ||
1339 | 74008 | #: view:wizard.import.batch:0 | ||
1340 | 74009 | msgid "Select a file to import: " | ||
1341 | 74010 | msgstr "Sélectionnez un fichier à importer: " | ||
1342 | 74011 | |||
1343 | 74012 | #. module: msf_doc_import | ||
1344 | 74013 | #: view:wizard.import.batch:0 | ||
1345 | 74014 | msgid "Or download a template: " | ||
1346 | 74015 | msgstr "Ou téléchargez le modèle: " | ||
1347 | 74016 | |||
1348 | 74017 | #. module: msf_doc_import | ||
1349 | 74018 | #: view:wizard.import.batch:0 | ||
1350 | 74019 | msgid "Run import" | ||
1351 | 74020 | msgstr "Démarrer l'import" | ||
1352 | 74021 | |||
1353 | 74022 | #. module: msf_doc_import | ||
1354 | 74023 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:336 | ||
1355 | 74024 | #, python-format | ||
1356 | 74025 | msgid "No file to import. Please select a file or download the template file and fill it." | ||
1357 | 74026 | msgstr "Aucun fichier à importer. Veuillez sélectionner un fichier ou télécharger le modèle et le remplir." | ||
1358 | 74027 | |||
1359 | 74028 | #. module: msf_doc_import | ||
1360 | 74029 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:168 | ||
1361 | 74030 | #, python-format | ||
1362 | 74031 | msgid "The Type of the batch number should be 'Standard' or 'Internal'" | ||
1363 | 74032 | msgstr "Le type du numéro de lot doit être 'Standard' ou 'Interne'" | ||
1364 | 74033 | |||
1365 | 74034 | #. module: msf_doc_import | ||
1366 | 74035 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:166 | ||
1367 | 74036 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:171 | ||
1368 | 74037 | #, python-format | ||
1369 | 74038 | msgid "Standard" | ||
1370 | 74039 | msgstr "Standard" | ||
1371 | 74040 | |||
1372 | 74041 | #. module: msf_doc_import | ||
1373 | 74042 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:166 | ||
1374 | 74043 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:173 | ||
1375 | 74044 | #, python-format | ||
1376 | 74045 | msgid "Internal" | ||
1377 | 74046 | msgstr "Interne" | ||
1378 | 74047 | |||
1379 | 74048 | #. module: msf_doc_import | ||
1380 | 74049 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:187 | ||
1381 | 74050 | #, python-format | ||
1382 | 74051 | msgid "You cannot create a batch number for a product that is not 'Perishable' nor 'Batch mandatory'" | ||
1383 | 74052 | msgstr "Vous ne pouvez pas créer un numéro de lot pour un produit dont le numéro de lot ni la date d'expiration ne sont obligatoires" | ||
1384 | 74053 | |||
1385 | 74054 | #. module: msf_doc_import | ||
1386 | 74055 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:192 | ||
1387 | 74056 | #, python-format | ||
1388 | 74057 | msgid "You cannot create an 'Internal' batch number for a 'Batch mandatory' product" | ||
1389 | 74058 | msgstr "Vous ne pouvez pas créer un numéro de lot 'Interne' pour un produit dont le numéro de lot n'est pas obligatoire" | ||
1390 | 74059 | |||
1391 | 74060 | #. module: msf_doc_import | ||
1392 | 74061 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:197 | ||
1393 | 74062 | #, python-format | ||
1394 | 74063 | msgid "You cannot create a 'Standard' batch number for a non 'Batch mandatory' product" | ||
1395 | 74064 | msgstr "Vous ne pouvez pas créer un numéro de lot 'Standard' pour un produit dont le numéro de lot n'est pas obligatoire" | ||
1396 | 74065 | |||
1397 | 74066 | #. module: msf_doc_import | ||
1398 | 74067 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:202 | ||
1399 | 74068 | #, python-format | ||
1400 | 74069 | msgid "For a 'Standard' batch number, you have to define value in the 'Name' column" | ||
1401 | 74070 | msgstr "Pour un numéro de lot 'Standard', vous devez définir une valeur dans la colonne 'Nom'" | ||
1402 | 74071 | |||
1403 | 74072 | #. module: msf_doc_import | ||
1404 | 74073 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:1147 | ||
1405 | 74074 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:1222 | ||
1406 | 74075 | #, python-format | ||
1407 | 74076 | msgid "A batch is defined on the imported file but the product doesn't require batch number - Batch ignored" | ||
1408 | 74077 | msgstr "Un numéro de lot est défini dans le fichier importé mais le produit ne requiert pas de numéro de lot - Numéro de lot ignoré" | ||
1409 | 74078 | |||
1410 | 74079 | #. module: msf_doc_import | ||
1411 | 74080 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:225 | ||
1412 | 74081 | #, python-format | ||
1413 | 74082 | msgid "Name of the batch will be ignored because the batch is 'Internal' so name is created by the system" | ||
1414 | 74083 | msgstr "Le nom du numéro de lot sera ignoré car le numéro de lot est 'Interne' danc le nom est créé par le système" | ||
1415 | 74084 | |||
1416 | 74085 | #. module: msf_doc_import | ||
1417 | 74086 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:218 | ||
1418 | 74087 | #, python-format | ||
1419 | 74088 | msgid "A batch number with the same parameters already exists in the system" | ||
1420 | 74089 | msgstr "Un numéro de lot avec les mêmes paramèters existe déjà dans le système" | ||
1421 | 74090 | |||
1422 | 74091 | #. module: msf_doc_import | ||
1423 | 74092 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:258 | ||
1424 | 74093 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:264 | ||
1425 | 74094 | #, python-format | ||
1426 | 74095 | msgid "Line %s: %s" | ||
1427 | 74096 | msgstr "Ligne %s : %s" | ||
1428 | 74097 | |||
1429 | 74098 | #. module: msf_doc_import | ||
1430 | 74099 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:54 | ||
1431 | 74100 | #, python-format | ||
1432 | 74101 | msgid "Defined type of header '%s' is not in the list of possible type: %s - Please contact\n" | ||
1433 | 74102 | "your support team and give us this message.\n" | ||
1434 | 74103 | " " | ||
1435 | 74104 | msgstr "Le type d'en-tête \'%s\' n'est pas dans la liste des types possibles : %s - Veuillez contacter\n" | ||
1436 | 74105 | "votre équipe de support et leur indiquer ce message.\n" | ||
1437 | 74106 | " " | ||
1438 | 74107 | |||
1439 | 74108 | #. module: msf_doc_import | ||
1440 | 74109 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:100 | ||
1441 | 74110 | #, python-format | ||
1442 | 74111 | msgid "The column '%s' is required" | ||
1443 | 74112 | msgstr "La colonne '%s' est obligatoire" | ||
1444 | 74113 | |||
1445 | 74114 | #. module: msf_doc_import | ||
1446 | 74115 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:120 | ||
1447 | 74116 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:122 | ||
1448 | 74117 | #, python-format | ||
1449 | 74118 | msgid "The date format was not correct" | ||
1450 | 74119 | msgstr "Le format de date n'est pas correct" | ||
1451 | 74120 | |||
1452 | 74121 | #. module: msf_doc_import | ||
1453 | 74122 | #: field:abstract.wizard.import,model_name:0 | ||
1454 | 74123 | #: field:wizard.import.batch,model_name:0 | ||
1455 | 74124 | msgid "Model to import" | ||
1456 | 74125 | msgstr "Modèle à importer" | ||
1457 | 74126 | |||
1458 | 74127 | #. module: msf_doc_import | ||
1459 | 74128 | #: field:abstract.wizard.import,parent_model_name:0 | ||
1460 | 74129 | #: field:wizard.import.batch,parent_model_name:0 | ||
1461 | 74130 | msgid "Model of the parent" | ||
1462 | 74131 | msgstr "Nodèle du parent" | ||
1463 | 74132 | |||
1464 | 74133 | #. module: msf_doc_import | ||
1465 | 74134 | #: help:abstract.wizard.import,parent_model_name:0 | ||
1466 | 74135 | #: help:wizard.import.batch,parent_model_name:0 | ||
1467 | 74136 | msgid "To go back to the parent when the window is closed" | ||
1468 | 74137 | msgstr "Pour revenir au parent quand la fenêtre est fermée" | ||
1469 | 74138 | |||
1470 | 74139 | #. module: msf_doc_import | ||
1471 | 74140 | #: field:abstract.wizard.import,parent_record_id:0 | ||
1472 | 74141 | #: field:wizard.import.batch,parent_record_id:0 | ||
1473 | 74142 | msgid "ID of the parent record" | ||
1474 | 74143 | msgstr "ID de l'enregistrement parent" | ||
1475 | 74144 | |||
1476 | 74145 | #. module: msf_doc_import | ||
1477 | 74146 | #: field:abstract.wizard.import,template_file:0 | ||
1478 | 74147 | #: field:wizard.import.batch,template_file:0 | ||
1479 | 74148 | msgid "Template file" | ||
1480 | 74149 | msgstr "Fichier modèle" | ||
1481 | 74150 | |||
1482 | 74151 | #. module: msf_doc_import | ||
1483 | 74152 | #: field:abstract.wizard.import,template_filename:0 | ||
1484 | 74153 | #: field:wizard.import.batch,template_filename:0 | ||
1485 | 74154 | msgid "Template filename" | ||
1486 | 74155 | msgstr "Nom du fichier modèle" | ||
1487 | 74156 | |||
1488 | 74157 | #. module: msf_doc_import | ||
1489 | 74158 | #: field:abstract.wizard.import,error_message:0 | ||
1490 | 74159 | #: field:msf.doc.import.accounting,error_ids:0 | ||
1491 | 74160 | #: field:wizard.import.batch,error_message:0 | ||
1492 | 74161 | msgid "Errors" | ||
1493 | 74162 | msgstr "Erreurs" | ||
1494 | 74163 | |||
1495 | 74164 | #. module: msf_doc_import | ||
1496 | 74165 | #: field:abstract.wizard.import,warning_message:0 | ||
1497 | 74166 | #: field:wizard.import.batch,warning_message:0 | ||
1498 | 74167 | msgid "Warnings" | ||
1499 | 74168 | msgstr "Avertissements" | ||
1500 | 74169 | |||
1501 | 74170 | #. module: msf_doc_import | ||
1502 | 74171 | #: field:abstract.wizard.import,total_lines_to_import:0 | ||
1503 | 74172 | #: field:wizard.import.batch,total_lines_to_import:0 | ||
1504 | 74173 | msgid "# of lines to import" | ||
1505 | 74174 | msgstr "# de ligens à importer" | ||
1506 | 74175 | |||
1507 | 74176 | #. module: msf_doc_import | ||
1508 | 74177 | #: field:abstract.wizard.import,total_lines_imported:0 | ||
1509 | 74178 | #: field:wizard.import.batch,total_lines_imported:0 | ||
1510 | 74179 | msgid "# of lines imported" | ||
1511 | 74180 | msgstr "# de lignes importées" | ||
1512 | 74181 | |||
1513 | 74182 | #. module: msf_doc_import | ||
1514 | 74183 | #: selection:abstract.wizard.import,state:0 | ||
1515 | 74184 | #: selection:wizard.import.batch,state:0 | ||
1516 | 74185 | msgid "Not started" | ||
1517 | 74186 | msgstr "Non démarré" | ||
1518 | 74187 | |||
1519 | 74188 | #. module: msf_doc_import | ||
1520 | 74189 | #: selection:wizard.import.auto.supply.line,state:0 | ||
1521 | 74190 | #: selection:wizard.import.order.cycle.line,state:0 | ||
1522 | 74191 | #: selection:wizard.import.pick.line,state:0 | ||
1523 | 74192 | #: selection:wizard.import.product.list,state:0 | ||
1524 | 74193 | #: selection:wizard.import.stock.warehouse.orderpoint.line,state:0 | ||
1525 | 74194 | #: selection:wizard.import.supplier.catalogue,state:0 | ||
1526 | 74195 | #: selection:wizard.import.threshold.value.line,state:0 | ||
1527 | 74196 | msgid "In Progress" | ||
1528 | 74197 | msgstr "En cours" | ||
1529 | 74198 | |||
1530 | 74199 | #. module: msf_doc_import | ||
1531 | 74200 | #: selection:abstract.wizard.import,state:0 | ||
1532 | 74201 | #: selection:wizard.import.auto.supply.line,state:0 | ||
1533 | 74202 | #: selection:wizard.import.batch,state:0 | ||
1534 | 74203 | #: selection:wizard.import.in.simulation.screen,state:0 | ||
1535 | 74204 | #: selection:wizard.import.order.cycle.line,state:0 | ||
1536 | 74205 | #: selection:wizard.import.pick.line,state:0 | ||
1537 | 74206 | #: selection:wizard.import.po.simulation.screen,state:0 | ||
1538 | 74207 | #: selection:wizard.import.product.list,state:0 | ||
1539 | 74208 | #: selection:wizard.import.stock.warehouse.orderpoint.line,state:0 | ||
1540 | 74209 | #: selection:wizard.import.supplier.catalogue,state:0 | ||
1541 | 74210 | #: selection:wizard.import.threshold.value.line,state:0 | ||
1542 | 74211 | msgid "Done" | ||
1543 | 74212 | msgstr "Terminé" | ||
1544 | 74213 | |||
1545 | 74214 | #. module: msf_doc_import | ||
1546 | 74215 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:280 | ||
1547 | 74216 | #, python-format | ||
1548 | 74217 | msgid "Not allowed" | ||
1549 | 74218 | msgstr "Non autorisé" | ||
1550 | 74219 | |||
1551 | 74220 | #. module: msf_doc_import | ||
1552 | 74221 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:281 | ||
1553 | 74222 | #, python-format | ||
1554 | 74223 | msgid "You cannot duplicate a %s document!" | ||
1555 | 74224 | msgstr "Vous ne pouvez pas dupliquer un document %s !" | ||
1556 | 74225 | |||
1557 | 74226 | #. module: msf_doc_import | ||
1558 | 74227 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:297 | ||
1559 | 74228 | #, python-format | ||
1560 | 74229 | msgid "No 'run_import' action is defined for the object '%s'!" | ||
1561 | 74230 | msgstr "Aucune action 'run_import' n'est définie pour l'objet '%s'!" | ||
1562 | 74231 | |||
1563 | 74232 | #. module: msf_doc_import | ||
1564 | 74233 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:328 | ||
1565 | 74234 | #, python-format | ||
1566 | 74235 | msgid "Import can be run only on draft wizard." | ||
1567 | 74236 | msgstr "L'important ne peut être effectué que sur des assistants en état 'Non démarré'" | ||
1568 | 74237 | |||
1569 | 74238 | #. module: msf_doc_import | ||
1570 | 74239 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:334 | ||
1571 | 74240 | #, python-format | ||
1572 | 74241 | msgid "The given file seems not to be encoding in UTF-8. Please check the encoding of the file and re-try." | ||
1573 | 74242 | msgstr "Le fichier donnée ne semble pas être encodé en UTF-8. Veuillez vérifier l'encodage du fichie et réessayez." | ||
1574 | 74243 | |||
1575 | 74244 | #. module: msf_doc_import | ||
1576 | 74245 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:396 | ||
1577 | 74246 | #, python-format | ||
1578 | 74247 | msgid "Line is empty" | ||
1579 | 74248 | msgstr "La ligne est vide" | ||
1580 | 74249 | |||
1581 | 74250 | #. module: msf_doc_import | ||
1582 | 74251 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:399 | ||
1583 | 74252 | #, python-format | ||
1584 | 74253 | msgid "Number of columns (%s) in the line are larger than expected (%s)." | ||
1585 | 74254 | msgstr "Le nombre de colonnes (%s) de la ligne est plus grand qu'attendu (%s)." | ||
1586 | 74255 | |||
1587 | 74256 | #. module: msf_doc_import | ||
1588 | 74257 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:428 | ||
1589 | 74258 | #, python-format | ||
1590 | 74259 | msgid "No product found for the code '%s'" | ||
1591 | 74260 | msgstr "Aucun produit trouvé pour le code '%s'" | ||
1592 | 74261 | |||
1593 | 74262 | #. module: msf_doc_import | ||
1594 | 74263 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:36 | ||
1595 | 74264 | #, python-format | ||
1596 | 74265 | msgid "get_import_batch_headers_name" | ||
1597 | 74266 | msgstr "Numéro de lot" | ||
1598 | 74267 | |||
1599 | 74268 | #. module: msf_doc_import | ||
1600 | 74269 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:37 | ||
1601 | 74270 | #, python-format | ||
1602 | 74271 | msgid "get_import_batch_headers_product_code" | ||
1603 | 74272 | msgstr "Code du produit" | ||
1604 | 74273 | |||
1605 | 74274 | #. module: msf_doc_import | ||
1606 | 74275 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:38 | ||
1607 | 74276 | #, python-format | ||
1608 | 74277 | msgid "get_import_batch_headers_product_desc" | ||
1609 | 74278 | msgstr "Description du produit" | ||
1610 | 74279 | |||
1611 | 74280 | #. module: msf_doc_import | ||
1612 | 74281 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:39 | ||
1613 | 74282 | #, python-format | ||
1614 | 74283 | msgid "get_import_batch_headers_life_date" | ||
1615 | 74284 | msgstr "Date d'expiration" | ||
1616 | 74285 | |||
1617 | 74286 | #. module: msf_doc_import | ||
1618 | 74287 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:40 | ||
1619 | 74288 | #, python-format | ||
1620 | 74289 | msgid "get_import_batch_headers_type" | ||
1621 | 74290 | msgstr "Type" | ||
1622 | 74291 | |||
1623 | 74292 | #. module: msf_doc_import | ||
1624 | 74293 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:285 | ||
1625 | 74294 | #, python-format | ||
1626 | 74295 | msgid "no data will be imported until all the error messages are corrected" | ||
1627 | 74296 | msgstr "aucune donnée ne sera importée tant que toutes les erreurs ne seront pas corrigées" | ||
1628 | 74297 | |||
1629 | 74298 | #. module: msf_doc_import | ||
1630 | 74299 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:37 | ||
1631 | 74300 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:54 | ||
1632 | 74301 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:57 | ||
1633 | 74302 | #: field:wizard.simu.import.po.line,import_product_code:0 | ||
1634 | 74303 | #: field:wizard.simu.import.po.line,initial_product_code:0 | ||
1635 | 74304 | #, python-format | ||
1636 | 74305 | msgid "Product Code" | ||
1637 | 74306 | msgstr "Code du produit" | ||
1638 | 74307 | |||
1639 | 74308 | #. module: msf_doc_import | ||
1640 | 74309 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:38 | ||
1641 | 74310 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:55 | ||
1642 | 74311 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:58 | ||
1643 | 74312 | #: field:wizard.simu.import.po.line,import_product_name:0 | ||
1644 | 74313 | #: field:wizard.simu.import.po.line,initial_product_name:0 | ||
1645 | 74314 | #, python-format | ||
1646 | 74315 | msgid "Product Description" | ||
1647 | 74316 | msgstr "Description du produit" | ||
1648 | 74317 | |||
1649 | 74318 | #. module: msf_doc_import | ||
1650 | 74319 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:39 | ||
1651 | 74320 | #, python-format | ||
1652 | 74321 | msgid "Life Date" | ||
1653 | 74322 | msgstr "Date d'expiration" | ||
1654 | 74323 | |||
1655 | 74324 | #. module: msf_doc_import | ||
1656 | 74325 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:40 | ||
1657 | 74326 | #, python-format | ||
1658 | 74327 | msgid "Type" | ||
1659 | 74328 | msgstr "Type" | ||
1660 | 74329 | |||
1661 | 74330 | #. module: msf_doc_import | ||
1662 | 74331 | #: field:abstract.wizard.import,show_error:0 | ||
1663 | 74332 | #: field:wizard.import.batch,show_error:0 | ||
1664 | 74333 | msgid "Show error message ?" | ||
1665 | 74334 | msgstr "Voir les messages d'erreurs ?" | ||
1666 | 74335 | |||
1667 | 74336 | #. module: msf_doc_import | ||
1668 | 74337 | #: field:abstract.wizard.import,show_warning:0 | ||
1669 | 74338 | #: field:wizard.import.batch,show_warning:0 | ||
1670 | 74339 | msgid "Show warning message ?" | ||
1671 | 74340 | msgstr "Voir les avertissements ?" | ||
1672 | 74341 | |||
1673 | 74342 | #. module: msf_doc_import | ||
1674 | 74343 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:260 | ||
1675 | 74344 | #, python-format | ||
1676 | 74345 | msgid "Select a file to import and click on 'Run import' button." | ||
1677 | 74346 | msgstr "Sélectionnez un fichier à importer et cliquez sur le bouton 'Démarrer l'import'." | ||
1678 | 74347 | |||
1679 | 74348 | #. module: msf_doc_import | ||
1680 | 74349 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:276 | ||
1681 | 74350 | #, python-format | ||
1682 | 74351 | msgid "imported" | ||
1683 | 74352 | msgstr "importées" | ||
1684 | 74353 | |||
1685 | 74354 | #. module: msf_doc_import | ||
1686 | 74355 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:276 | ||
1687 | 74356 | #, python-format | ||
1688 | 74357 | msgid "without errors" | ||
1689 | 74358 | msgstr "sans erreurs" | ||
1690 | 74359 | |||
1691 | 74360 | #. module: msf_doc_import | ||
1692 | 74361 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:269 | ||
1693 | 74362 | #, python-format | ||
1694 | 74363 | msgid "Processing of file completed in %s second(s)!\n" | ||
1695 | 74364 | "- Total lines to import: %s\n" | ||
1696 | 74365 | "- Total lines %s: %s %s\n" | ||
1697 | 74366 | "- Total lines with errors: %s %s\n" | ||
1698 | 74367 | "%s\n" | ||
1699 | 74368 | " " | ||
1700 | 74369 | msgstr "Traitement du fichier terminé en %s seconde(s) !\n" | ||
1701 | 74370 | "- Nombre de lignes à importer : %s\n" | ||
1702 | 74371 | "- Nombre de lignes %s : %s %s\n" | ||
1703 | 74372 | "- Nombre de lignes avec erreurs : %s %s\n" | ||
1704 | 74373 | "%s\n" | ||
1705 | 74374 | " " | ||
1706 | 74375 | |||
1707 | 74376 | #. module: msf_doc_import | ||
1708 | 74377 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:279 | ||
1709 | 74378 | #, python-format | ||
1710 | 74379 | msgid "(%s line(s) with warning - see warning messages below)" | ||
1711 | 74380 | msgstr "(%s ligne(s) avec des avertissements - voir les avertissements ci-dessous)" | ||
1712 | 74381 | |||
1713 | 74382 | #. module: msf_doc_import | ||
1714 | 74383 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:283 | ||
1715 | 74384 | #, python-format | ||
1716 | 74385 | msgid "(see error messages below)" | ||
1717 | 74386 | msgstr "(voir les erreurs ci-dessous)" | ||
1718 | 74387 | |||
1719 | 74388 | #. module: msf_doc_import | ||
1720 | 74389 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:234 | ||
1721 | 74390 | #, python-format | ||
1722 | 74391 | msgid "Name of the batch will be ignored because the batch is 'Internal' so name is created by the system" | ||
1723 | 74392 | msgstr "Le nom du batch sera ignoré car le batch est 'Interne' donc son nom sera créé par le système" | ||
1724 | 74393 | |||
1725 | 74394 | #. module: msf_doc_import | ||
1726 | 74395 | #: view:wizard.import.batch:0 | ||
1727 | 74396 | msgid "Warning messages" | ||
1728 | 74397 | msgstr "Messages d'avertissement" | ||
1729 | 74398 | |||
1730 | 74399 | #. module: msf_doc_import | ||
1731 | 74400 | #: view:wizard.import.batch:0 | ||
1732 | 74401 | msgid "Error messages" | ||
1733 | 74402 | msgstr "Messages d'erreur" | ||
1734 | 74403 | |||
1735 | 74404 | #. module: msf_doc_import | ||
1736 | 74405 | #: code:addons/msf_doc_import/wizard/wizard_import_batch.py:104 | ||
1737 | 74406 | #, python-format | ||
1738 | 74407 | msgid "Import in progress, please leave this window open and press the button 'Update' to show the progression of the import. Otherwise, you can continue tu use Unifield" | ||
1739 | 74408 | msgstr "Traitement en cours, veuillez laisser cette fenêtre ouverte et cliquez sur le bouton 'Mettre à jour' pour voir la progression de l'import. Sinon, vous pouvez continuer d'utiliser Unifield" | ||
1740 | 74409 | |||
1741 | 74410 | #. module: msf_doc_import | ||
1742 | 74411 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:385 | ||
1743 | 74412 | #, python-format | ||
1744 | 74413 | msgid "The column '%s' of the Excel file should be '%s', not '%s'." | ||
1745 | 74414 | msgstr "La colonne '%s' du fichier Excel doit être '%s', pas '%s'." | ||
1746 | 74415 | |||
1747 | 74416 | #. module: msf_doc_import | ||
1748 | 74417 | #: code:addons/msf_doc_import/wizard/abstract_wizard_import.py:381 | ||
1749 | 74418 | #, python-format | ||
1750 | 74419 | msgid "The column '%s' is not present in the file." | ||
1751 | 74420 | msgstr "La colonne '%s' n'est pas présente dans le fichier." | ||
1752 | 74421 | >>>>>>> MERGE-SOURCE | ||
1753 | 73862 | 74422 | ||
1754 | === modified file 'bin/addons/purchase_override/purchase.py' | |||
1755 | --- bin/addons/purchase_override/purchase.py 2016-08-03 16:06:05 +0000 | |||
1756 | +++ bin/addons/purchase_override/purchase.py 2016-08-18 14:00:36 +0000 | |||
1757 | @@ -2617,8 +2617,8 @@ | |||
1758 | 2617 | help='Header level dates has to be populated by default with the possibility of manual updates'), | 2617 | help='Header level dates has to be populated by default with the possibility of manual updates'), |
1759 | 2618 | 'name': fields.function(_get_name, method=True, type='char', string='Name', store=False), | 2618 | 'name': fields.function(_get_name, method=True, type='char', string='Name', store=False), |
1760 | 2619 | } | 2619 | } |
1761 | 2620 | def create(self, cr, uid, vals, context=None): | ||
1762 | 2620 | 2621 | ||
1763 | 2621 | def create(self, cr, uid, vals, context=None): | ||
1764 | 2622 | ''' | 2622 | ''' |
1765 | 2623 | Set the line number to 0 | 2623 | Set the line number to 0 |
1766 | 2624 | ''' | 2624 | ''' |
1767 | 2625 | 2625 | ||
1768 | === modified file 'bin/addons/report_webkit/webkit_report.py' | |||
1769 | --- bin/addons/report_webkit/webkit_report.py 2016-02-16 15:18:57 +0000 | |||
1770 | +++ bin/addons/report_webkit/webkit_report.py 2016-08-18 14:00:36 +0000 | |||
1771 | @@ -41,7 +41,9 @@ | |||
1772 | 41 | import netsvc | 41 | import netsvc |
1773 | 42 | import pooler | 42 | import pooler |
1774 | 43 | from report_helper import WebKitHelper | 43 | from report_helper import WebKitHelper |
1776 | 44 | from report.report_sxw import report_sxw, report_rml, _int_format, _float_format, _date_format, _dttime_format, browse_record_list | 44 | from report.report_sxw import report_sxw, report_rml, _int_format, \ |
1777 | 45 | _float_format, _date_format, _dttime_format, browse_record_list, \ | ||
1778 | 46 | rml_parse | ||
1779 | 45 | import addons | 47 | import addons |
1780 | 46 | import tools | 48 | import tools |
1781 | 47 | from tools.translate import _ | 49 | from tools.translate import _ |
1782 | @@ -412,3 +414,18 @@ | |||
1783 | 412 | if not result: | 414 | if not result: |
1784 | 413 | return (False,False) | 415 | return (False,False) |
1785 | 414 | return result | 416 | return result |
1786 | 417 | |||
1787 | 418 | |||
1788 | 419 | class XlsWebKitParser(WebKitParser): | ||
1789 | 420 | def __init__(self, name, table, rml=False, parser=rml_parse, header='external', store=False): | ||
1790 | 421 | WebKitParser.__init__(self, name, table, rml=rml, parser=parser, header=header, store=store) | ||
1791 | 422 | |||
1792 | 423 | def create_single_pdf(self, cr, uid, ids, data, report_xml, context=None): | ||
1793 | 424 | report_xml.webkit_debug = 1 | ||
1794 | 425 | report_xml.header = " " | ||
1795 | 426 | report_xml.webkit_header.html = "${_debug or ''|n}" | ||
1796 | 427 | return super(XlsWebKitParser, self).create_single_pdf(cr, uid, ids, data, report_xml, context) | ||
1797 | 428 | |||
1798 | 429 | def create(self, cr, uid, ids, data, context=None): | ||
1799 | 430 | a = super(XlsWebKitParser, self).create(cr, uid, ids, data, context) | ||
1800 | 431 | return (a[0], 'xls') | ||
1801 | 415 | 432 | ||
1802 | === modified file 'bin/addons/spreadsheet_xml/spreadsheet_xml.py' | |||
1803 | --- bin/addons/spreadsheet_xml/spreadsheet_xml.py 2014-11-05 08:06:06 +0000 | |||
1804 | +++ bin/addons/spreadsheet_xml/spreadsheet_xml.py 2016-08-18 14:00:36 +0000 | |||
1805 | @@ -130,6 +130,9 @@ | |||
1806 | 130 | ret.append(self.get(wb, 'Name')) | 130 | ret.append(self.get(wb, 'Name')) |
1807 | 131 | return ret | 131 | return ret |
1808 | 132 | 132 | ||
1809 | 133 | def getNbRows(self,worksheet=1): | ||
1810 | 134 | return len(self.xmlobj.xpath('//ss:Worksheet[%d]/ss:Table[1]/ss:Row' % (worksheet,), **self.xa)) | ||
1811 | 135 | |||
1812 | 133 | def getRows(self,worksheet=1): | 136 | def getRows(self,worksheet=1): |
1813 | 134 | table = self.xmlobj.xpath('//ss:Worksheet[%d]/ss:Table[1]'%(worksheet, ), **self.xa) | 137 | table = self.xmlobj.xpath('//ss:Worksheet[%d]/ss:Table[1]'%(worksheet, ), **self.xa) |
1814 | 135 | return SpreadsheetRow(table[0].getiterator(etree.QName(self.defaultns, 'Row'))) | 138 | return SpreadsheetRow(table[0].getiterator(etree.QName(self.defaultns, 'Row'))) |