Merge lp:~julie-w/unifield-server/US-1520 into lp:unifield-server/uf3
- US-1520
- Merge into uf3
Proposed by
jftempo
Status: | Needs review |
---|---|
Proposed branch: | lp:~julie-w/unifield-server/US-1520 |
Merge into: | lp:unifield-server/uf3 |
Diff against target: |
1291 lines (+341/-194) 21 files modified
bin/addons/account_override/account_move_line.py (+7/-1) bin/addons/account_override/finance_export.py (+20/-1) bin/addons/account_reconciliation/wizard/account_reconcile.py (+31/-7) bin/addons/base/ir/ir_attachment.py (+4/-4) bin/addons/finance/account_view.xml (+1/-1) bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako (+2/-2) bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py (+14/-5) bin/addons/msf_profile/i18n/fr_MF.po (+81/-2) bin/addons/order_types/stock.py (+13/-15) bin/addons/purchase_override/report/merged_order.rml (+1/-1) bin/addons/purchase_override/report/purchase_order.rml (+1/-1) bin/addons/stock/stock_view.xml (+2/-1) bin/addons/supplier_catalogue/product.py (+116/-99) bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako (+1/-1) bin/addons/tender_flow/report/tender_rfq_comparison_xls.py (+0/-39) bin/addons/vertical_integration/report/hq_report_ocb.py (+14/-6) bin/addons/vertical_integration/wizard/ocb_export.py (+21/-2) bin/osv/orm.py (+7/-3) bin/release.py (+1/-1) bin/service/web_services.py (+2/-2) bin/tools/translate.py (+2/-0) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-1520 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email: mp+314722@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 4127. By Julie Nuguet
-
US-1520 [FIX] JE creation: display only the open periods
- 4126. By jftempo
-
Version 4.0dev
- 4125. By jftempo
-
US-2047 [FIX] Attachment config: French translation missing
- 4124. By jftempo
-
US-1822 [FIX] Unreconciliation: allow to unreconcile manually reconciled system JIs
- 4123. By jftempo
-
US-1900 [FIX] View translation when a node have multiplte attributes + export/translate help msg
- 4122. By jftempo
-
US-1571 [IMP] Delivery Orders: new "Draft" search button
- 4121. By jftempo
-
US-1694 [FIX] Comparison RFQ report: fix currency
- 4120. By jftempo
-
US-1804 [FIX] Typo + translation
- 4119. By jftempo
-
US-1743 [FIX] Export xls PO simulation: fix xls corruption when RTS is not set
- 4118. By jftempo
-
US-1773 [IMP] Reconciliation must include at least one debit and one credit
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/account_override/account_move_line.py' | |||
2 | --- bin/addons/account_override/account_move_line.py 2016-11-24 15:02:51 +0000 | |||
3 | +++ bin/addons/account_override/account_move_line.py 2017-01-13 16:35:52 +0000 | |||
4 | @@ -484,7 +484,13 @@ | |||
5 | 484 | context = {} | 484 | context = {} |
6 | 485 | if context.get('from_web_menu', False): | 485 | if context.get('from_web_menu', False): |
7 | 486 | for ml in self.browse(cr, uid, ids): | 486 | for ml in self.browse(cr, uid, ids): |
9 | 487 | if ml.move_id and ml.move_id.status == 'sys': | 487 | # US-1822 When unreconciling entries, to check if the write can be done use the reconciliation status |
10 | 488 | # (manual / auto) instead of the JI one | ||
11 | 489 | if 'unreconcile_date' in vals and vals['unreconcile_date']: | ||
12 | 490 | reconciliation = ml.reconcile_id or ml.reconcile_partial_id or False | ||
13 | 491 | if reconciliation and reconciliation.type == 'auto': | ||
14 | 492 | raise osv.except_osv(_('Warning'), _('Only manually reconciled entries can be unreconciled.')) | ||
15 | 493 | elif ml.move_id and ml.move_id.status == 'sys': | ||
16 | 488 | raise osv.except_osv(_('Warning'), _('You cannot change Journal Items that comes from the system!')) | 494 | raise osv.except_osv(_('Warning'), _('You cannot change Journal Items that comes from the system!')) |
17 | 489 | # Check date validity with period | 495 | # Check date validity with period |
18 | 490 | self._check_date_validity(cr, uid, ids, vals) | 496 | self._check_date_validity(cr, uid, ids, vals) |
19 | 491 | 497 | ||
20 | === modified file 'bin/addons/account_override/finance_export.py' | |||
21 | --- bin/addons/account_override/finance_export.py 2016-01-20 10:18:19 +0000 | |||
22 | +++ bin/addons/account_override/finance_export.py 2017-01-13 16:35:52 +0000 | |||
23 | @@ -56,9 +56,13 @@ | |||
24 | 56 | + Do not repeat headers if you use the same filename for more than 1 request. This avoid having multiple lines as headers. | 56 | + Do not repeat headers if you use the same filename for more than 1 request. This avoid having multiple lines as headers. |
25 | 57 | """ | 57 | """ |
26 | 58 | 58 | ||
28 | 59 | def __init__(self, sql, process): | 59 | def __init__(self, sql, process, context): |
29 | 60 | self.sqlrequests = sql | 60 | self.sqlrequests = sql |
30 | 61 | self.processrequests = process | 61 | self.processrequests = process |
31 | 62 | if 'background_id' in context: | ||
32 | 63 | self.bg_id = context['background_id'] | ||
33 | 64 | else: | ||
34 | 65 | self.bg_id = None | ||
35 | 62 | 66 | ||
36 | 63 | def line_to_utf8(self, line): | 67 | def line_to_utf8(self, line): |
37 | 64 | """ | 68 | """ |
38 | @@ -183,6 +187,14 @@ | |||
39 | 183 | # - filename | 187 | # - filename |
40 | 184 | # - key of sqlrequests dict to fetch its SQL request | 188 | # - key of sqlrequests dict to fetch its SQL request |
41 | 185 | files = {} | 189 | files = {} |
42 | 190 | |||
43 | 191 | if self.bg_id: | ||
44 | 192 | bg_report_obj = pool.get('memory.background.report') | ||
45 | 193 | else: | ||
46 | 194 | bg_report_obj = None | ||
47 | 195 | |||
48 | 196 | request_count = 0 | ||
49 | 197 | |||
50 | 186 | for fileparams in self.processrequests: | 198 | for fileparams in self.processrequests: |
51 | 187 | if not fileparams.get('filename', False): | 199 | if not fileparams.get('filename', False): |
52 | 188 | raise osv.except_osv(_('Error'), _('Filename param is missing!')) | 200 | raise osv.except_osv(_('Error'), _('Filename param is missing!')) |
53 | @@ -256,6 +268,13 @@ | |||
54 | 256 | if filename not in files: | 268 | if filename not in files: |
55 | 257 | files[filename] = tmp_file | 269 | files[filename] = tmp_file |
56 | 258 | 270 | ||
57 | 271 | if bg_report_obj: | ||
58 | 272 | request_count += 1 | ||
59 | 273 | percent = request_count / float(len(self.processrequests) + 1) # add 1 | ||
60 | 274 | # to the total because task is not finish at the end of the for | ||
61 | 275 | # loop, there is some ZIP work to do | ||
62 | 276 | bg_report_obj.update_percent(cr, uid, [self.bg_id], percent) | ||
63 | 277 | |||
64 | 259 | # WRITE RESULT INTO AN ARCHIVE | 278 | # WRITE RESULT INTO AN ARCHIVE |
65 | 260 | # Create a ZIP file | 279 | # Create a ZIP file |
66 | 261 | out_zipfile = zipfile.ZipFile(zip_buffer, "w") | 280 | out_zipfile = zipfile.ZipFile(zip_buffer, "w") |
67 | 262 | 281 | ||
68 | === modified file 'bin/addons/account_reconciliation/wizard/account_reconcile.py' | |||
69 | --- bin/addons/account_reconciliation/wizard/account_reconcile.py 2016-10-04 10:11:04 +0000 | |||
70 | +++ bin/addons/account_reconciliation/wizard/account_reconcile.py 2017-01-13 16:35:52 +0000 | |||
71 | @@ -24,7 +24,6 @@ | |||
72 | 24 | from osv import osv | 24 | from osv import osv |
73 | 25 | from osv import fields | 25 | from osv import fields |
74 | 26 | from tools.translate import _ | 26 | from tools.translate import _ |
75 | 27 | import time | ||
76 | 28 | from collections import defaultdict | 27 | from collections import defaultdict |
77 | 29 | 28 | ||
78 | 30 | class account_move_line_reconcile(osv.osv_memory): | 29 | class account_move_line_reconcile(osv.osv_memory): |
79 | @@ -33,8 +32,8 @@ | |||
80 | 33 | 32 | ||
81 | 34 | _columns = { | 33 | _columns = { |
82 | 35 | 'state': fields.selection([('total', 'Full Reconciliation'), ('partial', 'Partial Reconciliation'), | 34 | 'state': fields.selection([('total', 'Full Reconciliation'), ('partial', 'Partial Reconciliation'), |
85 | 36 | ('total_change', 'Full Reconciliation with change'), ('partial_change', 'Partial Reconciliation with change')], string="State", | 35 | ('total_change', 'Full Reconciliation with change'), ('partial_change', 'Partial Reconciliation with change')], string="State", |
86 | 37 | required=True, readonly=True), | 36 | required=True, readonly=True), |
87 | 38 | 'different_currencies': fields.boolean('Is this reconciliation in different currencies? (2 at most)'), | 37 | 'different_currencies': fields.boolean('Is this reconciliation in different currencies? (2 at most)'), |
88 | 39 | } | 38 | } |
89 | 40 | 39 | ||
90 | @@ -145,7 +144,13 @@ | |||
91 | 145 | state = 'total_change' | 144 | state = 'total_change' |
92 | 146 | currency_id = False | 145 | currency_id = False |
93 | 147 | currency2_id = False | 146 | currency2_id = False |
94 | 147 | rec_partial_set = set() | ||
95 | 148 | rec_partial_leg_nb = 0 | ||
96 | 148 | for line in account_move_line_obj.browse(cr, uid, context['active_ids'], context=context): | 149 | for line in account_move_line_obj.browse(cr, uid, context['active_ids'], context=context): |
97 | 150 | # for partially reconciled lines: store the different partial reconciliation ids and the total nb of legs | ||
98 | 151 | if line.reconcile_partial_id: | ||
99 | 152 | rec_partial_leg_nb += 1 | ||
100 | 153 | rec_partial_set.add(line.reconcile_partial_id.id) | ||
101 | 149 | # prepare some values | 154 | # prepare some values |
102 | 150 | account_id = line.account_id.id | 155 | account_id = line.account_id.id |
103 | 151 | # some verifications | 156 | # some verifications |
104 | @@ -166,9 +171,9 @@ | |||
105 | 166 | # UTP-1040: 3RD party is also desactivated in case of account that is "Disregard Third Party" as "type_for_register" | 171 | # UTP-1040: 3RD party is also desactivated in case of account that is "Disregard Third Party" as "type_for_register" |
106 | 167 | if not transfer and not disregard_third_party: | 172 | if not transfer and not disregard_third_party: |
107 | 168 | third_party = { | 173 | third_party = { |
111 | 169 | 'partner_id': line.partner_id and line.partner_id.id or False, | 174 | 'partner_id': line.partner_id and line.partner_id.id or False, |
112 | 170 | 'employee_id': line.employee_id and line.employee_id.id or False, | 175 | 'employee_id': line.employee_id and line.employee_id.id or False, |
113 | 171 | 'transfer_journal_id': line.transfer_journal_id and line.transfer_journal_id.id or False} | 176 | 'transfer_journal_id': line.transfer_journal_id and line.transfer_journal_id.id or False} |
114 | 172 | if not prev_third_party: | 177 | if not prev_third_party: |
115 | 173 | prev_third_party = third_party | 178 | prev_third_party = third_party |
116 | 174 | if prev_third_party != third_party: | 179 | if prev_third_party != third_party: |
117 | @@ -186,8 +191,27 @@ | |||
118 | 186 | debit += line.debit_currency | 191 | debit += line.debit_currency |
119 | 187 | fcredit += line.credit | 192 | fcredit += line.credit |
120 | 188 | fdebit += line.debit | 193 | fdebit += line.debit |
121 | 194 | |||
122 | 195 | diff_in_booking = abs(debit - credit) | ||
123 | 196 | # (US-1847) If we reconcile together entries from at least 2 different partial reconciliations: | ||
124 | 197 | # - the reconciliation must be total | ||
125 | 198 | # - all the legs of the partial reconciliations must be included | ||
126 | 199 | if len(rec_partial_set) > 1: | ||
127 | 200 | if diff_in_booking > 10**-3: | ||
128 | 201 | raise osv.except_osv(_('Error'), _('Only full reconciliation is allowed when entries from two (or more)' | ||
129 | 202 | ' different partial reconciliations are included.')) | ||
130 | 203 | elif rec_partial_leg_nb != account_move_line_obj.search(cr, uid, | ||
131 | 204 | [('reconcile_partial_id', 'in', list(rec_partial_set))], | ||
132 | 205 | count=True, order='NO_ORDER', context=context): | ||
133 | 206 | raise osv.except_osv(_('Error'), | ||
134 | 207 | _('When entries from different partial reconciliations are reconciled together, ' | ||
135 | 208 | 'all the legs of these partial reconciliations must be included.')) | ||
136 | 209 | |||
137 | 210 | if debit <= 10**-3 or credit <= 10**-3: | ||
138 | 211 | raise osv.except_osv(_('Error'), _('Both Debit and Credit lines are required for reconciliation.')) | ||
139 | 212 | |||
140 | 189 | # Adapt state value | 213 | # Adapt state value |
142 | 190 | if abs(debit - credit) <= 10**-3: | 214 | if diff_in_booking <= 10**-3: |
143 | 191 | state = 'total' | 215 | state = 'total' |
144 | 192 | if transfer_with_change: | 216 | if transfer_with_change: |
145 | 193 | debit = fdebit | 217 | debit = fdebit |
146 | 194 | 218 | ||
147 | === modified file 'bin/addons/base/ir/ir_attachment.py' | |||
148 | --- bin/addons/base/ir/ir_attachment.py 2016-11-24 14:41:24 +0000 | |||
149 | +++ bin/addons/base/ir/ir_attachment.py 2017-01-13 16:35:52 +0000 | |||
150 | @@ -442,12 +442,12 @@ | |||
151 | 442 | 442 | ||
152 | 443 | _columns = { | 443 | _columns = { |
153 | 444 | 'name': fields.char('Path to save the attachments to', size=256, | 444 | 'name': fields.char('Path to save the attachments to', size=256, |
155 | 445 | help="The complet path to the local folder where Unifield will save attachment files.", | 445 | help="The complete path to the local folder where Unifield will save attachment files.", |
156 | 446 | required=True), | 446 | required=True), |
157 | 447 | 'next_migration' : fields.datetime('Next migration date', | 447 | 'next_migration' : fields.datetime('Next migration date', |
159 | 448 | help="Next planned execution of thei migration to move the old attachment to the path you defined"), | 448 | help="Next planned execution of the migration to move the old attachment to the path defined"), |
160 | 449 | 'migration_date': fields.datetime('Last migration execution date', readonly=True), | 449 | 'migration_date': fields.datetime('Last migration execution date', readonly=True), |
162 | 450 | 'migration_error': fields.text('Migration error', readonly=True), | 450 | 'migration_error': fields.text('Migration errors', readonly=True), |
163 | 451 | 'is_migration_running': fields.function(_is_migration_running, | 451 | 'is_migration_running': fields.function(_is_migration_running, |
164 | 452 | type='boolean', string='Moving files...', method=True, | 452 | type='boolean', string='Moving files...', method=True, |
165 | 453 | readonly=True), | 453 | readonly=True), |
166 | @@ -614,7 +614,7 @@ | |||
167 | 614 | 'numbercall': 1, | 614 | 'numbercall': 1, |
168 | 615 | 'active': True, | 615 | 'active': True, |
169 | 616 | } | 616 | } |
171 | 617 | cron_obj.write(cr, uid, default_migrate_attachment.id, values, context=context) | 617 | cron_obj.write(cr, uid, default_migrate_attachment.id, values, context=context) |
172 | 618 | return super(attachment_config, self).write(cr, uid, ids, vals, context=context) | 618 | return super(attachment_config, self).write(cr, uid, ids, vals, context=context) |
173 | 619 | 619 | ||
174 | 620 | attachment_config() | 620 | attachment_config() |
175 | 621 | 621 | ||
176 | === modified file 'bin/addons/finance/account_view.xml' | |||
177 | --- bin/addons/finance/account_view.xml 2016-09-28 08:20:24 +0000 | |||
178 | +++ bin/addons/finance/account_view.xml 2017-01-13 16:35:52 +0000 | |||
179 | @@ -71,7 +71,7 @@ | |||
180 | 71 | <group colspan="4" col="6"> | 71 | <group colspan="4" col="6"> |
181 | 72 | <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" context="{'from_manual_entry': True}"/> | 72 | <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" context="{'from_manual_entry': True}"/> |
182 | 73 | <field name="name" readonly="1"/> | 73 | <field name="name" readonly="1"/> |
184 | 74 | <field name="period_id" on_change="onchange_period_id(period_id, date)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" domain="[('number', '!=', 16)]"/> | 74 | <field name="period_id" on_change="onchange_period_id(period_id, date)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" domain="[('number', '!=', 16), ('state','=','draft')]"/> |
185 | 75 | <field name="document_date" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}"/> | 75 | <field name="document_date" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}"/> |
186 | 76 | <field name="date" string="Posting Date" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}"/> | 76 | <field name="date" string="Posting Date" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}"/> |
187 | 77 | 77 | ||
188 | 78 | 78 | ||
189 | === modified file 'bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako' | |||
190 | --- bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2016-06-13 07:41:13 +0000 | |||
191 | +++ bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2017-01-13 16:35:52 +0000 | |||
192 | @@ -139,7 +139,7 @@ | |||
193 | 139 | % else: | 139 | % else: |
194 | 140 | <Cell ss:StyleID="line" ></Cell> | 140 | <Cell ss:StyleID="line" ></Cell> |
195 | 141 | % endif | 141 | % endif |
197 | 142 | % if o.imp_ready_to_ship_date != o.in_ready_to_ship_date: | 142 | % if o.imp_ready_to_ship_date not in ('False', False) and o.imp_ready_to_ship_date != o.in_ready_to_ship_date: |
198 | 143 | <Cell ss:StyleID="line_change_short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_ready_to_ship_date)|n}T00:00:00.000</Data></Cell> | 143 | <Cell ss:StyleID="line_change_short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_ready_to_ship_date)|n}T00:00:00.000</Data></Cell> |
199 | 144 | % elif o.imp_ready_to_ship_date not in ('False', False): | 144 | % elif o.imp_ready_to_ship_date not in ('False', False): |
200 | 145 | <Cell ss:StyleID="short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_ready_to_ship_date)|n}T00:00:00.000</Data></Cell> | 145 | <Cell ss:StyleID="short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_ready_to_ship_date)|n}T00:00:00.000</Data></Cell> |
201 | @@ -155,7 +155,7 @@ | |||
202 | 155 | % else: | 155 | % else: |
203 | 156 | <Cell ss:StyleID="line" ></Cell> | 156 | <Cell ss:StyleID="line" ></Cell> |
204 | 157 | % endif | 157 | % endif |
206 | 158 | % if o.imp_shipment_date != o.in_shipment_date: | 158 | % if o.imp_shipment_date not in ('False', False) and o.imp_shipment_date != o.in_shipment_date: |
207 | 159 | <Cell ss:StyleID="line_change_short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_shipment_date)|n}T00:00:00.000</Data></Cell> | 159 | <Cell ss:StyleID="line_change_short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_shipment_date)|n}T00:00:00.000</Data></Cell> |
208 | 160 | % elif o.imp_shipment_date not in ('False', False): | 160 | % elif o.imp_shipment_date not in ('False', False): |
209 | 161 | <Cell ss:StyleID="short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_shipment_date)|n}T00:00:00.000</Data></Cell> | 161 | <Cell ss:StyleID="short_date" ss:MergeAcross="1" ><Data ss:Type="DateTime">${(o.imp_shipment_date)|n}T00:00:00.000</Data></Cell> |
210 | 162 | 162 | ||
211 | === modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py' | |||
212 | --- bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2016-11-09 09:07:38 +0000 | |||
213 | +++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2017-01-13 16:35:52 +0000 | |||
214 | @@ -155,10 +155,6 @@ | |||
215 | 155 | 'return to IN form view and re-try.'), | 155 | 'return to IN form view and re-try.'), |
216 | 156 | ) | 156 | ) |
217 | 157 | 157 | ||
218 | 158 | self.write(cr, uid, [proc.id], { | ||
219 | 159 | 'already_processed': True, | ||
220 | 160 | }, context=context) | ||
221 | 161 | |||
222 | 162 | for line in proc.move_ids: | 158 | for line in proc.move_ids: |
223 | 163 | # If one line as an error, return to wizard | 159 | # If one line as an error, return to wizard |
224 | 164 | if line.integrity_status != 'empty': | 160 | if line.integrity_status != 'empty': |
225 | @@ -172,6 +168,10 @@ | |||
226 | 172 | 'context': context, | 168 | 'context': context, |
227 | 173 | } | 169 | } |
228 | 174 | 170 | ||
229 | 171 | self.write(cr, uid, [proc.id], { | ||
230 | 172 | 'already_processed': True, | ||
231 | 173 | }, context=context) | ||
232 | 174 | |||
233 | 175 | for line in proc.move_ids: | 175 | for line in proc.move_ids: |
234 | 176 | # if no quantity, don't process the move | 176 | # if no quantity, don't process the move |
235 | 177 | if not line.quantity: | 177 | if not line.quantity: |
236 | @@ -318,7 +318,16 @@ | |||
237 | 318 | _('Processing Error'), | 318 | _('Processing Error'), |
238 | 319 | _('No data to process !'), | 319 | _('No data to process !'), |
239 | 320 | ) | 320 | ) |
241 | 321 | incoming_obj.write(cr, uid, ids, {'draft': True}, context=context) | 321 | |
242 | 322 | # make sure that the current incoming proc is not already processed : | ||
243 | 323 | for r in incoming_obj.read(cr, uid, ids, ['already_processed']): | ||
244 | 324 | if not r['already_processed']: | ||
245 | 325 | incoming_obj.write(cr, uid, ids, {'draft': True}, context=context) | ||
246 | 326 | else: | ||
247 | 327 | raise osv.except_osv( | ||
248 | 328 | _('Error'), _('The incoming shipment has already been processed, you cannot save it as draft.') | ||
249 | 329 | ) | ||
250 | 330 | |||
251 | 322 | return {} | 331 | return {} |
252 | 323 | 332 | ||
253 | 324 | def force_process(self, cr, uid, ids, context=None): | 333 | def force_process(self, cr, uid, ids, context=None): |
254 | 325 | 334 | ||
255 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
256 | --- bin/addons/msf_profile/i18n/fr_MF.po 2016-12-07 06:47:50 +0000 | |||
257 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2017-01-13 16:35:52 +0000 | |||
258 | @@ -75286,16 +75286,61 @@ | |||
259 | 75286 | msgstr "Dossier d'enregistrement des pièces jointes" | 75286 | msgstr "Dossier d'enregistrement des pièces jointes" |
260 | 75287 | 75287 | ||
261 | 75288 | #. module: base | 75288 | #. module: base |
264 | 75289 | #: help:attachment.config,name:0 | 75289 | #: field:attachment.config,next_migration:444 |
265 | 75290 | msgid "The complet path to the local folder where Unifield will save attachment files." | 75290 | msgid "Next migration date" |
266 | 75291 | msgstr "Date de la prochaine migration" | ||
267 | 75292 | |||
268 | 75293 | #. module: base | ||
269 | 75294 | #: help:attachment.config,name:445 | ||
270 | 75295 | msgid "The complete path to the local folder where Unifield will save attachment files." | ||
271 | 75291 | msgstr "Dossier dans lequel les pièces jointes seront stockées." | 75296 | msgstr "Dossier dans lequel les pièces jointes seront stockées." |
272 | 75292 | 75297 | ||
273 | 75293 | #. module: base | 75298 | #. module: base |
274 | 75299 | #: help:attachment.config,next_migration:448 | ||
275 | 75300 | msgid "Next planned execution of the migration to move the old attachment to the path defined" | ||
276 | 75301 | msgstr "Prochaine execution planifiée de migration pour déplacer les anciènes pièces jointes vers le nouveau chemin défini." | ||
277 | 75302 | |||
278 | 75303 | #. module: base | ||
279 | 75304 | #: field:attachment.config,migration_date:449 | ||
280 | 75305 | msgid "Last migration execution date" | ||
281 | 75306 | msgstr "Date de la dernière migration" | ||
282 | 75307 | |||
283 | 75308 | #. module: base | ||
284 | 75309 | #: field:attachment.config,migration_error:450 | ||
285 | 75310 | msgid "Migration errors" | ||
286 | 75311 | msgstr "Erreurs de migration" | ||
287 | 75312 | |||
288 | 75313 | #. module: base | ||
289 | 75314 | #: field:attachment.config,is_migration_running:452 | ||
290 | 75315 | msgid "Moving files..." | ||
291 | 75316 | msgstr "Déplacement des fichiers..." | ||
292 | 75317 | |||
293 | 75318 | #. module: base | ||
294 | 75319 | #: field:attachment.config,moving_rate:454 | ||
295 | 75320 | msgid "Moving process" | ||
296 | 75321 | msgstr "Avancement du déplacement" | ||
297 | 75322 | |||
298 | 75323 | #. module: base | ||
299 | 75324 | #: constraint:attachment.config:469 | ||
300 | 75325 | msgid "You cannot have more than one Attachment configuration" | ||
301 | 75326 | msgstr "Vous ne pouvez pas avoir plus d'une configuration de pièces jointes" | ||
302 | 75327 | |||
303 | 75328 | #. module: base | ||
304 | 75294 | #: view:attachment.config:0 | 75329 | #: view:attachment.config:0 |
305 | 75295 | #: model:ir.model,name:base.model_attachment_config | 75330 | #: model:ir.model,name:base.model_attachment_config |
306 | 75296 | msgid "Attachment configuration" | 75331 | msgid "Attachment configuration" |
307 | 75297 | msgstr "Configuration des pièces jointes" | 75332 | msgstr "Configuration des pièces jointes" |
308 | 75298 | 75333 | ||
309 | 75334 | #. module: base | ||
310 | 75335 | #: view:attachment.config:0 | ||
311 | 75336 | msgid "Old attachments migration" | ||
312 | 75337 | msgstr "Migration des anciennes pièces jointes" | ||
313 | 75338 | |||
314 | 75339 | #. module: base | ||
315 | 75340 | #: view:attachment.config:0 | ||
316 | 75341 | msgid "Migrate old attachement to store them in local file system" | ||
317 | 75342 | msgstr "Migrer les anciennes pièces jointes pour les stocker sur le système de fichier local" | ||
318 | 75343 | |||
319 | 75299 | #. module: board | 75344 | #. module: board |
320 | 75300 | #: code:addons/board/queries_finance.py:11 | 75345 | #: code:addons/board/queries_finance.py:11 |
321 | 75301 | #: code:addons/board/queries_finance.py:30 | 75346 | #: code:addons/board/queries_finance.py:30 |
322 | @@ -75769,3 +75814,37 @@ | |||
323 | 75769 | msgid "Partner Created on this instance" | 75814 | msgid "Partner Created on this instance" |
324 | 75770 | msgstr "Partenaire créé sur cette instance" | 75815 | msgstr "Partenaire créé sur cette instance" |
325 | 75771 | 75816 | ||
326 | 75817 | #. module: account_reconciliation | ||
327 | 75818 | #: code:addons/account_reconciliation/wizard/account_reconcile.py:207 | ||
328 | 75819 | #, python-format | ||
329 | 75820 | msgid "When entries from different partial reconciliations are reconciled together, all the legs of these partial reconciliations must be included." | ||
330 | 75821 | msgstr "Lorsque des entrées de différents lettrages partiels sont lettrées ensemble, toutes les lignes de ces lettrage partiels doivent être incluses." | ||
331 | 75822 | |||
332 | 75823 | #. module: account_reconciliation | ||
333 | 75824 | #: code:addons/account_reconciliation/wizard/account_reconcile.py:201 | ||
334 | 75825 | #, python-format | ||
335 | 75826 | msgid "Only full reconciliation is allowed when entries from two (or more) different partial reconciliations are included." | ||
336 | 75827 | msgstr "Seul un lettrage complet est autorisé lorsque des entrées de deux lettrages partiels différents (ou plus) sont incluses." | ||
337 | 75828 | |||
338 | 75829 | #. module: account_reconciliation | ||
339 | 75830 | #: code:addons/account_reconciliation/wizard/account_reconcile.py:190 | ||
340 | 75831 | #, python-format | ||
341 | 75832 | msgid "Both Debit and Credit lines are required for reconciliation." | ||
342 | 75833 | msgstr "Un lettrage requiert à la fois des lignes en débit et en crédit." | ||
343 | 75834 | |||
344 | 75835 | #. module: msf_outgoing | ||
345 | 75836 | #: code:addons/msf_outgoing/wizard/incoming_shipment_processor.py:328 | ||
346 | 75837 | #, python-format | ||
347 | 75838 | msgid "The incoming shipment has already been processed, you cannot save it as draft." | ||
348 | 75839 | msgstr "La livraison a déjà été traitée, vous ne pouvez pas la sauvegarder en brouillon." | ||
349 | 75840 | |||
350 | 75841 | #. module: stock | ||
351 | 75842 | #: view:stock.picking:0 | ||
352 | 75843 | msgid "Delivery orders which are in draft state" | ||
353 | 75844 | msgstr "Bons de livraison dans l'état brouillon" | ||
354 | 75845 | |||
355 | 75846 | #. module: account_override | ||
356 | 75847 | #: code:addons/account_override/account_move_line.py:491 | ||
357 | 75848 | #, python-format | ||
358 | 75849 | msgid "Only manually reconciled entries can be unreconciled." | ||
359 | 75850 | msgstr "Seules les entrées lettrées manuellement peuvent être délettrées." | ||
360 | 75772 | 75851 | ||
361 | === modified file 'bin/addons/order_types/stock.py' | |||
362 | --- bin/addons/order_types/stock.py 2016-05-17 12:12:38 +0000 | |||
363 | +++ bin/addons/order_types/stock.py 2017-01-13 16:35:52 +0000 | |||
364 | @@ -192,7 +192,7 @@ | |||
365 | 192 | if new_ids: | 192 | if new_ids: |
366 | 193 | stock_move_obj = self.pool.get('stock.move') | 193 | stock_move_obj = self.pool.get('stock.move') |
367 | 194 | move_line_read_list = self.read(cr, uid, new_ids, ['id', 'move_lines', 'type'], | 194 | move_line_read_list = self.read(cr, uid, new_ids, ['id', 'move_lines', 'type'], |
369 | 195 | context=context) | 195 | context=context) |
370 | 196 | for move_line_dict in move_line_read_list: | 196 | for move_line_dict in move_line_read_list: |
371 | 197 | stock_move_ids = move_line_dict['move_lines'] | 197 | stock_move_ids = move_line_dict['move_lines'] |
372 | 198 | if stock_move_obj.search(cr, uid, [('id', 'in', stock_move_ids), | 198 | if stock_move_obj.search(cr, uid, [('id', 'in', stock_move_ids), |
373 | @@ -200,7 +200,7 @@ | |||
374 | 200 | ('donation_exp', | 200 | ('donation_exp', |
375 | 201 | 'donation_st', | 201 | 'donation_st', |
376 | 202 | 'in_kind')), | 202 | 'in_kind')), |
378 | 203 | ], context=context): | 203 | ], context=context): |
379 | 204 | res[move_line_dict['id']] = True | 204 | res[move_line_dict['id']] = True |
380 | 205 | return res | 205 | return res |
381 | 206 | 206 | ||
382 | @@ -227,12 +227,12 @@ | |||
383 | 227 | for picking in self.browse(cr, uid, ids): | 227 | for picking in self.browse(cr, uid, ids): |
384 | 228 | for move in picking.move_lines: | 228 | for move in picking.move_lines: |
385 | 229 | self.pool.get('stock.certificate.valuation').create(cr, uid, {'picking_id': picking.id, | 229 | self.pool.get('stock.certificate.valuation').create(cr, uid, {'picking_id': picking.id, |
392 | 230 | 'product_id': move.product_id.id, | 230 | 'product_id': move.product_id.id, |
393 | 231 | 'qty': move.product_qty, | 231 | 'qty': move.product_qty, |
394 | 232 | 'print_id': print_id, | 232 | 'print_id': print_id, |
395 | 233 | 'move_id': move.id, | 233 | 'move_id': move.id, |
396 | 234 | 'prodlot_id': move.prodlot_id.id, | 234 | 'prodlot_id': move.prodlot_id.id, |
397 | 235 | 'unit_price': move.product_id.list_price}) | 235 | 'unit_price': move.product_id.list_price}) |
398 | 236 | 236 | ||
399 | 237 | return {'type': 'ir.actions.act_window', | 237 | return {'type': 'ir.actions.act_window', |
400 | 238 | 'res_model': 'stock.print.certificate', | 238 | 'res_model': 'stock.print.certificate', |
401 | @@ -296,7 +296,7 @@ | |||
402 | 296 | 296 | ||
403 | 297 | if certif and not context.get('attach_ok', False): | 297 | if certif and not context.get('attach_ok', False): |
404 | 298 | partial_id = self.pool.get("stock.certificate.picking").create( | 298 | partial_id = self.pool.get("stock.certificate.picking").create( |
406 | 299 | cr, uid, {'picking_id': ids[0]}, context=dict(context, active_ids=ids)) | 299 | cr, uid, {'picking_id': ids[0]}, context=dict(context, active_ids=ids)) |
407 | 300 | return {'name':_("Attach a certificate of donation"), | 300 | return {'name':_("Attach a certificate of donation"), |
408 | 301 | 'view_mode': 'form', | 301 | 'view_mode': 'form', |
409 | 302 | 'view_id': False, | 302 | 'view_id': False, |
410 | @@ -326,10 +326,8 @@ | |||
411 | 326 | 326 | ||
412 | 327 | # US-148 | 327 | # US-148 |
413 | 328 | if pick.type == 'in': | 328 | if pick.type == 'in': |
418 | 329 | args = [('picking_id', '=', pick.id), | 329 | domain = [('picking_id', '=', pick.id), ('draft', '=', True), ('already_processed', '=', False)] |
419 | 330 | ('draft', '=', True)] | 330 | wiz_ids = wizard_obj.search(cr, uid, domain, context=context) |
416 | 331 | wiz_ids = wizard_obj.search(cr, uid, args=args, | ||
417 | 332 | context=context) | ||
420 | 333 | if wiz_ids: | 331 | if wiz_ids: |
421 | 334 | proc_id = wiz_ids[0] | 332 | proc_id = wiz_ids[0] |
422 | 335 | else: | 333 | else: |
423 | @@ -349,13 +347,13 @@ | |||
424 | 349 | 'view_type': 'form', | 347 | 'view_type': 'form', |
425 | 350 | 'view_mode': 'form', | 348 | 'view_mode': 'form', |
426 | 351 | 'target': 'new', | 349 | 'target': 'new', |
428 | 352 | } | 350 | } |
429 | 353 | 351 | ||
430 | 354 | if not context.get('force_process', False) and pick.type == 'in' \ | 352 | if not context.get('force_process', False) and pick.type == 'in' \ |
431 | 355 | and not pick.in_dpo \ | 353 | and not pick.in_dpo \ |
432 | 356 | and pick.state != 'shipped' and pick.partner_id.partner_type == 'internal': | 354 | and pick.state != 'shipped' and pick.partner_id.partner_type == 'internal': |
433 | 357 | view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, | 355 | view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, |
435 | 358 | 'msf_outgoing', 'stock_incoming_processor_internal_warning_form_view')[1] | 356 | 'msf_outgoing', 'stock_incoming_processor_internal_warning_form_view')[1] |
436 | 359 | res['view_id'] = [view_id] | 357 | res['view_id'] = [view_id] |
437 | 360 | 358 | ||
438 | 361 | return res | 359 | return res |
439 | 362 | 360 | ||
440 | === modified file 'bin/addons/purchase_override/report/merged_order.rml' | |||
441 | --- bin/addons/purchase_override/report/merged_order.rml 2016-11-24 10:31:53 +0000 | |||
442 | +++ bin/addons/purchase_override/report/merged_order.rml 2017-01-13 16:35:52 +0000 | |||
443 | @@ -341,7 +341,7 @@ | |||
444 | 341 | </tr> | 341 | </tr> |
445 | 342 | <tr> | 342 | <tr> |
446 | 343 | <td> | 343 | <td> |
448 | 344 | <para style="TextInformation">Goods value :Â [[ objects[0].amount_total or '0.00' ]]</para> | 344 | <para style="TextInformation">Goods value :Â [[ objects[0].amount_untaxed or '0.00' ]]</para> |
449 | 345 | </td> | 345 | </td> |
450 | 346 | <td> | 346 | <td> |
451 | 347 | <para style="TextInformation"> </para> | 347 | <para style="TextInformation"> </para> |
452 | 348 | 348 | ||
453 | === modified file 'bin/addons/purchase_override/report/purchase_order.rml' | |||
454 | --- bin/addons/purchase_override/report/purchase_order.rml 2016-11-09 08:10:08 +0000 | |||
455 | +++ bin/addons/purchase_override/report/purchase_order.rml 2017-01-13 16:35:52 +0000 | |||
456 | @@ -343,7 +343,7 @@ | |||
457 | 343 | </tr> | 343 | </tr> |
458 | 344 | <tr> | 344 | <tr> |
459 | 345 | <td> | 345 | <td> |
461 | 346 | <para style="TextInformation">Goods value :Â [[ objects[0].amount_total or '0.00' ]]</para> | 346 | <para style="TextInformation">Goods value :Â [[ objects[0].amount_untaxed or '0.00' ]]</para> |
462 | 347 | </td> | 347 | </td> |
463 | 348 | <td> | 348 | <td> |
464 | 349 | <para style="TextInformation"> </para> | 349 | <para style="TextInformation"> </para> |
465 | 350 | 350 | ||
466 | === modified file 'bin/addons/stock/stock_view.xml' | |||
467 | --- bin/addons/stock/stock_view.xml 2016-02-18 15:39:31 +0000 | |||
468 | +++ bin/addons/stock/stock_view.xml 2017-01-13 16:35:52 +0000 | |||
469 | @@ -1024,8 +1024,9 @@ | |||
470 | 1024 | <field name="arch" type="xml"> | 1024 | <field name="arch" type="xml"> |
471 | 1025 | <search string="Picking list"> | 1025 | <search string="Picking list"> |
472 | 1026 | <group col="8" colspan="4"> | 1026 | <group col="8" colspan="4"> |
473 | 1027 | <filter icon="terp-document-new" name="draft" string="Draft" domain="[('state', 'in', ['draft'])]" help="Delivery orders which are in draft state" /> | ||
474 | 1028 | <filter icon="terp-camera_test" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Delivery Orders"/> | ||
475 | 1027 | <filter icon="terp-check" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Delivery Orders"/> | 1029 | <filter icon="terp-check" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Delivery Orders"/> |
476 | 1028 | <filter icon="terp-camera_test" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Delivery Orders"/> | ||
477 | 1029 | <filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Delivery orders already processed"/> | 1030 | <filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Delivery orders already processed"/> |
478 | 1030 | <separator orientation="vertical"/> | 1031 | <separator orientation="vertical"/> |
479 | 1031 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order" groups="base.group_extended"/> | 1032 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order" groups="base.group_extended"/> |
480 | 1032 | 1033 | ||
481 | === modified file 'bin/addons/supplier_catalogue/product.py' | |||
482 | --- bin/addons/supplier_catalogue/product.py 2016-08-18 08:32:03 +0000 | |||
483 | +++ bin/addons/supplier_catalogue/product.py 2017-01-13 16:35:52 +0000 | |||
484 | @@ -30,7 +30,7 @@ | |||
485 | 30 | class product_supplierinfo(osv.osv): | 30 | class product_supplierinfo(osv.osv): |
486 | 31 | _name = 'product.supplierinfo' | 31 | _name = 'product.supplierinfo' |
487 | 32 | _inherit = 'product.supplierinfo' | 32 | _inherit = 'product.supplierinfo' |
489 | 33 | 33 | ||
490 | 34 | def unlink(self, cr, uid, info_ids, context=None): | 34 | def unlink(self, cr, uid, info_ids, context=None): |
491 | 35 | ''' | 35 | ''' |
492 | 36 | Disallow the possibility to remove a supplier info if | 36 | Disallow the possibility to remove a supplier info if |
493 | @@ -43,45 +43,45 @@ | |||
494 | 43 | context = {} | 43 | context = {} |
495 | 44 | if isinstance(info_ids, (int, long)): | 44 | if isinstance(info_ids, (int, long)): |
496 | 45 | info_ids = [info_ids] | 45 | info_ids = [info_ids] |
498 | 46 | 46 | ||
499 | 47 | for info in self.browse(cr, uid, info_ids, context=context): | 47 | for info in self.browse(cr, uid, info_ids, context=context): |
500 | 48 | if info.catalogue_id and not context.get('product_change', False): | 48 | if info.catalogue_id and not context.get('product_change', False): |
501 | 49 | raise osv.except_osv(_('Error'), _('You cannot remove a supplier information which is linked ' \ | 49 | raise osv.except_osv(_('Error'), _('You cannot remove a supplier information which is linked ' \ |
502 | 50 | 'to a supplier catalogue line ! Please remove the corresponding ' \ | 50 | 'to a supplier catalogue line ! Please remove the corresponding ' \ |
503 | 51 | 'supplier catalogue line to remove this supplier information.')) | 51 | 'supplier catalogue line to remove this supplier information.')) |
505 | 52 | 52 | ||
506 | 53 | return super(product_supplierinfo, self).unlink(cr, uid, info_ids, context=context) | 53 | return super(product_supplierinfo, self).unlink(cr, uid, info_ids, context=context) |
508 | 54 | 54 | ||
509 | 55 | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | 55 | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): |
510 | 56 | if not context: | 56 | if not context: |
511 | 57 | context = {} | 57 | context = {} |
513 | 58 | 58 | ||
514 | 59 | new_res = [] | 59 | new_res = [] |
515 | 60 | res = super(product_supplierinfo, self).search(cr, uid, args, offset, limit, | 60 | res = super(product_supplierinfo, self).search(cr, uid, args, offset, limit, |
517 | 61 | order, context=context, count=count) | 61 | order, context=context, count=count) |
518 | 62 | if count: | 62 | if count: |
519 | 63 | return res | 63 | return res |
521 | 64 | 64 | ||
522 | 65 | if isinstance(res, (int, long)): | 65 | if isinstance(res, (int, long)): |
523 | 66 | res = [res] | 66 | res = [res] |
525 | 67 | 67 | ||
526 | 68 | for r in self.browse(cr, uid, res, context=context): | 68 | for r in self.browse(cr, uid, res, context=context): |
527 | 69 | if not r.catalogue_id or r.catalogue_id.active: | 69 | if not r.catalogue_id or r.catalogue_id.active: |
528 | 70 | new_res.append(r.id) | 70 | new_res.append(r.id) |
530 | 71 | 71 | ||
531 | 72 | return new_res | 72 | return new_res |
533 | 73 | 73 | ||
534 | 74 | def _get_editable(self, cr, uid, ids, field_name, args, context=None): | 74 | def _get_editable(self, cr, uid, ids, field_name, args, context=None): |
535 | 75 | ''' | 75 | ''' |
536 | 76 | Return True if no catalogue associated | 76 | Return True if no catalogue associated |
537 | 77 | ''' | 77 | ''' |
538 | 78 | res = {} | 78 | res = {} |
540 | 79 | 79 | ||
541 | 80 | for x in self.browse(cr, uid, ids, context=context): | 80 | for x in self.browse(cr, uid, ids, context=context): |
542 | 81 | res[x.id] = True | 81 | res[x.id] = True |
543 | 82 | if x.catalogue_id: | 82 | if x.catalogue_id: |
544 | 83 | res[x.id] = False | 83 | res[x.id] = False |
546 | 84 | 84 | ||
547 | 85 | return res | 85 | return res |
548 | 86 | 86 | ||
549 | 87 | def _get_seller_delay(self, cr, uid, ids, field_name, args, context=None): | 87 | def _get_seller_delay(self, cr, uid, ids, field_name, args, context=None): |
550 | @@ -95,7 +95,7 @@ | |||
551 | 95 | res[price.id] = (price.name and price.name.supplier_lt) or (product_id and int(product[0].procure_delay)) or 1 | 95 | res[price.id] = (price.name and price.name.supplier_lt) or (product_id and int(product[0].procure_delay)) or 1 |
552 | 96 | 96 | ||
553 | 97 | return res | 97 | return res |
555 | 98 | 98 | ||
556 | 99 | _columns = { | 99 | _columns = { |
557 | 100 | 'catalogue_id': fields.many2one('supplier.catalogue', string='Associated catalogue', ondelete='cascade'), | 100 | 'catalogue_id': fields.many2one('supplier.catalogue', string='Associated catalogue', ondelete='cascade'), |
558 | 101 | 'editable': fields.function(_get_editable, method=True, string='Editable', store=False, type='boolean'), | 101 | 'editable': fields.function(_get_editable, method=True, string='Editable', store=False, type='boolean'), |
559 | @@ -122,7 +122,7 @@ | |||
560 | 122 | 122 | ||
561 | 123 | return {'value': v} | 123 | return {'value': v} |
562 | 124 | 124 | ||
564 | 125 | 125 | ||
565 | 126 | # Override the original method | 126 | # Override the original method |
566 | 127 | def price_get(self, cr, uid, supplier_ids, product_id, product_qty=1, context=None): | 127 | def price_get(self, cr, uid, supplier_ids, product_id, product_qty=1, context=None): |
567 | 128 | """ | 128 | """ |
568 | @@ -141,16 +141,16 @@ | |||
569 | 141 | uom_id = context.get('uom', False) or product_pool.browse(cr, uid, product_id, context=context).uom_id.id | 141 | uom_id = context.get('uom', False) or product_pool.browse(cr, uid, product_id, context=context).uom_id.id |
570 | 142 | for supplier in partner_pool.browse(cr, uid, supplier_ids, context=context): | 142 | for supplier in partner_pool.browse(cr, uid, supplier_ids, context=context): |
571 | 143 | res[supplier.id] = product_pool._get_partner_price(cr, uid, product_id, supplier.id, product_qty, | 143 | res[supplier.id] = product_pool._get_partner_price(cr, uid, product_id, supplier.id, product_qty, |
573 | 144 | currency_id, date, uom_id, context=context) | 144 | currency_id, date, uom_id, context=context) |
574 | 145 | return res | 145 | return res |
576 | 146 | 146 | ||
577 | 147 | product_supplierinfo() | 147 | product_supplierinfo() |
578 | 148 | 148 | ||
579 | 149 | 149 | ||
580 | 150 | class pricelist_partnerinfo(osv.osv): | 150 | class pricelist_partnerinfo(osv.osv): |
581 | 151 | _name = 'pricelist.partnerinfo' | 151 | _name = 'pricelist.partnerinfo' |
582 | 152 | _inherit = 'pricelist.partnerinfo' | 152 | _inherit = 'pricelist.partnerinfo' |
584 | 153 | 153 | ||
585 | 154 | def default_get(self, cr, uid, fields, context=None): | 154 | def default_get(self, cr, uid, fields, context=None): |
586 | 155 | ''' | 155 | ''' |
587 | 156 | Set automatically the currency of the line with the default | 156 | Set automatically the currency of the line with the default |
588 | @@ -158,9 +158,9 @@ | |||
589 | 158 | ''' | 158 | ''' |
590 | 159 | if not context: | 159 | if not context: |
591 | 160 | context = {} | 160 | context = {} |
593 | 161 | 161 | ||
594 | 162 | res = super(pricelist_partnerinfo, self).default_get(cr, uid, fields, context=context) | 162 | res = super(pricelist_partnerinfo, self).default_get(cr, uid, fields, context=context) |
596 | 163 | 163 | ||
597 | 164 | if context.get('partner_id', False) and isinstance(context['partner_id'], (int, long)): | 164 | if context.get('partner_id', False) and isinstance(context['partner_id'], (int, long)): |
598 | 165 | partner = self.pool.get('res.partner').browse(cr, uid, context.get('partner_id'), context=context) | 165 | partner = self.pool.get('res.partner').browse(cr, uid, context.get('partner_id'), context=context) |
599 | 166 | res['currency_id'] = partner.property_product_pricelist_purchase.currency_id.id | 166 | res['currency_id'] = partner.property_product_pricelist_purchase.currency_id.id |
600 | @@ -168,9 +168,9 @@ | |||
601 | 168 | if context.get('active_model', False) == 'product.supplierinfo' and context.get('active_id', False) and isinstance(context['active_id'], (int, long)): | 168 | if context.get('active_model', False) == 'product.supplierinfo' and context.get('active_id', False) and isinstance(context['active_id'], (int, long)): |
602 | 169 | read_partnerinfo = self.pool.get('product.supplierinfo').read(cr, uid, context['active_id']) | 169 | read_partnerinfo = self.pool.get('product.supplierinfo').read(cr, uid, context['active_id']) |
603 | 170 | res['uom_id'] = read_partnerinfo['product_uom'][0] | 170 | res['uom_id'] = read_partnerinfo['product_uom'][0] |
605 | 171 | 171 | ||
606 | 172 | return res | 172 | return res |
608 | 173 | 173 | ||
609 | 174 | def unlink(self, cr, uid, info_id, context=None): | 174 | def unlink(self, cr, uid, info_id, context=None): |
610 | 175 | ''' | 175 | ''' |
611 | 176 | Disallow the possibility to remove a supplier pricelist | 176 | Disallow the possibility to remove a supplier pricelist |
612 | @@ -181,7 +181,7 @@ | |||
613 | 181 | ''' | 181 | ''' |
614 | 182 | if context is None: | 182 | if context is None: |
615 | 183 | context = {} | 183 | context = {} |
617 | 184 | 184 | ||
618 | 185 | if isinstance(info_id, (int, long)): | 185 | if isinstance(info_id, (int, long)): |
619 | 186 | info_id = [info_id] | 186 | info_id = [info_id] |
620 | 187 | 187 | ||
621 | @@ -190,27 +190,27 @@ | |||
622 | 190 | raise osv.except_osv(_('Error'), _('You cannot remove a supplier pricelist line which is linked ' \ | 190 | raise osv.except_osv(_('Error'), _('You cannot remove a supplier pricelist line which is linked ' \ |
623 | 191 | 'to a supplier catalogue line ! Please remove the corresponding ' \ | 191 | 'to a supplier catalogue line ! Please remove the corresponding ' \ |
624 | 192 | 'supplier catalogue line to remove this supplier information.')) | 192 | 'supplier catalogue line to remove this supplier information.')) |
626 | 193 | 193 | ||
627 | 194 | return super(pricelist_partnerinfo, self).unlink(cr, uid, info_id, context=context) | 194 | return super(pricelist_partnerinfo, self).unlink(cr, uid, info_id, context=context) |
629 | 195 | 195 | ||
630 | 196 | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | 196 | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): |
631 | 197 | if not context: | 197 | if not context: |
632 | 198 | context = {} | 198 | context = {} |
634 | 199 | 199 | ||
635 | 200 | res = super(pricelist_partnerinfo, self).search(cr, uid, args, offset, limit, | 200 | res = super(pricelist_partnerinfo, self).search(cr, uid, args, offset, limit, |
637 | 201 | order, context=context, count=count) | 201 | order, context=context, count=count) |
638 | 202 | 202 | ||
639 | 203 | if count: | 203 | if count: |
640 | 204 | return res | 204 | return res |
642 | 205 | 205 | ||
643 | 206 | new_res = [] | 206 | new_res = [] |
645 | 207 | 207 | ||
646 | 208 | for r in self.browse(cr, uid, res, context=context): | 208 | for r in self.browse(cr, uid, res, context=context): |
647 | 209 | if not r.suppinfo_id or not r.suppinfo_id.catalogue_id or r.suppinfo_id.catalogue_id.active: | 209 | if not r.suppinfo_id or not r.suppinfo_id.catalogue_id or r.suppinfo_id.catalogue_id.active: |
648 | 210 | new_res.append(r.id) | 210 | new_res.append(r.id) |
650 | 211 | 211 | ||
651 | 212 | return new_res | 212 | return new_res |
653 | 213 | 213 | ||
654 | 214 | def _check_min_quantity(self, cr, uid, ids, context=None): | 214 | def _check_min_quantity(self, cr, uid, ids, context=None): |
655 | 215 | ''' | 215 | ''' |
656 | 216 | Check if the min_qty field is set | 216 | Check if the min_qty field is set |
657 | @@ -226,7 +226,7 @@ | |||
658 | 226 | if line.min_quantity <= 0.00: | 226 | if line.min_quantity <= 0.00: |
659 | 227 | raise osv.except_osv(_('Error'), _('The line of product %s has a negative or zero min. quantity !') %line.suppinfo_id.product_id.name) | 227 | raise osv.except_osv(_('Error'), _('The line of product %s has a negative or zero min. quantity !') %line.suppinfo_id.product_id.name) |
660 | 228 | return False | 228 | return False |
662 | 229 | 229 | ||
663 | 230 | return True | 230 | return True |
664 | 231 | 231 | ||
665 | 232 | def _get_supplierinfo(self, cr, uid, ids, context=None): | 232 | def _get_supplierinfo(self, cr, uid, ids, context=None): |
666 | @@ -254,7 +254,7 @@ | |||
667 | 254 | 'sequence': fields.function(_get_sequence, method=True, string='Sequence', type='integer', | 254 | 'sequence': fields.function(_get_sequence, method=True, string='Sequence', type='integer', |
668 | 255 | store={'pricelist.partnerinfo': (lambda self, cr, uid, ids, c={}: ids, [], 20), | 255 | store={'pricelist.partnerinfo': (lambda self, cr, uid, ids, c={}: ids, [], 20), |
669 | 256 | 'product.supplierinfo': (_get_supplierinfo, ['sequence'], 20), | 256 | 'product.supplierinfo': (_get_supplierinfo, ['sequence'], 20), |
671 | 257 | }) | 257 | }) |
672 | 258 | } | 258 | } |
673 | 259 | 259 | ||
674 | 260 | def create(self, cr, uid, vals, context=None): | 260 | def create(self, cr, uid, vals, context=None): |
675 | @@ -285,15 +285,15 @@ | |||
676 | 285 | class product_product(osv.osv): | 285 | class product_product(osv.osv): |
677 | 286 | _name = 'product.product' | 286 | _name = 'product.product' |
678 | 287 | _inherit = 'product.product' | 287 | _inherit = 'product.product' |
680 | 288 | 288 | ||
681 | 289 | def _get_partner_info_price(self, cr, uid, product, partner_id, product_qty, currency_id, | 289 | def _get_partner_info_price(self, cr, uid, product, partner_id, product_qty, currency_id, |
683 | 290 | order_date, product_uom_id, context=None): | 290 | order_date, product_uom_id, context=None): |
684 | 291 | ''' | 291 | ''' |
685 | 292 | Returns the pricelist_information from product form | 292 | Returns the pricelist_information from product form |
686 | 293 | ''' | 293 | ''' |
687 | 294 | if not context: | 294 | if not context: |
688 | 295 | context = {} | 295 | context = {} |
690 | 296 | 296 | ||
691 | 297 | partner_price = self.pool.get('pricelist.partnerinfo') | 297 | partner_price = self.pool.get('pricelist.partnerinfo') |
692 | 298 | info_prices = [] | 298 | info_prices = [] |
693 | 299 | suppinfo_ids = self.pool.get('product.supplierinfo').search(cr, uid, [('name', '=', partner_id), ('product_id', '=', product.product_tmpl_id.id)], context=context) | 299 | suppinfo_ids = self.pool.get('product.supplierinfo').search(cr, uid, [('name', '=', partner_id), ('product_id', '=', product.product_tmpl_id.id)], context=context) |
694 | @@ -304,18 +304,18 @@ | |||
695 | 304 | ('valid_from', '=', False), | 304 | ('valid_from', '=', False), |
696 | 305 | '|', ('valid_till', '>=', order_date), | 305 | '|', ('valid_till', '>=', order_date), |
697 | 306 | ('valid_till', '=', False)] | 306 | ('valid_till', '=', False)] |
699 | 307 | 307 | ||
700 | 308 | domain_cur = [('currency_id', '=', currency_id)] | 308 | domain_cur = [('currency_id', '=', currency_id)] |
701 | 309 | domain_cur.extend(domain) | 309 | domain_cur.extend(domain) |
703 | 310 | 310 | ||
704 | 311 | info_prices = partner_price.search(cr, uid, domain_cur, order='sequence asc, min_quantity desc, id desc', limit=1, context=context) | 311 | info_prices = partner_price.search(cr, uid, domain_cur, order='sequence asc, min_quantity desc, id desc', limit=1, context=context) |
705 | 312 | if not info_prices: | 312 | if not info_prices: |
706 | 313 | info_prices = partner_price.search(cr, uid, domain, order='sequence asc, min_quantity desc, id desc', limit=1, context=context) | 313 | info_prices = partner_price.search(cr, uid, domain, order='sequence asc, min_quantity desc, id desc', limit=1, context=context) |
708 | 314 | 314 | ||
709 | 315 | return info_prices | 315 | return info_prices |
711 | 316 | 316 | ||
712 | 317 | def _get_partner_price(self, cr, uid, product_ids, partner_id, product_qty, currency_id, | 317 | def _get_partner_price(self, cr, uid, product_ids, partner_id, product_qty, currency_id, |
714 | 318 | order_date, product_uom_id, context=None): | 318 | order_date, product_uom_id, context=None): |
715 | 319 | ''' | 319 | ''' |
716 | 320 | Search the good partner price line for products | 320 | Search the good partner price line for products |
717 | 321 | ''' | 321 | ''' |
718 | @@ -323,29 +323,27 @@ | |||
719 | 323 | one_product = False | 323 | one_product = False |
720 | 324 | cur_obj = self.pool.get('res.currency') | 324 | cur_obj = self.pool.get('res.currency') |
721 | 325 | partner_price = self.pool.get('pricelist.partnerinfo') | 325 | partner_price = self.pool.get('pricelist.partnerinfo') |
722 | 326 | suppinfo_obj = self.pool.get('product.supplierinfo') | ||
723 | 327 | prod_obj = self.pool.get('product.product') | 326 | prod_obj = self.pool.get('product.product') |
726 | 328 | catalogue_obj = self.pool.get('supplier.catalogue') | 327 | |
725 | 329 | |||
727 | 330 | if not context: | 328 | if not context: |
728 | 331 | context = {} | 329 | context = {} |
730 | 332 | 330 | ||
731 | 333 | if isinstance(product_ids, (int, long)): | 331 | if isinstance(product_ids, (int, long)): |
732 | 334 | one_product = product_ids | 332 | one_product = product_ids |
733 | 335 | product_ids = [product_ids] | 333 | product_ids = [product_ids] |
735 | 336 | 334 | ||
736 | 337 | for product in prod_obj.browse(cr, uid, product_ids, context=context): | 335 | for product in prod_obj.browse(cr, uid, product_ids, context=context): |
737 | 338 | info_prices = self._get_partner_info_price(cr, uid, product, partner_id, product_qty, currency_id, | 336 | info_prices = self._get_partner_info_price(cr, uid, product, partner_id, product_qty, currency_id, |
738 | 339 | order_date, product_uom_id, context=context) | 337 | order_date, product_uom_id, context=context) |
740 | 340 | 338 | ||
741 | 341 | if info_prices: | 339 | if info_prices: |
743 | 342 | # info = partner_price.browse(cr, uid, info_price, context=context)[0] | 340 | # info = partner_price.browse(cr, uid, info_price, context=context)[0] |
744 | 343 | info = partner_price.browse(cr, uid, info_prices[0], context=context) | 341 | info = partner_price.browse(cr, uid, info_prices[0], context=context) |
745 | 344 | price = cur_obj.compute(cr, uid, info.currency_id.id, currency_id, info.price, round=False, context=context) | 342 | price = cur_obj.compute(cr, uid, info.currency_id.id, currency_id, info.price, round=False, context=context) |
746 | 345 | res[product.id] = (price, info.rounding or 1.00, info.suppinfo_id.min_qty or 0.00) | 343 | res[product.id] = (price, info.rounding or 1.00, info.suppinfo_id.min_qty or 0.00) |
747 | 346 | else: | 344 | else: |
748 | 347 | res[product.id] = (False, 1.0, 1.0) | 345 | res[product.id] = (False, 1.0, 1.0) |
750 | 348 | 346 | ||
751 | 349 | return not one_product and res or res[one_product] | 347 | return not one_product and res or res[one_product] |
752 | 350 | 348 | ||
753 | 351 | def _get_catalogue_ids(self, cr, uid, ids, field_name, arg, context=None): | 349 | def _get_catalogue_ids(self, cr, uid, ids, field_name, arg, context=None): |
754 | @@ -371,51 +369,70 @@ | |||
755 | 371 | res[product.id] = list(catalogue_ids) | 369 | res[product.id] = list(catalogue_ids) |
756 | 372 | 370 | ||
757 | 373 | return res | 371 | return res |
759 | 374 | 372 | ||
760 | 375 | def _search_catalogue_ids(self, cr, uid, obj, name, args, context=None): | 373 | def _search_catalogue_ids(self, cr, uid, obj, name, args, context=None): |
761 | 376 | ''' | 374 | ''' |
762 | 377 | Filter the search according to the args parameter | 375 | Filter the search according to the args parameter |
763 | 378 | ''' | 376 | ''' |
764 | 379 | # Objects | ||
765 | 380 | catalogue_obj = self.pool.get('supplier.catalogue') | 377 | catalogue_obj = self.pool.get('supplier.catalogue') |
766 | 381 | 378 | ||
769 | 382 | context = context is None and {} or context | 379 | if context is None: |
770 | 383 | ids = set() | 380 | context = {} |
771 | 381 | product_id_list = [] | ||
772 | 384 | 382 | ||
773 | 385 | for arg in args: | 383 | for arg in args: |
782 | 386 | if arg[0] == 'catalogue_ids' and arg[1] == '=' and arg[2]: | 384 | if arg[0] == 'catalogue_ids' and arg[1] == '=': |
783 | 387 | catalogue = catalogue_obj.browse(cr, uid, int(arg[2]), context=context) | 385 | catalogue_list = [int(arg[2])] |
784 | 388 | for line in catalogue.line_ids: | 386 | elif arg[0] == 'catalogue_ids' and arg[1] == 'in': |
785 | 389 | ids.add(line.product_id.id) | 387 | catalogue_list = arg[2] |
786 | 390 | elif arg[0] == 'catalogue_ids' and arg[1] == 'in' and arg[2]: | 388 | elif arg[0] == 'catalogue_ids' and arg[1] == 'ilike': |
787 | 391 | for catalogue in catalogue_obj.browse(cr, uid, arg[2], context=context): | 389 | name_search = arg[2] |
788 | 392 | for line in catalogue.line_ids: | 390 | catalogue_list = catalogue_obj.search(cr, uid, [('name', 'ilike', name_search)], |
789 | 393 | ids.add(line.product_id.id) | 391 | context=context) |
790 | 392 | if not catalogue_list: | ||
791 | 393 | return [] | ||
792 | 394 | else: | 394 | else: |
793 | 395 | return [] | 395 | return [] |
794 | 396 | 396 | ||
796 | 397 | return [('id', 'in', list(ids))] | 397 | catalog_lines_result = catalogue_obj.read(cr, uid, catalogue_list, |
797 | 398 | ['line_ids'], context) | ||
798 | 399 | catalog_line_ids_list = [] | ||
799 | 400 | for catalog in catalog_lines_result: | ||
800 | 401 | catalog_line_ids_list.extend(catalog['line_ids']) | ||
801 | 402 | |||
802 | 403 | total_lines = len(catalog_line_ids_list) | ||
803 | 404 | start_chunk = 0 | ||
804 | 405 | chunk_size = 500 | ||
805 | 406 | while start_chunk < total_lines: | ||
806 | 407 | ids_chunk = catalog_line_ids_list[start_chunk:start_chunk+chunk_size] | ||
807 | 408 | cr.execute("""SELECT scl.product_id | ||
808 | 409 | FROM supplier_catalogue_line as scl | ||
809 | 410 | WHERE scl.id in %s""", (tuple(ids_chunk),)) | ||
810 | 411 | current_res = [x[0] for x in cr.fetchall() if x] | ||
811 | 412 | product_id_list.extend(current_res) | ||
812 | 413 | start_chunk += chunk_size | ||
813 | 414 | return [('id', 'in', product_id_list)] | ||
814 | 398 | 415 | ||
815 | 399 | _columns = { | 416 | _columns = { |
816 | 400 | 'catalogue_ids': fields.function(_get_catalogue_ids, fnct_search=_search_catalogue_ids, | 417 | 'catalogue_ids': fields.function(_get_catalogue_ids, fnct_search=_search_catalogue_ids, |
818 | 401 | type='many2many', relation='supplier.catalogue', method=True, string='Catalogues'), | 418 | type='many2many', relation='supplier.catalogue', method=True, string='Catalogues'), |
819 | 402 | } | 419 | } |
821 | 403 | 420 | ||
822 | 404 | product_product() | 421 | product_product() |
823 | 405 | 422 | ||
824 | 406 | 423 | ||
825 | 407 | class product_pricelist(osv.osv): | 424 | class product_pricelist(osv.osv): |
826 | 408 | _name = 'product.pricelist' | 425 | _name = 'product.pricelist' |
827 | 409 | _inherit = 'product.pricelist' | 426 | _inherit = 'product.pricelist' |
829 | 410 | 427 | ||
830 | 411 | def _get_in_search(self, cr, uid, ids, field_name, args, context=None): | 428 | def _get_in_search(self, cr, uid, ids, field_name, args, context=None): |
831 | 412 | res = {} | 429 | res = {} |
833 | 413 | 430 | ||
834 | 414 | for id in ids: | 431 | for id in ids: |
835 | 415 | res[id] = True | 432 | res[id] = True |
837 | 416 | 433 | ||
838 | 417 | return res | 434 | return res |
840 | 418 | 435 | ||
841 | 419 | def _search_in_search(self, cr, uid, obj, name, args, context=None): | 436 | def _search_in_search(self, cr, uid, obj, name, args, context=None): |
842 | 420 | ''' | 437 | ''' |
843 | 421 | Returns pricelists according to partner type | 438 | Returns pricelists according to partner type |
844 | @@ -423,7 +440,7 @@ | |||
845 | 423 | user_obj = self.pool.get('res.users') | 440 | user_obj = self.pool.get('res.users') |
846 | 424 | cur_obj = self.pool.get('res.currency') | 441 | cur_obj = self.pool.get('res.currency') |
847 | 425 | dom = [] | 442 | dom = [] |
849 | 426 | 443 | ||
850 | 427 | for arg in args: | 444 | for arg in args: |
851 | 428 | if arg[0] == 'in_search': | 445 | if arg[0] == 'in_search': |
852 | 429 | if arg[1] != '=': | 446 | if arg[1] != '=': |
853 | @@ -438,42 +455,42 @@ | |||
854 | 438 | elif arg[2] == 'esc': | 455 | elif arg[2] == 'esc': |
855 | 439 | currency_ids = cur_obj.search(cr, uid, [('is_esc_currency', '=', True)]) | 456 | currency_ids = cur_obj.search(cr, uid, [('is_esc_currency', '=', True)]) |
856 | 440 | dom.append(('currency_id', 'in', currency_ids)) | 457 | dom.append(('currency_id', 'in', currency_ids)) |
858 | 441 | 458 | ||
859 | 442 | return dom | 459 | return dom |
861 | 443 | 460 | ||
862 | 444 | def _get_currency_name(self, cr, uid, ids, field_name, args, context=None): | 461 | def _get_currency_name(self, cr, uid, ids, field_name, args, context=None): |
863 | 445 | ''' | 462 | ''' |
864 | 446 | Return the name of the related currency | 463 | Return the name of the related currency |
865 | 447 | ''' | 464 | ''' |
866 | 448 | res = {} | 465 | res = {} |
868 | 449 | 466 | ||
869 | 450 | for p_list in self.browse(cr, uid, ids, context=context): | 467 | for p_list in self.browse(cr, uid, ids, context=context): |
870 | 451 | res[p_list.id] = False | 468 | res[p_list.id] = False |
871 | 452 | if p_list.currency_id: | 469 | if p_list.currency_id: |
872 | 453 | res[p_list.id] = p_list.currency_id.currency_name | 470 | res[p_list.id] = p_list.currency_id.currency_name |
874 | 454 | 471 | ||
875 | 455 | return res | 472 | return res |
877 | 456 | 473 | ||
878 | 457 | def _search_currency_name(self, cr, uid, obj, name, args, context=None): | 474 | def _search_currency_name(self, cr, uid, obj, name, args, context=None): |
879 | 458 | ''' | 475 | ''' |
880 | 459 | Return the list corresponding to the currency name | 476 | Return the list corresponding to the currency name |
881 | 460 | ''' | 477 | ''' |
882 | 461 | dom = [] | 478 | dom = [] |
884 | 462 | 479 | ||
885 | 463 | for arg in args: | 480 | for arg in args: |
886 | 464 | if arg[0] == 'currency_name': | 481 | if arg[0] == 'currency_name': |
887 | 465 | currency_ids = self.pool.get('res.currency').search(cr, uid, [('currency_name', arg[1], arg[2])], context=context) | 482 | currency_ids = self.pool.get('res.currency').search(cr, uid, [('currency_name', arg[1], arg[2])], context=context) |
888 | 466 | dom.append(('currency_id', 'in', currency_ids)) | 483 | dom.append(('currency_id', 'in', currency_ids)) |
890 | 467 | 484 | ||
891 | 468 | return dom | 485 | return dom |
894 | 469 | 486 | ||
895 | 470 | 487 | ||
896 | 471 | _columns = { | 488 | _columns = { |
897 | 472 | 'in_search': fields.function(_get_in_search, fnct_search=_search_in_search, method=True, | 489 | 'in_search': fields.function(_get_in_search, fnct_search=_search_in_search, method=True, |
898 | 473 | type='boolean', string='In search'), | 490 | type='boolean', string='In search'), |
899 | 474 | 'currency_name': fields.function(_get_currency_name, fnct_search=_search_currency_name, type='char', method=True, string='Currency name'), | 491 | 'currency_name': fields.function(_get_currency_name, fnct_search=_search_currency_name, type='char', method=True, string='Currency name'), |
900 | 475 | } | 492 | } |
902 | 476 | 493 | ||
903 | 477 | def _hook_product_partner_price(self, cr, uid, *args, **kwargs): | 494 | def _hook_product_partner_price(self, cr, uid, *args, **kwargs): |
904 | 478 | ''' | 495 | ''' |
905 | 479 | Rework the computation of price from partner section in product form | 496 | Rework the computation of price from partner section in product form |
906 | @@ -490,13 +507,13 @@ | |||
907 | 490 | if not partner and 'partner_id' in context: | 507 | if not partner and 'partner_id' in context: |
908 | 491 | partner = context.get('partner_id', False) | 508 | partner = context.get('partner_id', False) |
909 | 492 | uom_price_already_computed = kwargs['uom_price_already_computed'] | 509 | uom_price_already_computed = kwargs['uom_price_already_computed'] |
911 | 493 | 510 | ||
912 | 494 | price, rounding, min_qty = self.pool.get('product.product')._get_partner_price(cr, uid, product_id, partner, qty, currency_id, | 511 | price, rounding, min_qty = self.pool.get('product.product')._get_partner_price(cr, uid, product_id, partner, qty, currency_id, |
913 | 495 | date, uom, context=context) | 512 | date, uom, context=context) |
914 | 496 | uom_price_already_computed = 1 | 513 | uom_price_already_computed = 1 |
916 | 497 | 514 | ||
917 | 498 | return price, uom_price_already_computed | 515 | return price, uom_price_already_computed |
919 | 499 | 516 | ||
920 | 500 | def name_get(self, cr, user, ids, context=None): | 517 | def name_get(self, cr, user, ids, context=None): |
921 | 501 | ''' | 518 | ''' |
922 | 502 | Display the currency name instead of the pricelist name | 519 | Display the currency name instead of the pricelist name |
923 | @@ -507,7 +524,7 @@ | |||
924 | 507 | txt = pp.currency_id.name | 524 | txt = pp.currency_id.name |
925 | 508 | res += [(pp.id, txt)] | 525 | res += [(pp.id, txt)] |
926 | 509 | return res | 526 | return res |
928 | 510 | 527 | ||
929 | 511 | def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=80): | 528 | def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=80): |
930 | 512 | ''' | 529 | ''' |
931 | 513 | Search pricelist by currency name instead of pricelist name | 530 | Search pricelist by currency name instead of pricelist name |
932 | @@ -515,12 +532,12 @@ | |||
933 | 515 | ids = [] | 532 | ids = [] |
934 | 516 | if name: | 533 | if name: |
935 | 517 | currency_ids = self.pool.get('res.currency').search(cr, uid, | 534 | currency_ids = self.pool.get('res.currency').search(cr, uid, |
937 | 518 | [('name', operator, name)], order='NO_ORDER', context=context) | 535 | [('name', operator, name)], order='NO_ORDER', context=context) |
938 | 519 | ids = self.search(cr, uid, [('currency_id', 'in', currency_ids)] + (args or [])) | 536 | ids = self.search(cr, uid, [('currency_id', 'in', currency_ids)] + (args or [])) |
940 | 520 | 537 | ||
941 | 521 | return self.name_get(cr, uid, ids) | 538 | return self.name_get(cr, uid, ids) |
944 | 522 | 539 | ||
945 | 523 | 540 | ||
946 | 524 | product_pricelist() | 541 | product_pricelist() |
947 | 525 | 542 | ||
948 | 526 | class res_currency(osv.osv): | 543 | class res_currency(osv.osv): |
949 | @@ -550,21 +567,21 @@ | |||
950 | 550 | po_currency_id = price_obj.browse(cr, uid, arg[2]).currency_id.id | 567 | po_currency_id = price_obj.browse(cr, uid, arg[2]).currency_id.id |
951 | 551 | dom.append(('id', 'in', [func_currency_id, po_currency_id])) | 568 | dom.append(('id', 'in', [func_currency_id, po_currency_id])) |
952 | 552 | return dom | 569 | return dom |
954 | 553 | 570 | ||
955 | 554 | def _get_partner_currency(self, cr, uid, ids, field_name, args, context=None): | 571 | def _get_partner_currency(self, cr, uid, ids, field_name, args, context=None): |
956 | 555 | res = {} | 572 | res = {} |
957 | 556 | for id in ids: | 573 | for id in ids: |
958 | 557 | res[id] = True | 574 | res[id] = True |
960 | 558 | 575 | ||
961 | 559 | return res | 576 | return res |
963 | 560 | 577 | ||
964 | 561 | def _src_partner_currency(self, cr, uid, obj, name, args, context=None): | 578 | def _src_partner_currency(self, cr, uid, obj, name, args, context=None): |
965 | 562 | ''' | 579 | ''' |
966 | 563 | Returns currencies according to partner type | 580 | Returns currencies according to partner type |
967 | 564 | ''' | 581 | ''' |
968 | 565 | user_obj = self.pool.get('res.users') | 582 | user_obj = self.pool.get('res.users') |
969 | 566 | dom = [] | 583 | dom = [] |
971 | 567 | 584 | ||
972 | 568 | for arg in args: | 585 | for arg in args: |
973 | 569 | if arg[0] == 'partner_currency': | 586 | if arg[0] == 'partner_currency': |
974 | 570 | if arg[1] != '=': | 587 | if arg[1] != '=': |
975 | @@ -578,14 +595,14 @@ | |||
976 | 578 | dom.append(('is_section_currency', '=', True)) | 595 | dom.append(('is_section_currency', '=', True)) |
977 | 579 | elif partner.partner_type == 'esc': | 596 | elif partner.partner_type == 'esc': |
978 | 580 | dom.append(('is_esc_currency', '=', True)) | 597 | dom.append(('is_esc_currency', '=', True)) |
980 | 581 | 598 | ||
981 | 582 | return dom | 599 | return dom |
982 | 583 | 600 | ||
983 | 584 | _columns = { | 601 | _columns = { |
984 | 585 | 'is_section_currency': fields.boolean(string='Functional currency', | 602 | 'is_section_currency': fields.boolean(string='Functional currency', |
986 | 586 | help='If this box is checked, this currency is used as a functional currency for at least one section in MSF.'), | 603 | help='If this box is checked, this currency is used as a functional currency for at least one section in MSF.'), |
987 | 587 | 'is_esc_currency': fields.boolean(string='ESC currency', | 604 | 'is_esc_currency': fields.boolean(string='ESC currency', |
989 | 588 | help='If this box is checked, this currency is used as a currency for at least one ESC.'), | 605 | help='If this box is checked, this currency is used as a currency for at least one ESC.'), |
990 | 589 | 'is_po_functional': fields.function(_get_in_search, fnct_search=_search_in_search, method=True, | 606 | 'is_po_functional': fields.function(_get_in_search, fnct_search=_search_in_search, method=True, |
991 | 590 | type='boolean', string='transport PO currencies'), | 607 | type='boolean', string='transport PO currencies'), |
992 | 591 | 'partner_currency': fields.function(_get_partner_currency, fnct_search=_src_partner_currency, type='boolean', method=True, | 608 | 'partner_currency': fields.function(_get_partner_currency, fnct_search=_src_partner_currency, type='boolean', method=True, |
993 | @@ -605,9 +622,9 @@ | |||
994 | 605 | # Check if Inter-section partners used one of these currencies | 622 | # Check if Inter-section partners used one of these currencies |
995 | 606 | if 'is_section_currency' in values and not values['is_section_currency']: | 623 | if 'is_section_currency' in values and not values['is_section_currency']: |
996 | 607 | pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', | 624 | pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', |
998 | 608 | 'in', ids)], order='NO_ORDER', context=context) | 625 | 'in', ids)], order='NO_ORDER', context=context) |
999 | 609 | partner_ids = partner_obj.search(cr, uid, [('partner_type', '=', | 626 | partner_ids = partner_obj.search(cr, uid, [('partner_type', '=', |
1001 | 610 | 'section')], order='NO_ORDER', context=context) | 627 | 'section')], order='NO_ORDER', context=context) |
1002 | 611 | value_reference = ['product.pricelist,%s' % x for x in pricelist_ids] | 628 | value_reference = ['product.pricelist,%s' % x for x in pricelist_ids] |
1003 | 612 | res_reference = ['res.partner,%s' % x for x in partner_ids] | 629 | res_reference = ['res.partner,%s' % x for x in partner_ids] |
1004 | 613 | property_ids = [] | 630 | property_ids = [] |
1005 | @@ -615,7 +632,7 @@ | |||
1006 | 615 | property_ids = property_obj.search(cr, uid, [('res_id', 'in', res_reference), | 632 | property_ids = property_obj.search(cr, uid, [('res_id', 'in', res_reference), |
1007 | 616 | ('value_reference', 'in', value_reference), | 633 | ('value_reference', 'in', value_reference), |
1008 | 617 | '|', ('name', '=', 'property_product_pricelist'), | 634 | '|', ('name', '=', 'property_product_pricelist'), |
1010 | 618 | ('name', '=', 'property_product_pricelist_purchase'),], context=context) | 635 | ('name', '=', 'property_product_pricelist_purchase'),], context=context) |
1011 | 619 | if property_ids: | 636 | if property_ids: |
1012 | 620 | properties = property_obj.browse(cr, uid, property_ids, context=context) | 637 | properties = property_obj.browse(cr, uid, property_ids, context=context) |
1013 | 621 | partner_list = ' / '.join(x.res_id.name for x in properties) | 638 | partner_list = ' / '.join(x.res_id.name for x in properties) |
1014 | @@ -626,9 +643,9 @@ | |||
1015 | 626 | # Check if ESC partners used one of these currencies | 643 | # Check if ESC partners used one of these currencies |
1016 | 627 | if 'is_esc_currency' in values and not values['is_esc_currency']: | 644 | if 'is_esc_currency' in values and not values['is_esc_currency']: |
1017 | 628 | pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', | 645 | pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', |
1019 | 629 | 'in', ids)], order='NO_ORDER', context=context) | 646 | 'in', ids)], order='NO_ORDER', context=context) |
1020 | 630 | partner_ids = partner_obj.search(cr, uid, [('partner_type', '=', | 647 | partner_ids = partner_obj.search(cr, uid, [('partner_type', '=', |
1022 | 631 | 'esc')], order='NO_ORDER', context=context) | 648 | 'esc')], order='NO_ORDER', context=context) |
1023 | 632 | value_reference = ['product.pricelist,%s' % x for x in pricelist_ids] | 649 | value_reference = ['product.pricelist,%s' % x for x in pricelist_ids] |
1024 | 633 | res_reference = ['res.partner,%s' % x for x in partner_ids] | 650 | res_reference = ['res.partner,%s' % x for x in partner_ids] |
1025 | 634 | property_ids = [] | 651 | property_ids = [] |
1026 | @@ -636,7 +653,7 @@ | |||
1027 | 636 | property_ids = property_obj.search(cr, uid, [('res_id', 'in', res_reference), | 653 | property_ids = property_obj.search(cr, uid, [('res_id', 'in', res_reference), |
1028 | 637 | ('value_reference', 'in', value_reference), | 654 | ('value_reference', 'in', value_reference), |
1029 | 638 | '|', ('name', '=', 'property_product_pricelist'), | 655 | '|', ('name', '=', 'property_product_pricelist'), |
1031 | 639 | ('name', '=', 'property_product_pricelist_purchase'),], context=context) | 656 | ('name', '=', 'property_product_pricelist_purchase'),], context=context) |
1032 | 640 | if property_ids: | 657 | if property_ids: |
1033 | 641 | properties = property_obj.browse(cr, uid, property_ids, context=context) | 658 | properties = property_obj.browse(cr, uid, property_ids, context=context) |
1034 | 642 | partner_list = ' / '.join(x.res_id.name for x in properties) | 659 | partner_list = ' / '.join(x.res_id.name for x in properties) |
1035 | 643 | 660 | ||
1036 | === modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako' | |||
1037 | --- bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2016-12-05 15:18:05 +0000 | |||
1038 | +++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2017-01-13 16:35:52 +0000 | |||
1039 | @@ -541,7 +541,7 @@ | |||
1040 | 541 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Details')}:</Data></Cell> | 541 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Details')}:</Data></Cell> |
1041 | 542 | <Cell ss:StyleID="sData"><Data ss:Type="String">${o.details or ''|x}</Data></Cell> | 542 | <Cell ss:StyleID="sData"><Data ss:Type="String">${o.details or ''|x}</Data></Cell> |
1042 | 543 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Currency')}:</Data></Cell> | 543 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Currency')}:</Data></Cell> |
1044 | 544 | <Cell ss:StyleID="sData"><Data ss:Type="String">${get_same_and_default_currency(o)[1].name or ''|x}</Data></Cell> | 544 | <Cell ss:StyleID="sData"><Data ss:Type="String">${o.company_id.currency_id.name or ''|x}</Data></Cell> |
1045 | 545 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Tender Priority')}:</Data></Cell> | 545 | <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Tender Priority')}:</Data></Cell> |
1046 | 546 | <Cell ss:StyleID="sData"><Data ss:Type="String">${getSel(o, 'priority')|x}</Data></Cell> | 546 | <Cell ss:StyleID="sData"><Data ss:Type="String">${getSel(o, 'priority')|x}</Data></Cell> |
1047 | 547 | </Row> | 547 | </Row> |
1048 | 548 | 548 | ||
1049 | === modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.py' | |||
1050 | --- bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2016-12-05 15:15:27 +0000 | |||
1051 | +++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2017-01-13 16:35:52 +0000 | |||
1052 | @@ -17,8 +17,6 @@ | |||
1053 | 17 | super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context) | 17 | super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context) |
1054 | 18 | self.localcontext.update({ | 18 | self.localcontext.update({ |
1055 | 19 | 'get_compare_lines': self.get_compare_lines, | 19 | 'get_compare_lines': self.get_compare_lines, |
1056 | 20 | 'gen_line_link': self.gen_line_link, | ||
1057 | 21 | 'get_same_and_default_currency': self.get_same_and_default_currency, | ||
1058 | 22 | }) | 20 | }) |
1059 | 23 | 21 | ||
1060 | 24 | def get_compare_lines(self, tender_obj): | 22 | def get_compare_lines(self, tender_obj): |
1061 | @@ -85,42 +83,5 @@ | |||
1062 | 85 | 83 | ||
1063 | 86 | return lines | 84 | return lines |
1064 | 87 | 85 | ||
1065 | 88 | def get_same_and_default_currency(self, tender_obj): | ||
1066 | 89 | |||
1067 | 90 | if tender_obj == 'draft' or not tender_obj.rfq_ids: | ||
1068 | 91 | return (True, self.localcontext['company'].currency_id) | ||
1069 | 92 | |||
1070 | 93 | current_cur = False | ||
1071 | 94 | |||
1072 | 95 | for rfq in tender_obj.rfq_ids: | ||
1073 | 96 | next_cur = rfq.currency_id | ||
1074 | 97 | if current_cur and current_cur.id != next_cur.id: | ||
1075 | 98 | return (False, self.localcontext['company'].currency_id) | ||
1076 | 99 | current_cur = rfq.currency_id | ||
1077 | 100 | return (True, current_cur) | ||
1078 | 101 | |||
1079 | 102 | def gen_line_link(self, tender_obj): | ||
1080 | 103 | link_line_supp = {} | ||
1081 | 104 | |||
1082 | 105 | same_cur, currency = self.get_same_and_default_currency(tender_obj) | ||
1083 | 106 | cur_obj = self.pool.get('res.currency') | ||
1084 | 107 | |||
1085 | 108 | if tender_obj.rfq_ids: | ||
1086 | 109 | # fine we have rfqs | ||
1087 | 110 | for rfq in tender_obj.rfq_ids: | ||
1088 | 111 | for line in rfq.order_line: | ||
1089 | 112 | data = {'notes': line.notes, 'price_unit': line.price_unit} | ||
1090 | 113 | if not same_cur: | ||
1091 | 114 | data['price_unit'] = cur_obj.compute(self.cr, self.uid, line.currency_id.id, currency.id, line.price_unit, round=True) | ||
1092 | 115 | |||
1093 | 116 | link_line_supp.setdefault(line.product_id.id, {}).setdefault(rfq.partner_id.id, data) | ||
1094 | 117 | elif tender_obj.supplier_ids: | ||
1095 | 118 | for line in tender_obj.tender_line_ids: | ||
1096 | 119 | link_line_supp[line.product_id.id] = {} | ||
1097 | 120 | for supp in tender_obj.supplier_ids: | ||
1098 | 121 | link_line_supp[line.product_id.id][supp.id] = {} | ||
1099 | 122 | |||
1100 | 123 | return link_line_supp | ||
1101 | 124 | |||
1102 | 125 | 86 | ||
1103 | 126 | SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison) | 87 | SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison) |
1104 | 127 | 88 | ||
1105 | === modified file 'bin/addons/vertical_integration/report/hq_report_ocb.py' | |||
1106 | --- bin/addons/vertical_integration/report/hq_report_ocb.py 2016-11-18 16:44:10 +0000 | |||
1107 | +++ bin/addons/vertical_integration/report/hq_report_ocb.py 2017-01-13 16:35:52 +0000 | |||
1108 | @@ -63,6 +63,7 @@ | |||
1109 | 63 | dbname = cr.dbname | 63 | dbname = cr.dbname |
1110 | 64 | pool = pooler.get_pool(dbname) | 64 | pool = pooler.get_pool(dbname) |
1111 | 65 | partner_obj = pool.get('res.partner') | 65 | partner_obj = pool.get('res.partner') |
1112 | 66 | employee_obj = pool.get('hr.employee') | ||
1113 | 66 | 67 | ||
1114 | 67 | # define column number corresponding to properties | 68 | # define column number corresponding to properties |
1115 | 68 | partner_name_cl = 9 | 69 | partner_name_cl = 9 |
1116 | @@ -73,6 +74,12 @@ | |||
1117 | 73 | partner_search_dict = {} | 74 | partner_search_dict = {} |
1118 | 74 | employee_search_dict = {} | 75 | employee_search_dict = {} |
1119 | 75 | employee_code_dict = {} | 76 | employee_code_dict = {} |
1120 | 77 | partner_name_dict = {} | ||
1121 | 78 | partner_hash_dict = {} | ||
1122 | 79 | |||
1123 | 80 | partner_id_list = list(set([x[partner_id_cl] for x in data if x[partner_id_cl]])) | ||
1124 | 81 | partner_result = partner_obj.read(cr, uid, partner_id_list, ['name']) | ||
1125 | 82 | partner_name_dict = dict((x['id'], x['name']) for x in partner_result) | ||
1126 | 76 | 83 | ||
1127 | 77 | for line in data: | 84 | for line in data: |
1128 | 78 | tmp_line = list(line) | 85 | tmp_line = list(line) |
1129 | @@ -90,7 +97,7 @@ | |||
1130 | 90 | partner_id = tmp_line[partner_id_cl] | 97 | partner_id = tmp_line[partner_id_cl] |
1131 | 91 | if partner_id: | 98 | if partner_id: |
1132 | 92 | # US-497: extract name from partner_id (better than partner_txt) | 99 | # US-497: extract name from partner_id (better than partner_txt) |
1134 | 93 | tmp_line[partner_name_cl] = partner_obj.read(cr, uid, partner_id, ['name'])['name'] | 100 | tmp_line[partner_name_cl] = partner_name_dict[partner_id] |
1135 | 94 | 101 | ||
1136 | 95 | partner_name = tmp_line[partner_name_cl] | 102 | partner_name = tmp_line[partner_name_cl] |
1137 | 96 | # Search only if partner_name is not empty | 103 | # Search only if partner_name is not empty |
1138 | @@ -109,12 +116,13 @@ | |||
1139 | 109 | 116 | ||
1140 | 110 | # If we get some ids, fetch the partner hash | 117 | # If we get some ids, fetch the partner hash |
1141 | 111 | if partner_id: | 118 | if partner_id: |
1145 | 112 | if isinstance(partner_id, (int, long)): | 119 | if partner_id in partner_hash_dict: |
1146 | 113 | partner_id = [partner_id] | 120 | partner_hash = partner_hash_dict[partner_id] |
1147 | 114 | partner_hash = self.get_hash(cr, uid, partner_id, 'res.partner') | 121 | else: |
1148 | 122 | partner_hash = self.get_hash(cr, uid, [partner_id], 'res.partner') | ||
1149 | 123 | partner_hash_dict[partner_id] = partner_hash | ||
1150 | 115 | 124 | ||
1151 | 116 | if not partner_id and tmp_line[partner_name_cl]: | 125 | if not partner_id and tmp_line[partner_name_cl]: |
1152 | 117 | employee_obj = pool.get('hr.employee') | ||
1153 | 118 | if partner_name not in employee_search_dict: | 126 | if partner_name not in employee_search_dict: |
1154 | 119 | employee_search = employee_obj.search(cr, uid, [('name', '=', partner_name), ('active', 'in', ['t', 'f'])]) | 127 | employee_search = employee_obj.search(cr, uid, [('name', '=', partner_name), ('active', 'in', ['t', 'f'])]) |
1155 | 120 | if employee_search: | 128 | if employee_search: |
1156 | @@ -673,7 +681,7 @@ | |||
1157 | 673 | }) | 681 | }) |
1158 | 674 | 682 | ||
1159 | 675 | # Launch finance archive object | 683 | # Launch finance archive object |
1161 | 676 | fe = finance_archive(sqlrequests, processrequests) | 684 | fe = finance_archive(sqlrequests, processrequests, context=context) |
1162 | 677 | # Use archive method to create the archive | 685 | # Use archive method to create the archive |
1163 | 678 | return fe.archive(cr, uid) | 686 | return fe.archive(cr, uid) |
1164 | 679 | 687 | ||
1165 | 680 | 688 | ||
1166 | === modified file 'bin/addons/vertical_integration/wizard/ocb_export.py' | |||
1167 | --- bin/addons/vertical_integration/wizard/ocb_export.py 2016-01-26 10:00:40 +0000 | |||
1168 | +++ bin/addons/vertical_integration/wizard/ocb_export.py 2017-01-13 16:35:52 +0000 | |||
1169 | @@ -45,6 +45,12 @@ | |||
1170 | 45 | """ | 45 | """ |
1171 | 46 | Launch a report to generate the ZIP file. | 46 | Launch a report to generate the ZIP file. |
1172 | 47 | """ | 47 | """ |
1173 | 48 | if context is None: | ||
1174 | 49 | context = {} | ||
1175 | 50 | |||
1176 | 51 | if isinstance(ids, (int, long)): | ||
1177 | 52 | ids = [ids] | ||
1178 | 53 | |||
1179 | 48 | # Prepare some values | 54 | # Prepare some values |
1180 | 49 | wizard = self.browse(cr, uid, ids[0], context=context) | 55 | wizard = self.browse(cr, uid, ids[0], context=context) |
1181 | 50 | data = {} | 56 | data = {} |
1182 | @@ -67,7 +73,7 @@ | |||
1183 | 67 | if wizard.period_id.number == 16: | 73 | if wizard.period_id.number == 16: |
1184 | 68 | msg = _("You can not select '%s' as already included in' \ | 74 | msg = _("You can not select '%s' as already included in' \ |
1185 | 69 | ' December export") % ( | 75 | ' December export") % ( |
1187 | 70 | wizard.period_id.name or 'Period 16', ) | 76 | wizard.period_id.name or 'Period 16', ) |
1188 | 71 | raise osv.except_osv(_('Warning'), msg) | 77 | raise osv.except_osv(_('Warning'), msg) |
1189 | 72 | """elif wizard.period_id.number == 12: | 78 | """elif wizard.period_id.number == 12: |
1190 | 73 | domain = [ | 79 | domain = [ |
1191 | @@ -89,7 +95,20 @@ | |||
1192 | 89 | wizard.instance_id and wizard.instance_id.code or '', | 95 | wizard.instance_id and wizard.instance_id.code or '', |
1193 | 90 | period_name) | 96 | period_name) |
1194 | 91 | 97 | ||
1196 | 92 | return {'type': 'ir.actions.report.xml', 'report_name': 'hq.ocb', 'datas': data} | 98 | background_id = self.pool.get('memory.background.report').create(cr, uid, { |
1197 | 99 | 'file_name': data['target_filename'], | ||
1198 | 100 | 'report_name': 'hq.ocb', | ||
1199 | 101 | }, context=context) | ||
1200 | 102 | context['background_id'] = background_id | ||
1201 | 103 | context['background_time'] = 2 | ||
1202 | 104 | |||
1203 | 105 | data['context'] = context | ||
1204 | 106 | return { | ||
1205 | 107 | 'type': 'ir.actions.report.xml', | ||
1206 | 108 | 'report_name': 'hq.ocb', | ||
1207 | 109 | 'datas': data, | ||
1208 | 110 | 'context': context, | ||
1209 | 111 | } | ||
1210 | 93 | 112 | ||
1211 | 94 | ocb_export_wizard() | 113 | ocb_export_wizard() |
1212 | 95 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 114 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1213 | 96 | 115 | ||
1214 | === modified file 'bin/osv/orm.py' | |||
1215 | --- bin/osv/orm.py 2016-11-17 08:46:41 +0000 | |||
1216 | +++ bin/osv/orm.py 2017-01-13 16:35:52 +0000 | |||
1217 | @@ -1450,11 +1450,15 @@ | |||
1218 | 1450 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum')) | 1450 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum')) |
1219 | 1451 | if trans: | 1451 | if trans: |
1220 | 1452 | node.set('sum', trans) | 1452 | node.set('sum', trans) |
1222 | 1453 | elif node.get('confirm'): | 1453 | if node.get('confirm'): |
1223 | 1454 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm')) | 1454 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm')) |
1224 | 1455 | if trans: | 1455 | if trans: |
1225 | 1456 | node.set('confirm', trans) | 1456 | node.set('confirm', trans) |
1227 | 1457 | elif node.get('string'): | 1457 | if node.get('help'): |
1228 | 1458 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('help')) | ||
1229 | 1459 | if trans: | ||
1230 | 1460 | node.set('help', trans) | ||
1231 | 1461 | if node.get('string'): | ||
1232 | 1458 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string')) | 1462 | trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string')) |
1233 | 1459 | if trans == node.get('string') and ('base_model_name' in context): | 1463 | if trans == node.get('string') and ('base_model_name' in context): |
1234 | 1460 | # If translation is same as source, perhaps we'd have more luck with the alternative model name | 1464 | # If translation is same as source, perhaps we'd have more luck with the alternative model name |
1235 | @@ -1462,7 +1466,7 @@ | |||
1236 | 1462 | trans = translation_obj._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string')) | 1466 | trans = translation_obj._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string')) |
1237 | 1463 | if trans: | 1467 | if trans: |
1238 | 1464 | node.set('string', trans) | 1468 | node.set('string', trans) |
1240 | 1465 | elif node.tag == 'translate': | 1469 | if node.tag == 'translate': |
1241 | 1466 | parent = node.getparent() | 1470 | parent = node.getparent() |
1242 | 1467 | source = node.text | 1471 | source = node.text |
1243 | 1468 | for child in node.getchildren(): | 1472 | for child in node.getchildren(): |
1244 | 1469 | 1473 | ||
1245 | === modified file 'bin/release.py' | |||
1246 | --- bin/release.py 2016-12-14 08:48:56 +0000 | |||
1247 | +++ bin/release.py 2017-01-13 16:35:52 +0000 | |||
1248 | @@ -20,7 +20,7 @@ | |||
1249 | 20 | ############################################################################## | 20 | ############################################################################## |
1250 | 21 | 21 | ||
1251 | 22 | name = 'openerp-server' | 22 | name = 'openerp-server' |
1253 | 23 | version = 'UF3.0' | 23 | version = 'UF4.0dev' |
1254 | 24 | major_version = '6.0' | 24 | major_version = '6.0' |
1255 | 25 | description = 'OpenERP Server' | 25 | description = 'OpenERP Server' |
1256 | 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 |
1257 | 27 | 27 | ||
1258 | === modified file 'bin/service/web_services.py' | |||
1259 | --- bin/service/web_services.py 2016-11-15 15:32:01 +0000 | |||
1260 | +++ bin/service/web_services.py 2017-01-13 16:35:52 +0000 | |||
1261 | @@ -848,7 +848,7 @@ | |||
1262 | 848 | data.append(tmp_data) | 848 | data.append(tmp_data) |
1263 | 849 | return data | 849 | return data |
1264 | 850 | 850 | ||
1266 | 851 | def exp_export(self, db_name, uid, fields, domain, model, fields_name, | 851 | def exp_export(self, db_name, uid, fields, domain, model, fields_name, |
1267 | 852 | group_by=None, export_format='csv', ids=None, context=None): | 852 | group_by=None, export_format='csv', ids=None, context=None): |
1268 | 853 | res = {'result': None} | 853 | res = {'result': None} |
1269 | 854 | db, pool = pooler.get_db_and_pool(db_name) | 854 | db, pool = pooler.get_db_and_pool(db_name) |
1270 | @@ -866,7 +866,7 @@ | |||
1271 | 866 | return res | 866 | return res |
1272 | 867 | return background_id | 867 | return background_id |
1273 | 868 | 868 | ||
1275 | 869 | def export(self, cr, pool, uid, fields, domain, model, fields_name, | 869 | def export(self, cr, pool, uid, fields, domain, model, fields_name, |
1276 | 870 | bg_id, group_by=None, export_format='csv', ids=None, res=None, | 870 | bg_id, group_by=None, export_format='csv', ids=None, res=None, |
1277 | 871 | context=None): | 871 | context=None): |
1278 | 872 | 872 | ||
1279 | 873 | 873 | ||
1280 | === modified file 'bin/tools/translate.py' | |||
1281 | --- bin/tools/translate.py 2016-11-09 08:41:40 +0000 | |||
1282 | +++ bin/tools/translate.py 2017-01-13 16:35:52 +0000 | |||
1283 | @@ -559,6 +559,8 @@ | |||
1284 | 559 | res.append(de.get('sum').encode("utf8")) | 559 | res.append(de.get('sum').encode("utf8")) |
1285 | 560 | if de.get("confirm"): | 560 | if de.get("confirm"): |
1286 | 561 | res.append(de.get('confirm').encode("utf8")) | 561 | res.append(de.get('confirm').encode("utf8")) |
1287 | 562 | if de.get("help"): | ||
1288 | 563 | res.append(de.get('help').encode("utf8")) | ||
1289 | 562 | if de.tag == 'translate': | 564 | if de.tag == 'translate': |
1290 | 563 | text_to_translate = '' | 565 | text_to_translate = '' |
1291 | 564 | if de.text: | 566 | if de.text: |