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