Merge lp:~jfb-tempo-consulting/unifield-server/us-2656 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4282
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/us-2656
Merge into: lp:unifield-server
Diff against target: 71 lines (+11/-7)
3 files modified
bin/addons/base/ir/ir_values.py (+9/-5)
bin/addons/msf_supply_doc_export/msf_supply_doc_export.py (+1/-1)
bin/osv/orm.py (+1/-1)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/us-2656
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+322109@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/ir/ir_values.py'
2--- bin/addons/base/ir/ir_values.py 2016-11-08 16:43:27 +0000
3+++ bin/addons/base/ir/ir_values.py 2017-04-07 09:02:47 +0000
4@@ -22,7 +22,6 @@
5 from osv import osv,fields
6 from osv.orm import except_orm
7 import pickle
8-from tools.translate import _
9 import tools
10
11 EXCLUDED_FIELDS = set((
12@@ -177,7 +176,9 @@
13 ids_res.append(self.create(cr, uid_access, vals))
14 return ids_res
15
16- def get(self, cr, uid, key, key2, models, meta=False, context={}, res_id_req=False, without_user=True, key2_req=True):
17+ def get(self, cr, uid, key, key2, models, meta=False, context=None, res_id_req=False, without_user=True, key2_req=True):
18+ if context is None:
19+ context = {}
20 result = []
21 for m in models:
22 if isinstance(m, (list, tuple)):
23@@ -206,8 +207,11 @@
24 where.append('res_id=%s')
25 params.append(res_id)
26
27- where.append('(user_id=%s or (user_id IS NULL)) order by sequence,id')
28- params.append(uid)
29+ if key == 'default' and (context.get('sync_update_execution') or context.get('sync_message_execution')):
30+ where.append('user_id IS NULL order by sequence,id')
31+ else:
32+ where.append('(user_id=%s or (user_id IS NULL)) order by sequence,id')
33+ params.append(uid)
34 clause = ' and '.join(where)
35 cr.execute('select id,name,value,object,meta, key from ir_values where ' + clause, params)
36 result = cr.fetchall()
37@@ -232,7 +236,7 @@
38
39 try:
40 datas = self.pool.get(model).read(cr, uid, [int(id)], fields, context)
41- except except_orm, e:
42+ except except_orm:
43 return False
44 datas = datas and datas[0]
45 if not datas:
46
47=== modified file 'bin/addons/msf_supply_doc_export/msf_supply_doc_export.py'
48--- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2017-02-17 15:16:45 +0000
49+++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2017-04-07 09:02:47 +0000
50@@ -727,7 +727,7 @@
51 elif context['_terp_view_name'] in (Shipment_Lists, Shipment_List, Shipments, Shipment):
52 new_act.append(v)
53 values = new_act
54- elif context.get('picking_screen') and context.get('from_so') and context.get('picking_type', False) != 'incoming_shipment':
55+ elif key == 'action' and key2 == 'client_print_multi' and context.get('picking_screen') and context.get('from_so') and context.get('picking_type', False) != 'incoming_shipment':
56 new_act = []
57 for v in values:
58 if v[2].get('report_name', False) :
59
60=== modified file 'bin/osv/orm.py'
61--- bin/osv/orm.py 2017-03-07 08:11:09 +0000
62+++ bin/osv/orm.py 2017-04-07 09:02:47 +0000
63@@ -1173,7 +1173,7 @@
64 # get the default values set by the user and override the default
65 # values defined in the object
66 ir_values_obj = self.pool.get('ir.values')
67- res = ir_values_obj.get(cr, uid, 'default', False, [self._name])
68+ res = ir_values_obj.get(cr, uid, 'default', False, [self._name], context=context)
69 for id, field, field_value in res:
70 if field in fields_list:
71 fld_def = (field in self._columns) and self._columns[field] or self._inherit_fields[field][2]

Subscribers

People subscribed via source and target branches