Merge lp:~dorian-kemps/unifield-server/US-5755 into lp:unifield-server
- US-5755
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5297 |
Proposed branch: | lp:~dorian-kemps/unifield-server/US-5755 |
Merge into: | lp:unifield-server |
Diff against target: |
269 lines (+66/-31) 3 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+22/-3) bin/addons/msf_supply_doc_export/report/report_pick_export_xls.mako (+6/-2) bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py (+38/-26) |
To merge this branch: | bzr merge lp:~dorian-kemps/unifield-server/US-5755 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+363563@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2019-02-19 14:49:35 +0000 | |||
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2019-02-25 14:57:39 +0000 | |||
4 | @@ -62807,12 +62807,13 @@ | |||
5 | 62807 | msgid "Virgin Islands (British)" | 62807 | msgid "Virgin Islands (British)" |
6 | 62808 | msgstr "Iles Vierges (Britanniques)" | 62808 | msgstr "Iles Vierges (Britanniques)" |
7 | 62809 | 62809 | ||
9 | 62810 | #. modules: msf_doc_import, kit, sale | 62810 | #. modules: msf_doc_import, kit, sale, msf_supply_doc_export |
10 | 62811 | #: code:addons/kit/wizard/kit_mass_import.py:210 | 62811 | #: code:addons/kit/wizard/kit_mass_import.py:210 |
11 | 62812 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:527 | 62812 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:527 |
12 | 62813 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:540 | 62813 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:540 |
13 | 62814 | #: code:addons/sale/wizard/internal_request_import.py:162 | 62814 | #: code:addons/sale/wizard/internal_request_import.py:162 |
14 | 62815 | #: code:addons/sale/wizard/internal_request_import.py:222 | 62815 | #: code:addons/sale/wizard/internal_request_import.py:222 |
15 | 62816 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:330 | ||
16 | 62816 | #, python-format | 62817 | #, python-format |
17 | 62817 | msgid "No file to import" | 62818 | msgid "No file to import" |
18 | 62818 | msgstr "Aucun fichier à importer" | 62819 | msgstr "Aucun fichier à importer" |
19 | @@ -105002,13 +105003,13 @@ | |||
20 | 105002 | #. module: msf_supply_doc_export | 105003 | #. module: msf_supply_doc_export |
21 | 105003 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:209 | 105004 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:209 |
22 | 105004 | #, python-format | 105005 | #, python-format |
24 | 105005 | msgid "Line %s: Given batch number with this expiry date doesn't exists in database" | 105006 | msgid "Line %s: The given batch number with this expiry date doesn't exist in database" |
25 | 105006 | msgstr "Ligne %s: Le numéro de lot avec cette date d'expiration n'existe pas en base" | 105007 | msgstr "Ligne %s: Le numéro de lot avec cette date d'expiration n'existe pas en base" |
26 | 105007 | 105008 | ||
27 | 105008 | #. module: msf_supply_doc_export | 105009 | #. module: msf_supply_doc_export |
28 | 105009 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:222 | 105010 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:222 |
29 | 105010 | #, python-format | 105011 | #, python-format |
31 | 105011 | msgid "Line %s: Given expiry date doesn't exists in database" | 105012 | msgid "Line %s: The given expiry date doesn't exist in database" |
32 | 105012 | msgstr "Ligne %s: La date d'expiration donnée n'existe pas en base" | 105013 | msgstr "Ligne %s: La date d'expiration donnée n'existe pas en base" |
33 | 105013 | 105014 | ||
34 | 105014 | #. module: msf_doc_import | 105015 | #. module: msf_doc_import |
35 | @@ -105310,3 +105311,21 @@ | |||
36 | 105310 | #, python-format | 105311 | #, python-format |
37 | 105311 | msgid "Document date (%s) should be in posting date FY" | 105312 | msgid "Document date (%s) should be in posting date FY" |
38 | 105312 | msgstr "La date du document (%s) doit être dans le même exercice comptable que la date de comptabilisation" | 105313 | msgstr "La date du document (%s) doit être dans le même exercice comptable que la date de comptabilisation" |
39 | 105314 | |||
40 | 105315 | #. module: msf_supply_doc_export | ||
41 | 105316 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:84 | ||
42 | 105317 | #, python-format | ||
43 | 105318 | msgid "Line %s: Column \"Qty Picked\" must be a number" | ||
44 | 105319 | msgstr "Ligne %s: La Colonne \"Qté prélevée\" doit être un nombre" | ||
45 | 105320 | |||
46 | 105321 | #. module: msf_supply_doc_export | ||
47 | 105322 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:95 | ||
48 | 105323 | #, python-format | ||
49 | 105324 | msgid "Line %s: Column \"Qty to Pick\" must be a number" | ||
50 | 105325 | msgstr "Ligne %s: La Colonne \"Qté à prélever\" doit être un nombre" | ||
51 | 105326 | |||
52 | 105327 | #. module: msf_supply_doc_export | ||
53 | 105328 | #: code:addons/msf_supply_doc_export/wizard/wizard_pick_import.py:346 | ||
54 | 105329 | #, python-format | ||
55 | 105330 | msgid "File line %s: Column \"Item\" must be an integer" | ||
56 | 105331 | msgstr "Fichier ligne %s: La Colonne \"Article\" doit être un entier" | ||
57 | 105313 | 105332 | ||
58 | === modified file 'bin/addons/msf_supply_doc_export/report/report_pick_export_xls.mako' | |||
59 | --- bin/addons/msf_supply_doc_export/report/report_pick_export_xls.mako 2019-01-29 10:21:42 +0000 | |||
60 | +++ bin/addons/msf_supply_doc_export/report/report_pick_export_xls.mako 2019-02-25 14:57:39 +0000 | |||
61 | @@ -169,11 +169,15 @@ | |||
62 | 169 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.sale_line_id and move.sale_line_id.product_id != move.product_id and '[%s] %s' % (move.product_id.default_code, move.product_id.name) or '' | x}</Data></Cell> | 169 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.sale_line_id and move.sale_line_id.product_id != move.product_id and '[%s] %s' % (move.product_id.default_code, move.product_id.name) or '' | x}</Data></Cell> |
63 | 170 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.comment or '' | x}</Data></Cell> | 170 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.comment or '' | x}</Data></Cell> |
64 | 171 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.location_id.name or '' | x}</Data></Cell> | 171 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.location_id.name or '' | x}</Data></Cell> |
66 | 172 | <Cell ss:StyleID="line" ><Data ss:Type="String">${formatLang(getStock(m) or 0.00) | x}</Data></Cell> | 172 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${getStock(move) or 0.00}</Data></Cell> |
67 | 173 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${move.product_qty or 0.00 | x}</Data></Cell> | 173 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${move.product_qty or 0.00 | x}</Data></Cell> |
68 | 174 | <Cell ss:StyleID="line" ><Data ss:Type="String">${0 | x}</Data></Cell> | 174 | <Cell ss:StyleID="line" ><Data ss:Type="String">${0 | x}</Data></Cell> |
69 | 175 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.prodlot_id and move.prodlot_id.name or '' | x}</Data></Cell> | 175 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.prodlot_id and move.prodlot_id.name or '' | x}</Data></Cell> |
71 | 176 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${move.expired_date or '' | n}T00:00:00.000</Data></Cell> | 176 | % if move.expired_date and isDate(move.expired_date): |
72 | 177 | <Cell ss:StyleID="short_date"><Data ss:Type="DateTime">${move.expired_date or '' | n}T00:00:00.000</Data></Cell> | ||
73 | 178 | % else: | ||
74 | 179 | <Cell ss:StyleID="line"><Data ss:Type="String"></Data></Cell> | ||
75 | 180 | % endif | ||
76 | 177 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.kc_check and _('Yes') or '' | x}</Data></Cell> | 181 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.kc_check and _('Yes') or '' | x}</Data></Cell> |
77 | 178 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.dg_check and _('Yes') or '' | x}</Data></Cell> | 182 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.dg_check and _('Yes') or '' | x}</Data></Cell> |
78 | 179 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.np_check and _('Yes') or '' | x}</Data></Cell> | 183 | <Cell ss:StyleID="line" ><Data ss:Type="String">${move.np_check and _('Yes') or '' | x}</Data></Cell> |
79 | 180 | 184 | ||
80 | === modified file 'bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py' | |||
81 | --- bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py 2019-02-15 10:46:11 +0000 | |||
82 | +++ bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py 2019-02-25 14:57:39 +0000 | |||
83 | @@ -60,6 +60,7 @@ | |||
84 | 60 | 'cs', | 60 | 'cs', |
85 | 61 | ] | 61 | ] |
86 | 62 | 62 | ||
87 | 63 | |||
88 | 63 | class wizard_pick_import(osv.osv_memory): | 64 | class wizard_pick_import(osv.osv_memory): |
89 | 64 | _name = 'wizard.pick.import' | 65 | _name = 'wizard.pick.import' |
90 | 65 | _description = 'PICK import wizard' | 66 | _description = 'PICK import wizard' |
91 | @@ -68,24 +69,33 @@ | |||
92 | 68 | 'picking_id': fields.many2one('stock.picking', string="PICK ref", required=True), | 69 | 'picking_id': fields.many2one('stock.picking', string="PICK ref", required=True), |
93 | 69 | 'picking_processor_id': fields.many2one('create.picking.processor', string="PICK processor ref"), | 70 | 'picking_processor_id': fields.many2one('create.picking.processor', string="PICK processor ref"), |
94 | 70 | 'validate_processor_id': fields.many2one('validate.picking.processor', string="PICK processor ref"), | 71 | 'validate_processor_id': fields.many2one('validate.picking.processor', string="PICK processor ref"), |
96 | 71 | 'import_file': fields.binary('PICK import file'), | 72 | 'import_file': fields.binary('PICK import file', required=True), |
97 | 72 | } | 73 | } |
98 | 73 | 74 | ||
102 | 74 | 75 | def normalize_data(self, cr, uid, data): | |
103 | 75 | def normalize_data(self, cr, uid, data, xls_line_number): | 76 | if 'qty_picked' in data: # set to float |
101 | 76 | if 'qty_picked' in data: # set to float | ||
104 | 77 | if not data['qty_picked']: | 77 | if not data['qty_picked']: |
105 | 78 | data['qty_picked'] = 0.0 | 78 | data['qty_picked'] = 0.0 |
106 | 79 | if isinstance(data['qty_picked'], (str,unicode)): | 79 | if isinstance(data['qty_picked'], (str,unicode)): |
108 | 80 | data['qty_picked'] = float(data['qty_picked']) | 80 | try: |
109 | 81 | data['qty_picked'] = float(data['qty_picked']) | ||
110 | 82 | except: | ||
111 | 83 | raise osv.except_osv( | ||
112 | 84 | _('Error'), _('Line %s: Column "Qty Picked" must be a number') % data['item'] | ||
113 | 85 | ) | ||
114 | 81 | 86 | ||
116 | 82 | if 'qty_to_pick' in data: # set to float | 87 | if 'qty_to_pick' in data: # set to float |
117 | 83 | if not data['qty_to_pick']: | 88 | if not data['qty_to_pick']: |
118 | 84 | data['qty_to_pick'] = 0.0 | 89 | data['qty_to_pick'] = 0.0 |
119 | 85 | if isinstance(data['qty_to_pick'], (str,unicode)): | 90 | if isinstance(data['qty_to_pick'], (str,unicode)): |
121 | 86 | data['qty_to_pick'] = float(data['qty_to_pick']) | 91 | try: |
122 | 92 | data['qty_to_pick'] = float(data['qty_to_pick']) | ||
123 | 93 | except: | ||
124 | 94 | raise osv.except_osv( | ||
125 | 95 | _('Error'), _('Line %s: Column "Qty to Pick" must be a number') % data['item'] | ||
126 | 96 | ) | ||
127 | 87 | 97 | ||
129 | 88 | if 'batch' in data: # set to str | 98 | if 'batch' in data: # set to str |
130 | 89 | if not data['batch']: | 99 | if not data['batch']: |
131 | 90 | data['batch'] = '' | 100 | data['batch'] = '' |
132 | 91 | 101 | ||
133 | @@ -97,18 +107,17 @@ | |||
134 | 97 | data['expiry_date'] = datetime(data['expiry_date'].year, data['expiry_date'].month, data['expiry_date'].day) | 107 | data['expiry_date'] = datetime(data['expiry_date'].year, data['expiry_date'].month, data['expiry_date'].day) |
135 | 98 | except: | 108 | except: |
136 | 99 | raise osv.except_osv( | 109 | raise osv.except_osv( |
138 | 100 | _('Error'), _('Line %s: Column "Expiry Date" must be a date') % xls_line_number | 110 | _('Error'), _('Line %s: Column "Expiry Date" must be a date') % data['item'] |
139 | 101 | ) | 111 | ) |
140 | 102 | 112 | ||
141 | 103 | if data['qty_picked'] > data['qty_to_pick']: | 113 | if data['qty_picked'] > data['qty_to_pick']: |
142 | 104 | raise osv.except_osv( | 114 | raise osv.except_osv( |
143 | 105 | _('Error'), | 115 | _('Error'), |
145 | 106 | _('Line %s: Column "Qty Picked" cannot be greater than "Qty to pick"') % xls_line_number | 116 | _('Line %s: Column "Qty Picked" cannot be greater than "Qty to pick"') % data['item'] |
146 | 107 | ) | 117 | ) |
147 | 108 | 118 | ||
148 | 109 | return data | 119 | return data |
149 | 110 | 120 | ||
150 | 111 | |||
151 | 112 | def cancel(self, cr, uid, ids, context=None): | 121 | def cancel(self, cr, uid, ids, context=None): |
152 | 113 | if context is None: | 122 | if context is None: |
153 | 114 | context = {} | 123 | context = {} |
154 | @@ -125,7 +134,6 @@ | |||
155 | 125 | 'context': context, | 134 | 'context': context, |
156 | 126 | } | 135 | } |
157 | 127 | 136 | ||
158 | 128 | |||
159 | 129 | def get_matching_move(self, cr, uid, ids, wizard_id, move_proc_model, xls_line_number, line_data, product_id, location_id, picking_id, context=None): | 137 | def get_matching_move(self, cr, uid, ids, wizard_id, move_proc_model, xls_line_number, line_data, product_id, location_id, picking_id, context=None): |
160 | 130 | if context is None: | 138 | if context is None: |
161 | 131 | context = {} | 139 | context = {} |
162 | @@ -191,28 +199,26 @@ | |||
163 | 191 | else: | 199 | else: |
164 | 192 | raise osv.except_osv( | 200 | raise osv.except_osv( |
165 | 193 | _('Error'), | 201 | _('Error'), |
167 | 194 | _('Line %s: Matching move not found') % xls_line_number | 202 | _('Line %s: Matching move not found') % line_data['item'] |
168 | 195 | ) | 203 | ) |
169 | 196 | 204 | ||
170 | 197 | return move_proc_ids[0] | 205 | return move_proc_ids[0] |
171 | 198 | 206 | ||
174 | 199 | 207 | def checks_on_batch(self, cr, uid, ids, move_proc, line_data, context=None): | |
173 | 200 | def checks_on_batch(self, cr, uid, ids, move_proc, line_data, xls_line_number, context=None): | ||
175 | 201 | if context is None: | 208 | if context is None: |
176 | 202 | context = {} | 209 | context = {} |
177 | 203 | 210 | ||
178 | 204 | if move_proc.product_id.batch_management and not line_data['batch']: | 211 | if move_proc.product_id.batch_management and not line_data['batch']: |
179 | 205 | raise osv.except_osv( | 212 | raise osv.except_osv( |
180 | 206 | _('Error'), | 213 | _('Error'), |
182 | 207 | _('Line %s: Product is batch number mandatory and no batch number is given') % xls_line_number | 214 | _('Line %s: Product is batch number mandatory and no batch number is given') % line_data['item'] |
183 | 208 | ) | 215 | ) |
184 | 209 | if not move_proc.product_id.batch_management and move_proc.product_id.perishable and not line_data['expiry_date']: | 216 | if not move_proc.product_id.batch_management and move_proc.product_id.perishable and not line_data['expiry_date']: |
185 | 210 | raise osv.except_osv( | 217 | raise osv.except_osv( |
186 | 211 | _('Error'), | 218 | _('Error'), |
188 | 212 | _('Line %s: Product is expiry date mandatory and no expiry date is given') % xls_line_number | 219 | _('Line %s: Product is expiry date mandatory and no expiry date is given') % line_data['item'] |
189 | 213 | ) | 220 | ) |
190 | 214 | 221 | ||
191 | 215 | |||
192 | 216 | def get_import_data(self, cr, uid, ids, import_file, context=None): | 222 | def get_import_data(self, cr, uid, ids, import_file, context=None): |
193 | 217 | if context is None: | 223 | if context is None: |
194 | 218 | context = {} | 224 | context = {} |
195 | @@ -289,7 +295,7 @@ | |||
196 | 289 | 295 | ||
197 | 290 | import_data = {} | 296 | import_data = {} |
198 | 291 | for xls_line_number, line_data in sorted(import_data_lines.items()): | 297 | for xls_line_number, line_data in sorted(import_data_lines.items()): |
200 | 292 | line_data = self.normalize_data(cr, uid, line_data, xls_line_number) | 298 | line_data = self.normalize_data(cr, uid, line_data) |
201 | 293 | 299 | ||
202 | 294 | if line_data['item'] in ln_with_cancelled: # ignore cancelled/done lines | 300 | if line_data['item'] in ln_with_cancelled: # ignore cancelled/done lines |
203 | 295 | product_id = self.get_product_id(cr, uid, ids, line_data, context=context) | 301 | product_id = self.get_product_id(cr, uid, ids, line_data, context=context) |
204 | @@ -315,12 +321,13 @@ | |||
205 | 315 | _('The total quantity of line #%s in the import file doesn\'t match with the total qty on screen') % ln | 321 | _('The total quantity of line #%s in the import file doesn\'t match with the total qty on screen') % ln |
206 | 316 | ) | 322 | ) |
207 | 317 | 323 | ||
208 | 318 | |||
209 | 319 | def import_pick_xls(self, cr, uid, ids, context=None): | 324 | def import_pick_xls(self, cr, uid, ids, context=None): |
210 | 320 | if context is None: | 325 | if context is None: |
211 | 321 | context = {} | 326 | context = {} |
212 | 322 | 327 | ||
213 | 323 | wiz = self.browse(cr, uid, ids[0], context=context) | 328 | wiz = self.browse(cr, uid, ids[0], context=context) |
214 | 329 | if not wiz.import_file: | ||
215 | 330 | raise osv.except_osv(_('Error'), _('No file to import')) | ||
216 | 324 | import_file = SpreadsheetXML(xmlstring=base64.decodestring(wiz.import_file)) | 331 | import_file = SpreadsheetXML(xmlstring=base64.decodestring(wiz.import_file)) |
217 | 325 | res_model = 'create.picking.processor' if wiz.picking_processor_id else 'validate.picking.processor' | 332 | res_model = 'create.picking.processor' if wiz.picking_processor_id else 'validate.picking.processor' |
218 | 326 | move_proc_model = 'create.picking.move.processor' if wiz.picking_processor_id else 'validate.move.processor' | 333 | move_proc_model = 'create.picking.move.processor' if wiz.picking_processor_id else 'validate.move.processor' |
219 | @@ -335,10 +342,15 @@ | |||
220 | 335 | self.check_matching_qty_per_line_number(cr, uid, ids, import_data_lines, wiz, context=context) | 342 | self.check_matching_qty_per_line_number(cr, uid, ids, import_data_lines, wiz, context=context) |
221 | 336 | 343 | ||
222 | 337 | for xls_line_number, line_data in sorted(import_data_lines.items()): | 344 | for xls_line_number, line_data in sorted(import_data_lines.items()): |
223 | 345 | try: | ||
224 | 346 | line_data['item'] = int(line_data['item']) | ||
225 | 347 | except: | ||
226 | 348 | raise osv.except_osv(_('Error'), _('File line %s: Column "Item" must be an integer') % xls_line_number) | ||
227 | 349 | |||
228 | 338 | if line_data['qty_picked'] is None: | 350 | if line_data['qty_picked'] is None: |
230 | 339 | raise osv.except_osv(_('Error'), _('Line %s: Column "Qty Picked" should contains the quantity to process and cannot be empty, please fill it with "0" instead') % xls_line_number) | 351 | raise osv.except_osv(_('Error'), _('Line %s: Column "Qty Picked" should contains the quantity to process and cannot be empty, please fill it with "0" instead') % line_data['item']) |
231 | 340 | 352 | ||
233 | 341 | line_data = self.normalize_data(cr, uid, line_data, xls_line_number) | 353 | line_data = self.normalize_data(cr, uid, line_data) |
234 | 342 | 354 | ||
235 | 343 | if line_data['qty_picked'] and line_data['qty_to_pick']: | 355 | if line_data['qty_picked'] and line_data['qty_to_pick']: |
236 | 344 | product_id = self.get_product_id(cr, uid, ids, line_data, context=context) | 356 | product_id = self.get_product_id(cr, uid, ids, line_data, context=context) |
237 | @@ -350,7 +362,7 @@ | |||
238 | 350 | move_proc = self.pool.get(move_proc_model).browse(cr, uid, move_proc_id, context=context) | 362 | move_proc = self.pool.get(move_proc_model).browse(cr, uid, move_proc_id, context=context) |
239 | 351 | to_write = {} | 363 | to_write = {} |
240 | 352 | 364 | ||
242 | 353 | self.checks_on_batch(cr, uid, ids, move_proc, line_data, xls_line_number, context=context) | 365 | self.checks_on_batch(cr, uid, ids, move_proc, line_data, context=context) |
243 | 354 | 366 | ||
244 | 355 | to_write['quantity'] = line_data['qty_picked'] | 367 | to_write['quantity'] = line_data['qty_picked'] |
245 | 356 | 368 | ||
246 | @@ -366,12 +378,12 @@ | |||
247 | 366 | else: | 378 | else: |
248 | 367 | raise osv.except_osv( | 379 | raise osv.except_osv( |
249 | 368 | _('Error'), | 380 | _('Error'), |
251 | 369 | _('Line %s: Given batch number with this expiry date doesn\'t exists in database') % xls_line_number | 381 | _('Line %s: The given batch number with this expiry date doesn\'t exist in database') % line_data['item'] |
252 | 370 | ) | 382 | ) |
253 | 371 | else: | 383 | else: |
254 | 372 | raise osv.except_osv(_('Error'), | 384 | raise osv.except_osv(_('Error'), |
255 | 373 | _('Line %s: Product %s must have a batch number and an expiry date') | 385 | _('Line %s: Product %s must have a batch number and an expiry date') |
257 | 374 | % (xls_line_number, line_data['code'])) | 386 | % (line_data['item'], line_data['code'])) |
258 | 375 | elif not move_proc.product_id.batch_management and move_proc.product_id.perishable and line_data['expiry_date']: | 387 | elif not move_proc.product_id.batch_management and move_proc.product_id.perishable and line_data['expiry_date']: |
259 | 376 | prodlot_ids = self.pool.get('stock.production.lot').search(cr, uid, [ | 388 | prodlot_ids = self.pool.get('stock.production.lot').search(cr, uid, [ |
260 | 377 | ('life_date', '=', line_data['expiry_date']), | 389 | ('life_date', '=', line_data['expiry_date']), |
261 | @@ -383,7 +395,7 @@ | |||
262 | 383 | else: | 395 | else: |
263 | 384 | raise osv.except_osv( | 396 | raise osv.except_osv( |
264 | 385 | _('Error'), | 397 | _('Error'), |
266 | 386 | _('Line %s: Given expiry date doesn\'t exists in database') % xls_line_number | 398 | _('Line %s: The given expiry date doesn\'t exist in database') % line_data['item'] |
267 | 387 | ) | 399 | ) |
268 | 388 | 400 | ||
269 | 389 | self.pool.get(move_proc_model).write(cr, uid, [move_proc.id], to_write, context=context) | 401 | self.pool.get(move_proc_model).write(cr, uid, [move_proc.id], to_write, context=context) |