Merge lp:~mukunde/unifield-server/8088 into lp:unifield-server
- 8088
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 6255 |
Proposed branch: | lp:~mukunde/unifield-server/8088 |
Merge into: | lp:unifield-server |
Diff against target: |
238 lines (+97/-4) (has conflicts) 4 files modified
bin/addons/msf_doc_import/msf_import_export.py (+42/-3) bin/addons/msf_doc_import/msf_import_export_conf.py (+2/-0) bin/addons/msf_doc_import/report/import_generic_template.py (+1/-1) bin/addons/msf_profile/i18n/fr_MF.po (+52/-0) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~mukunde/unifield-server/8088 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+420749@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/msf_import_export.py' |
2 | --- bin/addons/msf_doc_import/msf_import_export.py 2021-11-02 16:20:11 +0000 |
3 | +++ bin/addons/msf_doc_import/msf_import_export.py 2022-04-28 16:07:53 +0000 |
4 | @@ -843,7 +843,7 @@ |
5 | self._cache[dbname].setdefault('product.product.%s' % field, {}) |
6 | self._cache[dbname]['product.product.%s.%s' % (field, value)] = key |
7 | break |
8 | - if fields_def[field]['type'] == 'many2many': |
9 | + if fields_def[field]['type'] == 'many2many' and field != 'fp_account_ids': |
10 | new_obj = self.pool.get(fields_def[field]['relation']) |
11 | ret = [(6, 0, [])] |
12 | for name in value.split(','): |
13 | @@ -964,8 +964,13 @@ |
14 | data[points[0]] = False |
15 | elif line_data[n]: |
16 | data[points[0]] = _get_obj(h, line_data[n], fields_def) or False |
17 | - elif fields_def[points[0]]['type'] == 'many2many' and line_data[n]: |
18 | - data.setdefault(points[0], []).append((4, _get_obj(h, line_data[n], fields_def))) |
19 | + elif fields_def[points[0]]['type'] == 'many2many' and line_data[n] : |
20 | + if points[0] == 'fp_account_ids' : |
21 | + value = process_data(points[0], line_data[n], fields_def) |
22 | + if value is not None: |
23 | + data[points[0]] = value |
24 | + else: |
25 | + data.setdefault(points[0], []).append((4, _get_obj(h, line_data[n], fields_def))) |
26 | |
27 | if not line_ok: |
28 | rejected.append((row_index+1, line_data, '')) |
29 | @@ -1047,6 +1052,12 @@ |
30 | raise Exception(_('The Parent Analytic Account must be a View type Funding Pool.')) |
31 | # Cost Centers |
32 | if data.get('cost_center_ids'): |
33 | + # Block the possibility to have both a list of Cost Centers and "Allow all Cost Centers" set to "True" |
34 | + if data.get('allow_all_cc_with_fp'): |
35 | + raise Exception(_('Import error for account "%s" : If listing Cost Centers, "Allow all Cost Centers" must be set to False.') % data.get('name')) |
36 | + else: |
37 | + # Listing "Cost Centers" unticks the box "Allow all Cost Centers" in the FP form |
38 | + data['allow_all_cc_with_fp'] = False |
39 | cc_list = [] |
40 | for cost_center in data.get('cost_center_ids').split(','): |
41 | cc = cost_center.strip() |
42 | @@ -1062,6 +1073,12 @@ |
43 | data['cost_center_ids'] = [(6, 0, [])] |
44 | # Account/Destination |
45 | if data.get('tuple_destination_account_ids'): |
46 | + # Block the possibility to have both "Accounts/Destinations" and "G/L Accounts |
47 | + if data.get('fp_account_ids'): |
48 | + raise Exception(_('Import error for account "%s" : Listing both Accounts/Destinations and G/L Accounts is not allowed') % data.get('name')) |
49 | + else: |
50 | + # Listing "Accounts/Destinations" unticks the box "Select Accounts Only" in the FP form |
51 | + data['select_accounts_only'] = False |
52 | dest_acc_list = [] |
53 | for destination_account in data.get('tuple_destination_account_ids').split(','): |
54 | dest_acc_ids = [] |
55 | @@ -1080,6 +1097,28 @@ |
56 | data['tuple_destination_account_ids'] = [(6, 0, dest_acc_list)] |
57 | else: |
58 | data['tuple_destination_account_ids'] = [(6, 0, [])] |
59 | + # G/L Accounts |
60 | + if data.get('fp_account_ids'): |
61 | + gl_list = [] |
62 | + # Block the possibility to have both "Accounts/Destinations" and "G/L Accounts |
63 | + if data.get('tuple_destination_account_ids')[0][2]: # at this stage even though the dest/acc is empty, data['tuple_destination_account_ids'] is filled with (6, 0, []) |
64 | + raise Exception(_('Import error for account "%s" : Listing both Accounts/Destinations and G/L Accounts is not allowed') % data.get('name')) |
65 | + else: |
66 | + # Listing "G/L Accounts" ticks the box "Select Accounts Only" in the FP form |
67 | + data['select_accounts_only'] = True |
68 | + gl_iter = data.get('fp_account_ids').split(',') |
69 | + for name in gl_iter: |
70 | + name = name.strip() |
71 | + # Allow the same accounts as in the interface |
72 | + gl_dom = [('type', '!=', 'view'), ('is_analytic_addicted', '=', True), ('active', '=', 't'), ('code', '=', name), ('user_type_code', 'in', ['expense', 'income'])] |
73 | + gl_ids = acc_obj.search(cr, uid, gl_dom, limit=1, context=context) |
74 | + if gl_ids: |
75 | + gl_list.append(gl_ids[0]) |
76 | + else: |
77 | + raise Exception(_('Import error for account "%s" : G/L Account "%s" not found or not of type Income or Expense') % (data.get('name'), name)) |
78 | + data['fp_account_ids'] = [(6, 0, gl_list)] |
79 | + else: |
80 | + data['fp_account_ids'] = [(6, 0, [])] |
81 | |
82 | # Destinations |
83 | dest_cc_tuple_list = [] |
84 | |
85 | === modified file 'bin/addons/msf_doc_import/msf_import_export_conf.py' |
86 | --- bin/addons/msf_doc_import/msf_import_export_conf.py 2021-11-16 14:37:35 +0000 |
87 | +++ bin/addons/msf_doc_import/msf_import_export_conf.py 2022-04-28 16:07:53 +0000 |
88 | @@ -517,6 +517,8 @@ |
89 | 'cost_center_ids', |
90 | 'tuple_destination_account_ids', |
91 | 'instance_id.code', |
92 | + 'allow_all_cc_with_fp', |
93 | + 'fp_account_ids', |
94 | ], |
95 | 'required_field_list': [ |
96 | 'name', |
97 | |
98 | === modified file 'bin/addons/msf_doc_import/report/import_generic_template.py' |
99 | --- bin/addons/msf_doc_import/report/import_generic_template.py 2019-05-24 15:09:28 +0000 |
100 | +++ bin/addons/msf_doc_import/report/import_generic_template.py 2022-04-28 16:07:53 +0000 |
101 | @@ -147,7 +147,7 @@ |
102 | new_ctx = context.copy() |
103 | if 'lang' in MODEL_DICT.get(data['selection'], {}): |
104 | new_ctx['lang'] = MODEL_DICT[data['selection']]['lang'] |
105 | - if data['selection'] == 'destinations': |
106 | + if data['selection'] in ['destinations', 'funding_pools']: |
107 | new_ctx['account_only_code'] = True |
108 | for i in range(0, len(ids), chunk_size): |
109 | ids_chunk = ids[i:i + chunk_size] |
110 | |
111 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
112 | --- bin/addons/msf_profile/i18n/fr_MF.po 2022-04-27 14:36:40 +0000 |
113 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2022-04-28 16:07:53 +0000 |
114 | @@ -43433,8 +43433,12 @@ |
115 | #: field:replenishment.segment.line,product_id:0 |
116 | #: report:kitting.order.report:0 |
117 | #: code:addons/msf_doc_import/report/return_from_unit_export.py:118 |
118 | +<<<<<<< TREE |
119 | #: field:wizard.import.po.simulation.screen.line,in_product_code:0 |
120 | #: field:tender.line,product_default_code:0 |
121 | +======= |
122 | +#: field:wizard.import.po.simulation.screen.line,in_product_code:0 |
123 | +>>>>>>> MERGE-SOURCE |
124 | #, python-format |
125 | msgid "Product Code" |
126 | msgstr "Code Produit" |
127 | @@ -43865,12 +43869,21 @@ |
128 | msgid "Update Instance" |
129 | msgstr "Mise à jour Instance" |
130 | |
131 | +<<<<<<< TREE |
132 | #. modules: msf_doc_import, tender_flow, delete_button, sync_so, sales_followup |
133 | #: constraint:tender:0 |
134 | #: constraint:tender:0 |
135 | #: constraint:tender:0 |
136 | #: constraint:tender:0 |
137 | #: constraint:tender.line:0 |
138 | +======= |
139 | +#. modules: msf_doc_import, tender_flow, delete_button, sync_so |
140 | +#: constraint:tender:0 |
141 | +#: constraint:tender:0 |
142 | +#: constraint:tender:0 |
143 | +#: constraint:tender:0 |
144 | +#: constraint:tender.line:0 |
145 | +>>>>>>> MERGE-SOURCE |
146 | msgid "You cannot validate this tender because it contains a line with an inactive product" |
147 | msgstr "Vous ne pouvez pas valider cet appel d'offre car il contient une ligne avec un produit inactif" |
148 | |
149 | @@ -48996,10 +49009,16 @@ |
150 | #: selection:res.partner,transport_2:0 |
151 | #: selection:purchase.order,transport_type:0 |
152 | #: selection:shipment.add.pack.processor,transport_type:0 |
153 | +<<<<<<< TREE |
154 | #: selection:wizard.import.in.simulation.screen,transport_type:0 |
155 | #: selection:wizard.import.po.simulation.screen,imp_transport_type:0 |
156 | #: selection:wizard.import.po.simulation.screen,in_transport_type:0 |
157 | #: selection:international.transport.cost.report,transport_type:0 |
158 | +======= |
159 | +#: selection:wizard.import.in.simulation.screen,transport_type:0 |
160 | +#: selection:wizard.import.po.simulation.screen,imp_transport_type:0 |
161 | +#: selection:wizard.import.po.simulation.screen,in_transport_type:0 |
162 | +>>>>>>> MERGE-SOURCE |
163 | msgid "Air" |
164 | msgstr "Air" |
165 | |
166 | @@ -90786,12 +90805,16 @@ |
167 | #: view:stock.move.cancel.more.wizard:0 |
168 | #: view:stock.picking.cancel.more.wizard:0 |
169 | #: view:product.ask.activate.wizard:0 |
170 | +<<<<<<< TREE |
171 | #: view:wizard.cancel.lines:0 |
172 | #: view:shipment.add.pack.processor:0 |
173 | #: view:po.follow.up:0 |
174 | #: view:supplier.performance.wizard:0 |
175 | #: view:wizard.pick.import:0 |
176 | #: view:stock.delivery.wizard:0 |
177 | +======= |
178 | +#: view:wizard.cancel.lines:0 |
179 | +>>>>>>> MERGE-SOURCE |
180 | msgid "Actions" |
181 | msgstr "Actions" |
182 | |
183 | @@ -93283,8 +93306,13 @@ |
184 | msgid "Need Batch Number (Standard) not Expiry Date (Internal)" |
185 | msgstr "Mention nécessaire d'un numéro de lot (Standard) mais pas d'une date d'expiration (Interne)" |
186 | |
187 | +<<<<<<< TREE |
188 | #. module: msf_outgoing, msf_doc_import,return_claim,kit,stock |
189 | +======= |
190 | +#. module: msf_outgoing, msf_doc_import |
191 | +>>>>>>> MERGE-SOURCE |
192 | #: code:addons/msf_outgoing/__init__.py:43 |
193 | +<<<<<<< TREE |
194 | #: selection:assign.to.kit.line,integrity_status:0 |
195 | #: selection:kit.selection.line,integrity_status:0 |
196 | #: selection:kit.selection.sale.line,integrity_status:0 |
197 | @@ -93298,6 +93326,9 @@ |
198 | #: selection:stock.move.processor,integrity_status:0 |
199 | #: selection:claim.product.line,integrity_status_claim_product_line:0 |
200 | #: selection:stock.move,integrity_error:0 |
201 | +======= |
202 | +#: selection:wizard.import.in.line.simulation.screen,integrity_status:0 |
203 | +>>>>>>> MERGE-SOURCE |
204 | msgid "BN is linked to another product" |
205 | msgstr "Ce lot est lié à un autre produit" |
206 | |
207 | @@ -114589,6 +114620,7 @@ |
208 | msgid "Remove taxes on lines" |
209 | msgstr "Supprimer les taxes des lignes" |
210 | |
211 | +<<<<<<< TREE |
212 | #. module: stock |
213 | #: code:addons/stock/physical_inventory.py:1068 |
214 | #, python-format |
215 | @@ -114821,3 +114853,23 @@ |
216 | #, python-format |
217 | msgid "There is already an Internal Partner with the name '%s'. The Intermission Partner could not be activated" |
218 | msgstr "Il y a déjà un Partenaire Interne ayant le nom '%s'. Le Partenaire Intermission n'a pas pu être activé" |
219 | +======= |
220 | +#. module: msf_doc_import |
221 | +#: code:addons/msf_doc_import/msf_import_export.py:1113 |
222 | +#, python-format |
223 | +msgid "Import error for account \"%s\" : G/L Account \"%s\" not found or not of type Income or Expense" |
224 | +msgstr "Erreur lors de l'import du compte \"%s\" : Le Compte Grand Livre \"%s\" n'a pas été trouvé ou n'est pas de type Compte de Produits ou Compte de Charge" |
225 | + |
226 | +#. module: msf_doc_import |
227 | +#: code:addons/msf_doc_import/msf_import_export.py:1052 |
228 | +#, python-format |
229 | +msgid "Import error for account \"%s\" : If listing Cost Centers, \"Allow all Cost Centers\" must be set to False." |
230 | +msgstr "Erreur lors de l'import du compte \"%s\" : Si vous listez les Centres de Coût, \"Autoriser tous les Centres de Coût\" doit être mis sur Faux" |
231 | + |
232 | +#. module: msf_doc_import |
233 | +#: code:addons/msf_doc_import/msf_import_export.py:1073 |
234 | +#: code:addons/msf_doc_import/msf_import_export.py:1100 |
235 | +#, python-format |
236 | +msgid "Import error for account \"%s\" : Listing both Accounts/Destinations and G/L Accounts is not allowed" |
237 | +msgstr "Erreur lors de l'import du compte \"%s\" : Lister à la fois les Comptes/Destinations et les Comptes Grand Livre n'est pas permis" |
238 | +>>>>>>> MERGE-SOURCE |