Merge lp:~julie-w/unifield-server/US-1520 into lp:unifield-server/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
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+314722@code.launchpad.net
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

lp:~fabien-morin/unifield-server/fm-us-2047

4124. By jftempo

US-1822 [FIX] Unreconciliation: allow to unreconcile manually reconciled system JIs

lp:~julie-w/unifield-server/US-1822

4123. By jftempo

US-1900 [FIX] View translation when a node have multiplte attributes + export/translate help msg

lp:~fabien-morin/unifield-server/fm-fix-orm-translation

4122. By jftempo

US-1571 [IMP] Delivery Orders: new "Draft" search button

lp:~mallorymarcot/unifield-server/us-1571

4121. By jftempo

US-1694 [FIX] Comparison RFQ report: fix currency

lp:~unifield-team/unifield-server/us-1694

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

lp:~unifield-team/unifield-server/us-1743

4118. By jftempo

US-1773 [IMP] Reconciliation must include at least one debit and one credit

lp:~julie-w/unifield-server/US-1773

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/account_override/account_move_line.py'
--- bin/addons/account_override/account_move_line.py 2016-11-24 15:02:51 +0000
+++ bin/addons/account_override/account_move_line.py 2017-01-13 16:35:52 +0000
@@ -484,7 +484,13 @@
484 context = {}484 context = {}
485 if context.get('from_web_menu', False):485 if context.get('from_web_menu', False):
486 for ml in self.browse(cr, uid, ids):486 for ml in self.browse(cr, uid, ids):
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
488 # (manual / auto) instead of the JI one
489 if 'unreconcile_date' in vals and vals['unreconcile_date']:
490 reconciliation = ml.reconcile_id or ml.reconcile_partial_id or False
491 if reconciliation and reconciliation.type == 'auto':
492 raise osv.except_osv(_('Warning'), _('Only manually reconciled entries can be unreconciled.'))
493 elif ml.move_id and ml.move_id.status == 'sys':
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!'))
489 # Check date validity with period495 # Check date validity with period
490 self._check_date_validity(cr, uid, ids, vals)496 self._check_date_validity(cr, uid, ids, vals)
491497
=== modified file 'bin/addons/account_override/finance_export.py'
--- bin/addons/account_override/finance_export.py 2016-01-20 10:18:19 +0000
+++ bin/addons/account_override/finance_export.py 2017-01-13 16:35:52 +0000
@@ -56,9 +56,13 @@
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.
57 """57 """
5858
59 def __init__(self, sql, process):59 def __init__(self, sql, process, context):
60 self.sqlrequests = sql60 self.sqlrequests = sql
61 self.processrequests = process61 self.processrequests = process
62 if 'background_id' in context:
63 self.bg_id = context['background_id']
64 else:
65 self.bg_id = None
6266
63 def line_to_utf8(self, line):67 def line_to_utf8(self, line):
64 """68 """
@@ -183,6 +187,14 @@
183 # - filename187 # - filename
184 # - key of sqlrequests dict to fetch its SQL request188 # - key of sqlrequests dict to fetch its SQL request
185 files = {}189 files = {}
190
191 if self.bg_id:
192 bg_report_obj = pool.get('memory.background.report')
193 else:
194 bg_report_obj = None
195
196 request_count = 0
197
186 for fileparams in self.processrequests:198 for fileparams in self.processrequests:
187 if not fileparams.get('filename', False):199 if not fileparams.get('filename', False):
188 raise osv.except_osv(_('Error'), _('Filename param is missing!'))200 raise osv.except_osv(_('Error'), _('Filename param is missing!'))
@@ -256,6 +268,13 @@
256 if filename not in files:268 if filename not in files:
257 files[filename] = tmp_file269 files[filename] = tmp_file
258270
271 if bg_report_obj:
272 request_count += 1
273 percent = request_count / float(len(self.processrequests) + 1) # add 1
274 # to the total because task is not finish at the end of the for
275 # loop, there is some ZIP work to do
276 bg_report_obj.update_percent(cr, uid, [self.bg_id], percent)
277
259 # WRITE RESULT INTO AN ARCHIVE278 # WRITE RESULT INTO AN ARCHIVE
260 # Create a ZIP file279 # Create a ZIP file
261 out_zipfile = zipfile.ZipFile(zip_buffer, "w")280 out_zipfile = zipfile.ZipFile(zip_buffer, "w")
262281
=== modified file 'bin/addons/account_reconciliation/wizard/account_reconcile.py'
--- bin/addons/account_reconciliation/wizard/account_reconcile.py 2016-10-04 10:11:04 +0000
+++ bin/addons/account_reconciliation/wizard/account_reconcile.py 2017-01-13 16:35:52 +0000
@@ -24,7 +24,6 @@
24from osv import osv24from osv import osv
25from osv import fields25from osv import fields
26from tools.translate import _26from tools.translate import _
27import time
28from collections import defaultdict27from collections import defaultdict
2928
30class account_move_line_reconcile(osv.osv_memory):29class account_move_line_reconcile(osv.osv_memory):
@@ -33,8 +32,8 @@
3332
34 _columns = {33 _columns = {
35 'state': fields.selection([('total', 'Full Reconciliation'), ('partial', 'Partial Reconciliation'), 34 'state': fields.selection([('total', 'Full Reconciliation'), ('partial', 'Partial Reconciliation'),
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",
37 required=True, readonly=True),36 required=True, readonly=True),
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)'),
39 }38 }
4039
@@ -145,7 +144,13 @@
145 state = 'total_change'144 state = 'total_change'
146 currency_id = False145 currency_id = False
147 currency2_id = False146 currency2_id = False
147 rec_partial_set = set()
148 rec_partial_leg_nb = 0
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):
150 # for partially reconciled lines: store the different partial reconciliation ids and the total nb of legs
151 if line.reconcile_partial_id:
152 rec_partial_leg_nb += 1
153 rec_partial_set.add(line.reconcile_partial_id.id)
149 # prepare some values154 # prepare some values
150 account_id = line.account_id.id155 account_id = line.account_id.id
151 # some verifications156 # some verifications
@@ -166,9 +171,9 @@
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"
167 if not transfer and not disregard_third_party:172 if not transfer and not disregard_third_party:
168 third_party = {173 third_party = {
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,
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,
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}
172 if not prev_third_party:177 if not prev_third_party:
173 prev_third_party = third_party178 prev_third_party = third_party
174 if prev_third_party != third_party:179 if prev_third_party != third_party:
@@ -186,8 +191,27 @@
186 debit += line.debit_currency191 debit += line.debit_currency
187 fcredit += line.credit192 fcredit += line.credit
188 fdebit += line.debit193 fdebit += line.debit
194
195 diff_in_booking = abs(debit - credit)
196 # (US-1847) If we reconcile together entries from at least 2 different partial reconciliations:
197 # - the reconciliation must be total
198 # - all the legs of the partial reconciliations must be included
199 if len(rec_partial_set) > 1:
200 if diff_in_booking > 10**-3:
201 raise osv.except_osv(_('Error'), _('Only full reconciliation is allowed when entries from two (or more)'
202 ' different partial reconciliations are included.'))
203 elif rec_partial_leg_nb != account_move_line_obj.search(cr, uid,
204 [('reconcile_partial_id', 'in', list(rec_partial_set))],
205 count=True, order='NO_ORDER', context=context):
206 raise osv.except_osv(_('Error'),
207 _('When entries from different partial reconciliations are reconciled together, '
208 'all the legs of these partial reconciliations must be included.'))
209
210 if debit <= 10**-3 or credit <= 10**-3:
211 raise osv.except_osv(_('Error'), _('Both Debit and Credit lines are required for reconciliation.'))
212
189 # Adapt state value213 # Adapt state value
190 if abs(debit - credit) <= 10**-3:214 if diff_in_booking <= 10**-3:
191 state = 'total'215 state = 'total'
192 if transfer_with_change:216 if transfer_with_change:
193 debit = fdebit217 debit = fdebit
194218
=== modified file 'bin/addons/base/ir/ir_attachment.py'
--- bin/addons/base/ir/ir_attachment.py 2016-11-24 14:41:24 +0000
+++ bin/addons/base/ir/ir_attachment.py 2017-01-13 16:35:52 +0000
@@ -442,12 +442,12 @@
442442
443 _columns = {443 _columns = {
444 'name': fields.char('Path to save the attachments to', size=256,444 'name': fields.char('Path to save the attachments to', size=256,
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.",
446 required=True),446 required=True),
447 'next_migration' : fields.datetime('Next migration date',447 'next_migration' : fields.datetime('Next migration date',
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"),
449 'migration_date': fields.datetime('Last migration execution date', readonly=True),449 'migration_date': fields.datetime('Last migration execution date', readonly=True),
450 'migration_error': fields.text('Migration error', readonly=True),450 'migration_error': fields.text('Migration errors', readonly=True),
451 'is_migration_running': fields.function(_is_migration_running,451 'is_migration_running': fields.function(_is_migration_running,
452 type='boolean', string='Moving files...', method=True,452 type='boolean', string='Moving files...', method=True,
453 readonly=True),453 readonly=True),
@@ -614,7 +614,7 @@
614 'numbercall': 1,614 'numbercall': 1,
615 'active': True,615 'active': True,
616 }616 }
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)
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)
619619
620attachment_config()620attachment_config()
621621
=== modified file 'bin/addons/finance/account_view.xml'
--- bin/addons/finance/account_view.xml 2016-09-28 08:20:24 +0000
+++ bin/addons/finance/account_view.xml 2017-01-13 16:35:52 +0000
@@ -71,7 +71,7 @@
71 <group colspan="4" col="6">71 <group colspan="4" col="6">
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}"/>
73 <field name="name" readonly="1"/>73 <field name="name" readonly="1"/>
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')]"/>
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)]}"/>
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)]}"/>
7777
7878
=== modified file 'bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako'
--- bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2016-06-13 07:41:13 +0000
+++ bin/addons/msf_doc_import/report/po_simulation_screen_xls_report.mako 2017-01-13 16:35:52 +0000
@@ -139,7 +139,7 @@
139 % else:139 % else:
140 <Cell ss:StyleID="line" ></Cell>140 <Cell ss:StyleID="line" ></Cell>
141 % endif141 % endif
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:
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>
144 % elif o.imp_ready_to_ship_date not in ('False', False):144 % elif o.imp_ready_to_ship_date not in ('False', False):
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>
@@ -155,7 +155,7 @@
155 % else:155 % else:
156 <Cell ss:StyleID="line" ></Cell>156 <Cell ss:StyleID="line" ></Cell>
157 % endif157 % endif
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:
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>
160 % elif o.imp_shipment_date not in ('False', False):160 % elif o.imp_shipment_date not in ('False', False):
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>
162162
=== modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py'
--- bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2016-11-09 09:07:38 +0000
+++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2017-01-13 16:35:52 +0000
@@ -155,10 +155,6 @@
155 'return to IN form view and re-try.'),155 'return to IN form view and re-try.'),
156 )156 )
157157
158 self.write(cr, uid, [proc.id], {
159 'already_processed': True,
160 }, context=context)
161
162 for line in proc.move_ids:158 for line in proc.move_ids:
163 # If one line as an error, return to wizard159 # If one line as an error, return to wizard
164 if line.integrity_status != 'empty':160 if line.integrity_status != 'empty':
@@ -172,6 +168,10 @@
172 'context': context,168 'context': context,
173 }169 }
174170
171 self.write(cr, uid, [proc.id], {
172 'already_processed': True,
173 }, context=context)
174
175 for line in proc.move_ids:175 for line in proc.move_ids:
176 # if no quantity, don't process the move176 # if no quantity, don't process the move
177 if not line.quantity:177 if not line.quantity:
@@ -318,7 +318,16 @@
318 _('Processing Error'),318 _('Processing Error'),
319 _('No data to process !'),319 _('No data to process !'),
320 )320 )
321 incoming_obj.write(cr, uid, ids, {'draft': True}, context=context)321
322 # make sure that the current incoming proc is not already processed :
323 for r in incoming_obj.read(cr, uid, ids, ['already_processed']):
324 if not r['already_processed']:
325 incoming_obj.write(cr, uid, ids, {'draft': True}, context=context)
326 else:
327 raise osv.except_osv(
328 _('Error'), _('The incoming shipment has already been processed, you cannot save it as draft.')
329 )
330
322 return {}331 return {}
323332
324 def force_process(self, cr, uid, ids, context=None):333 def force_process(self, cr, uid, ids, context=None):
325334
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2016-12-07 06:47:50 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2017-01-13 16:35:52 +0000
@@ -75286,16 +75286,61 @@
75286msgstr "Dossier d'enregistrement des pièces jointes"75286msgstr "Dossier d'enregistrement des pièces jointes"
7528775287
75288#. module: base75288#. module: base
75289#: help:attachment.config,name:075289#: field:attachment.config,next_migration:444
75290msgid "The complet path to the local folder where Unifield will save attachment files."75290msgid "Next migration date"
75291msgstr "Date de la prochaine migration"
75292
75293#. module: base
75294#: help:attachment.config,name:445
75295msgid "The complete path to the local folder where Unifield will save attachment files."
75291msgstr "Dossier dans lequel les pièces jointes seront stockées."75296msgstr "Dossier dans lequel les pièces jointes seront stockées."
7529275297
75293#. module: base75298#. module: base
75299#: help:attachment.config,next_migration:448
75300msgid "Next planned execution of the migration to move the old attachment to the path defined"
75301msgstr "Prochaine execution planifiée de migration pour déplacer les anciènes pièces jointes vers le nouveau chemin défini."
75302
75303#. module: base
75304#: field:attachment.config,migration_date:449
75305msgid "Last migration execution date"
75306msgstr "Date de la dernière migration"
75307
75308#. module: base
75309#: field:attachment.config,migration_error:450
75310msgid "Migration errors"
75311msgstr "Erreurs de migration"
75312
75313#. module: base
75314#: field:attachment.config,is_migration_running:452
75315msgid "Moving files..."
75316msgstr "Déplacement des fichiers..."
75317
75318#. module: base
75319#: field:attachment.config,moving_rate:454
75320msgid "Moving process"
75321msgstr "Avancement du déplacement"
75322
75323#. module: base
75324#: constraint:attachment.config:469
75325msgid "You cannot have more than one Attachment configuration"
75326msgstr "Vous ne pouvez pas avoir plus d'une configuration de pièces jointes"
75327
75328#. module: base
75294#: view:attachment.config:075329#: view:attachment.config:0
75295#: model:ir.model,name:base.model_attachment_config75330#: model:ir.model,name:base.model_attachment_config
75296msgid "Attachment configuration"75331msgid "Attachment configuration"
75297msgstr "Configuration des pièces jointes"75332msgstr "Configuration des pièces jointes"
7529875333
75334#. module: base
75335#: view:attachment.config:0
75336msgid "Old attachments migration"
75337msgstr "Migration des anciennes pièces jointes"
75338
75339#. module: base
75340#: view:attachment.config:0
75341msgid "Migrate old attachement to store them in local file system"
75342msgstr "Migrer les anciennes pièces jointes pour les stocker sur le système de fichier local"
75343
75299#. module: board75344#. module: board
75300#: code:addons/board/queries_finance.py:1175345#: code:addons/board/queries_finance.py:11
75301#: code:addons/board/queries_finance.py:3075346#: code:addons/board/queries_finance.py:30
@@ -75769,3 +75814,37 @@
75769msgid "Partner Created on this instance"75814msgid "Partner Created on this instance"
75770msgstr "Partenaire créé sur cette instance"75815msgstr "Partenaire créé sur cette instance"
7577175816
75817#. module: account_reconciliation
75818#: code:addons/account_reconciliation/wizard/account_reconcile.py:207
75819#, python-format
75820msgid "When entries from different partial reconciliations are reconciled together, all the legs of these partial reconciliations must be included."
75821msgstr "Lorsque des entrées de différents lettrages partiels sont lettrées ensemble, toutes les lignes de ces lettrage partiels doivent être incluses."
75822
75823#. module: account_reconciliation
75824#: code:addons/account_reconciliation/wizard/account_reconcile.py:201
75825#, python-format
75826msgid "Only full reconciliation is allowed when entries from two (or more) different partial reconciliations are included."
75827msgstr "Seul un lettrage complet est autorisé lorsque des entrées de deux lettrages partiels différents (ou plus) sont incluses."
75828
75829#. module: account_reconciliation
75830#: code:addons/account_reconciliation/wizard/account_reconcile.py:190
75831#, python-format
75832msgid "Both Debit and Credit lines are required for reconciliation."
75833msgstr "Un lettrage requiert à la fois des lignes en débit et en crédit."
75834
75835#. module: msf_outgoing
75836#: code:addons/msf_outgoing/wizard/incoming_shipment_processor.py:328
75837#, python-format
75838msgid "The incoming shipment has already been processed, you cannot save it as draft."
75839msgstr "La livraison a déjà été traitée, vous ne pouvez pas la sauvegarder en brouillon."
75840
75841#. module: stock
75842#: view:stock.picking:0
75843msgid "Delivery orders which are in draft state"
75844msgstr "Bons de livraison dans l'état brouillon"
75845
75846#. module: account_override
75847#: code:addons/account_override/account_move_line.py:491
75848#, python-format
75849msgid "Only manually reconciled entries can be unreconciled."
75850msgstr "Seules les entrées lettrées manuellement peuvent être délettrées."
7577275851
=== modified file 'bin/addons/order_types/stock.py'
--- bin/addons/order_types/stock.py 2016-05-17 12:12:38 +0000
+++ bin/addons/order_types/stock.py 2017-01-13 16:35:52 +0000
@@ -192,7 +192,7 @@
192 if new_ids:192 if new_ids:
193 stock_move_obj = self.pool.get('stock.move')193 stock_move_obj = self.pool.get('stock.move')
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'],
195 context=context)195 context=context)
196 for move_line_dict in move_line_read_list:196 for move_line_dict in move_line_read_list:
197 stock_move_ids = move_line_dict['move_lines']197 stock_move_ids = move_line_dict['move_lines']
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),
@@ -200,7 +200,7 @@
200 ('donation_exp',200 ('donation_exp',
201 'donation_st',201 'donation_st',
202 'in_kind')),202 'in_kind')),
203 ], context=context):203 ], context=context):
204 res[move_line_dict['id']] = True204 res[move_line_dict['id']] = True
205 return res205 return res
206206
@@ -227,12 +227,12 @@
227 for picking in self.browse(cr, uid, ids):227 for picking in self.browse(cr, uid, ids):
228 for move in picking.move_lines:228 for move in picking.move_lines:
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,
230 'product_id': move.product_id.id,230 'product_id': move.product_id.id,
231 'qty': move.product_qty,231 'qty': move.product_qty,
232 'print_id': print_id,232 'print_id': print_id,
233 'move_id': move.id,233 'move_id': move.id,
234 'prodlot_id': move.prodlot_id.id,234 'prodlot_id': move.prodlot_id.id,
235 'unit_price': move.product_id.list_price})235 'unit_price': move.product_id.list_price})
236236
237 return {'type': 'ir.actions.act_window',237 return {'type': 'ir.actions.act_window',
238 'res_model': 'stock.print.certificate',238 'res_model': 'stock.print.certificate',
@@ -296,7 +296,7 @@
296296
297 if certif and not context.get('attach_ok', False):297 if certif and not context.get('attach_ok', False):
298 partial_id = self.pool.get("stock.certificate.picking").create(298 partial_id = self.pool.get("stock.certificate.picking").create(
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))
300 return {'name':_("Attach a certificate of donation"),300 return {'name':_("Attach a certificate of donation"),
301 'view_mode': 'form',301 'view_mode': 'form',
302 'view_id': False,302 'view_id': False,
@@ -326,10 +326,8 @@
326326
327 # US-148327 # US-148
328 if pick.type == 'in':328 if pick.type == 'in':
329 args = [('picking_id', '=', pick.id),329 domain = [('picking_id', '=', pick.id), ('draft', '=', True), ('already_processed', '=', False)]
330 ('draft', '=', True)]330 wiz_ids = wizard_obj.search(cr, uid, domain, context=context)
331 wiz_ids = wizard_obj.search(cr, uid, args=args,
332 context=context)
333 if wiz_ids:331 if wiz_ids:
334 proc_id = wiz_ids[0]332 proc_id = wiz_ids[0]
335 else:333 else:
@@ -349,13 +347,13 @@
349 'view_type': 'form',347 'view_type': 'form',
350 'view_mode': 'form',348 'view_mode': 'form',
351 'target': 'new',349 'target': 'new',
352 }350 }
353351
354 if not context.get('force_process', False) and pick.type == 'in' \352 if not context.get('force_process', False) and pick.type == 'in' \
355 and not pick.in_dpo \353 and not pick.in_dpo \
356 and pick.state != 'shipped' and pick.partner_id.partner_type == 'internal':354 and pick.state != 'shipped' and pick.partner_id.partner_type == 'internal':
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,
358 'msf_outgoing', 'stock_incoming_processor_internal_warning_form_view')[1]356 'msf_outgoing', 'stock_incoming_processor_internal_warning_form_view')[1]
359 res['view_id'] = [view_id]357 res['view_id'] = [view_id]
360358
361 return res359 return res
362360
=== modified file 'bin/addons/purchase_override/report/merged_order.rml'
--- bin/addons/purchase_override/report/merged_order.rml 2016-11-24 10:31:53 +0000
+++ bin/addons/purchase_override/report/merged_order.rml 2017-01-13 16:35:52 +0000
@@ -341,7 +341,7 @@
341 </tr>341 </tr>
342 <tr>342 <tr>
343 <td>343 <td>
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>
345 </td>345 </td>
346 <td>346 <td>
347 <para style="TextInformation"> </para>347 <para style="TextInformation"> </para>
348348
=== modified file 'bin/addons/purchase_override/report/purchase_order.rml'
--- bin/addons/purchase_override/report/purchase_order.rml 2016-11-09 08:10:08 +0000
+++ bin/addons/purchase_override/report/purchase_order.rml 2017-01-13 16:35:52 +0000
@@ -343,7 +343,7 @@
343 </tr>343 </tr>
344 <tr>344 <tr>
345 <td>345 <td>
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>
347 </td>347 </td>
348 <td>348 <td>
349 <para style="TextInformation"> </para>349 <para style="TextInformation"> </para>
350350
=== modified file 'bin/addons/stock/stock_view.xml'
--- bin/addons/stock/stock_view.xml 2016-02-18 15:39:31 +0000
+++ bin/addons/stock/stock_view.xml 2017-01-13 16:35:52 +0000
@@ -1024,8 +1024,9 @@
1024 <field name="arch" type="xml">1024 <field name="arch" type="xml">
1025 <search string="Picking list">1025 <search string="Picking list">
1026 <group col="8" colspan="4">1026 <group col="8" colspan="4">
1027 <filter icon="terp-document-new" name="draft" string="Draft" domain="[('state', 'in', ['draft'])]" help="Delivery orders which are in draft state" />
1028 <filter icon="terp-camera_test" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Delivery Orders"/>
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"/>
1028 <filter icon="terp-camera_test" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Delivery Orders"/>
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"/>
1030 <separator orientation="vertical"/>1031 <separator orientation="vertical"/>
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"/>
10321033
=== modified file 'bin/addons/supplier_catalogue/product.py'
--- bin/addons/supplier_catalogue/product.py 2016-08-18 08:32:03 +0000
+++ bin/addons/supplier_catalogue/product.py 2017-01-13 16:35:52 +0000
@@ -30,7 +30,7 @@
30class product_supplierinfo(osv.osv):30class product_supplierinfo(osv.osv):
31 _name = 'product.supplierinfo'31 _name = 'product.supplierinfo'
32 _inherit = 'product.supplierinfo'32 _inherit = 'product.supplierinfo'
33 33
34 def unlink(self, cr, uid, info_ids, context=None):34 def unlink(self, cr, uid, info_ids, context=None):
35 '''35 '''
36 Disallow the possibility to remove a supplier info if 36 Disallow the possibility to remove a supplier info if
@@ -43,45 +43,45 @@
43 context = {}43 context = {}
44 if isinstance(info_ids, (int, long)):44 if isinstance(info_ids, (int, long)):
45 info_ids = [info_ids]45 info_ids = [info_ids]
46 46
47 for info in self.browse(cr, uid, info_ids, context=context):47 for info in self.browse(cr, uid, info_ids, context=context):
48 if info.catalogue_id and not context.get('product_change', False):48 if info.catalogue_id and not context.get('product_change', False):
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 ' \
50 'to a supplier catalogue line ! Please remove the corresponding ' \50 'to a supplier catalogue line ! Please remove the corresponding ' \
51 'supplier catalogue line to remove this supplier information.'))51 'supplier catalogue line to remove this supplier information.'))
52 52
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)
54 54
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):
56 if not context:56 if not context:
57 context = {}57 context = {}
58 58
59 new_res = [] 59 new_res = []
60 res = super(product_supplierinfo, self).search(cr, uid, args, offset, limit,60 res = super(product_supplierinfo, self).search(cr, uid, args, offset, limit,
61 order, context=context, count=count)61 order, context=context, count=count)
62 if count:62 if count:
63 return res63 return res
64 64
65 if isinstance(res, (int, long)):65 if isinstance(res, (int, long)):
66 res = [res]66 res = [res]
67 67
68 for r in self.browse(cr, uid, res, context=context):68 for r in self.browse(cr, uid, res, context=context):
69 if not r.catalogue_id or r.catalogue_id.active:69 if not r.catalogue_id or r.catalogue_id.active:
70 new_res.append(r.id)70 new_res.append(r.id)
71 71
72 return new_res72 return new_res
73 73
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):
75 '''75 '''
76 Return True if no catalogue associated76 Return True if no catalogue associated
77 '''77 '''
78 res = {}78 res = {}
79 79
80 for x in self.browse(cr, uid, ids, context=context):80 for x in self.browse(cr, uid, ids, context=context):
81 res[x.id] = True81 res[x.id] = True
82 if x.catalogue_id:82 if x.catalogue_id:
83 res[x.id] = False83 res[x.id] = False
84 84
85 return res85 return res
8686
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):
@@ -95,7 +95,7 @@
95 res[price.id] = (price.name and price.name.supplier_lt) or (product_id and int(product[0].procure_delay)) or 195 res[price.id] = (price.name and price.name.supplier_lt) or (product_id and int(product[0].procure_delay)) or 1
9696
97 return res97 return res
98 98
99 _columns = {99 _columns = {
100 'catalogue_id': fields.many2one('supplier.catalogue', string='Associated catalogue', ondelete='cascade'),100 'catalogue_id': fields.many2one('supplier.catalogue', string='Associated catalogue', ondelete='cascade'),
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'),
@@ -122,7 +122,7 @@
122122
123 return {'value': v}123 return {'value': v}
124124
125 125
126 # Override the original method126 # Override the original method
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):
128 """128 """
@@ -141,16 +141,16 @@
141 uom_id = context.get('uom', False) or product_pool.browse(cr, uid, product_id, context=context).uom_id.id141 uom_id = context.get('uom', False) or product_pool.browse(cr, uid, product_id, context=context).uom_id.id
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):
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,
144 currency_id, date, uom_id, context=context)144 currency_id, date, uom_id, context=context)
145 return res145 return res
146 146
147product_supplierinfo()147product_supplierinfo()
148148
149149
150class pricelist_partnerinfo(osv.osv):150class pricelist_partnerinfo(osv.osv):
151 _name = 'pricelist.partnerinfo'151 _name = 'pricelist.partnerinfo'
152 _inherit = 'pricelist.partnerinfo'152 _inherit = 'pricelist.partnerinfo'
153 153
154 def default_get(self, cr, uid, fields, context=None):154 def default_get(self, cr, uid, fields, context=None):
155 '''155 '''
156 Set automatically the currency of the line with the default156 Set automatically the currency of the line with the default
@@ -158,9 +158,9 @@
158 '''158 '''
159 if not context:159 if not context:
160 context = {}160 context = {}
161 161
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)
163 163
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)):
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)
166 res['currency_id'] = partner.property_product_pricelist_purchase.currency_id.id166 res['currency_id'] = partner.property_product_pricelist_purchase.currency_id.id
@@ -168,9 +168,9 @@
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)):
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'])
170 res['uom_id'] = read_partnerinfo['product_uom'][0]170 res['uom_id'] = read_partnerinfo['product_uom'][0]
171 171
172 return res172 return res
173 173
174 def unlink(self, cr, uid, info_id, context=None):174 def unlink(self, cr, uid, info_id, context=None):
175 '''175 '''
176 Disallow the possibility to remove a supplier pricelist 176 Disallow the possibility to remove a supplier pricelist
@@ -181,7 +181,7 @@
181 '''181 '''
182 if context is None:182 if context is None:
183 context = {}183 context = {}
184 184
185 if isinstance(info_id, (int, long)):185 if isinstance(info_id, (int, long)):
186 info_id = [info_id]186 info_id = [info_id]
187187
@@ -190,27 +190,27 @@
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 ' \
191 'to a supplier catalogue line ! Please remove the corresponding ' \191 'to a supplier catalogue line ! Please remove the corresponding ' \
192 'supplier catalogue line to remove this supplier information.'))192 'supplier catalogue line to remove this supplier information.'))
193 193
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)
195 195
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):
197 if not context:197 if not context:
198 context = {}198 context = {}
199 199
200 res = super(pricelist_partnerinfo, self).search(cr, uid, args, offset, limit,200 res = super(pricelist_partnerinfo, self).search(cr, uid, args, offset, limit,
201 order, context=context, count=count)201 order, context=context, count=count)
202202
203 if count:203 if count:
204 return res204 return res
205 205
206 new_res = []206 new_res = []
207 207
208 for r in self.browse(cr, uid, res, context=context):208 for r in self.browse(cr, uid, res, context=context):
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:
210 new_res.append(r.id)210 new_res.append(r.id)
211 211
212 return new_res212 return new_res
213 213
214 def _check_min_quantity(self, cr, uid, ids, context=None):214 def _check_min_quantity(self, cr, uid, ids, context=None):
215 '''215 '''
216 Check if the min_qty field is set216 Check if the min_qty field is set
@@ -226,7 +226,7 @@
226 if line.min_quantity <= 0.00:226 if line.min_quantity <= 0.00:
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)
228 return False228 return False
229 229
230 return True230 return True
231231
232 def _get_supplierinfo(self, cr, uid, ids, context=None):232 def _get_supplierinfo(self, cr, uid, ids, context=None):
@@ -254,7 +254,7 @@
254 'sequence': fields.function(_get_sequence, method=True, string='Sequence', type='integer',254 'sequence': fields.function(_get_sequence, method=True, string='Sequence', type='integer',
255 store={'pricelist.partnerinfo': (lambda self, cr, uid, ids, c={}: ids, [], 20),255 store={'pricelist.partnerinfo': (lambda self, cr, uid, ids, c={}: ids, [], 20),
256 'product.supplierinfo': (_get_supplierinfo, ['sequence'], 20),256 'product.supplierinfo': (_get_supplierinfo, ['sequence'], 20),
257 })257 })
258 }258 }
259259
260 def create(self, cr, uid, vals, context=None):260 def create(self, cr, uid, vals, context=None):
@@ -285,15 +285,15 @@
285class product_product(osv.osv):285class product_product(osv.osv):
286 _name = 'product.product'286 _name = 'product.product'
287 _inherit = 'product.product'287 _inherit = 'product.product'
288 288
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,
290 order_date, product_uom_id, context=None):290 order_date, product_uom_id, context=None):
291 '''291 '''
292 Returns the pricelist_information from product form292 Returns the pricelist_information from product form
293 '''293 '''
294 if not context:294 if not context:
295 context = {}295 context = {}
296 296
297 partner_price = self.pool.get('pricelist.partnerinfo')297 partner_price = self.pool.get('pricelist.partnerinfo')
298 info_prices = []298 info_prices = []
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)
@@ -304,18 +304,18 @@
304 ('valid_from', '=', False),304 ('valid_from', '=', False),
305 '|', ('valid_till', '>=', order_date),305 '|', ('valid_till', '>=', order_date),
306 ('valid_till', '=', False)]306 ('valid_till', '=', False)]
307 307
308 domain_cur = [('currency_id', '=', currency_id)]308 domain_cur = [('currency_id', '=', currency_id)]
309 domain_cur.extend(domain)309 domain_cur.extend(domain)
310 310
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)
312 if not info_prices:312 if not info_prices:
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)
314 314
315 return info_prices315 return info_prices
316 316
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,
318 order_date, product_uom_id, context=None):318 order_date, product_uom_id, context=None):
319 '''319 '''
320 Search the good partner price line for products320 Search the good partner price line for products
321 '''321 '''
@@ -323,29 +323,27 @@
323 one_product = False323 one_product = False
324 cur_obj = self.pool.get('res.currency')324 cur_obj = self.pool.get('res.currency')
325 partner_price = self.pool.get('pricelist.partnerinfo')325 partner_price = self.pool.get('pricelist.partnerinfo')
326 suppinfo_obj = self.pool.get('product.supplierinfo')
327 prod_obj = self.pool.get('product.product')326 prod_obj = self.pool.get('product.product')
328 catalogue_obj = self.pool.get('supplier.catalogue')327
329
330 if not context:328 if not context:
331 context = {}329 context = {}
332 330
333 if isinstance(product_ids, (int, long)):331 if isinstance(product_ids, (int, long)):
334 one_product = product_ids332 one_product = product_ids
335 product_ids = [product_ids]333 product_ids = [product_ids]
336 334
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):
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,
339 order_date, product_uom_id, context=context)337 order_date, product_uom_id, context=context)
340 338
341 if info_prices:339 if info_prices:
342 # info = partner_price.browse(cr, uid, info_price, context=context)[0]340 # info = partner_price.browse(cr, uid, info_price, context=context)[0]
343 info = partner_price.browse(cr, uid, info_prices[0], context=context)341 info = partner_price.browse(cr, uid, info_prices[0], context=context)
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)
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)
346 else:344 else:
347 res[product.id] = (False, 1.0, 1.0)345 res[product.id] = (False, 1.0, 1.0)
348 346
349 return not one_product and res or res[one_product]347 return not one_product and res or res[one_product]
350348
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):
@@ -371,51 +369,70 @@
371 res[product.id] = list(catalogue_ids)369 res[product.id] = list(catalogue_ids)
372370
373 return res371 return res
374 372
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):
376 '''374 '''
377 Filter the search according to the args parameter375 Filter the search according to the args parameter
378 '''376 '''
379 # Objects
380 catalogue_obj = self.pool.get('supplier.catalogue')377 catalogue_obj = self.pool.get('supplier.catalogue')
381378
382 context = context is None and {} or context379 if context is None:
383 ids = set()380 context = {}
381 product_id_list = []
384382
385 for arg in args:383 for arg in args:
386 if arg[0] == 'catalogue_ids' and arg[1] == '=' and arg[2]:384 if arg[0] == 'catalogue_ids' and arg[1] == '=':
387 catalogue = catalogue_obj.browse(cr, uid, int(arg[2]), context=context)385 catalogue_list = [int(arg[2])]
388 for line in catalogue.line_ids:386 elif arg[0] == 'catalogue_ids' and arg[1] == 'in':
389 ids.add(line.product_id.id)387 catalogue_list = arg[2]
390 elif arg[0] == 'catalogue_ids' and arg[1] == 'in' and arg[2]:388 elif arg[0] == 'catalogue_ids' and arg[1] == 'ilike':
391 for catalogue in catalogue_obj.browse(cr, uid, arg[2], context=context):389 name_search = arg[2]
392 for line in catalogue.line_ids:390 catalogue_list = catalogue_obj.search(cr, uid, [('name', 'ilike', name_search)],
393 ids.add(line.product_id.id)391 context=context)
392 if not catalogue_list:
393 return []
394 else:394 else:
395 return []395 return []
396396
397 return [('id', 'in', list(ids))]397 catalog_lines_result = catalogue_obj.read(cr, uid, catalogue_list,
398 ['line_ids'], context)
399 catalog_line_ids_list = []
400 for catalog in catalog_lines_result:
401 catalog_line_ids_list.extend(catalog['line_ids'])
402
403 total_lines = len(catalog_line_ids_list)
404 start_chunk = 0
405 chunk_size = 500
406 while start_chunk < total_lines:
407 ids_chunk = catalog_line_ids_list[start_chunk:start_chunk+chunk_size]
408 cr.execute("""SELECT scl.product_id
409 FROM supplier_catalogue_line as scl
410 WHERE scl.id in %s""", (tuple(ids_chunk),))
411 current_res = [x[0] for x in cr.fetchall() if x]
412 product_id_list.extend(current_res)
413 start_chunk += chunk_size
414 return [('id', 'in', product_id_list)]
398415
399 _columns = {416 _columns = {
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,
401 type='many2many', relation='supplier.catalogue', method=True, string='Catalogues'),418 type='many2many', relation='supplier.catalogue', method=True, string='Catalogues'),
402 }419 }
403 420
404product_product()421product_product()
405422
406423
407class product_pricelist(osv.osv):424class product_pricelist(osv.osv):
408 _name = 'product.pricelist'425 _name = 'product.pricelist'
409 _inherit = 'product.pricelist'426 _inherit = 'product.pricelist'
410 427
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):
412 res = {}429 res = {}
413 430
414 for id in ids:431 for id in ids:
415 res[id] = True432 res[id] = True
416 433
417 return res434 return res
418 435
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):
420 '''437 '''
421 Returns pricelists according to partner type438 Returns pricelists according to partner type
@@ -423,7 +440,7 @@
423 user_obj = self.pool.get('res.users')440 user_obj = self.pool.get('res.users')
424 cur_obj = self.pool.get('res.currency')441 cur_obj = self.pool.get('res.currency')
425 dom = []442 dom = []
426 443
427 for arg in args:444 for arg in args:
428 if arg[0] == 'in_search':445 if arg[0] == 'in_search':
429 if arg[1] != '=':446 if arg[1] != '=':
@@ -438,42 +455,42 @@
438 elif arg[2] == 'esc':455 elif arg[2] == 'esc':
439 currency_ids = cur_obj.search(cr, uid, [('is_esc_currency', '=', True)])456 currency_ids = cur_obj.search(cr, uid, [('is_esc_currency', '=', True)])
440 dom.append(('currency_id', 'in', currency_ids))457 dom.append(('currency_id', 'in', currency_ids))
441 458
442 return dom459 return dom
443 460
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):
445 '''462 '''
446 Return the name of the related currency463 Return the name of the related currency
447 ''' 464 '''
448 res = {}465 res = {}
449 466
450 for p_list in self.browse(cr, uid, ids, context=context):467 for p_list in self.browse(cr, uid, ids, context=context):
451 res[p_list.id] = False468 res[p_list.id] = False
452 if p_list.currency_id:469 if p_list.currency_id:
453 res[p_list.id] = p_list.currency_id.currency_name470 res[p_list.id] = p_list.currency_id.currency_name
454 471
455 return res472 return res
456 473
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):
458 '''475 '''
459 Return the list corresponding to the currency name476 Return the list corresponding to the currency name
460 '''477 '''
461 dom = []478 dom = []
462 479
463 for arg in args:480 for arg in args:
464 if arg[0] == 'currency_name':481 if arg[0] == 'currency_name':
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)
466 dom.append(('currency_id', 'in', currency_ids))483 dom.append(('currency_id', 'in', currency_ids))
467 484
468 return dom485 return dom
469 486
470 487
471 _columns = {488 _columns = {
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,
473 type='boolean', string='In search'),490 type='boolean', string='In search'),
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'),
475 }492 }
476 493
477 def _hook_product_partner_price(self, cr, uid, *args, **kwargs):494 def _hook_product_partner_price(self, cr, uid, *args, **kwargs):
478 '''495 '''
479 Rework the computation of price from partner section in product form496 Rework the computation of price from partner section in product form
@@ -490,13 +507,13 @@
490 if not partner and 'partner_id' in context:507 if not partner and 'partner_id' in context:
491 partner = context.get('partner_id', False)508 partner = context.get('partner_id', False)
492 uom_price_already_computed = kwargs['uom_price_already_computed']509 uom_price_already_computed = kwargs['uom_price_already_computed']
493 510
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,
495 date, uom, context=context)512 date, uom, context=context)
496 uom_price_already_computed = 1513 uom_price_already_computed = 1
497 514
498 return price, uom_price_already_computed515 return price, uom_price_already_computed
499 516
500 def name_get(self, cr, user, ids, context=None):517 def name_get(self, cr, user, ids, context=None):
501 '''518 '''
502 Display the currency name instead of the pricelist name519 Display the currency name instead of the pricelist name
@@ -507,7 +524,7 @@
507 txt = pp.currency_id.name524 txt = pp.currency_id.name
508 res += [(pp.id, txt)]525 res += [(pp.id, txt)]
509 return res526 return res
510 527
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):
512 '''529 '''
513 Search pricelist by currency name instead of pricelist name530 Search pricelist by currency name instead of pricelist name
@@ -515,12 +532,12 @@
515 ids = []532 ids = []
516 if name:533 if name:
517 currency_ids = self.pool.get('res.currency').search(cr, uid,534 currency_ids = self.pool.get('res.currency').search(cr, uid,
518 [('name', operator, name)], order='NO_ORDER', context=context)535 [('name', operator, name)], order='NO_ORDER', context=context)
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 []))
520 537
521 return self.name_get(cr, uid, ids) 538 return self.name_get(cr, uid, ids)
522 539
523 540
524product_pricelist()541product_pricelist()
525542
526class res_currency(osv.osv):543class res_currency(osv.osv):
@@ -550,21 +567,21 @@
550 po_currency_id = price_obj.browse(cr, uid, arg[2]).currency_id.id567 po_currency_id = price_obj.browse(cr, uid, arg[2]).currency_id.id
551 dom.append(('id', 'in', [func_currency_id, po_currency_id]))568 dom.append(('id', 'in', [func_currency_id, po_currency_id]))
552 return dom569 return dom
553 570
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):
555 res = {}572 res = {}
556 for id in ids:573 for id in ids:
557 res[id] = True574 res[id] = True
558 575
559 return res576 return res
560 577
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):
562 '''579 '''
563 Returns currencies according to partner type580 Returns currencies according to partner type
564 '''581 '''
565 user_obj = self.pool.get('res.users')582 user_obj = self.pool.get('res.users')
566 dom = []583 dom = []
567 584
568 for arg in args:585 for arg in args:
569 if arg[0] == 'partner_currency':586 if arg[0] == 'partner_currency':
570 if arg[1] != '=':587 if arg[1] != '=':
@@ -578,14 +595,14 @@
578 dom.append(('is_section_currency', '=', True))595 dom.append(('is_section_currency', '=', True))
579 elif partner.partner_type == 'esc':596 elif partner.partner_type == 'esc':
580 dom.append(('is_esc_currency', '=', True))597 dom.append(('is_esc_currency', '=', True))
581 598
582 return dom599 return dom
583600
584 _columns = {601 _columns = {
585 'is_section_currency': fields.boolean(string='Functional currency', 602 'is_section_currency': fields.boolean(string='Functional currency',
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.'),
587 'is_esc_currency': fields.boolean(string='ESC currency', 604 'is_esc_currency': fields.boolean(string='ESC currency',
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.'),
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,
590 type='boolean', string='transport PO currencies'),607 type='boolean', string='transport PO currencies'),
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,
@@ -605,9 +622,9 @@
605 # Check if Inter-section partners used one of these currencies622 # Check if Inter-section partners used one of these currencies
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']:
607 pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id',624 pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id',
608 'in', ids)], order='NO_ORDER', context=context)625 'in', ids)], order='NO_ORDER', context=context)
609 partner_ids = partner_obj.search(cr, uid, [('partner_type', '=',626 partner_ids = partner_obj.search(cr, uid, [('partner_type', '=',
610 'section')], order='NO_ORDER', context=context)627 'section')], order='NO_ORDER', context=context)
611 value_reference = ['product.pricelist,%s' % x for x in pricelist_ids]628 value_reference = ['product.pricelist,%s' % x for x in pricelist_ids]
612 res_reference = ['res.partner,%s' % x for x in partner_ids]629 res_reference = ['res.partner,%s' % x for x in partner_ids]
613 property_ids = []630 property_ids = []
@@ -615,7 +632,7 @@
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),
616 ('value_reference', 'in', value_reference),633 ('value_reference', 'in', value_reference),
617 '|', ('name', '=', 'property_product_pricelist'),634 '|', ('name', '=', 'property_product_pricelist'),
618 ('name', '=', 'property_product_pricelist_purchase'),], context=context)635 ('name', '=', 'property_product_pricelist_purchase'),], context=context)
619 if property_ids:636 if property_ids:
620 properties = property_obj.browse(cr, uid, property_ids, context=context)637 properties = property_obj.browse(cr, uid, property_ids, context=context)
621 partner_list = ' / '.join(x.res_id.name for x in properties)638 partner_list = ' / '.join(x.res_id.name for x in properties)
@@ -626,9 +643,9 @@
626 # Check if ESC partners used one of these currencies643 # Check if ESC partners used one of these currencies
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']:
628 pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id',645 pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id',
629 'in', ids)], order='NO_ORDER', context=context)646 'in', ids)], order='NO_ORDER', context=context)
630 partner_ids = partner_obj.search(cr, uid, [('partner_type', '=',647 partner_ids = partner_obj.search(cr, uid, [('partner_type', '=',
631 'esc')], order='NO_ORDER', context=context)648 'esc')], order='NO_ORDER', context=context)
632 value_reference = ['product.pricelist,%s' % x for x in pricelist_ids]649 value_reference = ['product.pricelist,%s' % x for x in pricelist_ids]
633 res_reference = ['res.partner,%s' % x for x in partner_ids]650 res_reference = ['res.partner,%s' % x for x in partner_ids]
634 property_ids = []651 property_ids = []
@@ -636,7 +653,7 @@
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),
637 ('value_reference', 'in', value_reference),654 ('value_reference', 'in', value_reference),
638 '|', ('name', '=', 'property_product_pricelist'),655 '|', ('name', '=', 'property_product_pricelist'),
639 ('name', '=', 'property_product_pricelist_purchase'),], context=context)656 ('name', '=', 'property_product_pricelist_purchase'),], context=context)
640 if property_ids:657 if property_ids:
641 properties = property_obj.browse(cr, uid, property_ids, context=context)658 properties = property_obj.browse(cr, uid, property_ids, context=context)
642 partner_list = ' / '.join(x.res_id.name for x in properties)659 partner_list = ' / '.join(x.res_id.name for x in properties)
643660
=== modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako'
--- bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2016-12-05 15:18:05 +0000
+++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2017-01-13 16:35:52 +0000
@@ -541,7 +541,7 @@
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>
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>
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>
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>
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>
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>
547 </Row>547 </Row>
548548
=== modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.py'
--- bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2016-12-05 15:15:27 +0000
+++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2017-01-13 16:35:52 +0000
@@ -17,8 +17,6 @@
17 super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context)17 super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context)
18 self.localcontext.update({18 self.localcontext.update({
19 'get_compare_lines': self.get_compare_lines,19 'get_compare_lines': self.get_compare_lines,
20 'gen_line_link': self.gen_line_link,
21 'get_same_and_default_currency': self.get_same_and_default_currency,
22 })20 })
2321
24 def get_compare_lines(self, tender_obj):22 def get_compare_lines(self, tender_obj):
@@ -85,42 +83,5 @@
8583
86 return lines84 return lines
8785
88 def get_same_and_default_currency(self, tender_obj):
89
90 if tender_obj == 'draft' or not tender_obj.rfq_ids:
91 return (True, self.localcontext['company'].currency_id)
92
93 current_cur = False
94
95 for rfq in tender_obj.rfq_ids:
96 next_cur = rfq.currency_id
97 if current_cur and current_cur.id != next_cur.id:
98 return (False, self.localcontext['company'].currency_id)
99 current_cur = rfq.currency_id
100 return (True, current_cur)
101
102 def gen_line_link(self, tender_obj):
103 link_line_supp = {}
104
105 same_cur, currency = self.get_same_and_default_currency(tender_obj)
106 cur_obj = self.pool.get('res.currency')
107
108 if tender_obj.rfq_ids:
109 # fine we have rfqs
110 for rfq in tender_obj.rfq_ids:
111 for line in rfq.order_line:
112 data = {'notes': line.notes, 'price_unit': line.price_unit}
113 if not same_cur:
114 data['price_unit'] = cur_obj.compute(self.cr, self.uid, line.currency_id.id, currency.id, line.price_unit, round=True)
115
116 link_line_supp.setdefault(line.product_id.id, {}).setdefault(rfq.partner_id.id, data)
117 elif tender_obj.supplier_ids:
118 for line in tender_obj.tender_line_ids:
119 link_line_supp[line.product_id.id] = {}
120 for supp in tender_obj.supplier_ids:
121 link_line_supp[line.product_id.id][supp.id] = {}
122
123 return link_line_supp
124
12586
126SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison)87SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison)
12788
=== modified file 'bin/addons/vertical_integration/report/hq_report_ocb.py'
--- bin/addons/vertical_integration/report/hq_report_ocb.py 2016-11-18 16:44:10 +0000
+++ bin/addons/vertical_integration/report/hq_report_ocb.py 2017-01-13 16:35:52 +0000
@@ -63,6 +63,7 @@
63 dbname = cr.dbname63 dbname = cr.dbname
64 pool = pooler.get_pool(dbname)64 pool = pooler.get_pool(dbname)
65 partner_obj = pool.get('res.partner')65 partner_obj = pool.get('res.partner')
66 employee_obj = pool.get('hr.employee')
6667
67 # define column number corresponding to properties68 # define column number corresponding to properties
68 partner_name_cl = 969 partner_name_cl = 9
@@ -73,6 +74,12 @@
73 partner_search_dict = {}74 partner_search_dict = {}
74 employee_search_dict = {}75 employee_search_dict = {}
75 employee_code_dict = {}76 employee_code_dict = {}
77 partner_name_dict = {}
78 partner_hash_dict = {}
79
80 partner_id_list = list(set([x[partner_id_cl] for x in data if x[partner_id_cl]]))
81 partner_result = partner_obj.read(cr, uid, partner_id_list, ['name'])
82 partner_name_dict = dict((x['id'], x['name']) for x in partner_result)
7683
77 for line in data:84 for line in data:
78 tmp_line = list(line)85 tmp_line = list(line)
@@ -90,7 +97,7 @@
90 partner_id = tmp_line[partner_id_cl]97 partner_id = tmp_line[partner_id_cl]
91 if partner_id:98 if partner_id:
92 # US-497: extract name from partner_id (better than partner_txt)99 # US-497: extract name from partner_id (better than partner_txt)
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]
94101
95 partner_name = tmp_line[partner_name_cl]102 partner_name = tmp_line[partner_name_cl]
96 # Search only if partner_name is not empty103 # Search only if partner_name is not empty
@@ -109,12 +116,13 @@
109116
110 # If we get some ids, fetch the partner hash117 # If we get some ids, fetch the partner hash
111 if partner_id:118 if partner_id:
112 if isinstance(partner_id, (int, long)):119 if partner_id in partner_hash_dict:
113 partner_id = [partner_id]120 partner_hash = partner_hash_dict[partner_id]
114 partner_hash = self.get_hash(cr, uid, partner_id, 'res.partner')121 else:
122 partner_hash = self.get_hash(cr, uid, [partner_id], 'res.partner')
123 partner_hash_dict[partner_id] = partner_hash
115124
116 if not partner_id and tmp_line[partner_name_cl]:125 if not partner_id and tmp_line[partner_name_cl]:
117 employee_obj = pool.get('hr.employee')
118 if partner_name not in employee_search_dict:126 if partner_name not in employee_search_dict:
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'])])
120 if employee_search:128 if employee_search:
@@ -673,7 +681,7 @@
673 })681 })
674682
675 # Launch finance archive object683 # Launch finance archive object
676 fe = finance_archive(sqlrequests, processrequests)684 fe = finance_archive(sqlrequests, processrequests, context=context)
677 # Use archive method to create the archive685 # Use archive method to create the archive
678 return fe.archive(cr, uid)686 return fe.archive(cr, uid)
679687
680688
=== modified file 'bin/addons/vertical_integration/wizard/ocb_export.py'
--- bin/addons/vertical_integration/wizard/ocb_export.py 2016-01-26 10:00:40 +0000
+++ bin/addons/vertical_integration/wizard/ocb_export.py 2017-01-13 16:35:52 +0000
@@ -45,6 +45,12 @@
45 """45 """
46 Launch a report to generate the ZIP file.46 Launch a report to generate the ZIP file.
47 """47 """
48 if context is None:
49 context = {}
50
51 if isinstance(ids, (int, long)):
52 ids = [ids]
53
48 # Prepare some values54 # Prepare some values
49 wizard = self.browse(cr, uid, ids[0], context=context)55 wizard = self.browse(cr, uid, ids[0], context=context)
50 data = {}56 data = {}
@@ -67,7 +73,7 @@
67 if wizard.period_id.number == 16:73 if wizard.period_id.number == 16:
68 msg = _("You can not select '%s' as already included in' \74 msg = _("You can not select '%s' as already included in' \
69 ' December export") % (75 ' December export") % (
70 wizard.period_id.name or 'Period 16', )76 wizard.period_id.name or 'Period 16', )
71 raise osv.except_osv(_('Warning'), msg)77 raise osv.except_osv(_('Warning'), msg)
72 """elif wizard.period_id.number == 12:78 """elif wizard.period_id.number == 12:
73 domain = [79 domain = [
@@ -89,7 +95,20 @@
89 wizard.instance_id and wizard.instance_id.code or '',95 wizard.instance_id and wizard.instance_id.code or '',
90 period_name)96 period_name)
9197
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, {
99 'file_name': data['target_filename'],
100 'report_name': 'hq.ocb',
101 }, context=context)
102 context['background_id'] = background_id
103 context['background_time'] = 2
104
105 data['context'] = context
106 return {
107 'type': 'ir.actions.report.xml',
108 'report_name': 'hq.ocb',
109 'datas': data,
110 'context': context,
111 }
93112
94ocb_export_wizard()113ocb_export_wizard()
95# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:114# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
96115
=== modified file 'bin/osv/orm.py'
--- bin/osv/orm.py 2016-11-17 08:46:41 +0000
+++ bin/osv/orm.py 2017-01-13 16:35:52 +0000
@@ -1450,11 +1450,15 @@
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'))
1451 if trans:1451 if trans:
1452 node.set('sum', trans)1452 node.set('sum', trans)
1453 elif node.get('confirm'):1453 if node.get('confirm'):
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'))
1455 if trans:1455 if trans:
1456 node.set('confirm', trans)1456 node.set('confirm', trans)
1457 elif node.get('string'):1457 if node.get('help'):
1458 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('help'))
1459 if trans:
1460 node.set('help', trans)
1461 if node.get('string'):
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'))
1459 if trans == node.get('string') and ('base_model_name' in context):1463 if trans == node.get('string') and ('base_model_name' in context):
1460 # If translation is same as source, perhaps we'd have more luck with the alternative model name1464 # If translation is same as source, perhaps we'd have more luck with the alternative model name
@@ -1462,7 +1466,7 @@
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'))
1463 if trans:1467 if trans:
1464 node.set('string', trans)1468 node.set('string', trans)
1465 elif node.tag == 'translate':1469 if node.tag == 'translate':
1466 parent = node.getparent()1470 parent = node.getparent()
1467 source = node.text1471 source = node.text
1468 for child in node.getchildren():1472 for child in node.getchildren():
14691473
=== modified file 'bin/release.py'
--- bin/release.py 2016-12-14 08:48:56 +0000
+++ bin/release.py 2017-01-13 16:35:52 +0000
@@ -20,7 +20,7 @@
20##############################################################################20##############################################################################
2121
22name = 'openerp-server'22name = 'openerp-server'
23version = 'UF3.0'23version = 'UF4.0dev'
24major_version = '6.0'24major_version = '6.0'
25description = 'OpenERP Server'25description = 'OpenERP Server'
26long_desc = '''OpenERP is a complete ERP and CRM. The main features are accounting (analytic26long_desc = '''OpenERP is a complete ERP and CRM. The main features are accounting (analytic
2727
=== modified file 'bin/service/web_services.py'
--- bin/service/web_services.py 2016-11-15 15:32:01 +0000
+++ bin/service/web_services.py 2017-01-13 16:35:52 +0000
@@ -848,7 +848,7 @@
848 data.append(tmp_data)848 data.append(tmp_data)
849 return data849 return data
850850
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,
852 group_by=None, export_format='csv', ids=None, context=None):852 group_by=None, export_format='csv', ids=None, context=None):
853 res = {'result': None}853 res = {'result': None}
854 db, pool = pooler.get_db_and_pool(db_name)854 db, pool = pooler.get_db_and_pool(db_name)
@@ -866,7 +866,7 @@
866 return res866 return res
867 return background_id867 return background_id
868868
869 def export(self, cr, pool, uid, fields, domain, model, fields_name,869 def export(self, cr, pool, uid, fields, domain, model, fields_name,
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,
871 context=None):871 context=None):
872872
873873
=== modified file 'bin/tools/translate.py'
--- bin/tools/translate.py 2016-11-09 08:41:40 +0000
+++ bin/tools/translate.py 2017-01-13 16:35:52 +0000
@@ -559,6 +559,8 @@
559 res.append(de.get('sum').encode("utf8"))559 res.append(de.get('sum').encode("utf8"))
560 if de.get("confirm"):560 if de.get("confirm"):
561 res.append(de.get('confirm').encode("utf8"))561 res.append(de.get('confirm').encode("utf8"))
562 if de.get("help"):
563 res.append(de.get('help').encode("utf8"))
562 if de.tag == 'translate':564 if de.tag == 'translate':
563 text_to_translate = ''565 text_to_translate = ''
564 if de.text:566 if de.text:

Subscribers

People subscribed via source and target branches