Merge lp:~unifield-team/unifield-server/us-966 into lp:unifield-server
- us-966
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 3778 |
Proposed branch: | lp:~unifield-team/unifield-server/us-966 |
Merge into: | lp:unifield-server |
Diff against target: |
4098 lines (+1824/-654) (has conflicts) 63 files modified
bin/addons/account/account_move_line.py (+6/-15) bin/addons/account/report/account_balance_sheet.py (+7/-9) bin/addons/account/report/account_balance_sheet_xls.mako (+4/-4) bin/addons/account/report/account_general_ledger.py (+8/-38) bin/addons/account/report/account_general_ledger_landscape.rml (+5/-11) bin/addons/account/report/account_general_ledger_xls.mako (+21/-27) bin/addons/account/report/account_profit_loss.py (+2/-4) bin/addons/account/report/common_report_header.py (+0/-15) bin/addons/account/wizard/account_report_balance_sheet_view.xml (+1/-1) bin/addons/account/wizard/account_report_general_ledger.py (+3/-1) bin/addons/account/wizard/account_report_profit_loss_view.xml (+1/-1) bin/addons/account_mcdb/account_view.xml (+4/-4) bin/addons/analytic_distribution/analytic_line.py (+1/-9) bin/addons/analytic_override/analytic_line.py (+3/-6) bin/addons/delivery_mechanism/delivery_mechanism.py (+1/-1) bin/addons/finance/account_drill.py (+43/-33) bin/addons/import_data/import_data.py (+78/-53) bin/addons/mission_stock/mission_stock.py (+36/-49) bin/addons/msf_accrual/msf_accrual_line.py (+8/-6) bin/addons/msf_accrual/wizard/wizard_accrual_validation.py (+0/-2) bin/addons/msf_cross_docking/cross_docking.py (+2/-6) bin/addons/msf_doc_import/account.py (+0/-8) bin/addons/msf_doc_import/view/internal_request_import_line_view.xml (+1/-3) bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml (+0/-1) bin/addons/msf_doc_import/view/sale_order_import_lines_view.xml (+1/-2) bin/addons/msf_doc_import/wizard/wiz_common_import.py (+1/-1) bin/addons/msf_doc_import/wizard/wizard_import_ir_line.py (+1/-1) bin/addons/msf_homere_interface/hr.py (+15/-0) bin/addons/msf_homere_interface/wizard/hr_expat_import.py (+22/-6) bin/addons/msf_instance/add_instance.py (+21/-0) bin/addons/msf_outgoing/msf_outgoing.py (+5/-64) bin/addons/msf_profile/data/patches.xml (+3/-0) bin/addons/msf_profile/i18n/fr_MF.po (+1/-15) bin/addons/msf_profile/msf_profile.py (+3/-9) bin/addons/msf_sync_data_server/__openerp__.py (+2/-1) bin/addons/msf_sync_data_server/data/automated_import_sync_groups.xml (+18/-0) bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv (+15/-15) bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+12/-1) bin/addons/msf_tools/__init__.py (+4/-1) bin/addons/msf_tools/__openerp__.py (+8/-1) bin/addons/msf_tools/automated_import.py (+513/-0) bin/addons/msf_tools/automated_import_data.xml (+102/-0) bin/addons/msf_tools/automated_import_function.py (+107/-0) bin/addons/msf_tools/automated_import_job.py (+366/-0) bin/addons/msf_tools/msf_tools.py (+1/-4) bin/addons/msf_tools/views/automated_import_function_view.xml (+58/-0) bin/addons/msf_tools/views/automated_import_job_view.xml (+120/-0) bin/addons/msf_tools/views/automated_import_view.xml (+77/-0) bin/addons/procurement_request/procurement_request.py (+2/-7) bin/addons/purchase_override/purchase.py (+7/-14) bin/addons/register_accounting/account_move_line.py (+1/-1) bin/addons/sale_override/sale.py (+11/-60) bin/addons/sourcing/procurement_order.py (+3/-9) bin/addons/sourcing/sale_order_line.py (+1/-7) bin/addons/specific_rules/specific_rules.py (+7/-7) bin/addons/stock/stock.py (+2/-12) bin/addons/stock_override/stock.py (+16/-48) bin/addons/stock_override/stock_view.xml (+1/-1) bin/addons/sync_client/sync_client.py (+0/-1) bin/addons/tender_flow/tender_flow.py (+16/-50) bin/osv/orm.py (+43/-8) bin/release.py (+2/-1) bin/unifield-version.txt (+1/-0) Text conflict in bin/addons/finance/account_drill.py Text conflict in bin/addons/mission_stock/mission_stock.py Text conflict in bin/addons/msf_profile/data/patches.xml Text conflict in bin/addons/msf_profile/msf_profile.py Text conflict in bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-966 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+295556@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/account/account_move_line.py' |
2 | --- bin/addons/account/account_move_line.py 2016-04-13 07:43:33 +0000 |
3 | +++ bin/addons/account/account_move_line.py 2016-05-24 07:58:03 +0000 |
4 | @@ -1240,32 +1240,24 @@ |
5 | move_obj.write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context) |
6 | return result |
7 | |
8 | - def _hook_check_period_state(self, cr, uid, result=False, context=None, raise_hq_closed=True, *args, **kargs): |
9 | + def _hook_check_period_state(self, cr, uid, result=False, context=None, *args, **kargs): |
10 | """ |
11 | Check period state |
12 | """ |
13 | if not result: |
14 | return False |
15 | - res = True |
16 | for (state,) in result: |
17 | if state == 'done': |
18 | - if raise_hq_closed: |
19 | - raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed journal.')) |
20 | - res = False |
21 | - break |
22 | - return res |
23 | + raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed journal.')) |
24 | |
25 | - def _update_journal_check(self, cr, uid, journal_id, period_id, |
26 | - context=None, raise_hq_closed=True): |
27 | + def _update_journal_check(self, cr, uid, journal_id, period_id, context=None): |
28 | journal_obj = self.pool.get('account.journal') |
29 | period_obj = self.pool.get('account.period') |
30 | jour_period_obj = self.pool.get('account.journal.period') |
31 | cr.execute('SELECT state FROM account_journal_period WHERE journal_id = %s AND period_id = %s', (journal_id, period_id)) |
32 | result = cr.fetchall() |
33 | - if result: |
34 | - res = self._hook_check_period_state(cr, uid, result, |
35 | - context=context, raise_hq_closed=raise_hq_closed) |
36 | - else: |
37 | + self._hook_check_period_state(cr, uid, result, context=context) |
38 | + if not result: |
39 | journal = journal_obj.browse(cr, uid, journal_id, context=context) |
40 | period = period_obj.browse(cr, uid, period_id, context=context) |
41 | jour_period_obj.create(cr, uid, { |
42 | @@ -1273,8 +1265,7 @@ |
43 | 'journal_id': journal.id, |
44 | 'period_id': period.id |
45 | }) |
46 | - res = True |
47 | - return res |
48 | + return True |
49 | |
50 | def _update_check(self, cr, uid, ids, context=None): |
51 | done = {} |
52 | |
53 | === modified file 'bin/addons/account/report/account_balance_sheet.py' |
54 | --- bin/addons/account/report/account_balance_sheet.py 2016-05-19 07:21:22 +0000 |
55 | +++ bin/addons/account/report/account_balance_sheet.py 2016-05-24 07:58:03 +0000 |
56 | @@ -77,13 +77,13 @@ |
57 | return res |
58 | |
59 | def sum_dr(self): |
60 | - if self.res_bl['type'] == _('Net Loss'): |
61 | - self.result_sum_dr += self.res_bl['balance'] |
62 | + if self.res_bl['type'] == _('Net Profit'): |
63 | + self.result_sum_dr += self.res_bl['balance']*-1 |
64 | return self.result_sum_dr |
65 | |
66 | def sum_cr(self): |
67 | - if self.res_bl['type'] == _('Net Profit'): |
68 | - self.result_sum_dr += self.res_bl['balance'] |
69 | + if self.res_bl['type'] == _('Net Loss'): |
70 | + self.result_sum_cr += self.res_bl['balance'] |
71 | return self.result_sum_cr |
72 | |
73 | def get_pl_balance(self): |
74 | @@ -137,7 +137,7 @@ |
75 | 'code': self.res_bl['type'], |
76 | 'name': self.res_bl['type'], |
77 | 'level': False, |
78 | - 'balance': self.res_bl['balance'], |
79 | + 'balance':self.res_bl['balance'], |
80 | } |
81 | for typ in types: |
82 | accounts_temp = [] |
83 | @@ -331,11 +331,9 @@ |
84 | if data['form'].get('instance_ids', False): |
85 | self.cr.execute('select code from msf_instance where id IN %s', |
86 | (tuple(data['form']['instance_ids']),)) |
87 | - instances = [x for x, in self.cr.fetchall()] |
88 | else: |
89 | - # US-1166: mission only instances if none provided |
90 | - instances = self._get_instances(get_code=True, |
91 | - mission_filter=True) |
92 | + self.cr.execute('select code from msf_instance') |
93 | + instances = [x for x, in self.cr.fetchall()] |
94 | return ', '.join(instances) |
95 | |
96 | report_sxw.report_sxw('report.account.balancesheet.horizontal', 'account.account', |
97 | |
98 | === modified file 'bin/addons/account/report/account_balance_sheet_xls.mako' |
99 | --- bin/addons/account/report/account_balance_sheet_xls.mako 2016-04-07 15:55:20 +0000 |
100 | +++ bin/addons/account/report/account_balance_sheet_xls.mako 2016-05-24 07:58:03 +0000 |
101 | @@ -162,24 +162,24 @@ |
102 | %> |
103 | <Cell ss:StyleID="ssAccountLine${strong}"><Data ss:Type="String">${(o.get('code1', False) or '')|x}</Data></Cell> |
104 | <Cell ss:StyleID="ssAccountLine${strong}"><Data ss:Type="String">${(o.get('name1', False) or '')|x}</Data></Cell> |
105 | -<Cell ss:StyleID="ssAccountLineNumber${strong}"><Data ss:Type="Number">${(o.get('balance1', False) or 0.0)}</Data></Cell> |
106 | +<Cell ss:StyleID="ssAccountLineNumber${strong}"><Data ss:Type="Number">${(abs(o.get('balance1', False)) or 0.0)}</Data></Cell> |
107 | ## liabilities |
108 | <% |
109 | strong = o.get('level', False) and o['level'] < 4 and 'Strong' or '' |
110 | %> |
111 | <Cell ss:StyleID="ssAccountLine${strong}"><Data ss:Type="String">${(o.get('code', False) or '')|x}</Data></Cell> |
112 | <Cell ss:StyleID="ssAccountLine${strong}"><Data ss:Type="String">${(o.get('name', False) or '')|x}</Data></Cell> |
113 | -<Cell ss:StyleID="ssAccountLineNumber${strong}"><Data ss:Type="Number">${(o.get('balance', False) or 0.0)}</Data></Cell> |
114 | +<Cell ss:StyleID="ssAccountLineNumber${strong}"><Data ss:Type="Number">${(abs(o.get('balance', False)) or 0.0)}</Data></Cell> |
115 | </Row> |
116 | % endfor |
117 | |
118 | <Row> |
119 | <Cell ss:StyleID="ssAccountLineStrong"><Data ss:Type="String">Balance ${company.currency_id.symbol or ''|x}</Data></Cell> |
120 | <Cell ss:StyleID="ssAccountLineStrong"><Data ss:Type="String"></Data></Cell> |
121 | -<Cell ss:StyleID="ssAccountLineNumberStrong"><Data ss:Type="Number">${sum_cr()}</Data></Cell> |
122 | +<Cell ss:StyleID="ssAccountLineNumberStrong"><Data ss:Type="Number">${abs(sum_cr())}</Data></Cell> |
123 | <Cell ss:StyleID="ssAccountLineStrong"><Data ss:Type="String">Balance ${company.currency_id.symbol or ''|x}</Data></Cell> |
124 | <Cell ss:StyleID="ssAccountLineStrong"><Data ss:Type="String"></Data></Cell> |
125 | -<Cell ss:StyleID="ssAccountLineNumberStrong"><Data ss:Type="Number">${sum_dr()}</Data></Cell> |
126 | +<Cell ss:StyleID="ssAccountLineNumberStrong"><Data ss:Type="Number">${abs(sum_dr())}</Data></Cell> |
127 | </Row> |
128 | |
129 | </Table> |
130 | |
131 | === modified file 'bin/addons/account/report/account_general_ledger.py' |
132 | --- bin/addons/account/report/account_general_ledger.py 2016-05-11 05:57:29 +0000 |
133 | +++ bin/addons/account/report/account_general_ledger.py 2016-05-24 07:58:03 +0000 |
134 | @@ -66,18 +66,6 @@ |
135 | 'show_period_0': 1, |
136 | 'state_agnostic': 1, |
137 | }) |
138 | - # US-1197/4: IB entries for yearly closing always in 1th Jan |
139 | - # => get rid of regular period/dates filters for _query_get |
140 | - # => if self.init_balance is True, note that filtering is OK |
141 | - # validated at wizard report level |
142 | - ib_local_context.update({ |
143 | - 'date_from': False, |
144 | - 'date_to': False, |
145 | - 'date_fromto_docdate': False, |
146 | - 'period_from': False, |
147 | - 'period_to': False, |
148 | - 'periods': False, |
149 | - }) |
150 | self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', |
151 | context=ib_local_context) |
152 | else: |
153 | @@ -237,18 +225,12 @@ |
154 | |
155 | def _show_node_in_report(self, node): |
156 | res = True |
157 | - if node.parent is None: |
158 | - return res # always show root account MSF |
159 | - if self.account_ids or self.account_report_types \ |
160 | - or self.unreconciled_filter: |
161 | - res = not node.skip |
162 | - if res: |
163 | - # hide if zero bal and any by account or unreconciled filter on |
164 | - bal = node.data.get('*', {}).get('debit', 0.) \ |
165 | - - node.data.get('*', {}).get('credit', 0.) |
166 | - if bal == 0.: |
167 | - res = False |
168 | - |
169 | + if self.account_ids or self.unreconciled_filter: |
170 | + # hide if zero bal and any by account or unreconciled filter on |
171 | + bal = node.data.get('*', {}).get('debit', 0.) \ |
172 | + - node.data.get('*', {}).get('credit', 0.) |
173 | + if bal == 0.: |
174 | + res = False |
175 | return res |
176 | |
177 | def _get_journals_str(self, data): |
178 | @@ -410,7 +392,6 @@ |
179 | line = self.get_start_period(data) + ' - ' + self.get_end_period(data) |
180 | if line: |
181 | infos.append(line) |
182 | - |
183 | return infos and ", \n".join(infos) or _('No Filter') |
184 | |
185 | def _get_line_debit(self, line, booking=False): |
186 | @@ -455,11 +436,9 @@ |
187 | if data['form'].get('instance_ids', False): |
188 | self.cr.execute('select code from msf_instance where id IN %s', |
189 | (tuple(data['form']['instance_ids']),)) |
190 | - instances = [x for x, in self.cr.fetchall()] |
191 | else: |
192 | - # US-1166: mission only instances if none provided |
193 | - instances = self._get_instances(get_code=True, |
194 | - mission_filter=True) |
195 | + self.cr.execute('select code from msf_instance') |
196 | + instances = [x for x, in self.cr.fetchall()] |
197 | return ', '.join(instances) |
198 | |
199 | # internal filter functions |
200 | @@ -497,15 +476,6 @@ |
201 | display_account = _('With balance is not equal to 0') |
202 | info_data.append((_('Accounts'), display_account, )) |
203 | |
204 | - account_ids = list(set(self._get_data_form(data, 'account_ids'))) |
205 | - if account_ids: |
206 | - # US-1197/2: display filtered accounts |
207 | - account_obj = self.pool.get('account.account') |
208 | - info_data.append((_('Selected Accounts'), ', '.join( |
209 | - [ a.code for a in account_obj.browse( |
210 | - self.cr, self.uid, account_ids) \ |
211 | - if a.type != 'view' ], ))) |
212 | - |
213 | res = [ "%s: %s" % (label, val, ) for label, val in info_data ] |
214 | return ', \n'.join(res) |
215 | |
216 | |
217 | === modified file 'bin/addons/account/report/account_general_ledger_landscape.rml' |
218 | --- bin/addons/account/report/account_general_ledger_landscape.rml 2016-04-13 15:35:05 +0000 |
219 | +++ bin/addons/account/report/account_general_ledger_landscape.rml 2016-05-24 07:58:03 +0000 |
220 | @@ -248,7 +248,7 @@ |
221 | [[ get_show_move_lines() or removeParentNode('blockTable') ]] |
222 | <tr> |
223 | <td> |
224 | - <para style="terp_tblheader_Details">Account/Entry Seq</para> |
225 | + <para style="terp_tblheader_Details">Entry Seq</para> |
226 | </td> |
227 | <td> |
228 | <para style="terp_tblheader_Details">Posting Date</para> |
229 | @@ -330,17 +330,14 @@ |
230 | |
231 | <section> |
232 | <para style="terp_default_8">[[ repeatIn(lines(o, initial_balance_mode=True), 'line') ]]</para> |
233 | - <blockTable colWidths="40.0,246.0,60.0,110.0,110.0,110.0,110.0" style="Table9"> |
234 | + <blockTable colWidths="286.0,60.0,110.0,110.0,110.0,110.0" style="Table9"> |
235 | [[ show_node_in_report(o) or removeParentNode('blockTable') ]] |
236 | <tr> |
237 | <td> |
238 | - <para style="terp_default_9_Right">[[ o.code or '' ]]</para> |
239 | - </td> |
240 | - <td> |
241 | <para style="terp_default_9_Right">[[ line['move'] or '' ]]</para> |
242 | </td> |
243 | <td> |
244 | - <para style="terp_default_9_Right">[[ line['currency_name'] or '' ]]</para> |
245 | + <para style="terp_def114.0,80.0,92.0,60.0,110.0,110.0,110.0,110.0ault_9_Right">[[ line['currency_name'] or '' ]]</para> |
246 | </td> |
247 | <td> |
248 | <para style="terp_default_9_Right">[[ formatLang(get_line_debit(line, booking=True), digits=get_digits(dp='Account')) ]]</para> |
249 | @@ -393,14 +390,11 @@ |
250 | |
251 | <section> |
252 | <para style="terp_default_8">[[ repeatIn(o.get_currencies(), 'ccy') ]]</para> |
253 | - <blockTable colWidths="40.0,246.0,60.0,110.0,110.0,110.0,110.0" style="Table8_subtotal_ccy"> |
254 | + <blockTable colWidths="286.0,60.0,110.0,110.0,110.0,110.0" style="Table8_subtotal_ccy"> |
255 | [[ show_node_in_report(o) or removeParentNode('blockTable') ]] |
256 | <tr> |
257 | <td> |
258 | - <para style="terp_default_9_Right">[[ o.code or '' ]]</para> |
259 | - </td> |
260 | - <td> |
261 | - <para style="terp_default_9_Right">Sub Total</para> |
262 | + <para style="terp_default_9_Right">[[ o.code ]]</para> |
263 | </td> |
264 | <td> |
265 | <para style="terp_default_9_Right">[[ ccy ]]</para> |
266 | |
267 | === modified file 'bin/addons/account/report/account_general_ledger_xls.mako' |
268 | --- bin/addons/account/report/account_general_ledger_xls.mako 2016-04-13 15:35:05 +0000 |
269 | +++ bin/addons/account/report/account_general_ledger_xls.mako 2016-05-24 07:58:03 +0000 |
270 | @@ -187,15 +187,21 @@ |
271 | display_account = (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0' |
272 | %> |
273 | <Table x:FullColumns="1" x:FullRows="1"> |
274 | -<Column ss:AutoFitWidth="1" ss:Width="50" /> |
275 | -<Column ss:AutoFitWidth="1" ss:Width="80" /> |
276 | -<Column ss:AutoFitWidth="1" ss:Width="55" /> |
277 | -<Column ss:AutoFitWidth="1" ss:Width="80" /> |
278 | -<Column ss:AutoFitWidth="1" ss:Width="50" /> |
279 | -<Column ss:Width="90" /> |
280 | -<Column ss:Width="90" /> |
281 | -<Column ss:Width="90" /> |
282 | -<Column ss:Width="90" /> |
283 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
284 | +<Column ss:AutoFitWidth="1" ss:Width="120" /> |
285 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
286 | +% if get_show_move_lines(): |
287 | +<Column ss:AutoFitWidth="1" ss:Width="300" /> |
288 | +% endif |
289 | +% if not get_show_move_lines(): |
290 | +<Column ss:AutoFitWidth="1" ss:Width="150" /> |
291 | +% endif |
292 | +<Column ss:AutoFitWidth="1" ss:Width="50" /> |
293 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
294 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
295 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
296 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
297 | +<Column ss:AutoFitWidth="1" ss:Width="64" /> |
298 | <Row> |
299 | <Cell ss:StyleID="ssH"><Data ss:Type="String">${header_company_or_chart_of_account}</Data></Cell> |
300 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Fiscal Year</Data></Cell> |
301 | @@ -240,14 +246,13 @@ |
302 | </Row> |
303 | <Row> |
304 | % if get_show_move_lines(): |
305 | -<Cell ss:StyleID="ssH"><Data ss:Type="String">Account</Data></Cell> |
306 | -<Cell ss:StyleID="ssH"><Data ss:Type="String">Entry Seq</Data></Cell> |
307 | +<Cell ss:StyleID="ssH" ss:MergeAcross="1"><Data ss:Type="String">Entry Seq</Data></Cell> |
308 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Posting Date</Data></Cell> |
309 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Description</Data></Cell> |
310 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Currency</Data></Cell> |
311 | % endif |
312 | % if not get_show_move_lines(): |
313 | -<Cell ss:StyleID="ssH"><Data ss:Type="String">Account</Data></Cell> |
314 | +<Cell ss:StyleID="ssH"><Data ss:Type="String">Account / CCY</Data></Cell> |
315 | <Cell ss:StyleID="ssH" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> |
316 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Currency</Data></Cell> |
317 | % endif |
318 | @@ -296,10 +301,7 @@ |
319 | |
320 | % for line in lines(o, initial_balance_mode=True): |
321 | <Row> |
322 | -<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}"> |
323 | - <Data ss:Type="String">${(o.code or '')|x}</Data> |
324 | -</Cell> |
325 | -<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}" ss:MergeAcross="2"> |
326 | +<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}" ss:MergeAcross="3"> |
327 | <Data ss:Type="String">${(line['move'] or '' or '')|x}</Data> |
328 | </Cell> |
329 | <Cell ss:StyleID="ssAccountLine${ccy_sub_total_style_suffix}"> |
330 | @@ -331,7 +333,7 @@ |
331 | <Cell ss:StyleID="ssAccountLine"> |
332 | <Data ss:Type="String">${(formatLang(line['ldate'],date=True)) or ''}</Data> |
333 | </Cell> |
334 | -<Cell ss:StyleID="ssAccountLine"> |
335 | +<Cell ss:StyleID="ssAccountLineNoWrap"> |
336 | <Data ss:Type="String">${(line['lname'] or '')|x}</Data> |
337 | </Cell> |
338 | <Cell ss:StyleID="ssAccountLine"> |
339 | @@ -354,12 +356,9 @@ |
340 | |
341 | % for ccy in o.get_currencies(): |
342 | <Row> |
343 | -<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}"> |
344 | +<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}" ss:MergeAcross="3"> |
345 | <Data ss:Type="String">${(o.code or '')|x}</Data> |
346 | </Cell> |
347 | -<Cell ss:StyleID="ssBorder${ccy_sub_total_style_suffix}${ccy_sub_total_style_right_suffix}" ss:MergeAcross="2"> |
348 | - <Data ss:Type="String">Sub Total</Data> |
349 | -</Cell> |
350 | <Cell ss:StyleID="ssAccountLine${ccy_sub_total_style_suffix}"> |
351 | <Data ss:Type="String">${(ccy or '')|x}</Data> |
352 | </Cell> |
353 | @@ -384,12 +383,7 @@ |
354 | <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> |
355 | <PageSetup> |
356 | <Layout x:Orientation="Landscape"/> |
357 | -% if get_show_move_lines(): |
358 | - <Header x:Data="&C&"Arial,Bold"&14General Ledger"/>0 |
359 | -% endif |
360 | -% if not get_show_move_lines(): |
361 | - <Header x:Data="&C&"Arial,Bold"&14Trial Balance"/>0 |
362 | -% endif |
363 | + <Header x:Data="&C&"Arial,Bold"&14General Ledger"/> |
364 | <Footer x:Data="Page &P of &N"/> |
365 | </PageSetup> |
366 | <Print> |
367 | |
368 | === modified file 'bin/addons/account/report/account_profit_loss.py' |
369 | --- bin/addons/account/report/account_profit_loss.py 2016-04-06 13:40:48 +0000 |
370 | +++ bin/addons/account/report/account_profit_loss.py 2016-05-24 07:58:03 +0000 |
371 | @@ -239,11 +239,9 @@ |
372 | if data['form'].get('instance_ids', False): |
373 | self.cr.execute('select code from msf_instance where id IN %s', |
374 | (tuple(data['form']['instance_ids']),)) |
375 | - instances = [x for x, in self.cr.fetchall()] |
376 | else: |
377 | - # US-1166: mission only instances if none provided |
378 | - instances = self._get_instances(get_code=True, |
379 | - mission_filter=True) |
380 | + self.cr.execute('select code from msf_instance') |
381 | + instances = [x for x, in self.cr.fetchall()] |
382 | return ', '.join(instances) |
383 | |
384 | report_sxw.report_sxw('report.pl.account.horizontal', 'account.account', |
385 | |
386 | === modified file 'bin/addons/account/report/common_report_header.py' |
387 | --- bin/addons/account/report/common_report_header.py 2016-04-06 13:40:48 +0000 |
388 | +++ bin/addons/account/report/common_report_header.py 2016-05-24 07:58:03 +0000 |
389 | @@ -192,19 +192,4 @@ |
390 | return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.symbol |
391 | return '' |
392 | |
393 | - def _get_instances(self, get_code=False, mission_filter=False): |
394 | - """ |
395 | - :param get_code: True to return code list vs ids list |
396 | - :type get_code: boolean |
397 | - :param mission_filter: only mission instance ? |
398 | - :type mission_filter: boolean |
399 | - :rtype : list/False |
400 | - """ |
401 | - instance_obj = pooler.get_pool(self.cr.dbname).get('msf.instance') |
402 | - ids = instance_obj.search(self.cr, self.uid, |
403 | - mission_filter and [('instance_to_display_ids','=',True)] or []) |
404 | - if not get_code or not ids: |
405 | - return ids |
406 | - return [ i.code for i in instance_obj.browse(self.cr, self.uid, ids) ] |
407 | - |
408 | #vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
409 | |
410 | === modified file 'bin/addons/account/wizard/account_report_balance_sheet_view.xml' |
411 | --- bin/addons/account/wizard/account_report_balance_sheet_view.xml 2016-04-06 13:40:48 +0000 |
412 | +++ bin/addons/account/wizard/account_report_balance_sheet_view.xml 2016-05-24 07:58:03 +0000 |
413 | @@ -20,7 +20,7 @@ |
414 | <field name="display_account"/> |
415 | <field name="export_format"/> |
416 | <newline /> |
417 | - <field name="instance_ids" domain="[('instance_to_display_ids','=',True)]"> |
418 | + <field name="instance_ids"> |
419 | <tree noteditable="1" editable="top" string="Proprietary Instances"> |
420 | <field name="code" /> |
421 | <field name="name" /> |
422 | |
423 | === modified file 'bin/addons/account/wizard/account_report_general_ledger.py' |
424 | --- bin/addons/account/wizard/account_report_general_ledger.py 2016-04-07 12:44:59 +0000 |
425 | +++ bin/addons/account/wizard/account_report_general_ledger.py 2016-05-24 07:58:03 +0000 |
426 | @@ -128,7 +128,9 @@ |
427 | fy_rec = self.pool.get('account.fiscalyear').browse(cr, uid, |
428 | fiscalyear_id, context=context) |
429 | if filter in ('filter_date_doc', 'filter_date', ): |
430 | - ib_available = date_from and date_from == fy_rec.date_start |
431 | + ib_available = date_from and date_to \ |
432 | + and date_from == fy_rec.date_start \ |
433 | + and date_to <= fy_rec.date_stop |
434 | elif filter in 'filter_period': |
435 | if not period_from or not period_to: |
436 | ib_available = False |
437 | |
438 | === modified file 'bin/addons/account/wizard/account_report_profit_loss_view.xml' |
439 | --- bin/addons/account/wizard/account_report_profit_loss_view.xml 2016-04-06 13:40:48 +0000 |
440 | +++ bin/addons/account/wizard/account_report_profit_loss_view.xml 2016-05-24 07:58:03 +0000 |
441 | @@ -20,7 +20,7 @@ |
442 | <field name="display_account"/> |
443 | <field name="export_format"/> |
444 | <newline/> |
445 | - <field name="instance_ids" domain="[('instance_to_display_ids','=',True)]"> |
446 | + <field name="instance_ids"> |
447 | <tree noteditable="1" editable="top" string="Proprietary Instances"> |
448 | <field name="code" /> |
449 | <field name="name" /> |
450 | |
451 | === modified file 'bin/addons/account_mcdb/account_view.xml' |
452 | --- bin/addons/account_mcdb/account_view.xml 2016-04-05 08:49:12 +0000 |
453 | +++ bin/addons/account_mcdb/account_view.xml 2016-05-24 07:58:03 +0000 |
454 | @@ -31,8 +31,8 @@ |
455 | <field name="transfer_journal_id" invisible="1"/> |
456 | <field name="partner_txt"/> |
457 | <field name="partner_type" invisible="1"/> |
458 | - <field name="debit_currency" sum="Total Booking Debit"/> |
459 | - <field name="credit_currency" sum="Total Booking Credit"/> |
460 | + <field name="debit_currency"/> |
461 | + <field name="credit_currency"/> |
462 | <field name="currency_id"/> |
463 | <field name="debit" sum="Total Functional Debit"/> |
464 | <field name="credit" sum="Total Functional Credit"/> |
465 | @@ -74,9 +74,9 @@ |
466 | <field name="cost_center_id" string="Cost Center" invisible="not context.get('display_fp', False)"/> |
467 | <field name="account_id"/> |
468 | <field name="partner_txt"/> |
469 | - <field name="amount_currency" sum="Total Booking Amount"/> |
470 | + <field name="amount_currency"/> |
471 | <field name="currency_id"/> |
472 | - <field name="amount" sum="Total Functional Amount"/> |
473 | + <field name="amount"/> |
474 | <field name="functional_currency_id"/> |
475 | <field name="output_amount"/> |
476 | <field name="output_currency"/> |
477 | |
478 | === modified file 'bin/addons/analytic_distribution/analytic_line.py' |
479 | --- bin/addons/analytic_distribution/analytic_line.py 2016-04-12 08:17:35 +0000 |
480 | +++ bin/addons/analytic_distribution/analytic_line.py 2016-05-24 07:58:03 +0000 |
481 | @@ -338,7 +338,7 @@ |
482 | self.pool.get('account.move.line').corrected_upstream_marker(cr, uid, [aline.move_id.id], context=context) |
483 | return True |
484 | |
485 | - def check_analytic_account(self, cr, uid, ids, account_id, wiz_date, context=None): |
486 | + def check_analytic_account(self, cr, uid, ids, account_id, context=None): |
487 | """ |
488 | Analytic distribution validity verification with given account for given ids. |
489 | Return all valid ids. |
490 | @@ -372,14 +372,6 @@ |
491 | # since US-711 date_stop is to be excluded itself as a frontier |
492 | # => >= date_stop vs > date_stop |
493 | # => http://jira.unifield.org/browse/US-711?focusedCommentId=45744&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-45744 |
494 | - if account_type in ['OC', 'DEST']: |
495 | - if aline.journal_id.type == 'hq' or aline.period_id and aline.period_id.state in ['done', 'mission-closed']: |
496 | - aline_cmp_date = wiz_date |
497 | - # these lines will be reverted, check if the reverted line is active |
498 | - oc_dest_date_start = max(aline.cost_center_id.date_start, aline.destination_id.date_start) |
499 | - oc_dest_date_stop = min(aline.cost_center_id.date or '9999-01-01', aline.destination_id.date or '9999-01-01') |
500 | - if (oc_dest_date_start and wiz_date < oc_dest_date_start) or (oc_dest_date_stop and wiz_date >= oc_dest_date_stop): |
501 | - expired_date_ids.append(aline.id) |
502 | if (date_start and aline_cmp_date < date_start) or (date_stop and aline_cmp_date >= date_stop): |
503 | expired_date_ids.append(aline.id) |
504 | # Process regarding account_type |
505 | |
506 | === modified file 'bin/addons/analytic_override/analytic_line.py' |
507 | --- bin/addons/analytic_override/analytic_line.py 2016-04-12 07:14:13 +0000 |
508 | +++ bin/addons/analytic_override/analytic_line.py 2016-05-24 07:58:03 +0000 |
509 | @@ -135,27 +135,24 @@ |
510 | if not 'account_id' in vals: |
511 | raise osv.except_osv(_('Error'), _('No account_id found in given values!')) |
512 | |
513 | - account_obj = self.pool.get('account.analytic.account') |
514 | - |
515 | #US-419: Use the document date and not posting date when checking the validity of analytic account |
516 | # tech: replaced all date by document_date |
517 | if 'document_date' in vals and vals['document_date'] is not False: |
518 | + account_obj = self.pool.get('account.analytic.account') |
519 | document_date = vals['document_date'] |
520 | account = account_obj.browse(cr, uid, vals['account_id'], context=context) |
521 | # FIXME: refactoring of next code |
522 | if document_date < account.date_start or (account.date != False and document_date >= account.date): |
523 | if 'from' not in context or context.get('from') != 'mass_reallocation': |
524 | raise osv.except_osv(_('Error'), _("The analytic account selected '%s' is not active.") % (account.name or '',)) |
525 | - if 'date' in vals and vals['date'] is not False: |
526 | - date = vals['date'] |
527 | if vals.get('cost_center_id', False): |
528 | cc = account_obj.browse(cr, uid, vals['cost_center_id'], context=context) |
529 | - if date < cc.date_start or (cc.date != False and date >= cc.date): |
530 | + if document_date < cc.date_start or (cc.date != False and document_date >= cc.date): |
531 | if 'from' not in context or context.get('from') != 'mass_reallocation': |
532 | raise osv.except_osv(_('Error'), _("The analytic account selected '%s' is not active.") % (cc.name or '',)) |
533 | if vals.get('destination_id', False): |
534 | dest = account_obj.browse(cr, uid, vals['destination_id'], context=context) |
535 | - if date < dest.date_start or (dest.date != False and date >= dest.date): |
536 | + if document_date < dest.date_start or (dest.date != False and document_date >= dest.date): |
537 | if 'from' not in context or context.get('from') != 'mass_reallocation': |
538 | raise osv.except_osv(_('Error'), _("The analytic account selected '%s' is not active.") % (dest.name or '',)) |
539 | return True |
540 | |
541 | === modified file 'bin/addons/delivery_mechanism/delivery_mechanism.py' |
542 | --- bin/addons/delivery_mechanism/delivery_mechanism.py 2016-05-02 07:56:36 +0000 |
543 | +++ bin/addons/delivery_mechanism/delivery_mechanism.py 2016-05-24 07:58:03 +0000 |
544 | @@ -1181,7 +1181,7 @@ |
545 | # UTP-967 |
546 | if move.state != 'cancel' and move.purchase_line_id and move.purchase_line_id.procurement_id: |
547 | proc = move.purchase_line_id.procurement_id |
548 | - if proc.move_id and proc.move_id.location_id.id == proc_loc_id: |
549 | + if proc.move_id and proc.move_id.location_id.id == proc_loc_id and count > 0.00: |
550 | if diff_qty > 0: |
551 | # REF-59: move of partial in, |
552 | # adapt proc order's move qty (for correct virtual stock) |
553 | |
554 | === modified file 'bin/addons/finance/account_drill.py' |
555 | --- bin/addons/finance/account_drill.py 2016-05-12 08:30:44 +0000 |
556 | +++ bin/addons/finance/account_drill.py 2016-05-24 07:58:03 +0000 |
557 | @@ -41,7 +41,6 @@ |
558 | # set during map/reduce |
559 | self.data = {} |
560 | self.zero_bal = False |
561 | - self.skip = False |
562 | |
563 | # set during next_node() calls |
564 | self.code = '' |
565 | @@ -80,11 +79,12 @@ |
566 | JOIN res_currency c ON (c.id = l.currency_id) |
567 | JOIN account_journal j on (l.journal_id=j.id) |
568 | JOIN account_account a on (a.id=l.account_id) |
569 | - WHERE l.account_id = %s{reconcile}{query} |
570 | + JOIN account_account_type at on (at.id=a.user_type) |
571 | + WHERE l.account_id = %s{reconcile}{options}{query} |
572 | GROUP BY l.currency_id''' |
573 | |
574 | # initial balance move lines base query (from IB journal period 0) |
575 | - _sql_ib = '''SELECT sum(debit), sum(credit), |
576 | + _sql_ib = '''SELECT sum(debit), sum(credit), |
577 | sum(debit_currency), sum(credit_currency), |
578 | max(c.name) |
579 | FROM account_move_line l |
580 | @@ -113,28 +113,8 @@ |
581 | self.query_ib = query_ib or '' |
582 | self.move_states = move_states or [ 'draft', 'posted', ] |
583 | self.include_accounts = include_accounts |
584 | - self.account_report_types = account_report_types |
585 | self.with_balance_only = with_balance_only |
586 | self.reconcile_filter = reconcile_filter |
587 | - if self.account_report_types and not self.include_accounts: |
588 | - # deduce included accounts from report type filter |
589 | - domain = [ |
590 | - ('report_type', 'in' , self.account_report_types), |
591 | - ] |
592 | - if 'asset' in self.account_report_types \ |
593 | - or 'liability' in self.account_report_types: |
594 | - # US-227 include tax account for BS accounts selection |
595 | - domain = [ '|', ('code', '=', 'tax') ] + domain |
596 | - account_types_ids = self.pool.get('account.account.type').search( |
597 | - self.cr, self.uid, domain, context=self.context) |
598 | - |
599 | - if account_types_ids: |
600 | - domain = [ |
601 | - ('type', '!=', 'view'), |
602 | - ('user_type', 'in' , account_types_ids), |
603 | - ] |
604 | - self.include_accounts = self.pool.get('account.account').search( |
605 | - self.cr, self.uid, domain, context=self.context) or [] |
606 | |
607 | # nodes |
608 | self.root = None |
609 | @@ -146,6 +126,18 @@ |
610 | # JI base query: constructed via _sql |
611 | self.sql = self._sql |
612 | self.sql = self.sql.replace('{reconcile}', self.reconcile_filter) |
613 | + if account_report_types: |
614 | + report_types = [ "'%s'" % (rt, ) for rt in account_report_types ] |
615 | + options = " AND (at.report_type in (%s)" % ( |
616 | + ','.join(report_types), ) |
617 | + if 'asset' in account_report_types \ |
618 | + or 'liability' in account_report_types: |
619 | + # US-227 include tax account for BS accounts selection |
620 | + options += " OR at.code = 'tax'" |
621 | + options += ')' |
622 | + else: |
623 | + options = '' |
624 | + self.sql = self.sql.replace('{options}', options) |
625 | |
626 | def output(self): |
627 | """ |
628 | @@ -177,6 +169,7 @@ |
629 | |
630 | level = max(self.nodes_by_level.keys()) |
631 | while level > 0: |
632 | +<<<<<<< TREE |
633 | nodes = self.nodes_by_level.get(level) |
634 | if nodes: |
635 | for n in nodes: |
636 | @@ -194,16 +187,30 @@ |
637 | n.skip = not n.childs |
638 | #elif level == self._move_level - 1: |
639 | # n.skip = not n.childs # no entries due to filtering |
640 | +======= |
641 | + nodes = self.nodes_by_level[level] |
642 | + for n in nodes: |
643 | + if level == self._move_level: |
644 | + if self.with_balance_only: |
645 | + bal = n.data.get('*', {}).get('debit', 0.) \ |
646 | + - n.data.get('*', {}).get('credit', 0.) |
647 | + if bal == 0.: |
648 | + # JI level: |
649 | + # with only balance filter: do not agregate account |
650 | + # debit/credit with a zero balance |
651 | + n.zero_bal = True |
652 | + continue |
653 | +>>>>>>> MERGE-SOURCE |
654 | |
655 | - parent = n.parent |
656 | - if parent: |
657 | - for ccy in n.data: |
658 | - if not ccy in parent.data: |
659 | - parent.data[ccy] = {} |
660 | - for f in fields: |
661 | - parent.data[ccy][f] = 0. |
662 | + parent = n.parent |
663 | + if parent: |
664 | + for ccy in n.data: |
665 | + if not ccy in parent.data: |
666 | + parent.data[ccy] = {} |
667 | for f in fields: |
668 | - parent.data[ccy][f] += n.data[ccy].get(f, 0.) |
669 | + parent.data[ccy][f] = 0. |
670 | + for f in fields: |
671 | + parent.data[ccy][f] += n.data[ccy].get(f, 0.) |
672 | level -= 1 # upper level (upper level by uper level) |
673 | |
674 | # uncomment to explore reduced nodes |
675 | @@ -223,11 +230,14 @@ |
676 | child_ids = self._search(domain) |
677 | if child_ids: |
678 | for id in child_ids: |
679 | +<<<<<<< TREE |
680 | if self.is_view(id) or not self.include_accounts or id in self.include_accounts: |
681 | +======= |
682 | + if not self.include_accounts or id in self.include_accounts: |
683 | +>>>>>>> MERGE-SOURCE |
684 | node = self._create_node(parent=parent, level=level, |
685 | account_id=id) |
686 | - if node: |
687 | - self._map_dive(node, level + 1) |
688 | + self._map_dive(node, level + 1) |
689 | |
690 | def _create_node(self, parent=None, level=0, account_id=False): |
691 | """ |
692 | |
693 | === modified file 'bin/addons/import_data/import_data.py' |
694 | --- bin/addons/import_data/import_data.py 2016-01-05 14:50:57 +0000 |
695 | +++ bin/addons/import_data/import_data.py 2016-05-24 07:58:03 +0000 |
696 | @@ -190,12 +190,23 @@ |
697 | 'import_mode': lambda *a: 'create', |
698 | } |
699 | |
700 | - def _import(self, dbname, uid, ids, context=None): |
701 | + def _import(self, cr, uid, ids, context=None, use_new_cursor=True, auto_import=False): |
702 | """if context includes 'import_data_field_max_size' dict, |
703 | this dict specifies the max tolerated field length at import |
704 | (key: field name, value: field size) |
705 | """ |
706 | - cr = pooler.get_db(dbname).cursor() |
707 | + dbname = cr.dbname |
708 | + if use_new_cursor: |
709 | + cr = pooler.get_db(cr.dbname).cursor() |
710 | + |
711 | + if context is None: |
712 | + context = {} |
713 | + |
714 | + if isinstance(ids, (int, long)): |
715 | + ids = [ids] |
716 | + |
717 | + processed = [] |
718 | + rejected = [] |
719 | |
720 | obj = self.read(cr, uid, ids[0]) |
721 | import_mode = obj.get('import_mode') |
722 | @@ -282,7 +293,8 @@ |
723 | self._cache[dbname]['product.international.status']['name'].update({iv['name']: iv['id']}) |
724 | |
725 | errorfile = TemporaryFile('w+') |
726 | - writer = csv.writer(errorfile, quotechar='"', delimiter=';') |
727 | + if not auto_import: |
728 | + writer = csv.writer(errorfile, quotechar='"', delimiter=';') |
729 | |
730 | fields_def = impobj.fields_get(cr, uid, context=context) |
731 | i = 0 |
732 | @@ -342,6 +354,13 @@ |
733 | |
734 | raise osv.except_osv(_('Warning !'), _('%s does not exist')%(value,)) |
735 | |
736 | + def write_error_row(row, index, error=""): |
737 | + if not auto_import: |
738 | + row.append(error) |
739 | + writer.writerow(row) |
740 | + else: |
741 | + rejected.append((index, row, error)) |
742 | + |
743 | i = 1 |
744 | nb_error = 0 |
745 | nb_succes = 0 |
746 | @@ -350,7 +369,8 @@ |
747 | if self.pre_hook.get(impobj._name): |
748 | # for headers mod. |
749 | col_datas = self.pre_hook[impobj._name](impobj, cr, uid, headers, {}, col_datas) |
750 | - writer.writerow(headers) |
751 | + if not auto_import: |
752 | + writer.writerow(headers) |
753 | |
754 | for row in reader: |
755 | newo2m = False |
756 | @@ -394,9 +414,8 @@ |
757 | logging.getLogger('import data').info( |
758 | 'Error %s'% (msg, )) |
759 | cr.rollback() |
760 | - row.append("Line %s, row: %s, %s" % (i, n, |
761 | - msg, )) |
762 | - writer.writerow(row) |
763 | + error = "Line %s, row: %s, %s" % (i, n, msg, ) |
764 | + write_error_row(row, i, error) |
765 | nb_error += 1 |
766 | line_ok = False |
767 | break |
768 | @@ -464,62 +483,64 @@ |
769 | impobj.create(cr, uid, data, context={'from_import_menu': True}) |
770 | nb_succes += 1 |
771 | cr.commit() |
772 | + processed.append((i, row)) |
773 | except osv.except_osv, e: |
774 | logging.getLogger('import data').info('Error %s'%e.value) |
775 | cr.rollback() |
776 | - row.append("Line %s, row: %s, %s"%(i, n, e.value)) |
777 | - writer.writerow(row) |
778 | + error = "Line %s, row: %s, %s"%(i, n, e.value) |
779 | + write_error_row(row, i, error) |
780 | nb_error += 1 |
781 | except Exception, e: |
782 | cr.rollback() |
783 | logging.getLogger('import data').info('Error %s'%e) |
784 | - row.append("Line %s, row: %s, %s"%(i, n, e)) |
785 | - writer.writerow(row) |
786 | + error = "Line %s, row: %s, %s"%(i, n, e) |
787 | + write_error_row(row, i, error) |
788 | nb_error += 1 |
789 | |
790 | if self.post_load_hook.get(impobj._name): |
791 | self.post_load_hook[impobj._name](impobj, cr, uid) |
792 | fileobj.close() |
793 | - import_type = 'Import' |
794 | - if import_mode == 'update': |
795 | - import_type = 'Update' |
796 | - summary = '''Datas Import Summary: |
797 | -Object: %s |
798 | -Records updated: %s |
799 | -Records created: %s |
800 | -'''%(objname, nb_update_success, nb_succes) |
801 | - else: |
802 | - summary = '''Datas Import Summary: |
803 | -Object: %s |
804 | -Records created: %s |
805 | -'''%(objname, nb_succes) |
806 | - |
807 | - if nb_error: |
808 | - summary += '''Records rejected: %s |
809 | - |
810 | -Find in attachment the rejected lines'''%(nb_error) |
811 | - |
812 | - request_obj = self.pool.get('res.request') |
813 | - req_id = request_obj.create(cr, uid, |
814 | - {'name': "%s %s"%(import_type, objname,), |
815 | - 'act_from': uid, |
816 | - 'act_to': uid, |
817 | - 'body': summary, |
818 | - }) |
819 | - if req_id: |
820 | - request_obj.request_send(cr, uid, [req_id]) |
821 | - |
822 | - if nb_error: |
823 | - errorfile.seek(0) |
824 | - attachment = self.pool.get('ir.attachment') |
825 | - attachment.create(cr, uid, { |
826 | - 'name': 'rejected-lines.csv', |
827 | - 'datas_fname': 'rejected-lines.csv', |
828 | - 'description': 'Rejected Lines', |
829 | - 'res_model': 'res.request', |
830 | - 'res_id': req_id, |
831 | - 'datas': base64.encodestring(errorfile.read()), |
832 | - }) |
833 | + if not auto_import: |
834 | + import_type = 'Import' |
835 | + if import_mode == 'update': |
836 | + import_type = 'Update' |
837 | + summary = '''Datas Import Summary: |
838 | + Object: %s |
839 | + Records updated: %s |
840 | + Records created: %s |
841 | + '''%(objname, nb_update_success, nb_succes) |
842 | + else: |
843 | + summary = '''Datas Import Summary: |
844 | + Object: %s |
845 | + Records created: %s |
846 | + '''%(objname, nb_succes) |
847 | + |
848 | + if nb_error: |
849 | + summary += '''Records rejected: %s |
850 | + |
851 | + Find in attachment the rejected lines'''%(nb_error) |
852 | + |
853 | + request_obj = self.pool.get('res.request') |
854 | + req_id = request_obj.create(cr, uid, |
855 | + {'name': "%s %s"%(import_type, objname,), |
856 | + 'act_from': uid, |
857 | + 'act_to': uid, |
858 | + 'body': summary, |
859 | + }) |
860 | + if req_id: |
861 | + request_obj.request_send(cr, uid, [req_id]) |
862 | + |
863 | + if nb_error: |
864 | + errorfile.seek(0) |
865 | + attachment = self.pool.get('ir.attachment') |
866 | + attachment.create(cr, uid, { |
867 | + 'name': 'rejected-lines.csv', |
868 | + 'datas_fname': 'rejected-lines.csv', |
869 | + 'description': 'Rejected Lines', |
870 | + 'res_model': 'res.request', |
871 | + 'res_id': req_id, |
872 | + 'datas': base64.encodestring(errorfile.read()), |
873 | + }) |
874 | |
875 | if impobj == 'product.product': |
876 | # Clear the cache |
877 | @@ -528,10 +549,14 @@ |
878 | |
879 | errorfile.close() |
880 | cr.commit() |
881 | - cr.close(True) |
882 | + if use_new_cursor: |
883 | + cr.close(True) |
884 | + |
885 | + if auto_import: |
886 | + return processed, rejected, headers |
887 | |
888 | def import_csv(self, cr, uid, ids, context=None): |
889 | - thread = threading.Thread(target=self._import, args=(cr.dbname, uid, ids, context)) |
890 | + thread = threading.Thread(target=self._import, args=(cr, uid, ids, context)) |
891 | thread.start() |
892 | return {'type': 'ir.actions.act_window_close'} |
893 | |
894 | |
895 | === modified file 'bin/addons/mission_stock/mission_stock.py' |
896 | --- bin/addons/mission_stock/mission_stock.py 2016-05-12 08:16:15 +0000 |
897 | +++ bin/addons/mission_stock/mission_stock.py 2016-05-24 07:58:03 +0000 |
898 | @@ -39,6 +39,7 @@ |
899 | return text |
900 | |
901 | |
902 | +<<<<<<< TREE |
903 | class msr_in_progress(osv.osv_memory): |
904 | ''' |
905 | US-1218: This memory class is used to store temporary values regarding the report process, when a report is in progress, at it into the table |
906 | @@ -84,6 +85,8 @@ |
907 | |
908 | msr_in_progress() |
909 | |
910 | +======= |
911 | +>>>>>>> MERGE-SOURCE |
912 | class stock_mission_report(osv.osv): |
913 | _name = 'stock.mission.report' |
914 | _description = 'Mission stock report' |
915 | @@ -185,21 +188,11 @@ |
916 | def update_newthread(self, cr, uid, ids=[], context=None): |
917 | # Open a new cursor :Â Don't forget to close it at the end of method |
918 | cr = pooler.get_db(cr.dbname).cursor() |
919 | - msr_in_progress = self.pool.get('msr_in_progress') |
920 | try: |
921 | - if msr_in_progress._is_in_progress(cr, uid, context): |
922 | - logging.getLogger('MSR').info("""____________________ Another process is progress, this request is ignore: %s""" % time.strftime('%Y-%m-%d %H:%M:%S')) |
923 | - return |
924 | - |
925 | - logging.getLogger('MSR').info("""____________________ Start the update process of MSR, at %s""" % time.strftime('%Y-%m-%d %H:%M:%S')) |
926 | self.update(cr, uid, ids=[], context=None) |
927 | - msr_in_progress._delete_all(cr, uid, context) |
928 | cr.commit() |
929 | - logging.getLogger('MSR').info("""____________________ Finished the update process of MSR, at %s""" % time.strftime('%Y-%m-%d %H:%M:%S')) |
930 | - except Exception as e: |
931 | + except Exception: |
932 | cr.rollback() |
933 | - logging.getLogger('MSR').error("""____________________ Error while running the update process of MSR, at %s - Error: %s""" % (time.strftime('%Y-%m-%d %H:%M:%S'), str(e))) |
934 | - msr_in_progress._delete_all(cr, uid, context) |
935 | finally: |
936 | cr.close(True) |
937 | |
938 | @@ -214,11 +207,9 @@ |
939 | ids = [ids] |
940 | |
941 | line_obj = self.pool.get('stock.mission.report.line') |
942 | - msr_in_progress = self.pool.get('msr_in_progress') |
943 | |
944 | - report_ids = self.search(cr, uid, [('local_report', '=', True), ('full_view', '=', False)], context=context) |
945 | + report_ids = self.search(cr, uid, [('local_report', '=', True)], context=context) |
946 | full_report_ids = self.search(cr, uid, [('full_view', '=', True)], context=context) |
947 | - |
948 | instance_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id |
949 | line_ids = [] |
950 | |
951 | @@ -251,15 +242,12 @@ |
952 | |
953 | product_ids = self.pool.get('product.product').search(cr, uid, [], context=context) |
954 | product_values = {} |
955 | - temp_prods = self.pool.get('product.product').read(cr, uid, product_ids, ['product_amc', 'reviewed_consumption'], context=context) |
956 | - |
957 | - logging.getLogger('MSR').info("""___ Number of MSR lines to be updated: %s, at %s""" % (len(temp_prods), time.strftime('%Y-%m-%d %H:%M:%S'))) |
958 | - |
959 | - for product in temp_prods: |
960 | + for product in self.pool.get('product.product').read(cr, uid, product_ids, ['product_amc', 'reviewed_consumption'], context=context): |
961 | product_values.setdefault(product['id'], {}) |
962 | product_values[product['id']].setdefault('product_amc', product['product_amc']) |
963 | product_values[product['id']].setdefault('reviewed_consumption', product['reviewed_consumption']) |
964 | |
965 | + |
966 | # Check in each report if new products are in the database and not in the report |
967 | for report in self.read(cr, uid, report_ids, ['local_report', 'full_view'], context=context): |
968 | #self.write(cr, uid, [report.id], {'export_ok': False}, context=context) |
969 | @@ -274,11 +262,16 @@ |
970 | if not report['local_report']: |
971 | continue |
972 | |
973 | +<<<<<<< TREE |
974 | #US-1218: If this report is previously processed, then do not redo it again for this transaction! |
975 | if msr_in_progress._already_processed(cr, uid, report['id'], context): |
976 | continue |
977 | +======= |
978 | + # Update the update date on report |
979 | + self.write(cr, uid, [report['id']], {'last_update': time.strftime('%Y-%m-%d %H:%M:%S'), |
980 | + 'export_ok': False}, context=context) |
981 | +>>>>>>> MERGE-SOURCE |
982 | |
983 | - logging.getLogger('MSR').info("""___ updating the report lines of the report: %s, at %s (this may take very long time!)""" % (report['id'], time.strftime('%Y-%m-%d %H:%M:%S'))) |
984 | if context.get('update_full_report'): |
985 | full_view = self.search(cr, uid, [('full_view', '=', True)]) |
986 | if full_view: |
987 | @@ -288,15 +281,22 @@ |
988 | # Update all lines |
989 | self.update_lines(cr, uid, [report['id']]) |
990 | |
991 | +<<<<<<< TREE |
992 | msr_ids = msr_in_progress.search(cr, uid, [('report_id', '=', report['id'])], context=context) |
993 | msr_in_progress.write(cr, uid, msr_ids, {'done_ok': True}, context=context) |
994 | |
995 | logging.getLogger('MSR').info("""___ exporting the report lines of the report %s to csv, at %s""" % (report['id'], time.strftime('%Y-%m-%d %H:%M:%S'))) |
996 | +======= |
997 | +>>>>>>> MERGE-SOURCE |
998 | self._get_export_csv(cr, uid, report['id'], product_values, context=context) |
999 | +<<<<<<< TREE |
1000 | # Update the update date on report |
1001 | self.write(cr, uid, [report['id']], {'last_update': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) |
1002 | logging.getLogger('MSR').info("""___ finished processing completely for the report: %s, at %s \n""" % (report['id'], time.strftime('%Y-%m-%d %H:%M:%S'))) |
1003 | |
1004 | +======= |
1005 | + |
1006 | +>>>>>>> MERGE-SOURCE |
1007 | # After update of all normal reports, update the full view report |
1008 | if not context.get('update_full_report'): |
1009 | c = context.copy() |
1010 | @@ -338,43 +338,31 @@ |
1011 | |
1012 | for id in ids: |
1013 | # In-Pipe moves |
1014 | - cr.execute('''SELECT m.product_id, sum(m.product_qty), m.product_uom, p.name |
1015 | + cr.execute('''SELECT m.product_id, m.product_qty, m.product_uom, p.name, m.id |
1016 | FROM stock_move m |
1017 | LEFT JOIN stock_picking s ON m.picking_id = s.id |
1018 | LEFT JOIN res_partner p ON s.partner_id2 = p.id |
1019 | - WHERE s.type = 'in' AND m.state in ('confirmed', 'waiting', 'assigned') |
1020 | - GROUP BY m.product_id, m.product_uom, p.name |
1021 | - ORDER BY m.product_id''') |
1022 | + WHERE s.type = 'in' AND m.state in ('confirmed', 'waiting', 'assigned')''') |
1023 | |
1024 | in_pipe_moves = cr.fetchall() |
1025 | - current_product = None |
1026 | - line = None |
1027 | - vals = {} |
1028 | - for product_id, qty, uom, partner in in_pipe_moves: |
1029 | - if current_product != product_id: |
1030 | - if line and vals and (vals.get('in_pipe_qty', False) or vals.get('in_pipe_coor_qty', False)): |
1031 | - line_obj.write(cr, uid, [line.id], vals) |
1032 | - line_id = line_obj.search(cr, uid, [('product_id', '=', product_id), |
1033 | - ('mission_report_id', '=', id)]) |
1034 | + for product_id, qty, uom, partner, move_id in in_pipe_moves: |
1035 | + line_id = line_obj.search(cr, uid, [('product_id', '=', product_id), |
1036 | + ('mission_report_id', '=', id)]) |
1037 | + if line_id: |
1038 | + line = line_obj.browse(cr, uid, line_id[0]) |
1039 | + if uom != line.product_id.uom_id.id: |
1040 | + qty = self.pool.get('product.uom')._compute_qty(cr, uid, uom, qty, line.product_id.uom_id.id) |
1041 | |
1042 | vals = {'in_pipe_qty': 0.00, |
1043 | 'in_pipe_coor_qty': 0.00, |
1044 | 'updated': True} |
1045 | - current_product = product_id |
1046 | - if not line_id: |
1047 | - continue |
1048 | - |
1049 | - line = line_obj.browse(cr, uid, line_id[0]) |
1050 | - if uom != line.product_id.uom_id.id: |
1051 | - qty = self.pool.get('product.uom')._compute_qty(cr, uid, uom, qty, line.product_id.uom_id.id) |
1052 | - |
1053 | - vals['in_pipe_qty'] = vals['in_pipe_qty'] + qty |
1054 | - |
1055 | - if partner == coordo_id: |
1056 | - vals['in_pipe_coor_qty'] = vals['in_pipe_coor_qty'] + qty |
1057 | - |
1058 | - if line and vals and (vals.get('in_pipe_qty', False) or vals.get('in_pipe_coor_qty', False)): |
1059 | - line_obj.write(cr, uid, [line.id], vals) |
1060 | + |
1061 | + vals['in_pipe_qty'] = vals['in_pipe_qty'] + qty |
1062 | + |
1063 | + if partner == coordo_id: |
1064 | + vals['in_pipe_coor_qty'] = vals['in_pipe_coor_qty'] + qty |
1065 | + |
1066 | + line_obj.write(cr, uid, line.id, vals) |
1067 | |
1068 | # All other moves |
1069 | cr.execute(''' |
1070 | @@ -883,7 +871,6 @@ |
1071 | if instance.parent_id.parent_id: |
1072 | return instance.parent_id.parent_id.id |
1073 | return instance.parent_id.id |
1074 | - return instance.id |
1075 | |
1076 | return False |
1077 | |
1078 | |
1079 | === modified file 'bin/addons/msf_accrual/msf_accrual_line.py' |
1080 | --- bin/addons/msf_accrual/msf_accrual_line.py 2016-04-08 12:50:27 +0000 |
1081 | +++ bin/addons/msf_accrual/msf_accrual_line.py 2016-05-24 07:58:03 +0000 |
1082 | @@ -178,13 +178,15 @@ |
1083 | context = {} |
1084 | if isinstance(ids, (int, long, )): |
1085 | ids = [ids] |
1086 | + |
1087 | + if 'document_date' in vals: |
1088 | + # US-192 check doc date reagarding post date |
1089 | + # => read date field (as readonly in form) |
1090 | + for r in self.read(cr, uid, ids, ['date', ], context=context): |
1091 | + self.pool.get('finance.tools').check_document_date(cr, uid, |
1092 | + vals['document_date'], r['date'], context=context) |
1093 | + |
1094 | self._create_write_set_vals(cr, uid, vals, context=context) |
1095 | - # US-192 check doc date regarding post date |
1096 | - current_values = self.read(cr, uid, ids, ['document_date', 'date'], context=context)[0] |
1097 | - document_date = 'document_date' in vals and vals['document_date'] or current_values['document_date'] |
1098 | - posting_date = 'date' in vals and vals['date'] or current_values['date'] |
1099 | - self.pool.get('finance.tools').check_document_date(cr, uid, document_date, posting_date, context=context) |
1100 | - |
1101 | return super(msf_accrual_line, self).write(cr, uid, ids, vals, context=context) |
1102 | |
1103 | def button_cancel(self, cr, uid, ids, context=None): |
1104 | |
1105 | === modified file 'bin/addons/msf_accrual/wizard/wizard_accrual_validation.py' |
1106 | --- bin/addons/msf_accrual/wizard/wizard_accrual_validation.py 2016-04-08 07:51:59 +0000 |
1107 | +++ bin/addons/msf_accrual/wizard/wizard_accrual_validation.py 2016-05-24 07:58:03 +0000 |
1108 | @@ -39,8 +39,6 @@ |
1109 | raise osv.except_osv(_('Warning !'), _("The line '%s' is already posted!") % accrual_line.description) |
1110 | elif accrual_line.state == 'partially_posted': |
1111 | raise osv.except_osv(_('Warning !'), _("The line '%s' is already partially posted!") % accrual_line.description) |
1112 | - elif accrual_line.state == 'cancel': |
1113 | - raise osv.except_osv(_('Warning !'), _("The line '%s' is cancelled and can't be re-posted.") % accrual_line.description) |
1114 | elif not accrual_line.period_id: |
1115 | raise osv.except_osv(_('Warning !'), _("The line '%s' has no period set!") % accrual_line.description) |
1116 | elif not accrual_line.analytic_distribution_id: |
1117 | |
1118 | === modified file 'bin/addons/msf_cross_docking/cross_docking.py' |
1119 | --- bin/addons/msf_cross_docking/cross_docking.py 2016-04-25 09:24:04 +0000 |
1120 | +++ bin/addons/msf_cross_docking/cross_docking.py 2016-05-24 07:58:03 +0000 |
1121 | @@ -403,9 +403,7 @@ |
1122 | self.write(cr, uid, ids, {'cross_docking_ok': True}, context=context) |
1123 | else: |
1124 | raise osv.except_osv(_('Warning !'), _('Please, enter some stock moves before changing the source location to CROSS DOCKING')) |
1125 | - self.infolog(cr, uid, "The source location of the stock moves of the picking id:%s (%s) has been changed to cross-docking location" % ( |
1126 | - pick.id, pick.name, |
1127 | - )) |
1128 | + self.infolog(cr, uid, "The source location of the stock moves of the picking id:%s has been changed to cross-docking location" % (pick.id)) |
1129 | # we check availability : cancel then check |
1130 | self.cancel_assign(cr, uid, ids) |
1131 | self.action_assign(cr, uid, ids, context) |
1132 | @@ -449,9 +447,7 @@ |
1133 | self.write(cr, uid, ids, {'cross_docking_ok': False}, context=context) |
1134 | else: |
1135 | raise osv.except_osv(_('Warning !'), _('Please, enter some stock moves before changing the source location to STOCK')) |
1136 | - self.infolog(cr, uid, "The source location of the stock moves of the picking id:%s (%s) has been changed to stock location" % ( |
1137 | - pick.id, pick.name, |
1138 | - )) |
1139 | + self.infolog(cr, uid, "The source location of the stock moves of the picking id:%s has been changed to stock location" % (pick.id)) |
1140 | # we check availability : cancel then check |
1141 | self.cancel_assign(cr, uid, ids) |
1142 | self.action_assign(cr, uid, ids, context) |
1143 | |
1144 | === modified file 'bin/addons/msf_doc_import/account.py' |
1145 | --- bin/addons/msf_doc_import/account.py 2016-04-14 15:11:58 +0000 |
1146 | +++ bin/addons/msf_doc_import/account.py 2016-05-24 07:58:03 +0000 |
1147 | @@ -406,19 +406,11 @@ |
1148 | if not line[cols['Cost Centre']]: |
1149 | errors.append(_('Line %s. No cost center specified!') % (current_line_num,)) |
1150 | continue |
1151 | - # If necessary cast the CC into a string, otherwise the below search would crash |
1152 | - if not isinstance(line[cols['Cost Centre']], basestring): |
1153 | - line[cols['Cost Centre']] = '%s' % (line[cols['Cost Centre']]) |
1154 | cc_ids = self.pool.get('account.analytic.account').search(cr, uid, [('category', '=', 'OC'), '|', ('name', '=', line[cols['Cost Centre']]), ('code', '=', line[cols['Cost Centre']])]) |
1155 | if not cc_ids: |
1156 | errors.append(_('Line %s. Cost Center %s not found!') % (current_line_num, line[cols['Cost Centre']])) |
1157 | continue |
1158 | r_cc = cc_ids[0] |
1159 | - # Check Cost Center type |
1160 | - cc = self.pool.get('account.analytic.account').browse(cr, uid, r_cc, context) |
1161 | - if cc.type == 'view': |
1162 | - errors.append(_('Line %s. %s is a VIEW type Cost Center!') % (current_line_num, line[cols['Cost Centre']])) |
1163 | - continue |
1164 | # Check Funding Pool (added since UTP-1082) |
1165 | r_fp = msf_fp_id |
1166 | if line[cols['Funding Pool']]: |
1167 | |
1168 | === modified file 'bin/addons/msf_doc_import/view/internal_request_import_line_view.xml' |
1169 | --- bin/addons/msf_doc_import/view/internal_request_import_line_view.xml 2016-04-12 15:36:23 +0000 |
1170 | +++ bin/addons/msf_doc_import/view/internal_request_import_line_view.xml 2016-05-24 07:58:03 +0000 |
1171 | @@ -31,7 +31,6 @@ |
1172 | background-color: #F0EBA4; |
1173 | font-weight: bold; |
1174 | text-transform: uppercase; |
1175 | - width: 90%%; |
1176 | } |
1177 | |
1178 | #error_message_unifield p, #error_message_unifield span |
1179 | @@ -42,7 +41,6 @@ |
1180 | font-weight: bold; |
1181 | text-transform: uppercase; |
1182 | padding: 5px; |
1183 | - width: 90%%; |
1184 | } |
1185 | |
1186 | #error_message_unifield .grip |
1187 | @@ -53,7 +51,7 @@ |
1188 | |
1189 | <div id="error_message_unifield"> |
1190 | <field name="text_error" invisible="context.get('hide_column_error_ok', False) != True" readonly="1" /> |
1191 | - <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" string="Error" colspan="4" /> |
1192 | + <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" string="Error" /> |
1193 | </div> |
1194 | </html> |
1195 | </group> |
1196 | |
1197 | === modified file 'bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml' |
1198 | --- bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml 2016-04-12 12:42:49 +0000 |
1199 | +++ bin/addons/msf_doc_import/view/purchase_order_import_line_view.xml 2016-05-24 07:58:03 +0000 |
1200 | @@ -96,7 +96,6 @@ |
1201 | font-weight: bold; |
1202 | text-transform: uppercase; |
1203 | padding: 5px; |
1204 | - width: 90%%; |
1205 | } |
1206 | </style> |
1207 | |
1208 | |
1209 | === modified file 'bin/addons/msf_doc_import/view/sale_order_import_lines_view.xml' |
1210 | --- bin/addons/msf_doc_import/view/sale_order_import_lines_view.xml 2016-04-12 12:42:49 +0000 |
1211 | +++ bin/addons/msf_doc_import/view/sale_order_import_lines_view.xml 2016-05-24 07:58:03 +0000 |
1212 | @@ -65,11 +65,10 @@ |
1213 | { |
1214 | height: 1em; |
1215 | min-height: 1em; |
1216 | - color: red; |
1217 | + color: red; |
1218 | font-weight: bold; |
1219 | text-transform: uppercase; |
1220 | padding: 5px; |
1221 | - width: 90%%; |
1222 | } |
1223 | </style> |
1224 | |
1225 | |
1226 | === modified file 'bin/addons/msf_doc_import/wizard/wiz_common_import.py' |
1227 | --- bin/addons/msf_doc_import/wizard/wiz_common_import.py 2016-04-08 15:25:39 +0000 |
1228 | +++ bin/addons/msf_doc_import/wizard/wiz_common_import.py 2016-05-24 07:58:03 +0000 |
1229 | @@ -1013,7 +1013,7 @@ |
1230 | p_obj = self.pool.get('product.product') |
1231 | |
1232 | location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')[1] |
1233 | - reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_stock_initialization')[1] |
1234 | + reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_loss')[1] |
1235 | |
1236 | for p_data in p_obj.read(cr, uid, product_ids, ['uom_id', 'perishable', 'batch_management', 'import_product_qty'], context=context): |
1237 | values = {'product_id': p_data['id'], |
1238 | |
1239 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_ir_line.py' |
1240 | --- bin/addons/msf_doc_import/wizard/wizard_import_ir_line.py 2016-04-12 12:02:11 +0000 |
1241 | +++ bin/addons/msf_doc_import/wizard/wizard_import_ir_line.py 2016-05-24 07:58:03 +0000 |
1242 | @@ -280,7 +280,7 @@ |
1243 | wizard_vals.update(file_to_export) |
1244 | self.write(cr, uid, ids, wizard_vals, context=context) |
1245 | # we reset the state of the FO to draft (initial state) |
1246 | - sale_obj.write(cr, uid, fo_id, {'state': 'draft', 'import_in_progress': False}, context) |
1247 | + sale_obj.write(cr, uid, fo_id, {'state': 'draft'}, context) |
1248 | if not context.get('yml_test', False): |
1249 | cr.commit() |
1250 | cr.close(True) |
1251 | |
1252 | === modified file 'bin/addons/msf_homere_interface/hr.py' |
1253 | --- bin/addons/msf_homere_interface/hr.py 2016-01-04 13:16:43 +0000 |
1254 | +++ bin/addons/msf_homere_interface/hr.py 2016-05-24 07:58:03 +0000 |
1255 | @@ -326,5 +326,20 @@ |
1256 | |
1257 | return super(hr_employee, self).name_search(cr, uid, name, args, operator, context, limit) |
1258 | |
1259 | + def auto_import(self, cr, uid, file_to_import): |
1260 | + import base64 |
1261 | + import os |
1262 | + processed = [] |
1263 | + rejected = [] |
1264 | + headers = [] |
1265 | + |
1266 | + import_obj = self.pool.get('hr.expat.employee.import') |
1267 | + import_id = import_obj.create(cr, uid, { |
1268 | + 'file': base64.encodestring(open(file_to_import, 'r').read()), |
1269 | + 'filename': os.path.split(file_to_import)[1], |
1270 | + }) |
1271 | + processed, rejected, headers = import_obj.button_validate(cr, uid, [import_id], auto_import=True) |
1272 | + return processed, rejected, headers |
1273 | + |
1274 | hr_employee() |
1275 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1276 | |
1277 | === modified file 'bin/addons/msf_homere_interface/wizard/hr_expat_import.py' |
1278 | --- bin/addons/msf_homere_interface/wizard/hr_expat_import.py 2015-03-24 08:40:43 +0000 |
1279 | +++ bin/addons/msf_homere_interface/wizard/hr_expat_import.py 2016-05-24 07:58:03 +0000 |
1280 | @@ -37,7 +37,7 @@ |
1281 | 'filename': fields.char(string="Imported filename", size=256), |
1282 | } |
1283 | |
1284 | - def button_validate(self, cr, uid, ids, context=None): |
1285 | + def button_validate(self, cr, uid, ids, context=None, auto_import=False): |
1286 | """ |
1287 | Import XLS file |
1288 | """ |
1289 | @@ -46,12 +46,22 @@ |
1290 | line.cells[cell_index] and line.cells[cell_index].data \ |
1291 | or False |
1292 | |
1293 | + def manage_error(line_index, msg, name='', code='', status=''): |
1294 | + if auto_import: |
1295 | + rejected_lines.append((line_index, [name, code, status], msg)) |
1296 | + else: |
1297 | + raise osv.except_osv(_('Error'), _(msg)) |
1298 | + |
1299 | + processed_lines = [] |
1300 | + rejected_lines = [] |
1301 | + headers = [_('Name'), _('Code'), _('Status')] |
1302 | hr_emp_obj = self.pool.get('hr.employee') |
1303 | # Some verifications |
1304 | if not context: |
1305 | context = {} |
1306 | if isinstance(ids, (int, long)): |
1307 | ids = [ids] |
1308 | + |
1309 | for wiz in self.browse(cr, uid, ids): |
1310 | # Prepare some values |
1311 | created = 0 |
1312 | @@ -72,25 +82,28 @@ |
1313 | # get cells |
1314 | name = get_xml_spreadheet_cell_value(0) |
1315 | if not name: |
1316 | + manage_error(line_index, 'No name defined') |
1317 | continue |
1318 | code = get_xml_spreadheet_cell_value(1) |
1319 | if not code: |
1320 | msg = "At least one employee in the import file does not" \ |
1321 | " have an ID number; make sure all employees in the" \ |
1322 | " file have an ID number and run the import again." |
1323 | - raise osv.except_osv(_('Error'), _(msg)) |
1324 | + manage_error(line_index, msg, name) |
1325 | active_str = get_xml_spreadheet_cell_value(2) |
1326 | if not active_str: |
1327 | - msg = "Active column is missing or empty at line %d" |
1328 | - raise osv.except_osv(_('Error'), _(msg) % (line_index, )) |
1329 | + msg = "Active column is missing or empty at line %d" % line_index |
1330 | + manage_error(line_index, msg, name, code) |
1331 | active_str = active_str.lower() |
1332 | if active_str not in ('active', 'inactive'): |
1333 | msg = "Active column invalid value line %d" \ |
1334 | - " (should be Active/Inactive)" |
1335 | - raise osv.except_osv(_('Error'), _(msg) % (line_index, )) |
1336 | + " (should be Active/Inactive)" % line_index |
1337 | + manage_error(line_index, msg, name, code, active_str) |
1338 | active = active_str == 'active' or False |
1339 | |
1340 | processed += 1 |
1341 | + if auto_import: |
1342 | + processed_lines.append((line_index, [name, code, active_str])) |
1343 | |
1344 | ids = hr_emp_obj.search(cr, uid, |
1345 | [('identification_id', '=', code)]) |
1346 | @@ -114,6 +127,9 @@ |
1347 | |
1348 | context.update({'message': ' ', 'from': 'expat_import'}) |
1349 | |
1350 | + if auto_import: |
1351 | + return processed_lines, rejected_lines, headers |
1352 | + |
1353 | view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'msf_homere_interface', 'payroll_import_confirmation') |
1354 | view_id = view_id and view_id[1] or False |
1355 | |
1356 | |
1357 | === modified file 'bin/addons/msf_instance/add_instance.py' |
1358 | --- bin/addons/msf_instance/add_instance.py 2016-02-05 16:08:07 +0000 |
1359 | +++ bin/addons/msf_instance/add_instance.py 2016-05-24 07:58:03 +0000 |
1360 | @@ -61,6 +61,27 @@ |
1361 | return False |
1362 | return True |
1363 | |
1364 | + def create(self, cr, uid, vals, context=None): |
1365 | + """ |
1366 | + Check there is only one account.analytic.journal with a couple (type, instance_id) during automated import |
1367 | + """ |
1368 | + if context is None: |
1369 | + context = {} |
1370 | + |
1371 | + new_id = super(account_analytic_journal, self).create(cr, uid, vals, context=context) |
1372 | + |
1373 | + if not context.get('update_mode') == 'init': |
1374 | + return new_id |
1375 | + |
1376 | + journal = self.browse(cr, uid, new_id, context=context) |
1377 | + if self.search(cr, uid, [('type', '=', journal.type), ('instance_id', '=', journal.instance_id.id), ('id', '!=', new_id)], limit=1, context=context): |
1378 | + raise osv.except_osv( |
1379 | + _('Error'), |
1380 | + _('A same analytic journal already exists with this type and for this instance!'), |
1381 | + ) |
1382 | + |
1383 | + return new_id |
1384 | + |
1385 | _constraints = [ |
1386 | (_check_engagement_count, 'You cannot have more than one engagement journal per instance!', ['type', 'instance_id']), |
1387 | ] |
1388 | |
1389 | === modified file 'bin/addons/msf_outgoing/msf_outgoing.py' |
1390 | --- bin/addons/msf_outgoing/msf_outgoing.py 2016-04-25 10:27:20 +0000 |
1391 | +++ bin/addons/msf_outgoing/msf_outgoing.py 2016-05-24 07:58:03 +0000 |
1392 | @@ -620,11 +620,6 @@ |
1393 | |
1394 | add_line_obj.create(cr, uid, line_vals, context=context) |
1395 | |
1396 | - # US-803: point 9, add the ship description, then remove it from the context |
1397 | - description_ppl = context.get('description_ppl', False) |
1398 | - if context.get('description_ppl', False): |
1399 | - del context['description_ppl'] |
1400 | - |
1401 | for family in wizard.family_ids: |
1402 | if not family.selected_number: # UTP-1015 fix from Quentin |
1403 | continue |
1404 | @@ -641,7 +636,6 @@ |
1405 | 'backorder_id': picking.id, |
1406 | 'shipment_id': False, |
1407 | 'move_lines': [], |
1408 | - 'description_ppl': description_ppl, # US-803: added the description |
1409 | } |
1410 | # Update context for copy |
1411 | context.update({ |
1412 | @@ -673,9 +667,9 @@ |
1413 | picking_obj.force_assign(cr, uid, [new_packing_id]) |
1414 | |
1415 | # Log creation message |
1416 | - message = _('The new Shipment id:%s (%s) has been created.') |
1417 | - self.log(cr, uid, shipment.id, message%(shipment.id, shipment_name,)) |
1418 | - self.infolog(cr, uid, message%(shipment.id, shipment.name)) |
1419 | + message = _('The new Shipment %s has been created.') |
1420 | + self.log(cr, uid, shipment.id, message%(shipment_name,)) |
1421 | + self.infolog(cr, uid, message%(shipment.id,)) |
1422 | # The shipment is automatically shipped, no more pack states in between. |
1423 | self.ship(cr, uid, [shipment_id], context=context) |
1424 | |
1425 | @@ -855,9 +849,6 @@ |
1426 | if not log_flag: |
1427 | draft_shipment_name = self.read(cr, uid, shipment.id, ['name'], context=context)['name'] |
1428 | self.log(cr, uid, shipment.id, _("Packs from the draft Shipment (%s) have been returned to stock.") % (draft_shipment_name,)) |
1429 | - self.infolog(cr, uid, "Packs from the draft Shipment id:%s (%s) have been returned to stock." % ( |
1430 | - shipment.id, shipment.name, |
1431 | - )) |
1432 | log_flag = True |
1433 | |
1434 | res = data_obj.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
1435 | @@ -1134,9 +1125,6 @@ |
1436 | # log corresponding action |
1437 | shipment_log_msg = _('Packs from the shipped Shipment (%s) have been returned to %s location.') % (shipment.name, _('Dispatch')) |
1438 | self.log(cr, uid, shipment.id, shipment_log_msg) |
1439 | - self.infolog(cr, uid, "Packs from the shipped Shipment id:%s (%s) have been returned to Dispatch location." % ( |
1440 | - shipment.id, shipment.name, |
1441 | - )) |
1442 | |
1443 | draft_log_msg = _('The corresponding Draft Shipment (%s) has been updated.') % family.draft_packing_id.backorder_id.shipment_id.name |
1444 | self.log(cr, uid, draft_shipment_id, draft_log_msg) |
1445 | @@ -1273,9 +1261,6 @@ |
1446 | |
1447 | # log the ship action |
1448 | self.log(cr, uid, shipment.id, _('The Shipment %s has been shipped.') % (shipment.name,)) |
1449 | - self.infolog(cr, uid, "The Shipment id:%s (%s) has been shipped." % ( |
1450 | - shipment.id, shipment.name, |
1451 | - )) |
1452 | |
1453 | # TODO which behavior |
1454 | return True |
1455 | @@ -1587,9 +1572,6 @@ |
1456 | |
1457 | # log validate action |
1458 | self.log(cr, uid, shipment.id, _('The Shipment %s has been closed.') % (shipment.name,)) |
1459 | - self.infolog(cr, uid, "The Shipment id:%s (%s) has been closed." % ( |
1460 | - shipment.id, shipment.name, |
1461 | - )) |
1462 | |
1463 | self.complete_finished(cr, uid, ids, context=context) |
1464 | return True |
1465 | @@ -3079,11 +3061,6 @@ |
1466 | context.update({'original_name': obj.name}) |
1467 | self._hook_create_rw_out_sync_messages(cr, uid, [new_pick_id or obj.id], context, True) |
1468 | |
1469 | - self.infolog(cr, uid, "The Picking Ticket id:%s (%s) has been converted to simple Out id:%s (%s)." % ( |
1470 | - obj.id, obj.name, |
1471 | - new_pick_id or obj.id, new_name, |
1472 | - )) |
1473 | - |
1474 | # TODO which behavior |
1475 | data_obj = self.pool.get('ir.model.data') |
1476 | view_id = data_obj.get_object_reference(cr, uid, 'stock', 'view_picking_out_form') |
1477 | @@ -3162,9 +3139,6 @@ |
1478 | # we force availability |
1479 | |
1480 | self.log(cr, uid, out.id, _('The Delivery order (%s) has been converted to draft Picking Ticket (%s).') % (out.name, new_name), context={'view_id': view_id, 'picking_type': 'picking'}) |
1481 | - self.infolog(cr, uid, "The Delivery order id:%s (%s) has been converted to draft Picking Ticket id:%s (%s)." % ( |
1482 | - out.id, out.name, out.id, new_name, |
1483 | - )) |
1484 | |
1485 | for move in out.move_lines: |
1486 | move_to_update.append(move.id) |
1487 | @@ -3364,15 +3338,7 @@ |
1488 | |
1489 | wf_service.trg_write(uid, 'stock.picking', picking.id, cr) |
1490 | delivered_pack_id = new_picking_id |
1491 | - |
1492 | - new_pick_name = self.read(cr, uid, new_picking_id, ['name'], context=context)['name'] |
1493 | - self.infolog(cr, uid, "The Outgoing Delivery id:%s (%s) has been processed. Backorder id:%s (%s) has been created." % ( |
1494 | - new_picking_id, new_pick_name, picking.id, picking.name, |
1495 | - )) |
1496 | else: |
1497 | - self.infolog(cr, uid, "The Outgoing Delivery id:%s (%s) has been processed." % ( |
1498 | - picking.id, picking.name, |
1499 | - )) |
1500 | # Claim specific code |
1501 | self._claim_registration(cr, uid, wizard, picking.id, context=context) |
1502 | if not wizard.register_a_claim or (wizard.register_a_claim and wizard.claim_type != 'return'): |
1503 | @@ -3466,11 +3432,6 @@ |
1504 | pick_name = context.get('associate_pick_name', False) |
1505 | del context['associate_pick_name'] |
1506 | already_replicated = True |
1507 | - #US-803: Set the pick name that given from sync |
1508 | - elif 'rw_backorder_name' in context: |
1509 | - pick_name = context.get('rw_backorder_name', False) |
1510 | - del context['rw_backorder_name'] |
1511 | - already_replicated = True |
1512 | |
1513 | # UF-2531: if not exist, then calculate the name as before |
1514 | if not pick_name: |
1515 | @@ -3557,10 +3518,7 @@ |
1516 | wf_service.trg_validate(uid, 'stock.picking', new_picking_id, 'button_confirm', cr) |
1517 | # We force availability |
1518 | self.force_assign(cr, uid, [new_picking_id]) |
1519 | - self.infolog(cr, uid, "The Validated Picking Ticket id:%s (%s) has been generated by the Draft Picking Ticket id:%s (%s)" % ( |
1520 | - new_picking_id, self.read(cr, uid, new_picking_id, ['name'], context=context)['name'], |
1521 | - picking.id, picking.name, |
1522 | - )) |
1523 | + self.infolog(cr, uid, "The Validated Picking Ticket id:%s has been generated by the Draft Picking Ticket id:%s" % (new_picking_id, picking.id)) |
1524 | |
1525 | # Just to avoid an error on kit test because view_picking_ticket_form is not still loaded when test is ran |
1526 | msf_outgoing = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', 'msf_outgoing'), ('state', '=', 'installed')], context=context) |
1527 | @@ -3809,9 +3767,7 @@ |
1528 | if picking.flow_type == 'quick' and new_ppl: |
1529 | return self.quick_mode(cr, uid, new_ppl.id, context=context) |
1530 | |
1531 | - self.infolog(cr, uid, "The Validated Picking Ticket id:%s (%s) has been validated" % ( |
1532 | - picking.id, picking.name, |
1533 | - )) |
1534 | + self.infolog(cr, uid, "The Validated Picking Ticket id:%s has been validated" % (picking.id)) |
1535 | |
1536 | data_obj = self.pool.get('ir.model.data') |
1537 | view_id = data_obj.get_object_reference(cr, uid, 'msf_outgoing', 'view_ppl_form') |
1538 | @@ -4001,10 +3957,8 @@ |
1539 | _('No data to process '), |
1540 | ) |
1541 | |
1542 | - pickings = {} |
1543 | for wizard in proc_obj.browse(cr, uid, wizard_ids, context=context): |
1544 | picking = wizard.picking_id |
1545 | - pickings.setdefault(picking.id, picking.name) |
1546 | |
1547 | if picking.state != 'assigned': |
1548 | raise osv.except_osv( |
1549 | @@ -4129,12 +4083,10 @@ |
1550 | This code can be set back to the old one, because the shipment should always be available at this stage!!!!! DUY |
1551 | ''' |
1552 | shipment_id = False |
1553 | - shipment_name = False |
1554 | if new_packing_id: |
1555 | obj = self.browse(cr, uid, new_packing_id, context) |
1556 | if obj and obj.shipment_id and obj.shipment_id.id: |
1557 | shipment_id = obj.shipment_id.id |
1558 | - shipment_name = obj.shipment_id.name |
1559 | |
1560 | if context.get('rw_shipment_name', False) and context.get('sync_message_execution', False): # RW Sync - update the shipment name same as on RW instance |
1561 | new_name = context.get('rw_shipment_name') |
1562 | @@ -4149,11 +4101,6 @@ |
1563 | if usb_entity == self.REMOTE_WAREHOUSE and not context.get('sync_message_execution', False): |
1564 | self._manual_create_rw_messages(cr, uid, context=context) |
1565 | |
1566 | - for pid, pname in pickings.iteritems(): |
1567 | - self.infolog(cr, uid, "Products of Pre-Packing List id:%s (%s) have been packed in Shipment id:%s (%s)" % ( |
1568 | - pid, pname, shipment_id, shipment_name, |
1569 | - )) |
1570 | - |
1571 | view_id = data_obj.get_object_reference(cr, uid, 'msf_outgoing', 'view_shipment_form') |
1572 | view_id = view_id and view_id[1] or False |
1573 | return {'name':_("Shipment"), |
1574 | @@ -4280,9 +4227,6 @@ |
1575 | context['view_id'] = ppl_view |
1576 | log_message = _('Products from Pre-Packing List (%s) have been returned to stock.') % (picking.name,) |
1577 | self.log(cr, uid, picking.id, log_message, context=context) |
1578 | - self.infolog(cr, uid, "Products from Pre-Packing List id:%s (%s) have been returned to stock." % ( |
1579 | - picking.id, picking.name, |
1580 | - )) |
1581 | |
1582 | # Log message for draft picking ticket |
1583 | pick_view = data_obj.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
1584 | @@ -4400,9 +4344,6 @@ |
1585 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
1586 | context.update({'view_id': res, 'picking_type': 'picking_ticket'}) |
1587 | self.log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.") % (picking.backorder_id.name,), context=context) |
1588 | - self.infolog(cr, uid, "The Validated Picking Ticket id:%s (%s) has been canceled. The corresponding Draft Picking Ticket id:%s (%s) has been updated." % ( |
1589 | - picking.id, picking.name, picking.backorder_id.id, picking.backorder_id.name, |
1590 | - )) |
1591 | |
1592 | if picking.subtype == 'packing': |
1593 | |
1594 | |
1595 | === modified file 'bin/addons/msf_profile/data/patches.xml' |
1596 | --- bin/addons/msf_profile/data/patches.xml 2016-05-19 08:04:50 +0000 |
1597 | +++ bin/addons/msf_profile/data/patches.xml 2016-05-24 07:58:03 +0000 |
1598 | @@ -29,6 +29,7 @@ |
1599 | <field name="method">clean_far_updates</field> |
1600 | </record> |
1601 | |
1602 | +<<<<<<< TREE |
1603 | <record id="us_1185_patch" model="patch.scripts"> |
1604 | <field name="method">us_1185_patch</field> |
1605 | </record> |
1606 | @@ -44,5 +45,7 @@ |
1607 | <record id="us-1273_patch" model="patch.scripts"> |
1608 | <field name="method">us_1273_patch</field> |
1609 | </record> |
1610 | +======= |
1611 | +>>>>>>> MERGE-SOURCE |
1612 | </data> |
1613 | </openerp> |
1614 | |
1615 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
1616 | --- bin/addons/msf_profile/i18n/fr_MF.po 2016-04-25 09:29:33 +0000 |
1617 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2016-05-24 07:58:03 +0000 |
1618 | @@ -8953,12 +8953,6 @@ |
1619 | msgid "The line '%s' is already partially posted!" |
1620 | msgstr "La ligne '%s' est déjà partiellement comptabilisée !" |
1621 | |
1622 | -#. module: msf_accrual |
1623 | -#: code:addons/msf_accrual/wizard/wizard_accrual_validation.py:43 |
1624 | -#, python-format |
1625 | -msgid "The line '%s' is cancelled and can't be re-posted." |
1626 | -msgstr "La ligne '%s' est annulée et ne peut pas être recomptabilisée." |
1627 | - |
1628 | #. module: account |
1629 | #: field:account.report.general.ledger,sortby:0 |
1630 | msgid "Sort By" |
1631 | @@ -46311,12 +46305,10 @@ |
1632 | msgid "Analytic distribution is mandatory for this line: %s!" |
1633 | msgstr "Allocation Analytique obligatoire pour cette ligne: %s" |
1634 | |
1635 | -#. modules: msf_accrual, account_period_closing_level |
1636 | +#. module: msf_accrual |
1637 | #: model:ir.actions.act_window,name:msf_accrual.action_msf_accrual_line_tree |
1638 | #: model:ir.ui.menu,name:msf_accrual.menu_action_msf_accrual_line_tree |
1639 | #: view:msf.accrual.line:0 |
1640 | -#: code:addons/account_period_closing_level/account_period.py:716 |
1641 | -#, python-format |
1642 | msgid "Accruals Management" |
1643 | msgstr "Gestion des Régularisations" |
1644 | |
1645 | @@ -52203,12 +52195,6 @@ |
1646 | msgid "Line %s. Cost Center %s not found!" |
1647 | msgstr "Ligne %s. Centre de coût %s non trouvé !" |
1648 | |
1649 | -#. module: msf_doc_import |
1650 | -#: code:addons/msf_doc_import/account.py:420 |
1651 | -#, python-format |
1652 | -msgid "Line %s. %s is a VIEW type Cost Center!" |
1653 | -msgstr "Ligne %s. %s est un Centre de coût de type VUE !" |
1654 | - |
1655 | #. module: stock |
1656 | #: view:stock.inventory.line.split:0 |
1657 | #: view:stock.move.split:0 |
1658 | |
1659 | === modified file 'bin/addons/msf_profile/msf_profile.py' |
1660 | --- bin/addons/msf_profile/msf_profile.py 2016-05-19 08:04:50 +0000 |
1661 | +++ bin/addons/msf_profile/msf_profile.py 2016-05-24 07:58:03 +0000 |
1662 | @@ -131,15 +131,6 @@ |
1663 | cr.execute("UPDATE sync_client_update_to_send " |
1664 | "SET sdref='ZMW' " |
1665 | "WHERE sdref='ZMK'") |
1666 | - def us_1061_patch(self, cr, uid, *a, **b): |
1667 | - '''setup the size on all attachment''' |
1668 | - attachment_obj = self.pool.get('ir.attachment') |
1669 | - attachment_ids = attachment_obj.search(cr, uid, []) |
1670 | - vals = {} |
1671 | - for attachment in attachment_obj.browse(cr, uid, attachment_ids): |
1672 | - if attachment.datas and not attachment.size: |
1673 | - vals['size'] = attachment_obj.get_size(attachment.datas) |
1674 | - attachment_obj.write(cr, uid, attachment.id, vals) |
1675 | |
1676 | def us_898_patch(self, cr, uid, *a, **b): |
1677 | context = {} |
1678 | @@ -486,6 +477,7 @@ |
1679 | if self.pool.get('sync.server.update'): |
1680 | cr.execute("delete from sync_server_update where values like '%msf_outgoing.field_product_product_is_keep_cool%' and model='msf_field_access_rights.field_access_rule_line'") |
1681 | |
1682 | +<<<<<<< TREE |
1683 | def us_1185_patch(self, cr, uid, *a, **b): |
1684 | # AT HQ level: untick 8/9 top accounts for display in BS/PL report |
1685 | user_rec = self.pool.get('res.users').browse(cr, uid, [uid])[0] |
1686 | @@ -547,6 +539,8 @@ |
1687 | ir_obj.write(cr, uid, ir_ids, {'import_in_progress': False}) |
1688 | return True |
1689 | |
1690 | +======= |
1691 | +>>>>>>> MERGE-SOURCE |
1692 | patch_scripts() |
1693 | |
1694 | |
1695 | |
1696 | === modified file 'bin/addons/msf_sync_data_server/__openerp__.py' |
1697 | --- bin/addons/msf_sync_data_server/__openerp__.py 2015-10-23 07:16:45 +0000 |
1698 | +++ bin/addons/msf_sync_data_server/__openerp__.py 2016-05-24 07:58:03 +0000 |
1699 | @@ -27,12 +27,13 @@ |
1700 | 'description': 'Data files for Sync Server', |
1701 | 'author': 'MSF, OpenERP SA', |
1702 | 'website': 'http://openerp.com', |
1703 | - 'depends': ['base', 'sync_server', 'msf_profile', 'sync_client', 'sync_so'], |
1704 | + 'depends': ['base', 'sync_server', 'msf_profile', 'sync_client', 'sync_so', 'msf_tools'], |
1705 | 'init_xml': [], |
1706 | 'data': [ |
1707 | 'data/sync.server.group_type.csv', |
1708 | 'data/sync_server.sync_rule.csv', |
1709 | 'data/sync_server.message_rule.csv', |
1710 | + 'data/automated_import_sync_groups.xml', |
1711 | ], |
1712 | 'demo_xml': [ |
1713 | ], |
1714 | |
1715 | === added file 'bin/addons/msf_sync_data_server/data/automated_import_sync_groups.xml' |
1716 | --- bin/addons/msf_sync_data_server/data/automated_import_sync_groups.xml 1970-01-01 00:00:00 +0000 |
1717 | +++ bin/addons/msf_sync_data_server/data/automated_import_sync_groups.xml 2016-05-24 07:58:03 +0000 |
1718 | @@ -0,0 +1,18 @@ |
1719 | +<?xml version="1.0" encoding="utf-8" ?> |
1720 | +<openerp> |
1721 | + <data> |
1722 | + |
1723 | + <record id="auto_import_fnct_sync_groups" model="automated.import.function"> |
1724 | + <field name="name">Import Sync. Groups</field> |
1725 | + <field name="model_id" model="ir.model" search="[('model', '=', 'sync.server.entity_group')]" /> |
1726 | + <field name="method_to_call">import_data_from_csv</field> |
1727 | + </record> |
1728 | + |
1729 | + <record id="auto_import_fnct_sync_group_type" model="automated.import.function"> |
1730 | + <field name="name">Import Sync. Group Types</field> |
1731 | + <field name="model_id" model="ir.model" search="[('model', '=', 'sync.server.group_type')]" /> |
1732 | + <field name="method_to_call">import_data_from_csv</field> |
1733 | + </record> |
1734 | + |
1735 | + </data> |
1736 | +</openerp> |
1737 | \ No newline at end of file |
1738 | |
1739 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv' |
1740 | --- bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2016-04-25 15:54:40 +0000 |
1741 | +++ bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2016-05-24 07:58:03 +0000 |
1742 | @@ -24,25 +24,25 @@ |
1743 | USB_replicate_po,TRUE,TRUE,"['name', 'analytic_distribution_id/id', 'partner_id/id','pricelist_id/id','delivery_requested_date','details','notes', 'origin', 'categ', 'order_type', 'priority', 'loan_duration', 'is_a_counterpart', 'cross_docking_ok', 'order_line/product_id/id', 'order_line/product_id/name','order_line/id', 'order_line/name', 'order_line/product_qty', 'order_line/product_uom', 'order_line/price_unit', 'order_line/analytic_distribution_id/id','order_line/comment','order_line/have_analytic_distribution_from_header','order_line/line_number', 'order_line/nomen_manda_0/id','order_line/nomen_manda_1/id','order_line/nomen_manda_2/id','order_line/nomen_manda_3/id', 'order_line/sync_order_line_db_id', 'order_line/nomenclature_description','order_line/notes','order_line/default_name','order_line/default_code','order_line/is_line_split','order_line/date_planned','order_line/procurement_id/id']","[('state','in',['approved', 'done'])]",partner_id,USB,purchase.order.usb_replicate_po,purchase.order,USB_replicate_po,2000,Valid |
1744 | USB_replicate_fo,TRUE,TRUE,"['name', 'location_requestor_id/id', 'analytic_distribution_id/id', 'partner_id/id','pricelist_id/id','delivery_requested_date','details','notes', 'origin', 'categ', 'order_type', 'priority', 'loan_duration', 'is_a_counterpart', 'order_line/product_id/id', 'order_line/product_id/name','order_line/id', 'order_line/name', 'order_line/product_uom_qty', 'order_line/product_uom', 'order_line/price_unit', 'order_line/analytic_distribution_id/id','order_line/comment','order_line/have_analytic_distribution_from_header','order_line/line_number', 'order_line/nomen_manda_0/id','order_line/nomen_manda_1/id','order_line/nomen_manda_2/id','order_line/nomen_manda_3/id', 'order_line/sync_order_line_db_id', 'order_line/nomenclature_description','order_line/notes','order_line/default_name','order_line/default_code','order_line/is_line_split','order_line/date_planned','order_line/procurement_id/id']","[('state','in',['manual','done','progress'])]",partner_id,USB,sale.order.usb_replicate_fo,sale.order,USB_replicate_fo,2001,Valid |
1745 | USB_replicate_ir,TRUE,TRUE,"['name', 'location_requestor_id/id', 'analytic_distribution_id/id', 'partner_id/id','pricelist_id/id','delivery_requested_date','details','notes', 'origin', 'categ', 'order_type', 'priority', 'loan_duration', 'is_a_counterpart', 'order_line/product_id/id', 'order_line/product_id/name','order_line/id', 'order_line/name', 'order_line/product_uom_qty', 'order_line/product_uom', 'order_line/price_unit','order_line/cost_price', 'order_line/analytic_distribution_id/id','order_line/comment','order_line/have_analytic_distribution_from_header','order_line/line_number', 'order_line/nomen_manda_0/id','order_line/nomen_manda_1/id','order_line/nomen_manda_2/id','order_line/nomen_manda_3/id', 'order_line/sync_order_line_db_id', 'order_line/nomenclature_description','order_line/notes','order_line/default_name','order_line/default_code','order_line/is_line_split','order_line/date_planned','order_line/procurement_id/id']","[('procurement_request', '=', True), ('state', 'in', ['progress','done'])]",partner_id,USB,sale.order.usb_replicate_fo,sale.order,USB_replicate_ir,2003,Valid |
1746 | -USB_replicate_in,TRUE,TRUE,"['name','subtype','rw_force_seq','from_wkf','state','stock_journal_id/id','origin','purchase_id/id', 'sale_id/id', 'shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_requestor_rw/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_in,stock.picking,USB_replicate_in,2010,Valid |
1747 | -USB_update_in_shipped_available,TRUE,TRUE,"['name','from_wkf','subtype','rw_force_seq','state','stock_journal_id/id','origin','purchase_id/id', 'sale_id/id', 'shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_requestor_rw/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['shipped']),('partner_id', '!=', False),('already_replicated', '=', False)]",partner_id,USB,stock.picking.usb_update_in_shipped_available,stock.picking,USB_update_in_shipped_available,2011,Valid |
1748 | +USB_replicate_in,TRUE,TRUE,"['name','subtype','rw_force_seq','from_wkf','state','stock_journal_id/id','origin','purchase_id/id', 'sale_id/id', 'shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_requestor_rw/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_in,stock.picking,USB_replicate_in,2010,Valid |
1749 | +USB_update_in_shipped_available,TRUE,TRUE,"['name','from_wkf','subtype','rw_force_seq','state','stock_journal_id/id','origin','purchase_id/id', 'sale_id/id', 'shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_requestor_rw/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['shipped']),('partner_id', '!=', False),('already_replicated', '=', False)]",partner_id,USB,stock.picking.usb_update_in_shipped_available,stock.picking,USB_update_in_shipped_available,2011,Valid |
1750 | USB_cancel_in,TRUE,TRUE,"['name','subtype','origin']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['cancel']),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_cancel_in,stock.picking,USB_cancel_in,2012,Valid |
1751 | USB_cancel_pick_out,TRUE,TRUE,"['name','subtype','origin']","[('type', '=', 'out'),('state', 'in', ['cancel']),('partner_id', '!=', False), ('already_replicated', '=', False)]",partner_id,USB,stock.picking.usb_cancel_pick_out,stock.picking,USB_cancel_pick_out,2013,Valid |
1752 | -USB_create_partial_in,TRUE,TRUE,"['name','from_wkf','subtype','date_done','associate_pick_name','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/location_requestor_rw/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['done']),('already_replicated', '=',False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_partial_in,stock.picking,USB_create_partial_in,2015,Valid |
1753 | -USB_replicate_int,TRUE,TRUE,"['name','from_wkf','subtype','date_done','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'internal'),('subtype', '=', 'standard'),('state', 'in', ['assigned','done','confirmed']),('already_replicated', '=', False)]",partner_id,USB,stock.picking.usb_replicate_int,stock.picking,USB_replicate_int,2020,Valid |
1754 | -USB_create_partial_int_moves,TRUE,TRUE,"['name','from_wkf','date_done','subtype','associate_pick_name','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/location_requestor_rw/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'internal'),('subtype', '=', 'standard'),('state', 'in', ['done'])]",partner_id,USB,stock.picking.usb_create_partial_int_moves,stock.picking,USB_create_partial_int_moves,2021,Valid |
1755 | -USB_replicate_out,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id', 'backorder_id/id','backorder_id/name','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'standard'),('state', 'in', ['confirmed', 'assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_out,2030,Valid |
1756 | -USB_replicate_pick,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id', 'backorder_id/id','backorder_id/name','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'picking'),('state', 'in', ['draft']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_pick,2031,Valid |
1757 | -USB_replicate_out_conso,TRUE,TRUE,"['name','subtype','from_wkf','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'standard'),('name', 'like', 'OUT-CONSO'),('state', '=', 'done'),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_out_conso,2032,Valid |
1758 | -USB_convert_PICK_to_OUT,TRUE,TRUE,"['name','subtype','from_wkf','associate_pick_name','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('name', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_convert_pick_to_out,stock.picking,USB_convert_PICK_to_OUT,2035,Valid |
1759 | -USB_convert_OUT_to_PICK,TRUE,TRUE,"['name','subtype','from_wkf','associate_pick_name','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('name', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_convert_out_to_pick,stock.picking,USB_convert_OUT_to_PICK,2036,Valid |
1760 | -USB_closed_OUT_closes_OUT,TRUE,TRUE,"['name','subtype','from_wkf','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'standard'),('state', '=', 'done'),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_closed_out_closes_out,stock.picking,USB_closed_OUT_closes_OUT,2040,Valid |
1761 | -USB_closed_new_PICK_closes_PICK,TRUE,TRUE,"['name','subtype','date_done','state','from_wkf','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'picking'),('state', 'in', ['done', 'assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_picking,stock.picking,USB_closed_new_PICK_closes_PICK,2041,Valid |
1762 | -USB_replicate_PPL,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'ppl'),('state', 'in', ['done','assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_ppl,stock.picking,USB_replicate_PPL,2044,Valid |
1763 | +USB_create_partial_in,TRUE,TRUE,"['name','from_wkf','subtype','date_done','associate_pick_name','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/location_requestor_rw/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'in'),('subtype', '=', 'standard'),('state', 'in', ['done']),('already_replicated', '=',False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_partial_in,stock.picking,USB_create_partial_in,2015,Valid |
1764 | +USB_replicate_int,TRUE,TRUE,"['name','from_wkf','subtype','date_done','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'internal'),('subtype', '=', 'standard'),('state', 'in', ['assigned','done','confirmed']),('already_replicated', '=', False)]",partner_id,USB,stock.picking.usb_replicate_int,stock.picking,USB_replicate_int,2020,Valid |
1765 | +USB_create_partial_int_moves,TRUE,TRUE,"['name','from_wkf','date_done','subtype','associate_pick_name','rw_force_seq','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/location_requestor_rw/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'internal'),('subtype', '=', 'standard'),('state', 'in', ['done'])]",partner_id,USB,stock.picking.usb_create_partial_int_moves,stock.picking,USB_create_partial_int_moves,2021,Valid |
1766 | +USB_replicate_out,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id', 'backorder_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'standard'),('state', 'in', ['confirmed', 'assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_out,2030,Valid |
1767 | +USB_replicate_pick,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id', 'backorder_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'picking'),('state', 'in', ['draft']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_pick,2031,Valid |
1768 | +USB_replicate_out_conso,TRUE,TRUE,"['name','subtype','from_wkf','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'standard'),('name', 'like', 'OUT-CONSO'),('state', '=', 'done'),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_picking,stock.picking,USB_replicate_out_conso,2032,Valid |
1769 | +USB_convert_PICK_to_OUT,TRUE,TRUE,"['name','subtype','from_wkf','associate_pick_name','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('name', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_convert_pick_to_out,stock.picking,USB_convert_PICK_to_OUT,2035,Valid |
1770 | +USB_convert_OUT_to_PICK,TRUE,TRUE,"['name','subtype','from_wkf','associate_pick_name','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('name', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_convert_out_to_pick,stock.picking,USB_convert_OUT_to_PICK,2036,Valid |
1771 | +USB_closed_OUT_closes_OUT,TRUE,TRUE,"['name','subtype','from_wkf','date_done','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'standard'),('state', '=', 'done'),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_closed_out_closes_out,stock.picking,USB_closed_OUT_closes_OUT,2040,Valid |
1772 | +USB_closed_new_PICK_closes_PICK,TRUE,TRUE,"['name','subtype','date_done','state','from_wkf','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id', 'backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'picking'),('state', 'in', ['done', 'assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_picking,stock.picking,USB_closed_new_PICK_closes_PICK,2041,Valid |
1773 | +USB_replicate_PPL,TRUE,TRUE,"['name','subtype','from_wkf','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'ppl'),('state', 'in', ['done','assigned']),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_replicate_ppl,stock.picking,USB_replicate_PPL,2044,Valid |
1774 | USB_picking_return_products,TRUE,TRUE,['name'],"[('state', 'in',['fake'])]",partner_id,USB,stock.picking.usb_picking_return_products,stock.picking,usb_picking_return_products,2045,Valid |
1775 | -USB_Create_Packing_List,TRUE,TRUE,"['name','from_wkf','subtype','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','backorder_id/name','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit','move_lines/price_currency_id/id']","[('type', '=', 'out'),('subtype', '=', 'packing'),('state', 'in', ['draft','done','assigned']),('shipment_id', '!=', False),('backorder_id', '=', False),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_packing,stock.picking,USB_Create_Packing_List,2046,Valid |
1776 | +USB_Create_Packing_List,TRUE,TRUE,"['name','from_wkf','subtype','state','stock_journal_id/id','purchase_id/id', 'sale_id/id','origin','shipment_id/name','shipment_id/num_of_packs','previous_step_id/name','location_id/id','backorder_ids/id','backorder_ids/rw_sdref_counterpart', 'backorder_id/id','warehouse_id/id','order_category','overall_qty','change_reason','cross_docking_ok','location_dest_id/id','address_id', 'partner_type_stock_picking', 'delivered','reason_type_id/id','min_date', 'note', 'partner_id', 'move_type', 'type', 'dpo_out', 'flow_type', 'transport_order_id/id', 'direct_incoming','shipment_id/name', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/reason_type_id/id','move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/product_uos_qty', 'move_lines/prodlot_id/id', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/id','move_lines/location_id/id','move_lines/from_pack','move_lines/to_pack','move_lines/width','move_lines/height','move_lines/weight','move_lines/length','move_lines/pack_type','move_lines/purchase_line_id/id','move_lines/sale_line_id/id','move_lines/price_unit']","[('type', '=', 'out'),('subtype', '=', 'packing'),('state', 'in', ['draft','done','assigned']),('shipment_id', '!=', False),('backorder_id', '=', False),('already_replicated', '=', False),('partner_id', '!=', False)]",partner_id,USB,stock.picking.usb_create_packing,stock.picking,USB_Create_Packing_List,2046,Valid |
1777 | USB_shipment_return_packs_shipment_draft,TRUE,TRUE,['name'],"[('state', 'in',['fake'])]",partner_id,USB,shipment.usb_shipment_return_packs_shipment_draft,shipment,usb_shipment_return_packs_shipment_draft,2047,Valid |
1778 | -USB_Create_Shipment,TRUE,TRUE,"['shipper_address','address_id/id','date_of_departure','shipment_expected_date','invoice_id/id', 'consignee_date', 'shipper_name', 'carrier_address', 'registration', 'planned_date_of_arrival', 'partner_id', 'carrier_name', 'carrier_other', 'consignee_email', 'shipment_actual_date', 'shipper_date', 'parent_id/name', 'state', 'driver_name' , 'cargo_manifest_reference', 'carrier_signature', 'shipper_phone' , 'carrier_phone' , 'consignee_signature' , 'sequence_id' , 'carrier_email' , 'date', 'shipper_signature', 'carrier_date', 'name' , 'consignee_other', 'consignee_phone' , 'consignee_address', 'in_ref', 'transit_via', 'transport_type', 'shipper_email', 'partner_id2/id' , 'shipper_other' , 'consignee_name' , 'transport_order_id/id','pack_family_memory_ids/ppl_id/name','pack_family_memory_ids/from_pack','pack_family_memory_ids/to_pack','pack_family_memory_ids/description_ppl']","[('state', 'not in', ['draft']),('already_replicated', '=', False)]",partner_id,USB,shipment.usb_create_shipment,shipment,USB_Create_Shipment,2050,Valid |
1779 | +USB_Create_Shipment,TRUE,TRUE,"['shipper_address','address_id/id','date_of_departure','shipment_expected_date','invoice_id/id', 'consignee_date', 'shipper_name', 'carrier_address', 'registration', 'planned_date_of_arrival', 'partner_id', 'carrier_name', 'carrier_other', 'consignee_email', 'shipment_actual_date', 'shipper_date', 'parent_id/name', 'state', 'driver_name' , 'cargo_manifest_reference', 'carrier_signature', 'shipper_phone' , 'carrier_phone' , 'consignee_signature' , 'sequence_id' , 'carrier_email' , 'date', 'shipper_signature', 'carrier_date', 'name' , 'consignee_other', 'consignee_phone' , 'consignee_address', 'in_ref', 'transit_via', 'transport_type', 'shipper_email', 'partner_id2/id' , 'shipper_other' , 'consignee_name' , 'transport_order_id/id','pack_family_memory_ids/ppl_id/name','pack_family_memory_ids/from_pack','pack_family_memory_ids/to_pack']","[('state', 'not in', ['draft']),('already_replicated', '=', False)]",partner_id,USB,shipment.usb_create_shipment,shipment,USB_Create_Shipment,2050,Valid |
1780 | Usb_Shipment_Return_Packs,TRUE,TRUE,['name'],"[('state','in',['fake'])]",partner_id,USB,shipment.usb_shipment_return_packs,shipment,USB_Shipment_Return_Packs,2051,Valid |
1781 | USB_Validate_Shipment,TRUE,TRUE,['name'],"[('state', 'in', ['done']), ('already_rw_validated', '=', False),('parent_id', '!=', False)]",partner_id,USB,shipment.usb_set_validated_shipment,shipment,USB_Validate_Shipment,2055,Valid |
1782 | USB_Set_Delivered_Shipment,TRUE,TRUE,['name'],"[('state', 'in', ['delivered']), ('already_rw_delivered', '=', False), ('parent_id', '!=', False)]",partner_id,USB,shipment.usb_set_delivered_shipment,shipment,USB_Set_Delivered_Shipment,2056,Valid |
1783 | |
1784 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv' |
1785 | --- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-05-19 09:21:07 +0000 |
1786 | +++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-05-24 07:58:03 +0000 |
1787 | @@ -83,9 +83,15 @@ |
1788 | msf_sync_data_server.budget,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('type','=','normal'), ('state', '!=', 'draft')]","['code', 'cost_center_id/id', 'currency_id/id', 'decision_moment_id/id', 'decision_moment_order', 'fiscalyear_id/id', 'name', 'type', 'version']",OC,msf.budget,,Budget,Valid,,430 |
1789 | msf_sync_data_server.budget_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('budget_id','in',('msf.budget','id',[('type','=','normal'), ('state', '!=', 'draft')]))]","['account_id/id', 'budget_id/id', 'month1', 'month2', 'month3', 'month4', 'month5', 'month6', 'month7', 'month8', 'month9', 'month10', 'month11', 'month12', 'destination_id/id', 'line_type']",OC,msf.budget.line,,Budget line,Valid,,431 |
1790 | msf_sync_data_server.budget_status,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('type','=','normal'), ('state', '!=', 'draft')]",['state'],OC,msf.budget,,Budget status,Valid,,432 |
1791 | +<<<<<<< TREE |
1792 | msf_sync_data_server.mission_stock_report,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('full_view', '=', False), ('local_report', '=', True)]","['full_view', 'instance_id/id', 'last_update', 'name']",OC,stock.mission.report,,Mission Stock Report,Valid,,440 |
1793 | msf_sync_data_server.mission_stock_report_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['Local', 'Temporary'])]","['central_qty', 'central_val', 'cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code']",MISSION,stock.mission.report.line,,Mission Stock Report Line,Valid,,441 |
1794 | msf_sync_data_server.mission_stock_report_line_OC,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['ITC', 'UniData', 'ESC', 'HQ'])]","['central_qty', 'central_val', 'cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code']",OC,stock.mission.report.line,,Mission Stock Report Line OC,Valid,,442 |
1795 | +======= |
1796 | +msf_sync_data_server.mission_stock_report,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('full_view', '=', False)]","['full_view', 'instance_id/id', 'last_update', 'name']",OC,stock.mission.report,,Mission Stock Report,Valid,,440 |
1797 | +msf_sync_data_server.mission_stock_report_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False)]","['central_qty', 'central_val', 'cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code']",MISSION,stock.mission.report.line,,Mission Stock Report Line,Valid,,441 |
1798 | +msf_sync_data_server.mission_stock_report_line_OC,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,"[('mission_report_id.full_view', '=', False), '|','|',('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ')]","['central_qty', 'central_val', 'cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code', 'instance_id']",OC,stock.mission.report.line,instance_id,Mission Stock Report Line OC,Valid,,442 |
1799 | +>>>>>>> MERGE-SOURCE |
1800 | msf_sync_data_server.financing_contract_formats_fc,TRUE,TRUE,FALSE,TRUE,bidirectional,Bidirectional-Private,[],"['cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type', 'hidden_instance_id/id']",HQ + MISSION,financing.contract.format,hidden_instance_id,Financing Contract Formats FC,Valid,,450 |
1801 | msf_sync_data_server.financing_contract_formats,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('hidden_instance_id','=',False)]","['hidden_instance_id/id','cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type']",HQ + MISSION,financing.contract.format,,Financing Contract Formats,Valid,,451 |
1802 | msf_sync_data_server.financing_contract_format_lines,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('instance_id', '=', False)]","['account_destination_ids/id', 'instance_id/id','allocated_budget_value', 'allocated_real_value', 'code', 'format_id/id', 'line_type', 'name', 'overhead_percentage', 'overhead_type', 'project_budget_value', 'project_real_value', 'is_quadruplet','quadruplet_update']",HQ + MISSION,financing.contract.format.line,,Financing Contract Format Lines,Valid,,452 |
1803 | @@ -109,8 +115,13 @@ |
1804 | msf_sync_data_server.price_list_version,FALSE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,[],"['active', 'date_end', 'date_start', 'name', 'pricelist_id/id']",MISSION,product.pricelist.version,,Price List Version,Valid,,561 |
1805 | msf_sync_data_server.country_restrictions,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],['name'],MISSION,res.country.restriction,,Country restrictions,Valid,,570 |
1806 | msf_sync_data_server.country_code_mapping,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,[],"['instance_id/id', 'mapping_value']",COORDINATIONS,country.export.mapping,,Country Code Mapping,Valid,,571 |
1807 | +<<<<<<< TREE |
1808 | msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|','|',('international_status','=','UniData'),('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'cold_chain/id', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight', 'soq_volume']",OC,product.product,,"OC Product (Creator = ITC, ESC, UniData or HQ)",Valid,,600 |
1809 | msf_sync_data_server.mission_product_creator_local,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('international_status','=','Local'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'xmlid_code','cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight','soq_volume']",MISSION,product.product,,Mission Product (Creator = local),Valid,,601 |
1810 | +======= |
1811 | +msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|','|',('international_status','=','UniData'),('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'cold_chain/id', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight', 'soq_volume']",OC,product.product,,"OC Product (Creator = ITC, ESC or HQ)",Valid,,600 |
1812 | +msf_sync_data_server.mission_product_creator_local,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('international_status','=','Local'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'xmlid_code','cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight','soq_volume']",MISSION,product.product,,Mission Product (Creator = local),Valid,,601 |
1813 | +>>>>>>> MERGE-SOURCE |
1814 | msf_sync_data_server.standard_product_list,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('standard_list_ok','=','True')]","['creation_date', 'creator', 'description', 'last_update_date', 'name', 'order_list_print_ok', 'ref', 'standard_list_ok', 'type']",OC,product.list,,Standard Product List,Valid,,605 |
1815 | msf_sync_data_server.standard_product_list_line,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('list_id' , 'in', ('product.list', 'id', [('standard_list_ok','=','True')]))]","['comment','list_id/id','ref','name']",OC,product.list.line,,Standard Product List Line,Valid,,606 |
1816 | msf_sync_data_server.tax_code,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],"['code', 'info', 'name', 'notprintable', 'sign']",OC,account.tax.code,,Tax Code,Valid,,610 |
1817 | @@ -202,7 +213,7 @@ |
1818 | msf_usb_sync_data_server.cp_all_partners_address,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['active', 'city', 'country_id/id', 'email', 'fax', 'function', 'mobile', 'name', 'partner_id/id', 'phone', 'state_id/id', 'street', 'street2', 'title/id', 'type', 'zip']",USB,res.partner.address,,[MASTER] Partner Address,Valid,,1662 |
1819 | msf_usb_sync_data_server.cp_product_price_list,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['active', 'company_id/id', 'currency_id/id', 'currency_name', 'name', 'type']",USB,product.pricelist,,[MASTER] Product_price_list,Valid,,1670 |
1820 | msf_usb_sync_data_server.cp_country_restrictions,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],['name'],USB,res.country.restriction,,[MASTER] Country restrictions,Valid,,1680 |
1821 | -msf_usb_sync_data_server.cp_all_product,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['alert_time', 'batch_management', 'asset_type_id', 'categ_id/id', 'closed_article','manufacturer_txt', 'manufacturer_ref','code', 'cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'xmlid_code', 'active', 'state', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume','volume_updated', 'soq_quantity', 'soq_weight','soq_volume']",USB,product.product,,[MASTER] Products,Valid,,1810 |
1822 | +msf_usb_sync_data_server.cp_all_product,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['alert_time', 'batch_management', 'asset_type_id', 'categ_id/id', 'closed_article','manufacturer_txt', 'manufacturer_ref','code', 'cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'xmlid_code', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume','volume_updated', 'soq_quantity', 'soq_weight','soq_volume']",USB,product.product,,[MASTER] Products,Valid,,1810 |
1823 | msf_usb_sync_data_server.cp_standard_product_list,TRUE,TRUE,TRUE,TRUE,cp_to_rw,Bidirectional,"[('standard_list_ok','=','True')]","['creation_date', 'creator', 'description', 'last_update_date', 'name', 'order_list_print_ok', 'ref', 'standard_list_ok', 'type']",USB,product.list,,[MASTER] Standard Product List,Valid,,1820 |
1824 | msf_usb_sync_data_server.cp_standard_product_list_line,TRUE,TRUE,TRUE,TRUE,cp_to_rw,Bidirectional,"[('list_id' , 'in', ('product.list', 'id', [('standard_list_ok','=','True')]))]","['comment','list_id/id','ref','name/id']",USB,product.list.line,,[MASTER] Standard Product List Line,Valid,,1821 |
1825 | msf_usb_sync_data_server.cp_composition_kit,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,"[('state','=','completed'),('composition_type','=','theoretical')]","['active', 'composition_creation_date', 'composition_description', 'composition_product_id/id', 'composition_type', 'composition_version', 'composition_version_txt', 'name', 'state']",USB,composition.kit,,[MASTER] Theoretical Kit Composition List,Valid,,1830 |
1826 | |
1827 | === modified file 'bin/addons/msf_tools/__init__.py' |
1828 | --- bin/addons/msf_tools/__init__.py 2012-04-04 07:07:34 +0000 |
1829 | +++ bin/addons/msf_tools/__init__.py 2016-05-24 07:58:03 +0000 |
1830 | @@ -15,8 +15,11 @@ |
1831 | # GNU Affero General Public License for more details. |
1832 | # |
1833 | # You should have received a copy of the GNU Affero General Public License |
1834 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1835 | +# along with this progrimport automated_import_job_progressam. If not, see <http://www.gnu.org/licenses/>. |
1836 | # |
1837 | ############################################################################## |
1838 | |
1839 | import msf_tools |
1840 | +import automated_import_function |
1841 | +import automated_import |
1842 | +import automated_import_job |
1843 | |
1844 | === modified file 'bin/addons/msf_tools/__openerp__.py' |
1845 | --- bin/addons/msf_tools/__openerp__.py 2013-03-18 16:15:46 +0000 |
1846 | +++ bin/addons/msf_tools/__openerp__.py 2016-05-24 07:58:03 +0000 |
1847 | @@ -24,6 +24,7 @@ |
1848 | "version": "1.0", |
1849 | "depends": ["base", |
1850 | "product", |
1851 | + "object_query", |
1852 | ], |
1853 | "author": "MSF, TeMPO Consulting", |
1854 | "website": "", |
1855 | @@ -33,7 +34,13 @@ |
1856 | """, |
1857 | "init_xml": [ |
1858 | ], |
1859 | - 'update_xml': ['security/ir.model.access.csv',], |
1860 | + 'update_xml': [ |
1861 | + 'views/automated_import_view.xml', |
1862 | + 'views/automated_import_function_view.xml', |
1863 | + 'views/automated_import_job_view.xml', |
1864 | + 'security/ir.model.access.csv', |
1865 | + 'automated_import_data.xml', |
1866 | + ], |
1867 | 'demo_xml': [ |
1868 | ], |
1869 | 'test': [# tests should be performed in base classes to avoid cyclic dependencies |
1870 | |
1871 | === added file 'bin/addons/msf_tools/automated_import.py' |
1872 | --- bin/addons/msf_tools/automated_import.py 1970-01-01 00:00:00 +0000 |
1873 | +++ bin/addons/msf_tools/automated_import.py 2016-05-24 07:58:03 +0000 |
1874 | @@ -0,0 +1,513 @@ |
1875 | +# -*- coding: utf-8 -*- |
1876 | +############################################################################## |
1877 | +# |
1878 | +# OpenERP, Open Source Management Solution |
1879 | +# Copyright (C) 2016 TeMPO Consulting, MSF |
1880 | +# |
1881 | +# This program is free software: you can redistribute it and/or modify |
1882 | +# it under the terms of the GNU Affero General Public License as |
1883 | +# published by the Free Software Foundation, either version 3 of the |
1884 | +# License, or (at your option) any later version. |
1885 | +# |
1886 | +# This program is distributed in the hope that it will be useful, |
1887 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1888 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1889 | +# GNU Affero General Public License for more details. |
1890 | +# |
1891 | +# You should have received a copy of the GNU Affero General Public License |
1892 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1893 | +# |
1894 | +############################################################################## |
1895 | + |
1896 | +import os |
1897 | +import time |
1898 | + |
1899 | +from osv import osv |
1900 | +from osv import fields |
1901 | + |
1902 | +from tools.translate import _ |
1903 | + |
1904 | + |
1905 | +class automated_import(osv.osv): |
1906 | + _name = 'automated.import' |
1907 | + |
1908 | + _columns = { |
1909 | + 'name': fields.char( |
1910 | + size=128, |
1911 | + string='Name', |
1912 | + required=True, |
1913 | + ), |
1914 | + 'src_path': fields.char( |
1915 | + size=512, |
1916 | + string='Source Path', |
1917 | + ), |
1918 | + 'dest_path': fields.char( |
1919 | + size=512, |
1920 | + string='Destination Path', |
1921 | + ), |
1922 | + 'report_path': fields.char( |
1923 | + size=512, |
1924 | + string='Report Path', |
1925 | + ), |
1926 | + 'start_time': fields.datetime( |
1927 | + string='Date and time of first planned execution', |
1928 | + ), |
1929 | + 'interval': fields.integer( |
1930 | + string='Interval number', |
1931 | + ), |
1932 | + 'interval_unit': fields.selection( |
1933 | + selection=[ |
1934 | + ('minutes', 'Minutes'), |
1935 | + ('hours', 'Hours'), |
1936 | + ('work_days', 'Work Days'), |
1937 | + ('days', 'Days'), |
1938 | + ('weeks', 'Weeks'), |
1939 | + ('months', 'Months'), |
1940 | + ], |
1941 | + string='Interval Unit', |
1942 | + ), |
1943 | + 'function_id': fields.many2one( |
1944 | + 'automated.import.function', |
1945 | + string='Functionality', |
1946 | + required=True, |
1947 | + ), |
1948 | + 'active': fields.boolean( |
1949 | + string='Active', |
1950 | + readonly=True, |
1951 | + ), |
1952 | + 'cron_id': fields.many2one( |
1953 | + 'ir.cron', |
1954 | + string='Associated cron job', |
1955 | + readonly=True, |
1956 | + ), |
1957 | + 'priority': fields.integer( |
1958 | + string='Priority', |
1959 | + required=True, |
1960 | + help="""Defines the priority of the automated import processing because some of them needs other data |
1961 | +to import well some data (e.g: Product Categories needs Product nomenclatures).""" |
1962 | + ), |
1963 | + } |
1964 | + |
1965 | + _defaults = { |
1966 | + 'interval': lambda *a: 1, |
1967 | + 'interval_unit': lambda *a: 'hours', |
1968 | + 'active': lambda *a: False, |
1969 | + 'priority': lambda *a: 10, |
1970 | + } |
1971 | + |
1972 | + def unique_import_by_name(self, cr, uid, name, ids=None, context=None): |
1973 | + """ |
1974 | + Check if no other automated.import with same name exists in the system |
1975 | + :param cr: Cursor to the database |
1976 | + :param uid: ID of the res.users that calls the method |
1977 | + :param name: Name of the automated.import to check |
1978 | + :param ids: List of ID of automated.import on which the test is made |
1979 | + :param context: Context of the call |
1980 | + :return: True or raise an error. |
1981 | + """ |
1982 | + if context is None: |
1983 | + context = {} |
1984 | + |
1985 | + if ids and isinstance(ids, (int, long)): |
1986 | + ids = [ids] |
1987 | + |
1988 | + src_domain = [('name', '=', name), ('active', 'in', ['t', 'f'])] |
1989 | + if ids: |
1990 | + src_domain.append(('id', 'not in', ids)) |
1991 | + if self.search(cr, uid, src_domain, limit=1, order='NO_ORDER', context=context): |
1992 | + raise osv.except_osv( |
1993 | + _('Error'), |
1994 | + _('''Another Automated import with same name already exists (maybe inactive). Automated import name |
1995 | +must be unique. Please select an other name.'''), |
1996 | + ) |
1997 | + |
1998 | + return True |
1999 | + |
2000 | + def unique_import_by_function(self, cr, uid, function_id, ids=None, context=None): |
2001 | + """ |
2002 | + Check if no other automated.import with same fuctionality exists in the system |
2003 | + :param cr: Cursor to the database |
2004 | + :param uid: ID of the res.users that calls the method |
2005 | + :param function_id: Functionality of the automated.import to check |
2006 | + :param ids: List of ID of automated.import on which the test is made |
2007 | + :param context: Context of the call |
2008 | + :return: True or raise an error. |
2009 | + """ |
2010 | + if context is None: |
2011 | + context = {} |
2012 | + |
2013 | + if ids and isinstance(ids, (int, long)): |
2014 | + ids = [ids] |
2015 | + |
2016 | + src_domain = [('function_id', '=', function_id), ('active', 'in', ['t', 'f'])] |
2017 | + if ids: |
2018 | + src_domain.append(('id', 'not in', ids)) |
2019 | + if self.search(cr, uid, src_domain, limit=1, order='NO_ORDER', context=context): |
2020 | + raise osv.except_osv( |
2021 | + _('Error'), |
2022 | + _('''Another Automated import with same functionality already exists (maybe inactive). Only one |
2023 | +automated import must be created for a same functionality. Please select an other functionality.'''), |
2024 | + ) |
2025 | + |
2026 | + return True |
2027 | + |
2028 | + def job_in_progress(self, cr, uid, ids, context=None): |
2029 | + """ |
2030 | + Check if there is job in progress for this automated import. |
2031 | + :param cr: Cursor to the database |
2032 | + :param uid: ID of the res.users that calls the method |
2033 | + :param ids: List of ID of automated.import on which the test is made |
2034 | + :param context: Context of the call |
2035 | + :return: Return True if there are jobs in progress |
2036 | + """ |
2037 | + job_progress_obj = self.pool.get('automated.import.job.progress') |
2038 | + |
2039 | + if context is None: |
2040 | + context = {} |
2041 | + |
2042 | + if isinstance(ids, (int, long)): |
2043 | + ids = [ids] |
2044 | + |
2045 | + # Use uid=1 to avoid return of only osv.memory that belongs to the current user |
2046 | + return job_progress_obj.search(cr, 1, [('import_id', 'in', ids)], limit=1, context=context) |
2047 | + |
2048 | + def path_is_accessible(self, path, mode='r'): |
2049 | + """ |
2050 | + Returns if the given path is accessible in the given mode |
2051 | + :param path: Local path to test |
2052 | + :param mode: Mode to test (can be 'r' for read, 'w' for write) |
2053 | + :return: True if the path is accessible or the error if not |
2054 | + """ |
2055 | + msg = None |
2056 | + if not os.access(path, os.F_OK): |
2057 | + msg = _('Path \'%s\' doesn\'t exist!') % path |
2058 | + elif 'r' in mode and not os.access(path, os.R_OK): |
2059 | + msg = _('Read is not allowed on \'%s\'!') % path |
2060 | + elif 'w' in mode and not os.access(path, os.W_OK): |
2061 | + msg = _('Write is not allowed on \'%s\'!') % path |
2062 | + |
2063 | + if msg: |
2064 | + raise osv.except_osv(_('Error'), msg) |
2065 | + |
2066 | + return True |
2067 | + |
2068 | + def run_job_manually(self, cr, uid, ids, context=None, params=None): |
2069 | + """ |
2070 | + Create a new job with automated import parameters and display a view |
2071 | + to add a file to import. Then, run it if user clicks on Run or delete |
2072 | + it if user clicks on Cancel |
2073 | + :param cr: Cursor to the database |
2074 | + :param uid: ID of the res.users that calls this method |
2075 | + :param ids: List of ID of automated.import that must be ran |
2076 | + :param context: Context of the call |
2077 | + :param params: Manual parameters in case of manual customized run |
2078 | + :return: An action to go to the view of automated.import.job to add a file to import |
2079 | + """ |
2080 | + job_obj = self.pool.get('automated.import.job') |
2081 | + data_obj = self.pool.get('ir.model.data') |
2082 | + |
2083 | + if context is None: |
2084 | + context = {} |
2085 | + |
2086 | + if isinstance(ids, (int, long)): |
2087 | + ids = [ids] |
2088 | + |
2089 | + if params is None: |
2090 | + params = {} |
2091 | + |
2092 | + for import_brw in self.browse(cr, uid, ids, context=context): |
2093 | + if not import_brw.src_path or not import_brw.dest_path or not import_brw.report_path: |
2094 | + raise osv.except_osv( |
2095 | + _('Error'), |
2096 | + _('You should define all paths before run manually this job !'), |
2097 | + ) |
2098 | + params = { |
2099 | + 'import_id': import_brw.id, |
2100 | + 'state': 'draft', |
2101 | + } |
2102 | + job_id = job_obj.create(cr, uid, params, context=context) |
2103 | + |
2104 | + return { |
2105 | + 'type': 'ir.actions.act_window', |
2106 | + 'res_model': job_obj._name, |
2107 | + 'res_id': job_id, |
2108 | + 'view_type': 'form', |
2109 | + 'view_mode': 'form', |
2110 | + 'view_id': [data_obj.get_object_reference(cr, uid, 'msf_tools', 'automated_import_job_file_view')[1]], |
2111 | + 'target': 'new', |
2112 | + 'context': context, |
2113 | + } |
2114 | + |
2115 | + |
2116 | + def run_job(self, cr, uid, ids, context=None, params=None): |
2117 | + """ |
2118 | + Create a new job with automated import parameters and run it |
2119 | + :param cr: Cursor to the database |
2120 | + :param uid: ID of the res.users that calls this method |
2121 | + :param ids: List of ID of automated.import that must be ran |
2122 | + :param context: Context of the call |
2123 | + :param params: Manual parameters in case of manual customized run |
2124 | + :return: An action to go to the view of automated.import.job |
2125 | + """ |
2126 | + job_obj = self.pool.get('automated.import.job') |
2127 | + |
2128 | + if context is None: |
2129 | + context = {} |
2130 | + |
2131 | + if isinstance(ids, (int, long)): |
2132 | + ids = [ids] |
2133 | + |
2134 | + if params is None: |
2135 | + params = {} |
2136 | + |
2137 | + for import_id in ids: |
2138 | + params = { |
2139 | + 'import_id': import_id, |
2140 | + 'state': 'in_progress', |
2141 | + } |
2142 | + job_id = job_obj.create(cr, uid, params, context=context) |
2143 | + cr.commit() |
2144 | + res = job_obj.process_import(cr, uid, [job_id], context=context) |
2145 | + cr.commit() |
2146 | + |
2147 | + return res |
2148 | + |
2149 | + def _generate_ir_cron(self, import_brw): |
2150 | + """ |
2151 | + Returns the values for the ir.cron to create according to automated.import values |
2152 | + :param import_brw: automated.import browse_record |
2153 | + :return: A dictionary with values for ir.cron |
2154 | + """ |
2155 | + # If no interval defined, stop the scheduled action |
2156 | + numbercall = -1 |
2157 | + if not import_brw.interval: |
2158 | + numbercall = 0 |
2159 | + |
2160 | + return { |
2161 | + 'name': _('[Automated import] %s') % import_brw.name, |
2162 | + 'user_id': 1, |
2163 | + 'active': import_brw.active, |
2164 | + 'interval_number': import_brw.interval, |
2165 | + 'interval_type': import_brw.interval_unit, |
2166 | + 'numbercall': numbercall, |
2167 | + 'nextcall': import_brw.start_time or time.strftime('%Y-%m-%d %H:%M:%S'), |
2168 | + 'model': self._name, |
2169 | + 'function': 'run_job', |
2170 | + 'args': '(%s,)' % import_brw.id, |
2171 | + 'priority': import_brw.priority, |
2172 | + } |
2173 | + |
2174 | + def create(self, cr, uid, vals, context=None): |
2175 | + """ |
2176 | + Create the automated.import record. |
2177 | + Make some checks (uniqueness of name, uniqueness of functionality...) |
2178 | + Create an ir_cron record and linked it to the new automated.import |
2179 | + :param cr: Cursor to the database |
2180 | + :param uid: ID of the res.users that calls the method |
2181 | + :param vals: Values for the new automated.import record |
2182 | + :param context: Context of the call |
2183 | + :return: The ID of the new automated.import created record |
2184 | + """ |
2185 | + cron_obj = self.pool.get('ir.cron') |
2186 | + |
2187 | + if context is None: |
2188 | + context = {} |
2189 | + |
2190 | + # Make some checks |
2191 | + if vals.get('name', False): |
2192 | + self.unique_import_by_name(cr, uid, vals.get('name', False), context=context) |
2193 | + |
2194 | + if vals.get('function_id', False): |
2195 | + self.unique_import_by_function(cr, uid, vals.get('function_id', False), context=context) |
2196 | + |
2197 | + for path in [('src_path', 'r'), ('dest_path', 'w'), ('report_path', 'w')]: |
2198 | + if vals.get(path[0]): |
2199 | + self.path_is_accessible(vals.get(path[0]), path[1]) |
2200 | + |
2201 | + src_path = vals.get('src_path') |
2202 | + dest_path = vals.get('dest_path') |
2203 | + report_path = vals.get('report_path') |
2204 | + if src_path: |
2205 | + if src_path == dest_path: |
2206 | + raise osv.except_osv( |
2207 | + _('Error'), |
2208 | + _('You cannot have same directory for \'Source Path\' and \'Destination Path\''), |
2209 | + ) |
2210 | + if src_path == report_path: |
2211 | + raise osv.except_osv( |
2212 | + _('Error'), |
2213 | + _('You cannot have same directory for \'Source Path\' and \'Report Path\''), |
2214 | + ) |
2215 | + |
2216 | + if vals.get('active') and not (src_path and dest_path and report_path): |
2217 | + raise osv.except_osv( |
2218 | + _('Error'), |
2219 | + _('Before activation, the different paths should be set.') |
2220 | + ) |
2221 | + |
2222 | + if vals.get('interval', 0.00) < 0: |
2223 | + raise osv.except_osv( |
2224 | + _('Error'), |
2225 | + _('Interval number cannot be negative !'), |
2226 | + ) |
2227 | + |
2228 | + # Call the super create |
2229 | + new_id = super(automated_import, self).create(cr, uid, vals, context=context) |
2230 | + |
2231 | + # Generate new ir.cron |
2232 | + import_brw = self.browse(cr, uid, new_id, context=context) |
2233 | + cron_id = cron_obj.create(cr, uid, self._generate_ir_cron(import_brw), context=context) |
2234 | + self.write(cr, uid, [new_id], {'cron_id': cron_id}, context=context) |
2235 | + |
2236 | + return new_id |
2237 | + |
2238 | + def write(self, cr, uid, ids, vals, context=None): |
2239 | + """ |
2240 | + Make some checks on new values (uniqueness of name, uniqueness of functionality...) |
2241 | + Update the ir_cron |
2242 | + Write new values on existing automated.import records |
2243 | + :param cr: Cursor to the database |
2244 | + :param uid: ID of the res.users that calls the method |
2245 | + :param ids: List of ID of automated.import records to write |
2246 | + :param vals: Values for the new automated.import record |
2247 | + :param context: Context of the call |
2248 | + :return: True |
2249 | + """ |
2250 | + cron_obj = self.pool.get('ir.cron') |
2251 | + |
2252 | + if context is None: |
2253 | + context = {} |
2254 | + |
2255 | + if isinstance(ids, (int, long)): |
2256 | + ids = [ids] |
2257 | + |
2258 | + # Make some checks |
2259 | + if vals.get('name', False): |
2260 | + self.unique_import_by_name(cr, uid, vals.get('name', False), ids, context=context) |
2261 | + |
2262 | + if vals.get('function_id', False): |
2263 | + self.unique_import_by_function(cr, uid, vals.get('function_id', False), ids, context=context) |
2264 | + |
2265 | + if vals.get('interval', 0.00) < 0: |
2266 | + raise osv.except_osv( |
2267 | + _('Error'), |
2268 | + _('Interval number cannot be negative !'), |
2269 | + ) |
2270 | + |
2271 | + res = super(automated_import, self).write(cr, uid, ids, vals, context=context) |
2272 | + |
2273 | + for import_brw in self.browse(cr, uid, ids, context=context): |
2274 | + for path in [('src_path', 'r'), ('dest_path', 'w'), ('report_path', 'w')]: |
2275 | + if vals.get(path[0], import_brw[path[0]]): |
2276 | + self.path_is_accessible(vals.get(path[0], import_brw[path[0]]), path[1]) |
2277 | + |
2278 | + src_path = vals.get('src_path', import_brw.src_path) |
2279 | + dest_path = vals.get('dest_path', import_brw.dest_path) |
2280 | + report_path = vals.get('report_path', import_brw.report_path) |
2281 | + if src_path: |
2282 | + if src_path == dest_path: |
2283 | + raise osv.except_osv( |
2284 | + _('Error'), |
2285 | + _('You cannot have same directory for \'Source Path\' and \'Destination Path\''), |
2286 | + ) |
2287 | + if src_path == report_path: |
2288 | + raise osv.except_osv( |
2289 | + _('Error'), |
2290 | + _('You cannot have same directory for \'Source Path\' and \'Report Path\''), |
2291 | + ) |
2292 | + |
2293 | + if vals.get('active', import_brw.active) and not (src_path and dest_path and report_path): |
2294 | + raise osv.except_osv( |
2295 | + _('Error'), |
2296 | + _('Before activation, the different paths should be set.') |
2297 | + ) |
2298 | + |
2299 | + cron_vals = self._generate_ir_cron(import_brw) |
2300 | + if import_brw.cron_id: |
2301 | + cron_obj.write(cr, uid, [import_brw.cron_id.id], cron_vals, context=context) |
2302 | + elif not vals.get('cron_id', False): |
2303 | + cron_id = cron_obj.create(cr, uid, cron_vals, context=context) |
2304 | + self.write(cr, uid, [import_brw.id], {'cron_id': cron_id}, context=context) |
2305 | + |
2306 | + return res |
2307 | + |
2308 | + def unlink(self, cr, uid, ids, context=None): |
2309 | + """ |
2310 | + Delete the associated ir_cron |
2311 | + :param cr: Cursor to the database |
2312 | + :param uid: ID of the res.users that calls this method |
2313 | + :param ids: List of automated.import ID to remove |
2314 | + :param context: Context of the call |
2315 | + :return: True |
2316 | + """ |
2317 | + cron_obj = self.pool.get('ir.cron') |
2318 | + job_obj = self.pool.get('automated.import.job') |
2319 | + |
2320 | + if context is None: |
2321 | + context = {} |
2322 | + |
2323 | + if isinstance(ids, (int, long)): |
2324 | + ids = [ids] |
2325 | + |
2326 | + if job_obj.search(cr, uid, [('import_id', 'in', ids)], limit=1, order='NO_ORDER', context=context): |
2327 | + raise osv.except_osv( |
2328 | + _('Error'), |
2329 | + _('Please delete the automated import jobs that are linked to the Automatic import you try to delete!'), |
2330 | + ) |
2331 | + |
2332 | + for import_brw in self.browse(cr, uid, ids, context=context): |
2333 | + if import_brw.cron_id: |
2334 | + cron_obj.unlink(cr, uid, [import_brw.cron_id.id], context=context) |
2335 | + |
2336 | + return super(automated_import, self).unlink(cr, uid, ids, context=context) |
2337 | + |
2338 | + def copy(self, cr, uid, import_id, new_vals=None, context=None): |
2339 | + """ |
2340 | + Display an error on copy as copy is not allowed on automated.import |
2341 | + :param cr: Cursor to the database |
2342 | + :param uid: ID of the res.users that calls this method |
2343 | + :param import_id: ID of the automated.import to copy |
2344 | + :param new_vals: Default values for the new automated.import record |
2345 | + :param context: Context of the call |
2346 | + :return: The ID of the new automated.import record |
2347 | + """ |
2348 | + raise osv.except_osv( |
2349 | + _('Error'), |
2350 | + _('Copy is not allowed for Automated imports!'), |
2351 | + ) |
2352 | + |
2353 | + def active_import(self, cr, uid, ids, context=None): |
2354 | + """ |
2355 | + Make the automated.import as active |
2356 | + :param cr: Cursor to the database |
2357 | + :param uid: ID of the res.users that calls this method |
2358 | + :param ids: List of ID of automated.import to activate |
2359 | + :param context: Context of the call |
2360 | + :return: True |
2361 | + """ |
2362 | + if context is None: |
2363 | + context = {} |
2364 | + |
2365 | + if isinstance(ids, (int, long)): |
2366 | + ids = [ids] |
2367 | + |
2368 | + return self.write(cr, uid, ids, {'active': True}, context=context) |
2369 | + |
2370 | + def deactive_import(self, cr, uid, ids, context=None): |
2371 | + """ |
2372 | + Make the automated.import as inactive |
2373 | + :param cr: Cursor to the database |
2374 | + :param uid: ID of the res.users that calls this method |
2375 | + :param ids: List of ID of automated.import to activate |
2376 | + :param context: Context of the call |
2377 | + :return: True |
2378 | + """ |
2379 | + if context is None: |
2380 | + context = {} |
2381 | + |
2382 | + if isinstance(ids, (int, long)): |
2383 | + ids = [ids] |
2384 | + |
2385 | + return self.write(cr, uid, ids, {'active': False}, context=context) |
2386 | + |
2387 | +automated_import() |
2388 | |
2389 | === added file 'bin/addons/msf_tools/automated_import_data.xml' |
2390 | --- bin/addons/msf_tools/automated_import_data.xml 1970-01-01 00:00:00 +0000 |
2391 | +++ bin/addons/msf_tools/automated_import_data.xml 2016-05-24 07:58:03 +0000 |
2392 | @@ -0,0 +1,102 @@ |
2393 | +<?xml version="1.0" encoding="utf-8" ?> |
2394 | +<openerp> |
2395 | + <data> |
2396 | + |
2397 | + <record id="auto_import_fnct_res_partner" model="automated.import.function"> |
2398 | + <field name="name">Import Suppliers</field> |
2399 | + <field name="model_id" model="ir.model" search="[('model', '=', 'res.partner')]" /> |
2400 | + <field name="method_to_call">import_data_from_csv</field> |
2401 | + </record> |
2402 | + |
2403 | + <record id="auto_import_fnct_account_account" model="automated.import.function"> |
2404 | + <field name="name">Import G/L Accounts</field> |
2405 | + <field name="model_id" model="ir.model" search="[('model', '=', 'account.account')]" /> |
2406 | + <field name="method_to_call">import_data_from_csv</field> |
2407 | + </record> |
2408 | + |
2409 | + <record id="auto_import_fnct_account_journal" model="automated.import.function"> |
2410 | + <field name="name">Import G/L Journals</field> |
2411 | + <field name="model_id" model="ir.model" search="[('model', '=', 'account.journal')]" /> |
2412 | + <field name="method_to_call">import_data_from_csv</field> |
2413 | + </record> |
2414 | + |
2415 | + <record id="auto_import_fnct_analytic_account" model="automated.import.function"> |
2416 | + <field name="name">Import Analytic Accounts</field> |
2417 | + <field name="model_id" model="ir.model" search="[('model', '=', 'account.analytic.account')]" /> |
2418 | + <field name="method_to_call">import_data_from_csv</field> |
2419 | + </record> |
2420 | + |
2421 | + <record id="auto_import_fnct_analytic_journal" model="automated.import.function"> |
2422 | + <field name="name">Import Analytic Journals</field> |
2423 | + <field name="model_id" model="ir.model" search="[('model', '=', 'account.analytic.journal')]" /> |
2424 | + <field name="method_to_call">import_data_from_csv</field> |
2425 | + </record> |
2426 | + |
2427 | + <record id="auto_import_fnct_destination_account" model="automated.import.function"> |
2428 | + <field name="name">Import Links between destinations and GL accounts</field> |
2429 | + <field name="model_id" model="ir.model" search="[('model', '=', 'account.analytic.account')]" /> |
2430 | + <field name="method_to_call">import_data_from_csv</field> |
2431 | + </record> |
2432 | + |
2433 | + <record id="auto_import_fnct_sync_product_nomenclature" model="automated.import.function"> |
2434 | + <field name="name">Import Product Nomenclatures</field> |
2435 | + <field name="model_id" model="ir.model" search="[('model', '=', 'product.nomenclature')]" /> |
2436 | + <field name="method_to_call">import_data_with_wizard</field> |
2437 | + </record> |
2438 | + |
2439 | + <record id="auto_import_fnct_product_categories" model="automated.import.function"> |
2440 | + <field name="name">Import Product Categories</field> |
2441 | + <field name="model_id" model="ir.model" search="[('model', '=', 'product.category')]" /> |
2442 | + <field name="method_to_call">import_data_with_wizard</field> |
2443 | + </record> |
2444 | + |
2445 | + <record id="auto_import_fnct_employee" model="automated.import.function"> |
2446 | + <field name="name">Import Employees</field> |
2447 | + <field name="model_id" model="ir.model" search="[('model', '=', 'hr.employee')]" /> |
2448 | + <field name="method_to_call">auto_import</field> |
2449 | + </record> |
2450 | + |
2451 | + <record id="auto_import_fnct_product" model="automated.import.function"> |
2452 | + <field name="name">Import Products</field> |
2453 | + <field name="model_id" model="ir.model" search="[('model', '=', 'product.product')]" /> |
2454 | + <field name="method_to_call">import_data_with_wizard</field> |
2455 | + </record> |
2456 | + |
2457 | + <record id="auto_import_fnct_access_control_list" model="automated.import.function"> |
2458 | + <field name="name">Import Access Control Lists</field> |
2459 | + <field name="model_id" model="ir.model" search="[('model', '=', 'ir.model.access')]" /> |
2460 | + <field name="method_to_call">import_data_from_csv</field> |
2461 | + </record> |
2462 | + |
2463 | + <record id="auto_import_fnct_record_rules" model="automated.import.function"> |
2464 | + <field name="name">Import Record Rules</field> |
2465 | + <field name="model_id" model="ir.model" search="[('model', '=', 'ir.rule')]" /> |
2466 | + <field name="method_to_call">import_data_from_csv</field> |
2467 | + </record> |
2468 | + |
2469 | + <record id="auto_import_fnct_window_actions" model="automated.import.function"> |
2470 | + <field name="name">Import Window Actions</field> |
2471 | + <field name="model_id" model="ir.model" search="[('model', '=', 'ir.actions.act_window')]" /> |
2472 | + <field name="method_to_call">import_data_from_csv</field> |
2473 | + </record> |
2474 | + |
2475 | + <record id="auto_import_fnct_field_access_rule" model="automated.import.function"> |
2476 | + <field name="name">Import Field Access Rules</field> |
2477 | + <field name="model_id" model="ir.model" search="[('model', '=', 'msf_field_access_rights.field_access_rule')]" /> |
2478 | + <field name="method_to_call">import_data_from_csv</field> |
2479 | + </record> |
2480 | + |
2481 | + <record id="auto_import_fnct_field_access_rule_lines" model="automated.import.function"> |
2482 | + <field name="name">Import Field Access Rule Lines</field> |
2483 | + <field name="model_id" model="ir.model" search="[('model', '=', 'msf_field_access_rights.field_access_rule_line')]" /> |
2484 | + <field name="method_to_call">import_data_from_csv</field> |
2485 | + </record> |
2486 | + |
2487 | + <record id="auto_import_fnct_button_access_rules" model="automated.import.function"> |
2488 | + <field name="name">Import Button Access Rules</field> |
2489 | + <field name="model_id" model="ir.model" search="[('model', '=', 'msf_button_access_rights.button_access_rule')]" /> |
2490 | + <field name="method_to_call">import_data_from_csv</field> |
2491 | + </record> |
2492 | + |
2493 | + </data> |
2494 | +</openerp> |
2495 | |
2496 | === added file 'bin/addons/msf_tools/automated_import_function.py' |
2497 | --- bin/addons/msf_tools/automated_import_function.py 1970-01-01 00:00:00 +0000 |
2498 | +++ bin/addons/msf_tools/automated_import_function.py 2016-05-24 07:58:03 +0000 |
2499 | @@ -0,0 +1,107 @@ |
2500 | +# -*- coding: utf-8 -*- |
2501 | +############################################################################## |
2502 | +# |
2503 | +# OpenERP, Open Source Management Solution |
2504 | +# Copyright (C) 2016 TeMPO Consulting, MSF |
2505 | +# |
2506 | +# This program is free software: you can redistribute it and/or modify |
2507 | +# it under the terms of the GNU Affero General Public License as |
2508 | +# published by the Free Software Foundation, either version 3 of the |
2509 | +# License, or (at your option) any later version. |
2510 | +# |
2511 | +# This program is distributed in the hope that it will be useful, |
2512 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2513 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2514 | +# GNU Affero General Public License for more details. |
2515 | +# |
2516 | +# You should have received a copy of the GNU Affero General Public License |
2517 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2518 | +# |
2519 | +############################################################################## |
2520 | + |
2521 | +from osv import osv |
2522 | +from osv import fields |
2523 | + |
2524 | +from tools.translate import _ |
2525 | + |
2526 | + |
2527 | +class automated_import_function(osv.osv): |
2528 | + _name = 'automated.import.function' |
2529 | + |
2530 | + _columns = { |
2531 | + 'name': fields.char( |
2532 | + size=64, |
2533 | + string='Name', |
2534 | + required=True, |
2535 | + ), |
2536 | + 'model_id': fields.many2one( |
2537 | + 'ir.model', |
2538 | + string='Model', |
2539 | + required=True, |
2540 | + ), |
2541 | + 'method_to_call': fields.char( |
2542 | + size=128, |
2543 | + string='Method to call', |
2544 | + required=True, |
2545 | + ), |
2546 | + } |
2547 | + |
2548 | + _defaults = { |
2549 | + 'method_to_call': lambda *a: 'import_data_from_csv', |
2550 | + } |
2551 | + |
2552 | + def check_method_to_call(self, cr, uid, model_id, method): |
2553 | + """ |
2554 | + Check if the model implements the method |
2555 | + :param cr: Cursor to the database |
2556 | + :param uid: ID of the res.users that calls the method |
2557 | + :param model: ID of ir.model |
2558 | + :param method: method name |
2559 | + :return: Return True or False |
2560 | + """ |
2561 | + model = self.pool.get('ir.model').browse(cr, uid, model_id) |
2562 | + if not hasattr(self.pool.get(model.model), method): |
2563 | + raise osv.except_osv( |
2564 | + _('Error'), |
2565 | + _('The method \'%s\' of the model \'%s\' is not callable') % (model.model, method), |
2566 | + ) |
2567 | + return True |
2568 | + |
2569 | + def create(self, cr, uid, vals, context=None): |
2570 | + """ |
2571 | + Run the check on method to call before create the new record |
2572 | + :param cr: Cursor to the database |
2573 | + :param uid: ID of the res.users that calls this method |
2574 | + :param vals: Values to put on the new record |
2575 | + :param context: Context of the call |
2576 | + :return: ID of the new automated.import.function |
2577 | + """ |
2578 | + if vals.get('model_id') and vals.get('method_to_call'): |
2579 | + self.check_method_to_call(cr, uid, vals.get('model_id'), vals.get('method_to_call')) |
2580 | + |
2581 | + return super(automated_import_function, self).create(cr, uid, vals, context=context) |
2582 | + |
2583 | + def write(self, cr, uid, ids, vals, context=None): |
2584 | + """ |
2585 | + Run the check on method to call before update the record(s) |
2586 | + :param cr: Cursor to the database |
2587 | + :param uid: ID of the res.users that calls this method |
2588 | + :param ids: List of ID of automated.import.function record to update |
2589 | + :param vals: Values to put on the new record |
2590 | + :param context: Context of the call |
2591 | + :return: True |
2592 | + """ |
2593 | + if isinstance(ids, (int, long)): |
2594 | + ids = [ids] |
2595 | + |
2596 | + if vals.get('model_id') and vals.get('method_to_call'): |
2597 | + self.check_method_to_call(cr, uid, vals.get('model_id'), vals.get('method_to_call')) |
2598 | + elif vals.get('model_id') or vals.get('method_to_call'): |
2599 | + for rec in self.browse(cr, uid, ids, context=context): |
2600 | + model = vals.get('model_id', rec.model_id) |
2601 | + func = vals.get('method_to_call', rec.method_to_call) |
2602 | + self.check_method_to_call(cr, uid, model, func) |
2603 | + |
2604 | + return super(automated_import_function, self).write(cr, uid, ids, vals, context=context) |
2605 | + |
2606 | +automated_import_function() |
2607 | \ No newline at end of file |
2608 | |
2609 | === added file 'bin/addons/msf_tools/automated_import_job.py' |
2610 | --- bin/addons/msf_tools/automated_import_job.py 1970-01-01 00:00:00 +0000 |
2611 | +++ bin/addons/msf_tools/automated_import_job.py 2016-05-24 07:58:03 +0000 |
2612 | @@ -0,0 +1,366 @@ |
2613 | +# -*- coding: utf-8 -*- |
2614 | +############################################################################## |
2615 | +# |
2616 | +# OpenERP, Open Source Management Solution |
2617 | +# Copyright (C) 2016 TeMPO Consulting, MSF |
2618 | +# |
2619 | +# This program is free software: you can redistribute it and/or modify |
2620 | +# it under the terms of the GNU Affero General Public License as |
2621 | +# published by the Free Software Foundation, either version 3 of the |
2622 | +# License, or (at your option) any later version. |
2623 | +# |
2624 | +# This program is distributed in the hope that it will be useful, |
2625 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2626 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2627 | +# GNU Affero General Public License for more details. |
2628 | +# |
2629 | +# You should have received a copy of the GNU Affero General Public License |
2630 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2631 | +# |
2632 | +############################################################################## |
2633 | + |
2634 | +import os |
2635 | +import csv |
2636 | +import time |
2637 | +import shutil |
2638 | +import base64 |
2639 | +import hashlib |
2640 | + |
2641 | +from osv import osv |
2642 | +from osv import fields |
2643 | + |
2644 | +from tools.translate import _ |
2645 | + |
2646 | + |
2647 | +def all_files_under(path): |
2648 | + """ |
2649 | + Iterates through all files that are under the given path. |
2650 | + :param path: Path on which we want to iterate |
2651 | + """ |
2652 | + for cur_path, dirnames, filenames in os.walk(path): |
2653 | + for filename in filenames: |
2654 | + yield os.path.join(cur_path, filename) |
2655 | + |
2656 | + |
2657 | +def move_to_process_path(file, src_path, dest_path): |
2658 | + """ |
2659 | + Move the file `file` from `src_path` to `dest_path` |
2660 | + :param file: Name of the file to move |
2661 | + :param src_path: Source folder |
2662 | + :param dest_path: Destination folder |
2663 | + :return: return True |
2664 | + """ |
2665 | + srcname = os.path.join(src_path, file) |
2666 | + renamed = os.path.join(dest_path, '%s_%s' % (time.strftime('%Y%m%d_%H%M%S'), file)) |
2667 | + shutil.move(srcname, renamed) |
2668 | + return True |
2669 | + |
2670 | + |
2671 | +class automated_import_job(osv.osv): |
2672 | + _name = 'automated.import.job' |
2673 | + |
2674 | + def _get_name(self, cr, uid, ids, field_name, args, context=None): |
2675 | + """ |
2676 | + Build the name of the job by using the function_id and the date and time |
2677 | + :param cr: Cursor to the database |
2678 | + :param uid: ID of the res.users that calls this issue |
2679 | + :param ids: List of ID of automated.import.job to compute name |
2680 | + :param field_name: The name of the field to compute (here: name) |
2681 | + :param args: Additional parameters |
2682 | + :param context: Context of the call |
2683 | + :return: A dictionnary with automated.import.job ID as key and computed name as value |
2684 | + """ |
2685 | + if context is None: |
2686 | + context = {} |
2687 | + |
2688 | + if isinstance(ids, (int, long)): |
2689 | + ids = [ids] |
2690 | + |
2691 | + res = {} |
2692 | + for job in self.browse(cr, uid, ids, context=context): |
2693 | + res[job.id] = '%s - %s' % (job.import_id.function_id.name, job.start_time or _('Not started')) |
2694 | + |
2695 | + return res |
2696 | + |
2697 | + _columns = { |
2698 | + 'name': fields.function( |
2699 | + _get_name, |
2700 | + method=True, |
2701 | + type='char', |
2702 | + size=128, |
2703 | + string='Name', |
2704 | + store=True, |
2705 | + ), |
2706 | + 'import_id': fields.many2one( |
2707 | + 'automated.import', |
2708 | + string='Automated import', |
2709 | + required=True, |
2710 | + readonly=True, |
2711 | + ), |
2712 | + 'file_to_import': fields.binary( |
2713 | + string='File to import', |
2714 | + ), |
2715 | + 'filename': fields.char( |
2716 | + size=128, |
2717 | + string='Name of the file to import', |
2718 | + ), |
2719 | + 'file_sum': fields.char( |
2720 | + string='Check sum', |
2721 | + size=256, |
2722 | + readonly=True, |
2723 | + ), |
2724 | + 'start_time': fields.datetime( |
2725 | + string='Start time', |
2726 | + readonly=True, |
2727 | + ), |
2728 | + 'end_time': fields.datetime( |
2729 | + string='End time', |
2730 | + readonly=True, |
2731 | + ), |
2732 | + 'nb_processed_records': fields.integer( |
2733 | + string='# of processed records', |
2734 | + readonly=True, |
2735 | + ), |
2736 | + 'nb_rejected_records': fields.integer( |
2737 | + string='# of rejected records', |
2738 | + readonly=True, |
2739 | + ), |
2740 | + 'comment': fields.text( |
2741 | + string='Comment', |
2742 | + readonly=True, |
2743 | + ), |
2744 | + 'state': fields.selection( |
2745 | + selection=[ |
2746 | + ('draft', 'Draft'), |
2747 | + ('in_progress', 'In progress'), |
2748 | + ('done', 'Done'), |
2749 | + ('error', 'Exception'), |
2750 | + ], |
2751 | + string='State', |
2752 | + readonly=True, |
2753 | + required=True, |
2754 | + ), |
2755 | + } |
2756 | + |
2757 | + _defaults = { |
2758 | + 'state': lambda *a: 'draft', |
2759 | + } |
2760 | + |
2761 | + def process_import(self, cr, uid, ids, context=None): |
2762 | + """ |
2763 | + First, browse the source path, then select the oldest file and run import on this file. |
2764 | + After the processing of import, generate a report and move the processed file to the |
2765 | + processed folder. |
2766 | + :param cr: Cursor to the database |
2767 | + :param uid: ID of the res.users that calls this method |
2768 | + :param ids: List of ID of automated.import.job to process |
2769 | + :param context: Context of the call |
2770 | + :return: True |
2771 | + """ |
2772 | + import_obj = self.pool.get('automated.import') |
2773 | + data_obj = self.pool.get('ir.model.data') |
2774 | + |
2775 | + if context is None: |
2776 | + context = [] |
2777 | + |
2778 | + if isinstance(ids, (int, long)): |
2779 | + ids = [ids] |
2780 | + |
2781 | + for job in self.browse(cr, uid, ids, context=context): |
2782 | + nb_rejected = 0 |
2783 | + nb_processed = 0 |
2784 | + start_time = time.strftime('%Y-%m-%d %H:%M:%S') |
2785 | + no_file = False |
2786 | + md5 = False |
2787 | + error = None |
2788 | + data64 = None |
2789 | + filename = False |
2790 | + |
2791 | + try: |
2792 | + for path in [('src_path', 'r'), ('dest_path', 'w'), ('report_path', 'w')]: |
2793 | + import_obj.path_is_accessible(job.import_id[path[0]], path[1]) |
2794 | + except osv.except_osv as e: |
2795 | + error = str(e) |
2796 | + # In case of manual processing, raise the error |
2797 | + if job.file_to_import: |
2798 | + raise e |
2799 | + |
2800 | + if not job.file_to_import: |
2801 | + try: |
2802 | + oldest_file = min(all_files_under(job.import_id.src_path), key=os.path.getmtime) |
2803 | + filename = os.path.split(oldest_file)[1] |
2804 | + md5 = hashlib.md5(open(oldest_file).read()).hexdigest() |
2805 | + data64 = base64.encodestring(open(oldest_file).read()) |
2806 | + except ValueError: |
2807 | + no_file = True |
2808 | + |
2809 | + if not error: |
2810 | + if no_file: |
2811 | + error = _('No file to import in %s !') % job.import_id.src_path |
2812 | + elif md5 and self.search(cr, uid, [('import_id', '=', job.import_id.id), ('file_sum', '=', md5)], limit=1, order='NO_ORDER', context=context): |
2813 | + error = _('A file with same checksum has been already imported !') |
2814 | + move_to_process_path(filename, job.import_id.src_path, job.import_id.dest_path) |
2815 | + |
2816 | + if error: |
2817 | + self.write(cr, uid, [job.id], { |
2818 | + 'filename': filename, |
2819 | + 'file_to_import': data64, |
2820 | + 'start_time': start_time, |
2821 | + 'end_time': time.strftime('%Y-%m-%d'), |
2822 | + 'nb_processed_records': 0, |
2823 | + 'nb_rejected_records': 0, |
2824 | + 'comment': error, |
2825 | + 'file_sum': md5, |
2826 | + 'state': 'error', |
2827 | + }, context=context) |
2828 | + continue |
2829 | + else: |
2830 | + oldest_file = open(os.path.join(job.import_id.src_path, job.filename), 'wb+') |
2831 | + oldest_file.write(base64.decodestring(job.file_to_import)) |
2832 | + oldest_file.close() |
2833 | + md5 = hashlib.md5(job.file_to_import).hexdigest() |
2834 | + |
2835 | + if job.file_sum != md5: |
2836 | + if self.search(cr, uid, [('file_sum', '=', md5), ('id', '!=', job.id)], limit=1, order='NO_ORDER', context=context): |
2837 | + self.write(cr, uid, [job.id], {'file_sum': md5}, context=context) |
2838 | + return { |
2839 | + 'type': 'ir.actions.act_window', |
2840 | + 'res_model': self._name, |
2841 | + 'res_id': ids[0], |
2842 | + 'view_type': 'form', |
2843 | + 'view_mode': 'form,tree', |
2844 | + 'target': 'new', |
2845 | + 'view_id': [data_obj.get_object_reference(cr, uid, 'msf_tools', 'automated_import_job_file_view')[1]], |
2846 | + 'context': context, |
2847 | + } |
2848 | + |
2849 | + oldest_file = os.path.join(job.import_id.src_path, job.filename) |
2850 | + filename = job.filename |
2851 | + data64 = base64.encodestring(job.file_to_import) |
2852 | + |
2853 | + # Process import |
2854 | + try: |
2855 | + processed, rejected, headers = getattr( |
2856 | + self.pool.get(job.import_id.function_id.model_id.model), |
2857 | + job.import_id.function_id.method_to_call |
2858 | + )(cr, uid, oldest_file) |
2859 | + if processed: |
2860 | + nb_processed = self.generate_file_report(cr, uid, job, processed, headers) |
2861 | + |
2862 | + if rejected: |
2863 | + nb_rejected = self.generate_file_report(cr, uid, job, rejected, headers, rejected=True) |
2864 | + |
2865 | + self.write(cr, uid, [job.id], { |
2866 | + 'filename': filename, |
2867 | + 'start_time': start_time, |
2868 | + 'end_time': time.strftime('%Y-%m-%d %H:%M:%S'), |
2869 | + 'nb_processed_records': nb_processed, |
2870 | + 'nb_rejected_records': nb_rejected, |
2871 | + 'file_sum': md5, |
2872 | + 'file_to_import': data64, |
2873 | + 'state': 'done', |
2874 | + }, context=context) |
2875 | + except Exception as e: |
2876 | + self.write(cr, uid, [job.id], { |
2877 | + 'filename': False, |
2878 | + 'start_time': start_time, |
2879 | + 'end_time': time.strftime('%Y-%m-%d'), |
2880 | + 'nb_processed_records': 0, |
2881 | + 'nb_rejected_records': 0, |
2882 | + 'comment': str(e), |
2883 | + 'file_sum': md5, |
2884 | + 'file_to_import': data64, |
2885 | + 'state': 'error', |
2886 | + }, context=context) |
2887 | + finally: |
2888 | + move_to_process_path(filename, job.import_id.src_path, job.import_id.dest_path) |
2889 | + |
2890 | + return { |
2891 | + 'type': 'ir.actions.act_window', |
2892 | + 'res_model': self._name, |
2893 | + 'res_id': ids[0], |
2894 | + 'view_type': 'form', |
2895 | + 'view_mode': 'form,tree', |
2896 | + 'target': 'current', |
2897 | + 'context': context, |
2898 | + } |
2899 | + |
2900 | + |
2901 | + def generate_file_report(self, cr, uid, job_brw, data_lines, headers, rejected=False): |
2902 | + """ |
2903 | + Create a csv file that contains the processed lines and put this csv file |
2904 | + on the report_path directory and attach it to the automated.import.job. |
2905 | + :param cr: Cursor to the database |
2906 | + :param uid: ID of the res.users that calls this method |
2907 | + :param job_brw:Â browse_record of the automated.import.job that need a report |
2908 | + :param data_lines: List of tuple containing the line index and the line data |
2909 | + :param headers: List of field names in the file |
2910 | + :param rejected: If true, the data_lines tuple is composed of 3 members, else, composed of 2 members |
2911 | + :return: # of lines in file |
2912 | + """ |
2913 | + att_obj = self.pool.get('ir.attachment') |
2914 | + |
2915 | + filename = '%s_%s_%s.csv' % ( |
2916 | + time.strftime('%Y%m%d_%H%M%S'), |
2917 | + job_brw.import_id.function_id.model_id.model, |
2918 | + rejected and 'rejected' or 'processed' |
2919 | + ) |
2920 | + pth_filename = os.path.join(job_brw.import_id.report_path, filename) |
2921 | + delimiter = ',' |
2922 | + quotechar = '"' |
2923 | + |
2924 | + with open(pth_filename, 'wb') as csvfile: |
2925 | + spamwriter = csv.writer(csvfile, delimiter=delimiter, quotechar=quotechar, quoting=csv.QUOTE_MINIMAL) |
2926 | + headers_row = [_('Line number')] + headers |
2927 | + if rejected: |
2928 | + headers_row += [_('Error')] |
2929 | + spamwriter.writerow(headers_row) |
2930 | + for pl in data_lines: |
2931 | + pl_row = [pl[0]] + pl[1] |
2932 | + if rejected: |
2933 | + pl_row += [pl[2]] |
2934 | + spamwriter.writerow(pl_row) |
2935 | + |
2936 | + csvfile = open(pth_filename, 'r') |
2937 | + att_obj.create(cr, uid, { |
2938 | + 'name': filename, |
2939 | + 'datas_fname': filename, |
2940 | + 'description': '%s Lines' % (rejected and _('Rejected') or _('Processed')), |
2941 | + 'res_model': 'automated.import.job', |
2942 | + 'res_id': job_brw.id, |
2943 | + 'datas': base64.encodestring(csvfile.read()) |
2944 | + }) |
2945 | + |
2946 | + return len(data_lines) |
2947 | + |
2948 | + def cancel_file_import(self, cr, uid, ids, context=None): |
2949 | + """ |
2950 | + Delete the automated.import.job and close the wizard. |
2951 | + :param cr: Cursor to the database |
2952 | + :param uid: ID of the res.users that calls this method |
2953 | + :param ids: List of automated.import.job to delete |
2954 | + :param context: Context of the call |
2955 | + :return: The action to close the wizard |
2956 | + """ |
2957 | + self.unlink(cr, uid, ids, context=context) |
2958 | + return {'type': 'ir.actions.act_window_close'} |
2959 | + |
2960 | +automated_import_job() |
2961 | + |
2962 | + |
2963 | +class automated_import_job_progress(osv.osv_memory): |
2964 | + _name = 'automated.import.job.progress' |
2965 | + |
2966 | + _columns = { |
2967 | + 'job_id': fields.many2one( |
2968 | + 'automated.import.job', |
2969 | + string='Import job', |
2970 | + required=True, |
2971 | + ), |
2972 | + 'import_id': fields.related( |
2973 | + 'automated.import', |
2974 | + string='Import', |
2975 | + ), |
2976 | + } |
2977 | + |
2978 | +automated_import_job_progress() |
2979 | |
2980 | === modified file 'bin/addons/msf_tools/msf_tools.py' |
2981 | --- bin/addons/msf_tools/msf_tools.py 2016-04-11 08:10:35 +0000 |
2982 | +++ bin/addons/msf_tools/msf_tools.py 2016-05-24 07:58:03 +0000 |
2983 | @@ -624,10 +624,7 @@ |
2984 | tr_split = name.split(',') |
2985 | res_id = self.pool.get('ir.model.data').find_sd_ref(cr, 1, sdref, field='res_id', context=context) |
2986 | if res_id and tr_split[0] == 'product.template': |
2987 | - prod = self.pool.get('product.product').read(cr, 1, [res_id], ['product_tmpl_id'], context=context) |
2988 | - if not prod: |
2989 | - return False |
2990 | - prod = prod[0] |
2991 | + prod = self.pool.get('product.product').read(cr, 1, [res_id], ['product_tmpl_id'], context=context)[0] |
2992 | if prod['product_tmpl_id']: |
2993 | return prod['product_tmpl_id'][0] |
2994 | return res_id |
2995 | |
2996 | === added directory 'bin/addons/msf_tools/views' |
2997 | === added file 'bin/addons/msf_tools/views/automated_import_function_view.xml' |
2998 | --- bin/addons/msf_tools/views/automated_import_function_view.xml 1970-01-01 00:00:00 +0000 |
2999 | +++ bin/addons/msf_tools/views/automated_import_function_view.xml 2016-05-24 07:58:03 +0000 |
3000 | @@ -0,0 +1,58 @@ |
3001 | +<?xml version="1.0" encoding="utf-8" ?> |
3002 | +<openerp> |
3003 | + <data> |
3004 | + |
3005 | + <record id="automated_import_function_search_view" model="ir.ui.view"> |
3006 | + <field name="name">automated.import.function.search.view</field> |
3007 | + <field name="model">automated.import.function</field> |
3008 | + <field name="type">search</field> |
3009 | + <field name="arch" type="xml"> |
3010 | + <search string="Automated import functions"> |
3011 | + <field name="name" /> |
3012 | + <field name="model_id" /> |
3013 | + <field name="method_to_call" /> |
3014 | + </search> |
3015 | + </field> |
3016 | + </record> |
3017 | + |
3018 | + <record id="automated_import_function_tree_view" model="ir.ui.view"> |
3019 | + <field name="name">automated.import.function.tree.view</field> |
3020 | + <field name="model">automated.import.function</field> |
3021 | + <field name="type">tree</field> |
3022 | + <field name="arch" type="xml"> |
3023 | + <tree string="Automated import functions"> |
3024 | + <field name="name" /> |
3025 | + <field name="model_id" /> |
3026 | + <field name="method_to_call" /> |
3027 | + </tree> |
3028 | + </field> |
3029 | + </record> |
3030 | + |
3031 | + <record id="automated_import_function_form_view" model="ir.ui.view"> |
3032 | + <field name="name">automated.import.function.form.view</field> |
3033 | + <field name="model">automated.import.function</field> |
3034 | + <field name="type">form</field> |
3035 | + <field name="arch" type="xml"> |
3036 | + <form string="Automated import function"> |
3037 | + <field name="name" /> |
3038 | + <newline /> |
3039 | + <field name="model_id" /> |
3040 | + <field name="method_to_call" /> |
3041 | + </form> |
3042 | + </field> |
3043 | + </record> |
3044 | + |
3045 | + <record id="automated_import_function_action" model="ir.actions.act_window"> |
3046 | + <field name="name">Automated import functions</field> |
3047 | + <field name="res_model">automated.import.function</field> |
3048 | + <field name="view_type">form</field> |
3049 | + <field name="view_mode">tree,form</field> |
3050 | + </record> |
3051 | + |
3052 | + <menuitem |
3053 | + id="automated_import_function_menu" |
3054 | + action="automated_import_function_action" |
3055 | + parent="automated_import_menu" /> |
3056 | + |
3057 | + </data> |
3058 | +</openerp> |
3059 | \ No newline at end of file |
3060 | |
3061 | === added file 'bin/addons/msf_tools/views/automated_import_job_view.xml' |
3062 | --- bin/addons/msf_tools/views/automated_import_job_view.xml 1970-01-01 00:00:00 +0000 |
3063 | +++ bin/addons/msf_tools/views/automated_import_job_view.xml 2016-05-24 07:58:03 +0000 |
3064 | @@ -0,0 +1,120 @@ |
3065 | +<?xml version="1.0" encoding="utf-8" ?> |
3066 | +<openerp> |
3067 | + <data> |
3068 | + |
3069 | + <record id="automated_import_job_search_view" model="ir.ui.view"> |
3070 | + <field name="name">automated.import.job.search.view</field> |
3071 | + <field name="model">automated.import.job</field> |
3072 | + <field name="type">search</field> |
3073 | + <field name="arch" type="xml"> |
3074 | + <search string="Import job requests"> |
3075 | + <filter icon="terp-document-new" string="Draft" name="draft" domain="[('state', '=', 'draft')]" help="Draft jobs" /> |
3076 | + <filter icon="terp-gnome-cpu-frequency-applet+" string="In progress" name="in_progress" domain="[('state', '=', 'in_progress')]" help="In progress jobs" /> |
3077 | + <filter icon="terp-dialog-close" string="Done" name="done" domain="[('state', '=', 'done')]" help="Done jobs" /> |
3078 | + <filter icon="terp-emblem-important" string="Exception" name="exceptions" domain="[('state', '=', 'error')]" help="Jobs with error" /> |
3079 | + <separator orientation="vertical" /> |
3080 | + <field name="import_id" /> |
3081 | + <field name="start_time" /> |
3082 | + <field name="end_time" /> |
3083 | + </search> |
3084 | + </field> |
3085 | + </record> |
3086 | + |
3087 | + <record id="automated_import_job_tree_view" model="ir.ui.view"> |
3088 | + <field name="name">automated.import.job.tree.view</field> |
3089 | + <field name="model">automated.import.job</field> |
3090 | + <field name="type">tree</field> |
3091 | + <field name="arch" type="xml"> |
3092 | + <tree string="Import job reports" noteditable="True" hide_new_button="True"> |
3093 | + <field name="import_id" /> |
3094 | + <field name="start_time" /> |
3095 | + <field name="end_time" /> |
3096 | + <field name="state" /> |
3097 | + </tree> |
3098 | + </field> |
3099 | + </record> |
3100 | + |
3101 | + <record id="automated_import_job_form_view" model="ir.ui.view"> |
3102 | + <field name="name">automated.import.job.form.view</field> |
3103 | + <field name="model">automated.import.job</field> |
3104 | + <field name="type">form</field> |
3105 | + <field name="arch" type="xml"> |
3106 | + <form string="Import job report"> |
3107 | + <field name="import_id" /> |
3108 | + <field name="start_time" /> |
3109 | + <field name="end_time" /> |
3110 | + <separator colspan="4" string="Import file" /> |
3111 | + <field name="file_to_import" readonly="True" filename="filename" /> |
3112 | + <field name="filename" invisible="1" /> |
3113 | + <separator colspan="4" string="Import results" /> |
3114 | + <field name="nb_processed_records" /> |
3115 | + <field name="nb_rejected_records" /> |
3116 | + <field name="comment" colspan="4" /> |
3117 | + <separator colspan="4" string="States" /> |
3118 | + <field name="state" /> |
3119 | + <button name="process_import" type="object" states="draft" string="Process import" icon="gtk-execute" /> |
3120 | + </form> |
3121 | + </field> |
3122 | + </record> |
3123 | + |
3124 | + <record id="automated_import_job_file_view" model="ir.ui.view"> |
3125 | + <field name="name">automated.import.job.file.view</field> |
3126 | + <field name="model">automated.import.job</field> |
3127 | + <field name="type">form</field> |
3128 | + <field name="priority" eval="99" /> |
3129 | + <field name="arch" type="xml"> |
3130 | + <form string="Automated import job"> |
3131 | + <field name="file_sum" invisible="1" /> |
3132 | + <separator colspan="4" string="Import file" /> |
3133 | + <group colspan="4" attrs="{'invisible': [('file_sum', '!=', False)]}"> |
3134 | + <html> |
3135 | + <style> |
3136 | + #explanation_message_unifield div |
3137 | + { |
3138 | + font-weight: bold; |
3139 | + font-size: 1.2em; |
3140 | + } |
3141 | + </style> |
3142 | + <div id="explanation_message_unifield"> |
3143 | + <label colspan="4" string="If no file is selected, the system will try to get the oldest file in the source path." align="0.0" /> |
3144 | + </div> |
3145 | + </html> |
3146 | + </group> |
3147 | + <group colspan="4" attrs="{'invisible': [('file_sum', '=', False)]}"> |
3148 | + <html> |
3149 | + <style> |
3150 | + #warning_message_unifield div |
3151 | + { |
3152 | + font-weight: bold; |
3153 | + font-size: 1.2em; |
3154 | + color: red; |
3155 | + } |
3156 | + </style> |
3157 | + <div id="warning_message_unifield"> |
3158 | + <label colspan="4" string="The file you selected has already been imported in the past. Are you sure you want to import it ?" align="0.0" /> |
3159 | + </div> |
3160 | + </html> |
3161 | + </group> |
3162 | + <field name="file_to_import" filename="filename" /> |
3163 | + <field name="filename" invisible="1" /> |
3164 | + <separator colspan="4" string="Actions" /> |
3165 | + <button name="cancel_file_import" type="object" string="Cancel" icon="gtk-cancel" colspan="2" /> |
3166 | + <button name="process_import" type="object" string="Run job" icon="gtk-execute" colspan="2" /> |
3167 | + </form> |
3168 | + </field> |
3169 | + </record> |
3170 | + |
3171 | + <record id="automated_import_job_action" model="ir.actions.act_window"> |
3172 | + <field name="name">Import job reports</field> |
3173 | + <field name="res_model">automated.import.job</field> |
3174 | + <field name="view_type">form</field> |
3175 | + <field name="view_mode">tree,form</field> |
3176 | + </record> |
3177 | + |
3178 | + <menuitem |
3179 | + id="automated_import_job_menu" |
3180 | + action="automated_import_job_action" |
3181 | + parent="automated_import_menu" /> |
3182 | + |
3183 | + </data> |
3184 | +</openerp> |
3185 | |
3186 | === added file 'bin/addons/msf_tools/views/automated_import_view.xml' |
3187 | --- bin/addons/msf_tools/views/automated_import_view.xml 1970-01-01 00:00:00 +0000 |
3188 | +++ bin/addons/msf_tools/views/automated_import_view.xml 2016-05-24 07:58:03 +0000 |
3189 | @@ -0,0 +1,77 @@ |
3190 | +<?xml version="1.0" encoding="utf-8" ?> |
3191 | +<openerp> |
3192 | + <data> |
3193 | + |
3194 | + <record id="automated_import_search_view" model="ir.ui.view"> |
3195 | + <field name="name">automated.import.search.view</field> |
3196 | + <field name="model">automated.import</field> |
3197 | + <field name="type">search</field> |
3198 | + <field name="arch" type="xml"> |
3199 | + <search string="Automated imports"> |
3200 | + <filter name="active" domain="[('active', '=', False)]" string="Inactive" icon="gtk-undo" /> |
3201 | + <field name="name" /> |
3202 | + <field name="function_id" /> |
3203 | + </search> |
3204 | + </field> |
3205 | + </record> |
3206 | + |
3207 | + <record id="automated_import_tree_view" model="ir.ui.view"> |
3208 | + <field name="name">automated.import.tree.view</field> |
3209 | + <field name="model">automated.import</field> |
3210 | + <field name="type">tree</field> |
3211 | + <field name="arch" type="xml"> |
3212 | + <tree string="Automated imports"> |
3213 | + <field name="name" /> |
3214 | + <field name="function_id" /> |
3215 | + <field name="start_time" /> |
3216 | + <field name="interval" /> |
3217 | + <field name="interval_unit" /> |
3218 | + </tree> |
3219 | + </field> |
3220 | + </record> |
3221 | + |
3222 | + <record id="automated_import_form_view" model="ir.ui.view"> |
3223 | + <field name="name">automated.import.form.view</field> |
3224 | + <field name="model">automated.import</field> |
3225 | + <field name="type">form</field> |
3226 | + <field name="arch" type="xml"> |
3227 | + <form string="Automated import"> |
3228 | + <separator colspan="4" string="General configuration" /> |
3229 | + <field name="name" /> |
3230 | + <field name="function_id" widget="selection" /> |
3231 | + <field name="active" /> |
3232 | + <button name="run_job_manually" string="Run job manually" colspan="2" type="object" icon="gtk-execute" /> |
3233 | + <separator colspan="4" string="Paths configuration" /> |
3234 | + <field name="src_path" colspan="4" attrs="{'required': [('active', '=', True)]}" /> |
3235 | + <field name="dest_path" colspan="4" attrs="{'required': [('active', '=', True)]}" /> |
3236 | + <field name="report_path" colspan="4" attrs="{'required': [('active', '=', True)]}" /> |
3237 | + <separator colspan="4" string="Scheduler configuration" /> |
3238 | + <group colspan="4" col="6"> |
3239 | + <field name="priority" /> |
3240 | + <field name="interval" attrs="{'required': [('interval_unit', '>', 0)]}" /> |
3241 | + <field name="interval_unit" /> |
3242 | + <field name="start_time" /> |
3243 | + </group> |
3244 | + <separator colspan="4" string="Activation" /> |
3245 | + <group colspan="4" col="1"> |
3246 | + <button name="active_import" string="Activate" colspan="1" type="object" icon="gtk-execute" attrs="{'invisible': [('active', '=', True)]}" /> |
3247 | + <button name="deactive_import" string="De-activate" colspan="1" type="object" icon="gtk-execute" attrs="{'invisible': [('active', '=', False)]}" /> |
3248 | + </group> |
3249 | + </form> |
3250 | + </field> |
3251 | + </record> |
3252 | + |
3253 | + <record id="automated_import_action" model="ir.actions.act_window"> |
3254 | + <field name="name">Automated imports</field> |
3255 | + <field name="res_model">automated.import</field> |
3256 | + <field name="view_type">form</field> |
3257 | + <field name="view_mode">tree,form</field> |
3258 | + </record> |
3259 | + |
3260 | + <menuitem |
3261 | + id="automated_import_menu" |
3262 | + action="automated_import_action" |
3263 | + parent="object_query.menu_preferences" /> |
3264 | + |
3265 | + </data> |
3266 | +</openerp> |
3267 | |
3268 | === modified file 'bin/addons/procurement_request/procurement_request.py' |
3269 | --- bin/addons/procurement_request/procurement_request.py 2016-05-02 07:56:36 +0000 |
3270 | +++ bin/addons/procurement_request/procurement_request.py 2016-05-24 07:58:03 +0000 |
3271 | @@ -497,10 +497,8 @@ |
3272 | self.write(cr, uid, ids, {'state': 'cancel'}, context=context) |
3273 | self.pool.get('sale.order.line').write(cr, uid, line_ids, {'state': 'cancel'}, context=context) |
3274 | |
3275 | - for ir in self.read(cr, uid, ids, ['name'], context=context): |
3276 | - self.infolog(cr, uid, "The IR id:%s (%s) has been canceled" % ( |
3277 | - ir['id'], ir['name'], |
3278 | - )) |
3279 | + for ir_id in ids: |
3280 | + self.infolog(cr, uid, "The IR id:%s has been canceled" % ir_id) |
3281 | |
3282 | return True |
3283 | |
3284 | @@ -539,9 +537,6 @@ |
3285 | if nb_lines: |
3286 | raise osv.except_osv(_('Error'), _('Please check the lines : you cannot have "To Be confirmed" for Nomenclature Level". You have %s lines to correct !') % nb_lines) |
3287 | self.log(cr, uid, req.id, _("The internal request '%s' has been validated (nb lines: %s).") % (req.name, len(req.order_line)), context=context) |
3288 | - self.infolog(cr, uid, "The internal request id:%s (%s) has been validated." % ( |
3289 | - req.id, req.name, |
3290 | - )) |
3291 | line_obj.update_supplier_on_line(cr, uid, line_ids, context=context) |
3292 | line_obj.write(cr, uid, reset_soq, {'soq_updated': False,}, context=context) |
3293 | self.write(cr, uid, ids, {'state': 'validated'}, context=context) |
3294 | |
3295 | === modified file 'bin/addons/purchase_override/purchase.py' |
3296 | --- bin/addons/purchase_override/purchase.py 2016-05-19 07:37:10 +0000 |
3297 | +++ bin/addons/purchase_override/purchase.py 2016-05-24 07:58:03 +0000 |
3298 | @@ -1103,9 +1103,6 @@ |
3299 | |
3300 | message = _("Purchase order '%s' is validated.") % (po.name,) |
3301 | self.log(cr, uid, po.id, message) |
3302 | - self.infolog(cr, uid, "Purchase order id:%s (%s) is validated." % ( |
3303 | - po.id, po.name, |
3304 | - )) |
3305 | # hook for corresponding Fo update |
3306 | self._hook_confirm_order_update_corresponding_so(cr, uid, ids, context=context, po=po) |
3307 | |
3308 | @@ -1235,9 +1232,8 @@ |
3309 | vals.update({'order_id': l.link_so_id.original_so_id_sale_order.id, |
3310 | 'state': 'done'}) |
3311 | sol_id = sol_obj.create(cr, uid, vals, context=context) |
3312 | - self.infolog(cr, uid, "The FO/IR line id:%s (line number: %s) has been added from the PO line id:%s (line number: %s)" % ( |
3313 | - sol_id, sol_obj.read(cr, uid, sol_id, ['line_number'], context=context)['line_number'], |
3314 | - l.id, l.line_number, |
3315 | + self.infolog(cr, uid, "The FO/IR line id:%s has been added from the PO line id:%s" % ( |
3316 | + sol_id, l.id, |
3317 | )) |
3318 | context['sale_id'] = tmp_sale_context |
3319 | |
3320 | @@ -1265,9 +1261,8 @@ |
3321 | pick_obj.action_confirm(cr, uid, pick_to_confirm, context=context) |
3322 | |
3323 | sol_ids.add(l.link_so_id.id) |
3324 | - self.infolog(cr, uid, "The FO/IR line id:%s (line number: %s) has been added from the PO line id:%s (line number: %s)" % ( |
3325 | - new_line_id, sol_obj.read(cr, uid, new_line_id, ['line_number'], context=context)['line_number'], |
3326 | - l.id, l.line_number, |
3327 | + self.infolog(cr, uid, "The FO/IR line id:%s has been added from the PO line id:%s" % ( |
3328 | + new_line_id, l.id, |
3329 | )) |
3330 | |
3331 | if sol_ids: |
3332 | @@ -1330,7 +1325,7 @@ |
3333 | context['wait_order'] = True |
3334 | self._hook_confirm_order_update_corresponding_so(cr, uid, ids, context=context, po=po, so_ids=so_ids) |
3335 | del context['wait_order'] |
3336 | - self.infolog(cr, uid, "The PO id:%s (%s) has been confirmed" % (po.id, po.name)) |
3337 | + self.infolog(cr, uid, "The PO id:%s has been confirmed" % po.id) |
3338 | |
3339 | return True |
3340 | |
3341 | @@ -3413,10 +3408,8 @@ |
3342 | |
3343 | res = super(purchase_order_line, self).unlink(cr, uid, ids, context=context) |
3344 | |
3345 | - for pol in self.read(cr, uid, ids, ['line_number'], context=context): |
3346 | - self.infolog(cr, uid, "The PO/RfQ line id:%s (line number: %s) has been deleted" % ( |
3347 | - pol['id'], pol['name'], |
3348 | - )) |
3349 | + for pol_id in ids: |
3350 | + self.infolog(cr, uid, "The PO/RfQ line id:%s has been deleted" % pol_id) |
3351 | |
3352 | po_obj.wkf_confirm_trigger(cr, uid, order_ids, context=context) |
3353 | |
3354 | |
3355 | === modified file 'bin/addons/register_accounting/account_move_line.py' |
3356 | --- bin/addons/register_accounting/account_move_line.py 2016-04-18 14:37:27 +0000 |
3357 | +++ bin/addons/register_accounting/account_move_line.py 2016-05-24 07:58:03 +0000 |
3358 | @@ -77,7 +77,7 @@ |
3359 | ('state', '=', 'valid'), |
3360 | ('move_state', '=', 'posted'), # UFTP-204: Exclude the Direct Invoice from the list |
3361 | ('journal_id.type', 'not in', ['migration']), # US-70 Open the pending payment to receivable and payable entries from all journals except for the migration journal |
3362 | - ('account_id.type_for_register', 'not in', ['down_payment', 'advance', 'donation', ]), |
3363 | + ('account_id.type_for_register', 'not in', ['down_payment', 'advance', ]), |
3364 | # UTP-1088 exclude correction/reversal lines as can be in journal of type correction |
3365 | ('corrected_line_id', '=', False), # is a correction line if has a corrected line |
3366 | ('reversal_line_id', '=', False), # is a reversal line if a reversed line |
3367 | |
3368 | === modified file 'bin/addons/sale_override/sale.py' |
3369 | --- bin/addons/sale_override/sale.py 2016-05-10 09:47:26 +0000 |
3370 | +++ bin/addons/sale_override/sale.py 2016-05-24 07:58:03 +0000 |
3371 | @@ -635,13 +635,7 @@ |
3372 | |
3373 | context.update({'no_check_line': True}) |
3374 | self.write(cr, uid, ids, {'delivery_confirmed_date': time.strftime('%Y-%m-%d')}, context=context) |
3375 | - res = super(sale_order, self).action_cancel(cr, uid, ids, context=context) |
3376 | - for order in self.browse(cr, uid, ids, context=context): |
3377 | - self.infolog(cr, uid, "The %s id:%s (%s) has been canceled." % ( |
3378 | - order.procurement_request and 'Internal request' or 'Field order', |
3379 | - order.id, order.name, |
3380 | - )) |
3381 | - return res |
3382 | + return super(sale_order, self).action_cancel(cr, uid, ids, context=context) |
3383 | |
3384 | #@@@override sale.sale_order._invoiced |
3385 | def _invoiced(self, cr, uid, ids, name, arg, context=None): |
3386 | @@ -814,9 +808,6 @@ |
3387 | get function values |
3388 | ''' |
3389 | result = {} |
3390 | - if context is None: |
3391 | - context = {} |
3392 | - |
3393 | for obj in self.browse(cr, uid, ids, context=context): |
3394 | result[obj.id] = {} |
3395 | for f in fields: |
3396 | @@ -827,10 +818,8 @@ |
3397 | if obj.state == 'done' and obj.split_type_sale_order == 'original_sale_order' and not obj.procurement_request: |
3398 | result[obj.id]['state_hidden_sale_order'] = 'split_so' |
3399 | |
3400 | - if obj.state_hidden_sale_order != result[obj.id]['state_hidden_sale_order'] and \ |
3401 | - (not obj.original_so_id_sale_order or obj.state_hidden_sale_order not in (False, 'draft')): |
3402 | - real_uid = context.get('computed_for_uid', uid) |
3403 | - self.add_audit_line(cr, real_uid, obj.id, |
3404 | + if obj.state_hidden_sale_order != result[obj.id]['state_hidden_sale_order']: |
3405 | + self.add_audit_line(cr, uid, obj.id, |
3406 | obj.state_hidden_sale_order, |
3407 | result[obj.id]['state_hidden_sale_order'], |
3408 | context=context) |
3409 | @@ -1330,10 +1319,8 @@ |
3410 | for order in order_brw_list: |
3411 | if not order.procurement_request: |
3412 | self.log(cr, uid, order.id, 'The Field order \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context) |
3413 | - self.infolog(cr, uid, "The Field order id:%s (%s) has been validated." % (order.id, order.name)) |
3414 | else: |
3415 | self.log(cr, uid, order.id, 'The Internal Request \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context) |
3416 | - self.infolog(cr, uid, "The Internal request id:%s (%s) has been validated." % (order.id, order.name)) |
3417 | |
3418 | return True |
3419 | |
3420 | @@ -1421,9 +1408,6 @@ |
3421 | 'original_so_id_sale_order': so.id}, context=dict(context, keepDateAndDistrib=True, keepClientOrder=True)) |
3422 | # log the action of split |
3423 | self.log(cr, uid, split_id, _('The %s split %s has been created.') % (selec_name, fo_name)) |
3424 | - self.infolog(cr, uid, "The %s split id:%s (%s) has been created." % ( |
3425 | - selec_name, split_id, fo_name, |
3426 | - )) |
3427 | split_fo_dic[fo_type] = split_id |
3428 | # For loans, change the subflow |
3429 | if fo_type == 'stock_split_sale_order': |
3430 | @@ -1537,10 +1521,8 @@ |
3431 | self.write(cr, uid, ids, {'state': 'done', |
3432 | 'active': False}, context=context) |
3433 | |
3434 | - for order in self.read(cr, uid, ids, ['name'], context=context): |
3435 | - self.infolog(cr, uid, "The splitted FO id:%s (%s) has been closed" % ( |
3436 | - order['id'], order['name'], |
3437 | - )) |
3438 | + for order_id in ids: |
3439 | + self.infolog(cr, uid, "The splitted FO id:%s has been closed" % order_id) |
3440 | |
3441 | return True |
3442 | |
3443 | @@ -1958,15 +1940,6 @@ |
3444 | date_tools = self.pool.get('date.tools') |
3445 | fields_tools = self.pool.get('fields.tools') |
3446 | |
3447 | - msg_type = { |
3448 | - 'in': 'Incoming shipment', |
3449 | - 'internal': 'Internal picking', |
3450 | - 'out': { |
3451 | - 'standard': 'Delivery order', |
3452 | - 'picking': 'Picking Ticket,' |
3453 | - } |
3454 | - } |
3455 | - |
3456 | if context is None: |
3457 | context = {} |
3458 | |
3459 | @@ -2004,14 +1977,6 @@ |
3460 | if not picking_id: |
3461 | picking_data = self._get_picking_data(cr, uid, order) |
3462 | picking_id = picking_obj.create(cr, uid, picking_data, context=context) |
3463 | - self.infolog(cr, uid, "The %s id:%s (%s) has been created from %s id:%s (%s)." % ( |
3464 | - picking_data.get('type', '') == 'out' and \ |
3465 | - msg_type.get('out', {}).get(picking_data.get('subtype', ''), '') or \ |
3466 | - msg_type.get(picking_data.get('type', ''), ''), |
3467 | - picking_id, picking_data.get('name', ''), |
3468 | - order.procurement_request and 'Internal request' or 'Field order', |
3469 | - order.id, order.name, |
3470 | - )) |
3471 | |
3472 | # Get move data and create the move |
3473 | move_data = self._get_move_data(cr, uid, order, line, picking_id, context=context) |
3474 | @@ -2125,9 +2090,9 @@ |
3475 | |
3476 | line_done += 1 |
3477 | if line.type == 'make_to_stock': |
3478 | - msg = 'The line id:%s (line number: %s) of FO/IR id:%s (%s) has been sourced \'from stock\' with the stock.move id:%s' % ( |
3479 | - line.id, line.line_number, |
3480 | - line.order_id.id, line.order_id.name, |
3481 | + msg = 'The line id:%s of FO/IR id:%s has been sourced \'from stock\' with the stock.move id:%s' % ( |
3482 | + line.id, |
3483 | + line.order_id.id, |
3484 | move_id, |
3485 | ) |
3486 | self.infolog(cr, uid, msg) |
3487 | @@ -2868,31 +2833,17 @@ |
3488 | lines_to_check = [] |
3489 | if isinstance(ids, (int, long)): |
3490 | ids = [ids] |
3491 | - |
3492 | - lines_to_log = [] |
3493 | - |
3494 | - for line in self.browse(cr, uid, ids, context=context): |
3495 | + for line in self.read(cr, uid, ids, ['order_id'], context=context): |
3496 | ltc_ids = self.search(cr, uid, [ |
3497 | - ('order_id', '=', line.order_id.id), |
3498 | + ('order_id', '=', line['order_id'][0]), |
3499 | ('order_id.state', '=', 'validated'), |
3500 | - ('id', '!=', line.id), |
3501 | + ('id', '!=', line['id']), |
3502 | ], limit=1, context=context) |
3503 | if ltc_ids and ltc_ids[0] not in lines_to_check: |
3504 | lines_to_check.append(ltc_ids[0]) |
3505 | |
3506 | - lines_to_log.append(( |
3507 | - line.id, |
3508 | - line.line_number, |
3509 | - line.order_id.procurement_request and 'Internal request' or 'Field orer', |
3510 | - line.order_id.id, |
3511 | - line.order_id.name, |
3512 | - )) |
3513 | - |
3514 | res = super(sale_order_line, self).unlink(cr, uid, ids, context=context) |
3515 | |
3516 | - for ltl in lines_to_log: |
3517 | - self.infolog(cr, uid, "The line id:%s (line number: %s) of the %s id:%s (%s) has been deleted." % ltl) |
3518 | - |
3519 | if lines_to_check: |
3520 | self.check_confirm_order(cr, uid, lines_to_check, run_scheduler=False, context=context) |
3521 | |
3522 | |
3523 | === modified file 'bin/addons/sourcing/procurement_order.py' |
3524 | --- bin/addons/sourcing/procurement_order.py 2016-04-25 09:24:04 +0000 |
3525 | +++ bin/addons/sourcing/procurement_order.py 2016-05-24 07:58:03 +0000 |
3526 | @@ -348,11 +348,7 @@ |
3527 | }, context=context) |
3528 | |
3529 | if line: |
3530 | - self.infolog(cr, uid, "The FO/IR line id:%s (line number: %s) has been sourced on order to the PO line id:%s (line number: %s) of the PO id:%s (%s)" % ( |
3531 | - line.id, line.line_number, |
3532 | - pol_id, self.pool.get('purchase.order.line').read(cr, uid, pol_id, ['line_number'], context=context)['line_number'], |
3533 | - purchase_ids[0], self.pool.get('purchase.order').read(cr, uid, purchase_ids[0], ['name'], context=context)['name'], |
3534 | - )) |
3535 | + self.infolog(cr, uid, "The FO/IR line id:%s has been sourced on order to the PO line id:%s of the PO id:%s" % (line.id, pol_id, purchase_ids[0])) |
3536 | |
3537 | return purchase_ids[0] |
3538 | else: |
3539 | @@ -386,10 +382,8 @@ |
3540 | }, context=context) |
3541 | |
3542 | if line: |
3543 | - self.infolog(cr, uid, "The FO/IR line id:%s (line number: %s) has been sourced on order to the PO id:%s (%s)" % ( |
3544 | - line.id, line.line_number, |
3545 | - purchase_id, self.pool.get('purchase.order').read(cr, uid, purchase_id, ['name'], context=context)['name'], |
3546 | - )) |
3547 | + self.infolog(cr, uid, "The FO/IR line id:%s has been sourced on order to the PO id:%s" % ( |
3548 | + line.id, purchase_id)) |
3549 | |
3550 | return purchase_id |
3551 | |
3552 | |
3553 | === modified file 'bin/addons/sourcing/sale_order_line.py' |
3554 | --- bin/addons/sourcing/sale_order_line.py 2016-05-11 08:59:01 +0000 |
3555 | +++ bin/addons/sourcing/sale_order_line.py 2016-05-24 07:58:03 +0000 |
3556 | @@ -1058,7 +1058,7 @@ |
3557 | |
3558 | return result |
3559 | |
3560 | - def confirmLine(self, cr, uid, ids, context=None, run_scheduler=False): |
3561 | + def confirmLine(self, cr, uid, ids, run_scheduler=False, context=None): |
3562 | """ |
3563 | Set the line as confirmed and check if all lines |
3564 | of the FO/IR are confirmed. If yes, launch the |
3565 | @@ -1248,12 +1248,6 @@ |
3566 | 'start_date': time.strftime('%Y-%m-%d %H:%M:%S'), |
3567 | }, context=context) |
3568 | |
3569 | - order = self.pool.get('sale.order').read(cr, uid, order_id, ['name'], context=context) |
3570 | - self.infolog(cr, uid, "All lines of the FO/IR id:%s (%s) have been sourced" % ( |
3571 | - order['id'], |
3572 | - order['name'], |
3573 | - )) |
3574 | - |
3575 | self.pool.get('sale.order').write(cr, uid, order_ids, { |
3576 | 'sourcing_trace_ok': True, |
3577 | 'sourcing_trace': 'Sourcing in progress', |
3578 | |
3579 | === modified file 'bin/addons/specific_rules/specific_rules.py' |
3580 | --- bin/addons/specific_rules/specific_rules.py 2016-04-25 09:24:04 +0000 |
3581 | +++ bin/addons/specific_rules/specific_rules.py 2016-05-24 07:58:03 +0000 |
3582 | @@ -1655,10 +1655,10 @@ |
3583 | # super function after production lot creation - production lot are therefore taken into account at stock move creation |
3584 | result = super(stock_inventory, self).action_confirm(cr, uid, ids, context=context) |
3585 | |
3586 | - self.infolog(cr, uid, 'The %s inventor%s %s (%s) ha%s been confirmed' % ( |
3587 | + self.infolog(cr, uid, 'The %s inventor%s %s ha%s been confirmed' % ( |
3588 | self._name == 'initial.stock.inventory' and 'Initial stock' or 'Physical', |
3589 | len(ids) > 1 and 'ies' or 'y', |
3590 | - ids, ', '.join(x['name'] for x in self.read(cr, uid, ids, ['name'], context=context)), |
3591 | + ids, |
3592 | len(ids) > 1 and 've' or 's', |
3593 | )) |
3594 | |
3595 | @@ -1667,10 +1667,10 @@ |
3596 | def action_cancel_draft(self, cr, uid, ids, context=None): |
3597 | res = super(stock_inventory, self).action_cancel_draft(cr, uid, ids, context=context) |
3598 | |
3599 | - for inv in self.read(cr, uid, ids, ['name'], context=context): |
3600 | - self.infolog(cr, uid, "The %s inventory id:%s (%s) has been re-set to draft" % ( |
3601 | + for inv_id in ids: |
3602 | + self.infolog(cr, uid, "The %s inventory id:%s has been re-set to draft" % ( |
3603 | self._name == 'initial.stock.inventory' and 'Initial stock' or 'Physical', |
3604 | - inv['id'], inv['name'], |
3605 | + inv_id, |
3606 | )) |
3607 | |
3608 | return res |
3609 | @@ -1678,9 +1678,9 @@ |
3610 | def action_done(self, cr, uid, ids, context=None): |
3611 | res = super(stock_inventory, self).action_done(cr, uid, ids, context=context) |
3612 | |
3613 | - self.infolog(cr, uid, 'The Physical inventor%s %s (%s) ha%s been validated' % ( |
3614 | + self.infolog(cr, uid, 'The Physical inventor%s %s ha%s been validated' % ( |
3615 | len(ids) > 1 and 'ies' or 'y', |
3616 | - ids, ', '.join(x['name'] for x in self.read(cr, uid, ids, ['name'], context=context)), |
3617 | + ids, |
3618 | len(ids) > 1 and 've' or 's', |
3619 | )) |
3620 | |
3621 | |
3622 | === modified file 'bin/addons/stock/stock.py' |
3623 | --- bin/addons/stock/stock.py 2016-04-25 08:27:30 +0000 |
3624 | +++ bin/addons/stock/stock.py 2016-05-24 07:58:03 +0000 |
3625 | @@ -1432,9 +1432,6 @@ |
3626 | } |
3627 | # modify the list of views |
3628 | message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' " |
3629 | - infolog_message = None |
3630 | - if pick.state == 'assigned': |
3631 | - infolog_message = type_list.get(pick.type, _('Document')) + " id:" + str(pick.id) or 'False' + " '" + (pick.name or '?') + "' " |
3632 | if pick.min_date: |
3633 | msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime(date_format).decode('utf-8') |
3634 | state_list = { |
3635 | @@ -1448,21 +1445,14 @@ |
3636 | res = self._hook_picking_get_view(cr, uid, ids, context=context, pick=pick) |
3637 | context.update({'view_id': res and res[1] or False}) |
3638 | message += state_list[pick.state] |
3639 | - if infolog_message: |
3640 | - infolog_message += state_list[pick.state] |
3641 | # modify the message to be displayed |
3642 | message = self._hook_log_picking_modify_message(cr, uid, ids, context=context, message=message, pick=pick) |
3643 | - if infolog_message: |
3644 | - infolog_message = self._hook_log_picking_modify_message(cr, uid, ids, context=context, message=infolog_message, pick=pick) |
3645 | # conditional test for message log |
3646 | log_cond = self._hook_log_picking_log_cond(cr, uid, ids, context=context, pick=pick) |
3647 | if log_cond and log_cond != 'packing': |
3648 | self.log(cr, uid, pick.id, message, context=context) |
3649 | elif not log_cond: |
3650 | self._hook_custom_log(cr, uid, ids, context=context, message=message, pick=pick) |
3651 | - |
3652 | - if infolog_message: |
3653 | - self.infolog(cr, uid, message) |
3654 | return True |
3655 | |
3656 | stock_picking() |
3657 | @@ -2898,9 +2888,9 @@ |
3658 | account_move_obj.unlink(cr, uid, [account_move['id']], context=context) |
3659 | self.write(cr, uid, [inv.id], {'state': 'cancel'}, context=context) |
3660 | if self._name == 'initial.stock.inventory': |
3661 | - self.infolog(cr, uid, "The Initial Stock inventory id:%s (%s) has been canceled" % (inv.id, inv.name)) |
3662 | + self.infolog(cr, uid, "The Initial Stock inventory id:%s has been canceled" % inv.id) |
3663 | else: |
3664 | - self.infolog(cr, uid, "The Physical inventory id:%s (%s) has been canceled" % (inv.id, inv.name)) |
3665 | + self.infolog(cr, uid, "The Physical inventory id:%s has been canceled" % inv.id) |
3666 | return True |
3667 | |
3668 | stock_inventory() |
3669 | |
3670 | === modified file 'bin/addons/stock_override/stock.py' |
3671 | --- bin/addons/stock_override/stock.py 2016-04-25 10:27:20 +0000 |
3672 | +++ bin/addons/stock_override/stock.py 2016-05-24 07:58:03 +0000 |
3673 | @@ -627,28 +627,22 @@ |
3674 | @check_cp_rw |
3675 | def force_assign(self, cr, uid, ids, context=None): |
3676 | res = super(stock_picking, self).force_assign(cr, uid, ids) |
3677 | - for pick in self.read(cr, uid, ids, ['name'], context=context): |
3678 | - self.infolog(cr, uid, 'Force availability ran on stock.picking id:%s (%s)' % ( |
3679 | - pick['id'], pick['name'], |
3680 | - )) |
3681 | + for pick_id in ids: |
3682 | + self.infolog(cr, uid, 'Force availability ran on stock.picking id:%s' % pick_id) |
3683 | return res |
3684 | |
3685 | @check_cp_rw |
3686 | def action_assign(self, cr, uid, ids, context=None): |
3687 | res = super(stock_picking, self).action_assign(cr, uid, ids, context=context) |
3688 | - for pick in self.read(cr, uid, ids, ['name'], context=context): |
3689 | - self.infolog(cr, uid, 'Check availability ran on stock.picking id:%s (%s)' % ( |
3690 | - pick['id'], pick['name'], |
3691 | - )) |
3692 | + for pick_id in ids: |
3693 | + self.infolog(cr, uid, 'Check availability ran on stock.picking id:%s' % pick_id) |
3694 | return res |
3695 | |
3696 | @check_cp_rw |
3697 | def cancel_assign(self, cr, uid, ids, *args, **kwargs): |
3698 | res = super(stock_picking, self).cancel_assign(cr, uid, ids) |
3699 | - for pick in self.read(cr, uid, ids, ['name']): |
3700 | - self.infolog(cr, uid, 'Cancel availability ran on stock.picking id:%s (%s)' % ( |
3701 | - pick['id'], pick['name'], |
3702 | - )) |
3703 | + for pick_id in ids: |
3704 | + self.infolog(cr, uid, 'Cancel availability ran on stock.picking id:%s' % pick_id) |
3705 | return res |
3706 | |
3707 | |
3708 | @@ -999,7 +993,7 @@ |
3709 | |
3710 | return res |
3711 | |
3712 | - def is_invoice_needed(self, cr, uid, sp=None, invoice_type=None): |
3713 | + def is_invoice_needed(self, cr, uid, sp=None): |
3714 | """ |
3715 | Check if invoice is needed. Cases where we do not need invoice: |
3716 | - OUT from scratch (without purchase_id and sale_id) AND stock picking type in internal, external or esc |
3717 | @@ -1032,8 +1026,7 @@ |
3718 | res = False |
3719 | |
3720 | # (US-952) Move out on an external partner should not create a Stock Transfer Voucher |
3721 | - # US-1212: but should create refund |
3722 | - if sp.type == 'out' and sp.partner_id.partner_type == 'external' and invoice_type != 'in_refund': |
3723 | + if sp.type == 'out' and sp.partner_id.partner_type == 'external': |
3724 | res = False |
3725 | |
3726 | return res |
3727 | @@ -1047,7 +1040,7 @@ |
3728 | invoice_type = self._get_invoice_type(stock_picking) |
3729 | |
3730 | # Check if no invoice needed |
3731 | - if not self.is_invoice_needed(cr, uid, stock_picking, invoice_type): |
3732 | + if not self.is_invoice_needed(cr, uid, stock_picking): |
3733 | return |
3734 | |
3735 | # we do not create invoice for procurement_request (Internal Request) |
3736 | @@ -1231,7 +1224,6 @@ |
3737 | |
3738 | return True |
3739 | |
3740 | - @check_cp_rw |
3741 | def change_all_location(self, cr, uid, ids, context=None): |
3742 | ''' |
3743 | Launch the wizard to change all destination location of stock moves |
3744 | @@ -1483,9 +1475,7 @@ |
3745 | if move.product_id.id == product_tbd and move.from_wkf_line: |
3746 | ids.pop(ids.index(move.id)) |
3747 | else: |
3748 | - self.infolog(cr, uid, 'Force availability run on stock move #%s (id:%s) of picking id:%s (%s)' % ( |
3749 | - move.line_number, move.id, move.picking_id.id, move.picking_id.name, |
3750 | - )) |
3751 | + self.infolog(cr, uid, 'Force availability run on stock move #%s (id:%s) of picking id:%s' % (move.line_number, move.id, move.picking_id.id)) |
3752 | |
3753 | return super(stock_move, self).force_assign(cr, uid, ids, context=context) |
3754 | |
3755 | @@ -1938,6 +1928,8 @@ |
3756 | |
3757 | def check_assign(self, cr, uid, ids, context=None): |
3758 | res = super(stock_move, self).check_assign(cr, uid, ids, context=context) |
3759 | + for move_id in ids: |
3760 | + self.infolog(cr, uid, 'Check availability ran on stock.move id:%s' % move_id) |
3761 | return res |
3762 | |
3763 | @check_cp_rw |
3764 | @@ -1952,12 +1944,10 @@ |
3765 | for move_data in self.read(cr, uid, ids, fields_to_read, context=context): |
3766 | search_domain = [('state', '=', 'confirmed'), ('id', '!=', move_data['id'])] |
3767 | |
3768 | - self.infolog(cr, uid, 'Cancel availability run on stock move #%s (id:%s) of picking id:%s (%s)' % ( |
3769 | + self.infolog(cr, uid, 'Cancel availability run on stock move #%s (id:%s) of picking id:%s' % ( |
3770 | move_data['line_number'], |
3771 | move_data['id'], |
3772 | - move_data['picking_id'][0], |
3773 | - self.pool.get('stock.picking').read(cr, uid, move_data['picking_id'][0], ['name'], context=context)['name'], |
3774 | - )) |
3775 | + move_data['picking_id'][0])) |
3776 | |
3777 | for f in fields_to_read: |
3778 | if f in ('product_qty', 'product_uos_qty'): |
3779 | @@ -2536,17 +2526,9 @@ |
3780 | move_ids = move_obj.search(cr, uid, [('id', '=', wiz.move_id.id)], |
3781 | limit=1, order='NO_ORDER', context=context) |
3782 | if move_ids and wiz.move_id.has_to_be_resourced: |
3783 | - self.infolog(cr, uid, "The stock.move id:%s of the picking id:%s (%s) has been canceled and resourced" % ( |
3784 | - move_id, |
3785 | - picking_id, |
3786 | - pick_obj.read(cr, uid, picking_id, ['name'], context=context)['name'], |
3787 | - )) |
3788 | + self.infolog(cr, uid, "The stock.move id:%s of the picking id:%s has been canceled and resourced" % (move_id, picking_id)) |
3789 | else: |
3790 | - self.infolog(cr, uid, "The stock.move id:%s of the picking id:%s (%s) has been canceled" % ( |
3791 | - move_id, |
3792 | - picking_id, |
3793 | - pick_obj.read(cr, uid, picking_id, ['name'], context=context)['name'], |
3794 | - )) |
3795 | + self.infolog(cr, uid, "The stock.move id:%s of the picking id:%s has been canceled" % (move_id, picking_id)) |
3796 | |
3797 | if move_ids and wiz.move_id.picking_id: |
3798 | lines = wiz.move_id.picking_id.move_lines |
3799 | @@ -2602,23 +2584,9 @@ |
3800 | ''' |
3801 | Just call the cancel of the stock.picking |
3802 | ''' |
3803 | - msg_type = { |
3804 | - 'in': 'Incoming Shipment', |
3805 | - 'internal': 'Internal Picking', |
3806 | - 'out': { |
3807 | - 'standard': 'Delivery Order', |
3808 | - 'picking': 'Picking Ticket', |
3809 | - } |
3810 | - } |
3811 | - |
3812 | wf_service = netsvc.LocalService("workflow") |
3813 | for wiz in self.browse(cr, uid, ids, context=context): |
3814 | wf_service.trg_validate(uid, 'stock.picking', wiz.picking_id.id, 'button_cancel', cr) |
3815 | - self.infolog(cr, uid, "The %s id:%s (%s) has been canceled%s." % ( |
3816 | - wiz.picking_id.type == 'out' and msg_type.get('out', {}).get(wiz.picking_id.subtype, '') or msg_type.get(wiz.picking_id.type), |
3817 | - wiz.picking_id.id, |
3818 | - wiz.picking_id.has_to_be_resourced and ' and resourced' or '', |
3819 | - )) |
3820 | |
3821 | return {'type': 'ir.actions.act_window_close'} |
3822 | |
3823 | |
3824 | === modified file 'bin/addons/stock_override/stock_view.xml' |
3825 | --- bin/addons/stock_override/stock_view.xml 2016-04-25 10:27:20 +0000 |
3826 | +++ bin/addons/stock_override/stock_view.xml 2016-05-24 07:58:03 +0000 |
3827 | @@ -469,7 +469,7 @@ |
3828 | <button name="draft_force_assign" states="draft,confirmed,assigned" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': ['|', '&', ('state', 'in', ['done', 'cancel', 'import']), ('state', '!=', 'draft'), ('has_draft_moves', '=', False)]}" /> |
3829 | <button name="action_assign" states="confirmed,assigned" string="Check Availability" type="object" icon="gtk-find" context="{'from_button': True}"/> |
3830 | <button name="force_assign" states="confirmed,assigned" string="Force Availability" type="object" icon="gtk-jump-to" context="{'from_button': True}" /> |
3831 | - <button name="change_all_location" string="Change All destinations" icon="gtk-execute" type="object" states="draft,confirmed,assigned" context="{'from_button': True}" /> |
3832 | + <button name="change_all_location" string="Change All destinations" icon="gtk-execute" type="object" states="draft,confirmed,assigned" /> |
3833 | <button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward" context="{'from_button': True}"/> |
3834 | <field name="certificate_donation" invisible="1"/> |
3835 | <button name="print_certificate" string="Print certificate" type="object" icon="gtk-print" attrs="{'invisible': [('certificate_donation', '=', False)]}"/> |
3836 | |
3837 | === modified file 'bin/addons/sync_client/sync_client.py' |
3838 | --- bin/addons/sync_client/sync_client.py 2016-05-02 08:02:47 +0000 |
3839 | +++ bin/addons/sync_client/sync_client.py 2016-05-24 07:58:03 +0000 |
3840 | @@ -69,7 +69,6 @@ |
3841 | connected = False |
3842 | raise osv.except_osv(_("Error!"), _("Not connected: please try to log on in the Connection Manager")) |
3843 | # Check for update |
3844 | - |
3845 | if hasattr(entity, 'upgrade'): |
3846 | up_to_date = entity.upgrade(cr, uid, context=context) |
3847 | if not up_to_date[0]: |
3848 | |
3849 | === modified file 'bin/addons/tender_flow/tender_flow.py' |
3850 | --- bin/addons/tender_flow/tender_flow.py 2016-04-25 09:24:04 +0000 |
3851 | +++ bin/addons/tender_flow/tender_flow.py 2016-05-24 07:58:03 +0000 |
3852 | @@ -385,11 +385,8 @@ |
3853 | 'res_id': po_id, |
3854 | 'domain': [('rfq_ok', '=', True)], |
3855 | }, context={'rfq_ok': True}) |
3856 | - self.infolog(cr, uid, "The RfQ id:%s (%s) has been generated from tender id:%s (%s)" % ( |
3857 | - po_id, |
3858 | - po_obj.read(cr, uid, po_id, ['name'], context=context)['name'], |
3859 | - tender.id, |
3860 | - tender.name, |
3861 | + self.infolog(cr, uid, "The RfQ id:%s has been generated from tender id:%s" % ( |
3862 | + po_id, tender.id, |
3863 | )) |
3864 | |
3865 | self.write(cr, uid, ids, {'state':'comparison'}, context=context) |
3866 | @@ -475,10 +472,7 @@ |
3867 | |
3868 | sol_ids.add(tender.sale_order_id.id) |
3869 | |
3870 | - self.infolog(cr, uid, "The tender id:%s (%s) has been closed" % ( |
3871 | - tender.id, |
3872 | - tender.name, |
3873 | - )) |
3874 | + self.infolog(cr, uid, "The tender id:%s has been closed" % tender.id) |
3875 | |
3876 | if sol_ids: |
3877 | so_obj.action_ship_proc_create(cr, uid, list(sol_ids), context=context) |
3878 | @@ -681,12 +675,7 @@ |
3879 | po_id = po_obj.create(cr, uid, po_data, context=context) |
3880 | po = po_obj.browse(cr, uid, po_id, context=context) |
3881 | po_obj.log(cr, uid, po_id, 'The Purchase order %s for supplier %s has been created.'%(po.name, po.partner_id.name)) |
3882 | - self.infolog(cr, uid, "The PO id:%s (%s) has been generated from tender id:%s (%s)" % ( |
3883 | - po_id, |
3884 | - po.name, |
3885 | - tender.id, |
3886 | - tender.name, |
3887 | - )) |
3888 | + self.infolog(cr, uid, "The PO id:%s has been generated from tender" % po_id) |
3889 | #UF-802: the PO created must be in draft state, and not validated! |
3890 | #wf_service.trg_validate(uid, 'purchase.order', po_id, 'purchase_confirm', cr) |
3891 | |
3892 | @@ -750,10 +739,7 @@ |
3893 | |
3894 | for line in tender.tender_line_ids: |
3895 | t_line_obj.cancel_sourcing(cr, uid, [line.id], context=context) |
3896 | - self.infolog(cr, uid, "The tender id:%s (%s) has been canceled" % ( |
3897 | - tender.id, |
3898 | - tender.name, |
3899 | - )) |
3900 | + self.infolog(cr, uid, "The tender id:%s has been canceled" % tender.id) |
3901 | |
3902 | return True |
3903 | |
3904 | @@ -1123,12 +1109,8 @@ |
3905 | ''' |
3906 | to_remove = self.cancel_sourcing(cr, uid, ids, context=dict(context, fake_unlink=True)) |
3907 | |
3908 | - for tl in self.browse(cr, uid, ids, context=context): |
3909 | - self.infolog(cr, uid, "The tender line id:%s of tender id:%s (%s) has been canceled" % ( |
3910 | - tl.id, |
3911 | - tl.tender_id.id, |
3912 | - tl.tender_id.name, |
3913 | - )) |
3914 | + for tl_id in ids: |
3915 | + self.infolog(cr, uid, "The tender line id:%s has been canceled" % tl_id) |
3916 | |
3917 | return self.unlink(cr, uid, to_remove, context=context) |
3918 | |
3919 | @@ -1400,14 +1382,8 @@ |
3920 | |
3921 | # log message concerning RfQ creation |
3922 | rfq_obj.log(cr, uid, rfq_id, "The Request for Quotation '%s' has been created and must be completed before purchase order creation."%rfq_obj.browse(cr, uid, rfq_id, context=context).name, context={'rfq_ok': 1}) |
3923 | - rfq_line = rfq_line_obj.browse(cr, uid, rfq_line_id, context=context) |
3924 | - self.infolog(cr, uid, "The FO/IR line id:%s (line number: %s) has been sourced on order to RfQ line id:%s (line number: %s) of the RfQ id:%s (%s)" % ( |
3925 | - sale_order_line.id, |
3926 | - sale_order_line.line_number, |
3927 | - rfq_line.id, |
3928 | - rfq_line.line_number, |
3929 | - rfq_line.order_id.id, |
3930 | - rfq_line.order_id.name, |
3931 | + self.infolog(cr, uid, "The FO/IR line id:%s has been sourced on order to RfQ line id:%s of the RfQ id:%s" % ( |
3932 | + sale_order_line.id, rfq_line_id, rfq_id, |
3933 | )) |
3934 | # state of procurement is Tender |
3935 | self.write(cr, uid, ids, {'state': 'rfq'}, context=context) |
3936 | @@ -1465,14 +1441,9 @@ |
3937 | self.write(cr, uid, ids, {'tender_id': tender_id, 'tender_line_id': tender_line_id}, context=context) |
3938 | |
3939 | # log message concerning tender creation |
3940 | - tender_line = tender_line_obj.browse(cr, uid, tender_line_id, context=context) |
3941 | - tender_obj.log(cr, uid, tender_id, "The tender '%s' has been created and must be completed before purchase order creation."%tender_line.tender_id.name) |
3942 | - self.infolog(cr, uid, "The FO/IR line id:%s (%s) has been sourced on order to tender line id:%s of the tender id:%s (%s)" % ( |
3943 | - sale_order_line.id, |
3944 | - sale_order_line.line_number, |
3945 | - tender_line.id, |
3946 | - tender_line.tender_id.id, |
3947 | - tender_line.tender_id.name, |
3948 | + tender_obj.log(cr, uid, tender_id, "The tender '%s' has been created and must be completed before purchase order creation."%tender_obj.browse(cr, uid, tender_id, context=context).name) |
3949 | + self.infolog(cr, uid, "The FO/IR line id:%s has been sourced on order to tender line id:%s of the tender id:%s" % ( |
3950 | + sale_order_line.id, tender_line_id, tender_id, |
3951 | )) |
3952 | # state of procurement is Tender |
3953 | self.write(cr, uid, ids, {'state': 'tender'}, context=context) |
3954 | @@ -1705,9 +1676,6 @@ |
3955 | for rfq in self.browse(cr, uid, ids, context=context): |
3956 | wf_service = netsvc.LocalService("workflow") |
3957 | wf_service.trg_validate(uid, 'purchase.order', rfq.id, 'rfq_sent', cr) |
3958 | - self.infolog(cr, uid, "The RfQ id:%s (%s) has been sent." % ( |
3959 | - rfq.id, rfq.name, |
3960 | - )) |
3961 | |
3962 | self.write(cr, uid, ids, {'date_confirm': time.strftime('%Y-%m-%d')}, context=context) |
3963 | |
3964 | @@ -1745,8 +1713,8 @@ |
3965 | 'tender_id': rfq.tender_id.id, |
3966 | 'created_by_rfq': True} |
3967 | tl_id = tl_obj.create(cr, uid, tl_vals, context=context) |
3968 | - self.infolog(cr, uid, "The tender line id:%s has been created by the RfQ line id:%s (line number: %s)" % ( |
3969 | - tl_id, line.id, line.line_number, |
3970 | + self.infolog(cr, uid, "The tender line id:%s has been created by the RfQ line id:%s" % ( |
3971 | + tl_id, line.id, |
3972 | )) |
3973 | line_obj.write(cr, uid, [line.id], {'tender_line_id': tl_id}, context=context) |
3974 | elif rfq.rfq_ok: |
3975 | @@ -1762,9 +1730,7 @@ |
3976 | ) |
3977 | |
3978 | wf_service.trg_validate(uid, 'purchase.order', rfq.id, 'rfq_updated', cr) |
3979 | - self.infolog(cr, uid, "The RfQ id:%s (%s) has been updated" % ( |
3980 | - rfq.id, rfq.name, |
3981 | - )) |
3982 | + self.infolog(cr, uid, "The RfQ id:%s has been updated" % rfq.id) |
3983 | |
3984 | return { |
3985 | 'type': 'ir.actions.act_window', |
3986 | @@ -1831,7 +1797,7 @@ |
3987 | ids = [ids] |
3988 | |
3989 | for rfq in self.browse(cr, uid, ids, context=context): |
3990 | - self.infolog(cr, uid, "The RfQ id:%s (%s) has been closed" % (rfq.id, rfq.name)) |
3991 | + self.infolog(cr, uid, "The RfQ id:%s has been closed" % rfq.id) |
3992 | if rfq.from_procurement: |
3993 | for line in rfq.order_line: |
3994 | if line.procurement_id: |
3995 | |
3996 | === modified file 'bin/osv/orm.py' (properties changed: +x to -x) |
3997 | --- bin/osv/orm.py 2016-04-12 16:43:36 +0000 |
3998 | +++ bin/osv/orm.py 2016-05-24 07:58:03 +0000 |
3999 | @@ -48,6 +48,7 @@ |
4000 | import time |
4001 | import traceback |
4002 | import types |
4003 | +import csv |
4004 | |
4005 | import netsvc |
4006 | from lxml import etree |
4007 | @@ -745,6 +746,48 @@ |
4008 | datas += self.__export_row(cr, uid, row, fields_to_export, context) |
4009 | return {'datas': datas} |
4010 | |
4011 | + def import_data_with_wizard(self, cr, uid, csv_file, quotechar="'", delimiter=","): |
4012 | + import base64 |
4013 | + |
4014 | + import_obj = self.pool.get('import_data') |
4015 | + import_id = import_obj.create(cr, uid, { |
4016 | + 'ignore': 1, |
4017 | + 'file': base64.encodestring(open(csv_file, 'r').read()), |
4018 | + 'object': self._name, |
4019 | + 'import_mode': 'create', |
4020 | + }) |
4021 | + processed, rejected, headers = import_obj._import(cr, uid, import_id, use_new_cursor=False, auto_import=True) |
4022 | + return processed, rejected, headers |
4023 | + |
4024 | + def import_data_from_csv(self, cr, uid, csv_file, quotechar='"', delimiter=','): |
4025 | + headers = [] |
4026 | + list_data = [] |
4027 | + with open(csv_file, 'r') as fcsv: |
4028 | + reader = csv.reader(fcsv, quotechar=quotechar, delimiter=delimiter) |
4029 | + for row in reader: |
4030 | + if not headers: |
4031 | + headers = row |
4032 | + else: |
4033 | + list_data.append(row) |
4034 | + |
4035 | + rejected = [] |
4036 | + processed = [] |
4037 | + i = 1 |
4038 | + for d in list_data: |
4039 | + i += 1 |
4040 | + try: |
4041 | + res = self.import_data(cr, uid, headers, [d]) |
4042 | + if res[0] == -1: |
4043 | + rejected.append((i, d, res[2])) |
4044 | + else: |
4045 | + processed.append((i, d)) |
4046 | + cr.commit() |
4047 | + except Exception as e: |
4048 | + rejected.append((i, d, str(e))) |
4049 | + cr.commit() |
4050 | + |
4051 | + return processed, rejected, headers |
4052 | + |
4053 | def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None): |
4054 | """ |
4055 | Import given data in given module |
4056 | @@ -4173,15 +4216,7 @@ |
4057 | val = todo[key] |
4058 | if key: |
4059 | # uid == 1 for accessing objects having rules defined on store fields |
4060 | - if hasattr(uid, 'realUid'): |
4061 | - context['computed_for_uid'] = uid.realUid |
4062 | - else: |
4063 | - context['computed_for_uid'] = uid |
4064 | result = self._columns[val[0]].get(cr, self, ids, val, 1, context=context) |
4065 | - try: |
4066 | - del context['computed_for_uid'] |
4067 | - except KeyError: |
4068 | - pass |
4069 | for id, value in result.items(): |
4070 | if field_flag: |
4071 | for f in value.keys(): |
4072 | |
4073 | === modified file 'bin/release.py' |
4074 | --- bin/release.py 2016-05-19 07:14:29 +0000 |
4075 | +++ bin/release.py 2016-05-24 07:58:03 +0000 |
4076 | @@ -20,7 +20,7 @@ |
4077 | ############################################################################## |
4078 | |
4079 | name = 'openerp-server' |
4080 | -version = 'UF2.1-2dev' |
4081 | +version = 'UF2.1-1dev' |
4082 | major_version = '6.0' |
4083 | description = 'OpenERP Server' |
4084 | long_desc = '''OpenERP is a complete ERP and CRM. The main features are accounting (analytic |
4085 | @@ -41,3 +41,4 @@ |
4086 | |
4087 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
4088 | |
4089 | +version = "UF2.1-1rc2-20160405-085815" |
4090 | |
4091 | === modified file 'bin/unifield-version.txt' |
4092 | --- bin/unifield-version.txt 2016-05-02 07:25:38 +0000 |
4093 | +++ bin/unifield-version.txt 2016-05-24 07:58:03 +0000 |
4094 | @@ -39,3 +39,4 @@ |
4095 | 9cc36509c8e23277fa984c409108214a 2016-04-19 17:00:00 UF2.1-1 |
4096 | 02fefe702b11f65e825167449ffbcd16 2016-05-02 10:00:00 UF2.1-1p1 |
4097 | |
4098 | +2b35d23b977618a2abab522b3681147c 2016-04-05 10:06:58 UF2.1-1rc2 |