Merge lp:~unifield-team/unifield-server/us-1279 into lp:unifield-server
- us-1279
- Merge into trunk
Proposed by
Quentin THEURET @Amaris
Status: | Merged |
---|---|
Merged at revision: | 4024 |
Proposed branch: | lp:~unifield-team/unifield-server/us-1279 |
Merge into: | lp:unifield-server |
Diff against target: |
373 lines (+132/-20) (has conflicts) 9 files modified
bin/addons/msf_doc_import/check_line.py (+25/-1) bin/addons/msf_doc_import/purchase_order.py (+8/-1) bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml (+4/-1) bin/addons/msf_doc_import/wizard/__init__.py (+2/-2) bin/addons/msf_doc_import/wizard/wizard_import_po_line.py (+80/-15) bin/addons/msf_profile/i18n/fr_MF.po (+9/-0) bin/addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako (+2/-0) bin/addons/purchase_override/purchase.py (+1/-0) bin/addons/purchase_override/purchase_view.xml (+1/-0) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-1279 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email: mp+308611@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/msf_doc_import/check_line.py' | |||
2 | --- bin/addons/msf_doc_import/check_line.py 2016-04-19 09:48:16 +0000 | |||
3 | +++ bin/addons/msf_doc_import/check_line.py 2016-10-26 10:53:26 +0000 | |||
4 | @@ -286,7 +286,9 @@ | |||
5 | 286 | except IndexError: | 286 | except IndexError: |
6 | 287 | comment += _(' Product Code to be defined') | 287 | comment += _(' Product Code to be defined') |
7 | 288 | error_list.append(_('The Product\'s Code has to be defined')) | 288 | error_list.append(_('The Product\'s Code has to be defined')) |
9 | 289 | return {'default_code': default_code, 'proc_type': proc_type, 'comment': comment, 'error_list': error_list, 'price_unit': price_unit, 'cost_price': cost_price} | 289 | return { |
10 | 290 | 'default_code': default_code, 'proc_type': proc_type, 'comment': comment, 'error_list': error_list, 'price_unit': price_unit, | ||
11 | 291 | 'cost_price': cost_price, 'product_code':product_code} | ||
12 | 290 | 292 | ||
13 | 291 | 293 | ||
14 | 292 | def quantity_value(**kwargs): | 294 | def quantity_value(**kwargs): |
15 | @@ -611,6 +613,28 @@ | |||
16 | 611 | warning_list.append(_("No comment was defined")) | 613 | warning_list.append(_("No comment was defined")) |
17 | 612 | return {'comment': comment, 'warning_list': warning_list} | 614 | return {'comment': comment, 'warning_list': warning_list} |
18 | 613 | 615 | ||
19 | 616 | |||
20 | 617 | def line_number_value(**kwargs): | ||
21 | 618 | ''' | ||
22 | 619 | Retrives line number from Excel file | ||
23 | 620 | ''' | ||
24 | 621 | row = kwargs["row"] | ||
25 | 622 | cell_nb = kwargs['cell_nb'] | ||
26 | 623 | line_number = kwargs['to_write']['line_number'] | ||
27 | 624 | error_list = kwargs['to_write']['error_list'] | ||
28 | 625 | try: | ||
29 | 626 | if not row.cells[cell_nb]: | ||
30 | 627 | error_list.append(_("No line number was defined")) | ||
31 | 628 | elif row.cells[cell_nb].type != 'int': | ||
32 | 629 | error_list.append(_("The line number must be an integer")) | ||
33 | 630 | else: | ||
34 | 631 | line_number = row.cells[cell_nb].data | ||
35 | 632 | except IndexError: | ||
36 | 633 | error_list.append(_("No line number was defined")) | ||
37 | 634 | return {'line_number': line_number, 'error_list':error_list} | ||
38 | 635 | |||
39 | 636 | |||
40 | 637 | |||
41 | 614 | def check_lines_currency(rows, ccy_col_index, ccy_expected_code): | 638 | def check_lines_currency(rows, ccy_col_index, ccy_expected_code): |
42 | 615 | """ | 639 | """ |
43 | 616 | check rows currency | 640 | check rows currency |
44 | 617 | 641 | ||
45 | === modified file 'bin/addons/msf_doc_import/purchase_order.py' | |||
46 | --- bin/addons/msf_doc_import/purchase_order.py 2016-08-18 08:32:03 +0000 | |||
47 | +++ bin/addons/msf_doc_import/purchase_order.py 2016-10-26 10:53:26 +0000 | |||
48 | @@ -268,6 +268,13 @@ | |||
49 | 268 | if isinstance(ids, (int, long)): | 268 | if isinstance(ids, (int, long)): |
50 | 269 | ids = [ids] | 269 | ids = [ids] |
51 | 270 | context.update({'active_id': ids[0]}) | 270 | context.update({'active_id': ids[0]}) |
52 | 271 | |||
53 | 272 | # Check if we are in the case of update of sent RfQ | ||
54 | 273 | po = self.browse(cr, uid, [ids[0]], context=context)[0] | ||
55 | 274 | columns = columns_for_po_line_import | ||
56 | 275 | if not po.rfq_ok or po.state != 'rfq_sent': | ||
57 | 276 | columns = columns_for_po_line_import[1:] | ||
58 | 277 | |||
59 | 271 | columns_header = [(_(f[0]), f[1]) for f in columns_header_for_po_line_import] | 278 | columns_header = [(_(f[0]), f[1]) for f in columns_header_for_po_line_import] |
60 | 272 | default_template = SpreadsheetCreator('Template of import', columns_header, []) | 279 | default_template = SpreadsheetCreator('Template of import', columns_header, []) |
61 | 273 | file = base64.encodestring(default_template.get_xml(default_filters=['decode.utf8'])) | 280 | file = base64.encodestring(default_template.get_xml(default_filters=['decode.utf8'])) |
62 | @@ -275,7 +282,7 @@ | |||
63 | 275 | 'filename_template': 'template.xls', | 282 | 'filename_template': 'template.xls', |
64 | 276 | 'filename': 'Lines_Not_Imported.xls', | 283 | 'filename': 'Lines_Not_Imported.xls', |
65 | 277 | 'po_id': ids[0], | 284 | 'po_id': ids[0], |
67 | 278 | 'message': """%s %s""" % (_(GENERIC_MESSAGE), ', '.join([_(f) for f in columns_for_po_line_import]),), | 285 | 'message': """%s %s""" % (_(GENERIC_MESSAGE), ', '.join([_(f) for f in columns]),), |
68 | 279 | 'state': 'draft', }, | 286 | 'state': 'draft', }, |
69 | 280 | context) | 287 | context) |
70 | 281 | return {'type': 'ir.actions.act_window', | 288 | return {'type': 'ir.actions.act_window', |
71 | 282 | 289 | ||
72 | === modified file 'bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml' | |||
73 | --- bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml 2016-05-26 08:58:45 +0000 | |||
74 | +++ bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml 2016-10-26 10:53:26 +0000 | |||
75 | @@ -25,7 +25,7 @@ | |||
76 | 25 | <field name="soq_updated" invisible="1" readonly="1" /> | 25 | <field name="soq_updated" invisible="1" readonly="1" /> |
77 | 26 | </xpath> | 26 | </xpath> |
78 | 27 | <xpath expr="/form/notebook/page/field[@name='order_line']/tree" position="attributes" > | 27 | <xpath expr="/form/notebook/page/field[@name='order_line']/tree" position="attributes" > |
80 | 28 | <attribute name="colors">red:to_correct_ok == True or inactive_product == True; #C8C8C8: fake_state == 'cancel'; orange:product_qty == 0.00;blue: soq_updated == True</attribute> | 28 | <attribute name="colors">red:to_correct_ok == True or inactive_product == True or red_color == True; #C8C8C8: fake_state == 'cancel'; orange:product_qty == 0.00;blue: soq_updated == True</attribute> |
81 | 29 | </xpath> | 29 | </xpath> |
82 | 30 | <xpath expr="/form/notebook/page[@string='Notes']/field[@name='notes']" position="before"> | 30 | <xpath expr="/form/notebook/page[@string='Notes']/field[@name='notes']" position="before"> |
83 | 31 | <field name="import_in_progress" readonly="1" invisible="0" /> | 31 | <field name="import_in_progress" readonly="1" invisible="0" /> |
84 | @@ -42,6 +42,9 @@ | |||
85 | 42 | </field> | 42 | </field> |
86 | 43 | </xpath> | 43 | </xpath> |
87 | 44 | <xpath expr="/form/notebook/page[@string='Purchase Order']/field[@name='order_line']" position="before" > | 44 | <xpath expr="/form/notebook/page[@string='Purchase Order']/field[@name='order_line']" position="before" > |
88 | 45 | <button name="wizard_import_po_line" string="Import RfQ lines" icon="gtk-dnd" type="object" attrs="{'invisible':[('state', '!=', 'rfq_sent')]}"/> | ||
89 | 46 | </xpath> | ||
90 | 47 | <xpath expr="/form/notebook/page[@string='Purchase Order']/field[@name='order_line']" position="before" > | ||
91 | 45 | <group name="import" string=" Import Lines " colspan="1" col="4" attrs="{'invisible':[('state', '!=', 'draft')]}"> | 48 | <group name="import" string=" Import Lines " colspan="1" col="4" attrs="{'invisible':[('state', '!=', 'draft')]}"> |
92 | 46 | <button name="wizard_import_po_line" string="Import lines" icon="gtk-dnd" col="1" type="object" attrs="{'invisible':[('state', '!=', 'draft')]}"/> | 49 | <button name="wizard_import_po_line" string="Import lines" icon="gtk-dnd" col="1" type="object" attrs="{'invisible':[('state', '!=', 'draft')]}"/> |
93 | 47 | <button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="1" type="object" attrs="{'invisible': ['|', ('po_from_fo', '=', True), ('po_from_ir', '=', True)]}" /> | 50 | <button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="1" type="object" attrs="{'invisible': ['|', ('po_from_fo', '=', True), ('po_from_ir', '=', True)]}" /> |
94 | 48 | 51 | ||
95 | === modified file 'bin/addons/msf_doc_import/wizard/__init__.py' | |||
96 | --- bin/addons/msf_doc_import/wizard/__init__.py 2016-09-12 08:55:55 +0000 | |||
97 | +++ bin/addons/msf_doc_import/wizard/__init__.py 2016-10-26 10:53:26 +0000 | |||
98 | @@ -54,8 +54,8 @@ | |||
99 | 54 | #Important NOTE: I didn't set the fields of type date with the attribute 'date' (2nd part of the tuple) because for Excel, when a date is empty, the field becomes '1899-30-12' as default. So I set 'string' instead for the fields date. | 54 | #Important NOTE: I didn't set the fields of type date with the attribute 'date' (2nd part of the tuple) because for Excel, when a date is empty, the field becomes '1899-30-12' as default. So I set 'string' instead for the fields date. |
100 | 55 | 55 | ||
101 | 56 | PO_COLUMNS_HEADER_FOR_IMPORT=[ | 56 | PO_COLUMNS_HEADER_FOR_IMPORT=[ |
104 | 57 | (_('Product Code'), 'string'), (_('Product Description'), 'string'), (_('Quantity'), 'number'), (_('UoM'), 'string'), (_('Price'), 'number'), | 57 | (_('Line Number'), 'number'), (_('Product Code'), 'string'), (_('Product Description'), 'string'), (_('Quantity'), 'number'), (_('UoM'), 'string'), (_('Price'), 'number'), |
105 | 58 | (_('Delivery Request Date'), 'date'), (_('Currency'), 'string'), (_('Comment'), 'string'), (_('Justification Code'), 'string'), (_('Justification Coordination'), 'string'), (_('HQ Remarks'), 'string'), (_('Justification Y/N'), 'string')] | 58 | (_('Delivery Request Date'), 'date'), (_('Currency'), 'string'), (_('Comment'), 'string'), (_('Justification Code'), 'string'), (_('Justification Coordination'), 'string'), (_('HQ Remarks'), 'string'), (_('Justification Y/N'), 'string'),] |
106 | 59 | PO_LINE_COLUMNS_FOR_IMPORT = [x for (x, y) in PO_COLUMNS_HEADER_FOR_IMPORT] | 59 | PO_LINE_COLUMNS_FOR_IMPORT = [x for (x, y) in PO_COLUMNS_HEADER_FOR_IMPORT] |
107 | 60 | 60 | ||
108 | 61 | FO_COLUMNS_HEADER_FOR_IMPORT=[ | 61 | FO_COLUMNS_HEADER_FOR_IMPORT=[ |
109 | 62 | 62 | ||
110 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_po_line.py' | |||
111 | --- bin/addons/msf_doc_import/wizard/wizard_import_po_line.py 2016-08-26 10:10:58 +0000 | |||
112 | +++ bin/addons/msf_doc_import/wizard/wizard_import_po_line.py 2016-10-26 10:53:26 +0000 | |||
113 | @@ -96,30 +96,38 @@ | |||
114 | 96 | or not wiz.po_id.pricelist_id.currency_id: | 96 | or not wiz.po_id.pricelist_id.currency_id: |
115 | 97 | raise osv.except_osv(_("Error!"), _("Order currency not found!")) | 97 | raise osv.except_osv(_("Error!"), _("Order currency not found!")) |
116 | 98 | 98 | ||
118 | 99 | ignore_lines, complete_lines, lines_to_correct = 0, 0, 0 | 99 | ignore_lines, complete_lines, lines_to_correct, created_lines = 0, 0, 0, 0 |
119 | 100 | line_ignored_num, error_list = [], [] | 100 | line_ignored_num, error_list = [], [] |
120 | 101 | error_log, message = '', '' | 101 | error_log, message = '', '' |
121 | 102 | header_index = context['header_index'] | 102 | header_index = context['header_index'] |
122 | 103 | template_col_count = len(header_index) | 103 | template_col_count = len(header_index) |
124 | 104 | mandatory_col_count = 7 | 104 | is_rfq = wiz.po_id.rfq_ok and wiz.po_id.state == 'rfq_sent' |
125 | 105 | mandatory_col_count = 8 if is_rfq else 7 | ||
126 | 105 | 106 | ||
127 | 106 | file_obj = SpreadsheetXML(xmlstring=base64.decodestring(wiz.file)) | 107 | file_obj = SpreadsheetXML(xmlstring=base64.decodestring(wiz.file)) |
128 | 107 | 108 | ||
129 | 108 | """ | 109 | """ |
130 | 109 | 1st path: check currency in lines in phasis with document | 110 | 1st path: check currency in lines in phasis with document |
131 | 110 | REF-94: BECAREFUL WHEN CHANGING THE ORDER OF CELLS IN THE IMPORT FILE!!!!! | 111 | REF-94: BECAREFUL WHEN CHANGING THE ORDER OF CELLS IN THE IMPORT FILE!!!!! |
133 | 111 | CCY COL INDEX: 6 | 112 | CCY COL INDEX: 6 (PO) or 7 (RfQ) |
134 | 112 | """ | 113 | """ |
135 | 113 | order_currency_code = wiz.po_id.pricelist_id.currency_id.name | 114 | order_currency_code = wiz.po_id.pricelist_id.currency_id.name |
137 | 114 | currency_index = 6 | 115 | currency_index = 7 if is_rfq else 6 |
138 | 115 | row_iterator = file_obj.getRows() | 116 | row_iterator = file_obj.getRows() |
139 | 116 | 117 | ||
140 | 117 | # don't use the original | 118 | # don't use the original |
141 | 118 | row_iterator, row_iterator_line_check = itertools.tee(row_iterator) | 119 | row_iterator, row_iterator_line_check = itertools.tee(row_iterator) |
142 | 119 | 120 | ||
143 | 120 | row_iterator_line_check.next() # skip header line | 121 | row_iterator_line_check.next() # skip header line |
146 | 121 | lines_to_correct = check_line.check_lines_currency(row_iterator_line_check, | 122 | try: |
147 | 122 | currency_index, order_currency_code) | 123 | lines_to_correct = check_line.check_lines_currency(row_iterator_line_check, currency_index, order_currency_code) |
148 | 124 | except Exception as e: | ||
149 | 125 | message = _("""An error occurs during the check of the currency: %s""") % e | ||
150 | 126 | categ_log = '' | ||
151 | 127 | line_num = 0 | ||
152 | 128 | error_list.append(message) | ||
153 | 129 | logging.getLogger('import purchase order').error('Error %s' % e) | ||
154 | 130 | |||
155 | 123 | if lines_to_correct > 0: | 131 | if lines_to_correct > 0: |
156 | 124 | categ_log = '' | 132 | categ_log = '' |
157 | 125 | line_num = 0 | 133 | line_num = 0 |
158 | @@ -129,6 +137,7 @@ | |||
159 | 129 | error_list.append(msg) | 137 | error_list.append(msg) |
160 | 130 | 138 | ||
161 | 131 | if not error_list: | 139 | if not error_list: |
162 | 140 | line_number_set = set() | ||
163 | 132 | to_write = {} | 141 | to_write = {} |
164 | 133 | total_line_num = file_obj.getNbRows() | 142 | total_line_num = file_obj.getNbRows() |
165 | 134 | # ignore the header line | 143 | # ignore the header line |
166 | @@ -153,13 +162,14 @@ | |||
167 | 153 | 'proc_type': 'make_to_order', | 162 | 'proc_type': 'make_to_order', |
168 | 154 | 'default_code': False, | 163 | 'default_code': False, |
169 | 155 | 'confirmed_delivery_date': False, | 164 | 'confirmed_delivery_date': False, |
170 | 165 | 'line_number':'', | ||
171 | 156 | } | 166 | } |
172 | 157 | 167 | ||
173 | 158 | col_count = len(row) | 168 | col_count = len(row) |
174 | 159 | if col_count != template_col_count and col_count != mandatory_col_count: | 169 | if col_count != template_col_count and col_count != mandatory_col_count: |
175 | 160 | message += _("Line %s: You should have exactly %s columns in this order: %s \n") % ( | 170 | message += _("Line %s: You should have exactly %s columns in this order: %s \n") % ( |
176 | 161 | line_num, template_col_count, | 171 | line_num, template_col_count, |
178 | 162 | ','.join(columns_for_po_line_import)) | 172 | ','.join(is_rfq and columns_for_po_line_import or columns_for_po_line_import[1:])) |
179 | 163 | line_with_error.append( | 173 | line_with_error.append( |
180 | 164 | wiz_common_import.get_line_values( | 174 | wiz_common_import.get_line_values( |
181 | 165 | cr, uid, ids, row, cell_nb=False, | 175 | cr, uid, ids, row, cell_nb=False, |
182 | @@ -176,7 +186,16 @@ | |||
183 | 176 | total_line_num -= 1 | 186 | total_line_num -= 1 |
184 | 177 | continue | 187 | continue |
185 | 178 | 188 | ||
187 | 179 | # Cell 0: Product Code | 189 | |
188 | 190 | # Cell 0 : Line Number (RfQ) | ||
189 | 191 | if is_rfq: | ||
190 | 192 | ln_value = check_line.line_number_value( | ||
191 | 193 | row=row, cell_nb=header_index[_('Line Number')], to_write=to_write, context=context) | ||
192 | 194 | to_write.update( | ||
193 | 195 | line_number=ln_value['line_number'], | ||
194 | 196 | error_list=ln_value['error_list']) | ||
195 | 197 | |||
196 | 198 | # Cell 1: Product Code | ||
197 | 180 | p_value = check_line.product_value( | 199 | p_value = check_line.product_value( |
198 | 181 | cr, uid, obj_data=obj_data, cell_nb=header_index[_('Product Code')], | 200 | cr, uid, obj_data=obj_data, cell_nb=header_index[_('Product Code')], |
199 | 182 | product_obj=product_obj, row=row, to_write=to_write, context=context) | 201 | product_obj=product_obj, row=row, to_write=to_write, context=context) |
200 | @@ -211,7 +230,7 @@ | |||
201 | 211 | to_write.update(product_qty=round_qty['value']['product_qty']) | 230 | to_write.update(product_qty=round_qty['value']['product_qty']) |
202 | 212 | warn_list = to_write['warning_list'] | 231 | warn_list = to_write['warning_list'] |
203 | 213 | warn_list.append(round_qty['warning']['message']) | 232 | warn_list.append(round_qty['warning']['message']) |
205 | 214 | #message += _("Line %s in the Excel file: %s\n") % (line_num, round_qty['warning']['message']) | 233 | #message += _("Line %s in the Excel file: %s\n") % (line_num, round_qty['warning']['message']) |
206 | 215 | 234 | ||
207 | 216 | # Cell 4: Price | 235 | # Cell 4: Price |
208 | 217 | price_value = check_line.compute_price_value( | 236 | price_value = check_line.compute_price_value( |
209 | @@ -245,11 +264,14 @@ | |||
210 | 245 | to_write.update( | 264 | to_write.update( |
211 | 246 | comment=c_value['comment'], | 265 | comment=c_value['comment'], |
212 | 247 | warning_list=c_value['warning_list']) | 266 | warning_list=c_value['warning_list']) |
213 | 267 | |||
214 | 268 | |||
215 | 248 | to_write.update( | 269 | to_write.update( |
216 | 249 | to_correct_ok=any(to_write['error_list']), # the lines with to_correct_ok=True will be red | 270 | to_correct_ok=any(to_write['error_list']), # the lines with to_correct_ok=True will be red |
217 | 250 | show_msg_ok=any(to_write['warning_list']), # the lines with show_msg_ok=True won't change color, it is just info | 271 | show_msg_ok=any(to_write['warning_list']), # the lines with show_msg_ok=True won't change color, it is just info |
218 | 251 | order_id=wiz.po_id.id, | 272 | order_id=wiz.po_id.id, |
219 | 252 | text_error='\n'.join(to_write['error_list'] + to_write['warning_list'])) | 273 | text_error='\n'.join(to_write['error_list'] + to_write['warning_list'])) |
220 | 274 | |||
221 | 253 | # we check consistency on the model of on_change functions to call for updating values | 275 | # we check consistency on the model of on_change functions to call for updating values |
222 | 254 | purchase_line_obj.check_line_consistency( | 276 | purchase_line_obj.check_line_consistency( |
223 | 255 | cr, uid, wiz.po_id.id, to_write=to_write, context=context) | 277 | cr, uid, wiz.po_id.id, to_write=to_write, context=context) |
224 | @@ -264,9 +286,50 @@ | |||
225 | 264 | cr.rollback() | 286 | cr.rollback() |
226 | 265 | continue | 287 | continue |
227 | 266 | 288 | ||
231 | 267 | # write order line on PO | 289 | |
232 | 268 | purchase_line_obj.create(cr, uid, to_write, context=context) | 290 | if is_rfq: |
233 | 269 | vals['order_line'].append((0, 0, to_write)) | 291 | rfq_line_ids = purchase_line_obj.search(cr, uid, [('order_id', '=', wiz.po_id.id), ('line_number', '=', to_write['line_number'])]) |
234 | 292 | to_write['rfq_ok'] = True | ||
235 | 293 | |||
236 | 294 | # CASE 1: the line is not registered in the system, so CREATE it : | ||
237 | 295 | if not rfq_line_ids: | ||
238 | 296 | created_lines += 1 | ||
239 | 297 | if wiz.po_id.tender_id: | ||
240 | 298 | msg = _('Warning! You are adding new lines which did not exist in the original tender!') | ||
241 | 299 | if msg not in message: | ||
242 | 300 | message += msg | ||
243 | 301 | to_write.update({ | ||
244 | 302 | 'line_number': False, | ||
245 | 303 | 'red_color': True, | ||
246 | 304 | }) | ||
247 | 305 | purchase_line_obj.create(cr, uid, to_write, context=context) | ||
248 | 306 | |||
249 | 307 | # CASE 2: the line is already in the system, so UPDATE it : | ||
250 | 308 | for po_line in purchase_line_obj.browse(cr, uid, rfq_line_ids, context=context): | ||
251 | 309 | # some checks : | ||
252 | 310 | if to_write['line_number'] in line_number_set: | ||
253 | 311 | raise osv.except_osv(_('Error'), _("the same line number appears several times")) | ||
254 | 312 | else: | ||
255 | 313 | line_number_set.add(to_write['line_number']) | ||
256 | 314 | if p_value['product_code'] != po_line.product_id.default_code: | ||
257 | 315 | raise osv.except_osv(_('Error'), _("Product code from system and from import must be the same.")) | ||
258 | 316 | if not price_value['price_unit_defined']: | ||
259 | 317 | raise osv.except_osv(_('Error'), _("Price must be defined in the RfQ import file.")) | ||
260 | 318 | |||
261 | 319 | # in case of update we do not want to update qty and uom values : | ||
262 | 320 | if to_write.has_key('product_qty'): | ||
263 | 321 | to_write.pop('product_qty') | ||
264 | 322 | if to_write.has_key('product_uom'): | ||
265 | 323 | to_write.pop('product_uom') | ||
266 | 324 | |||
267 | 325 | # update POL : | ||
268 | 326 | purchase_line_obj.write(cr, uid, rfq_line_ids, to_write, context=context) | ||
269 | 327 | |||
270 | 328 | else: # its not RfQ | ||
271 | 329 | purchase_line_obj.create(cr, uid, to_write, context=context) | ||
272 | 330 | |||
273 | 331 | vals['order_line'].append((0, 0, to_write)) | ||
274 | 332 | |||
275 | 270 | if to_write['error_list']: | 333 | if to_write['error_list']: |
276 | 271 | lines_to_correct += 1 | 334 | lines_to_correct += 1 |
277 | 272 | complete_lines += 1 | 335 | complete_lines += 1 |
278 | @@ -327,13 +390,13 @@ | |||
279 | 327 | final_message = _(''' | 390 | final_message = _(''' |
280 | 328 | %s | 391 | %s |
281 | 329 | Importation completed in %s! | 392 | Importation completed in %s! |
283 | 330 | # of imported lines : %s on %s lines | 393 | # of imported lines : %s on %s lines (%s updated and %s created) |
284 | 331 | # of ignored lines: %s | 394 | # of ignored lines: %s |
285 | 332 | # of lines to correct: %s | 395 | # of lines to correct: %s |
286 | 333 | %s | 396 | %s |
287 | 334 | 397 | ||
288 | 335 | %s | 398 | %s |
290 | 336 | ''') % (categ_log, total_time, complete_lines, line_num, ignore_lines, lines_to_correct, error_log, message) | 399 | ''') % (categ_log, total_time, complete_lines, line_num, complete_lines-created_lines,created_lines, ignore_lines, lines_to_correct, error_log, message) |
291 | 337 | wizard_vals['message'] = final_message | 400 | wizard_vals['message'] = final_message |
292 | 338 | if line_with_error: | 401 | if line_with_error: |
293 | 339 | file_to_export = wiz_common_import.export_file_with_error( | 402 | file_to_export = wiz_common_import.export_file_with_error( |
294 | @@ -371,8 +434,10 @@ | |||
295 | 371 | header_index = wiz_common_import.get_header_index( | 434 | header_index = wiz_common_import.get_header_index( |
296 | 372 | cr, uid, ids, first_row, error_list=[], line_num=0, context=context) | 435 | cr, uid, ids, first_row, error_list=[], line_num=0, context=context) |
297 | 373 | context.update({'po_id': po_id, 'header_index': header_index}) | 436 | context.update({'po_id': po_id, 'header_index': header_index}) |
298 | 437 | rfq = purchase_obj.read(cr, uid, po_id, ['state', 'rfq_ok'], context=context) | ||
299 | 438 | is_rfq = rfq['rfq_ok'] and rfq['state'] == 'rfq_sent' | ||
300 | 374 | res, res1 = wiz_common_import.check_header_values( | 439 | res, res1 = wiz_common_import.check_header_values( |
302 | 375 | cr, uid, ids, context, header_index, columns_for_po_line_import, | 440 | cr, uid, ids, context, header_index, is_rfq and columns_for_po_line_import or columns_for_po_line_import[1:], |
303 | 376 | origin='PO') | 441 | origin='PO') |
304 | 377 | if not res: | 442 | if not res: |
305 | 378 | return self.write(cr, uid, ids, res1, context) | 443 | return self.write(cr, uid, ids, res1, context) |
306 | 379 | 444 | ||
307 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
308 | --- bin/addons/msf_profile/i18n/fr_MF.po 2016-10-21 15:36:56 +0000 | |||
309 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2016-10-26 10:53:26 +0000 | |||
310 | @@ -74611,6 +74611,7 @@ | |||
311 | 74611 | " Number of columns is not equal to %s" | 74611 | " Number of columns is not equal to %s" |
312 | 74612 | msgstr "\n" | 74612 | msgstr "\n" |
313 | 74613 | " Le nombre de colonnes n'est pas égal à %s" | 74613 | " Le nombre de colonnes n'est pas égal à %s" |
314 | 74614 | <<<<<<< TREE | ||
315 | 74614 | 74615 | ||
316 | 74615 | #. module: specific_rules | 74616 | #. module: specific_rules |
317 | 74616 | #: report:addons/specific_rules/report/report_stock_inventory_all_locations_xls.mako:143 | 74617 | #: report:addons/specific_rules/report/report_stock_inventory_all_locations_xls.mako:143 |
318 | @@ -74683,3 +74684,11 @@ | |||
319 | 74683 | msgid "You can't search on this object without using at least one exact search term (precede your search with the character '=')." | 74684 | msgid "You can't search on this object without using at least one exact search term (precede your search with the character '=')." |
320 | 74684 | msgstr "Vous ne pouvez pas exécuter de recherche sur cet objet sans utiliser au moins une recherche exacte (ajoutez le caractère = devant votre filtre)." | 74685 | msgstr "Vous ne pouvez pas exécuter de recherche sur cet objet sans utiliser au moins une recherche exacte (ajoutez le caractère = devant votre filtre)." |
321 | 74685 | 74686 | ||
322 | 74687 | ======= | ||
323 | 74688 | |||
324 | 74689 | #. module: msf_doc_import | ||
325 | 74690 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:300 | ||
326 | 74691 | #, python-format | ||
327 | 74692 | msgid "Warning! You are adding new lines which did not exist in the original tender!" | ||
328 | 74693 | msgstr "Attention ! Vous avez ajouté une nouvelle ligne qui n'existe pas dans l'appel d'offre original !" | ||
329 | 74694 | >>>>>>> MERGE-SOURCE | ||
330 | 74686 | 74695 | ||
331 | === modified file 'bin/addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako' | |||
332 | --- bin/addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako 2014-04-29 14:10:16 +0000 | |||
333 | +++ bin/addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako 2016-10-26 10:53:26 +0000 | |||
334 | @@ -66,6 +66,7 @@ | |||
335 | 66 | <Column ss:AutoFitWidth="1" ss:Width="250" /> | 66 | <Column ss:AutoFitWidth="1" ss:Width="250" /> |
336 | 67 | 67 | ||
337 | 68 | <Row> | 68 | <Row> |
338 | 69 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Line Number')}</Data></Cell> | ||
339 | 69 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Product Code')}</Data></Cell> | 70 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Product Code')}</Data></Cell> |
340 | 70 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Product Description')}</Data></Cell> | 71 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Product Description')}</Data></Cell> |
341 | 71 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Quantity')}</Data></Cell> | 72 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Quantity')}</Data></Cell> |
342 | @@ -77,6 +78,7 @@ | |||
343 | 77 | </Row> | 78 | </Row> |
344 | 78 | % for line in o.order_line: | 79 | % for line in o.order_line: |
345 | 79 | <Row> | 80 | <Row> |
346 | 81 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.line_number or '')|x}</Data></Cell> | ||
347 | 80 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_id.default_code or '')|x}</Data></Cell> | 82 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_id.default_code or '')|x}</Data></Cell> |
348 | 81 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_id.name or '')|x}</Data></Cell> | 83 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_id.name or '')|x}</Data></Cell> |
349 | 82 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.product_qty or '')|x}</Data></Cell> | 84 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.product_qty or '')|x}</Data></Cell> |
350 | 83 | 85 | ||
351 | === modified file 'bin/addons/purchase_override/purchase.py' | |||
352 | --- bin/addons/purchase_override/purchase.py 2016-10-16 10:55:55 +0000 | |||
353 | +++ bin/addons/purchase_override/purchase.py 2016-10-26 10:53:26 +0000 | |||
354 | @@ -3708,6 +3708,7 @@ | |||
355 | 3708 | string='SoQ updated', | 3708 | string='SoQ updated', |
356 | 3709 | readonly=True, | 3709 | readonly=True, |
357 | 3710 | ), | 3710 | ), |
358 | 3711 | 'red_color': fields.boolean(string='Red color'), | ||
359 | 3711 | } | 3712 | } |
360 | 3712 | 3713 | ||
361 | 3713 | _defaults = { | 3714 | _defaults = { |
362 | 3714 | 3715 | ||
363 | === modified file 'bin/addons/purchase_override/purchase_view.xml' | |||
364 | --- bin/addons/purchase_override/purchase_view.xml 2016-08-03 12:08:12 +0000 | |||
365 | +++ bin/addons/purchase_override/purchase_view.xml 2016-10-26 10:53:26 +0000 | |||
366 | @@ -146,6 +146,7 @@ | |||
367 | 146 | </xpath> | 146 | </xpath> |
368 | 147 | 147 | ||
369 | 148 | <xpath expr="/form/notebook//tree//field[@name='price_subtotal']" position="after"> | 148 | <xpath expr="/form/notebook//tree//field[@name='price_subtotal']" position="after"> |
370 | 149 | <field name="red_color" invisible="1" /> | ||
371 | 149 | <field name="rfq_ok" invisible="1" /> | 150 | <field name="rfq_ok" invisible="1" /> |
372 | 150 | <field name="tender_line_id" invisible="1" /> | 151 | <field name="tender_line_id" invisible="1" /> |
373 | 151 | <field name="fake_state" invisible="1" /> | 152 | <field name="fake_state" invisible="1" /> |