Merge lp:~unifield-team/unifield-server/us-991 into lp:unifield-server

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4021
Proposed branch: lp:~unifield-team/unifield-server/us-991
Merge into: lp:unifield-server
Diff against target: 79 lines (+45/-1)
2 files modified
bin/addons/msf_doc_import/wizard/wizard_import_product_list.py (+29/-1)
bin/addons/msf_profile/i18n/fr_MF.po (+16/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-991
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+306873@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeff Allen (jr.allen) :

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/wizard/wizard_import_product_list.py'
2--- bin/addons/msf_doc_import/wizard/wizard_import_product_list.py 2016-07-22 14:29:06 +0000
3+++ bin/addons/msf_doc_import/wizard/wizard_import_product_list.py 2016-09-28 08:45:35 +0000
4@@ -93,7 +93,6 @@
5 wiz_common_import = self.pool.get('wiz.common.import')
6
7 line_with_error = []
8- vals = {'product_id': []}
9
10 for wiz_browse in self.browse(cr, uid, ids, context):
11 list_browse = wiz_browse.list_id
12@@ -104,6 +103,8 @@
13 error_log, message = '', ''
14 header_index = context['header_index']
15
16+ imp_product_ids = []
17+
18 file_obj = SpreadsheetXML(xmlstring=base64.decodestring(wiz_browse.file))
19 # iterator on rows
20 rows = file_obj.getRows()
21@@ -175,6 +176,33 @@
22 cr.rollback()
23 continue
24
25+ if to_write.get('product_id'):
26+ exist_line_ids = list_line_obj.search(cr, uid, [
27+ ('list_id', '=', list_browse.id),
28+ ('name', '=', to_write.get('product_id'))
29+ ], limit=1, context=context)
30+ in_list = to_write['product_id'] in imp_product_ids
31+ imp_product_ids.append(to_write['product_id'])
32+ if exist_line_ids or in_list:
33+ prod_brw = product_obj.browse(cr, uid, to_write['product_id'], context=context)
34+ to_write.setdefault('error_list', []).append(
35+ _('Product [%s] %s is already in the product list. Line not imported \n') % (
36+ prod_brw.default_code,
37+ prod_brw.name,
38+ )
39+ )
40+ error_log += _("Line %s in the Excel file was added to the file of the lines with errors."
41+ "Details: Product already in the product list \n") % line_num
42+ line_with_error.append(wiz_common_import.get_line_values(cr, uid, ids, row, cell_nb=False,
43+ error_list=error_list,
44+ line_num=line_num,
45+ context=context))
46+ ignore_lines += 1
47+ line_ignored_num.append(line_num)
48+ percent_completed = float(line_num)/float(total_line_num-1)*100.00
49+ cr.rollback()
50+ continue
51+
52 # Cell 2: Comment
53 to_write.update({'comment': row[2]})
54
55
56=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
57--- bin/addons/msf_profile/i18n/fr_MF.po 2016-09-13 14:59:08 +0000
58+++ bin/addons/msf_profile/i18n/fr_MF.po 2016-09-28 08:45:35 +0000
59@@ -74611,3 +74611,19 @@
60 " Number of columns is not equal to %s"
61 msgstr "\n"
62 " Le nombre de colonnes n'est pas égal à %s"
63+
64+#. module: msf_doc_import
65+#: code:addons/msf_doc_import/wizard/wizard_import_product_list.py:194
66+#, python-format
67+msgid "Line %s in the Excel file was added to the file of the lines with errors.Details: Product already in the product list \n"
68+""
69+msgstr "La ligne %s du fichier Excel a été ajoutée au fichier des lignes avec erreurs. Détails : Le produit est déjà dans la liste de produits.\n"
70+""
71+
72+#. module: msf_doc_import
73+#: code:addons/msf_doc_import/wizard/wizard_import_product_list.py:189
74+#, python-format
75+msgid "Product [%s] %s is already in the product list. Line not imported \n"
76+""
77+msgstr "Le produit [%s] %s est déjà dans la liste de produits. Ligne non importée \n"
78+""
79\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: