Merge lp:~dorian-kemps/unifield-server/US-3879 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4659
Proposed branch: lp:~dorian-kemps/unifield-server/US-3879
Merge into: lp:unifield-server
Diff against target: 56 lines (+16/-1)
3 files modified
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+8/-0)
bin/addons/procurement_request/procurement_request.py (+4/-1)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-3879
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+335156@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/msf_profile/data/patches.xml'
2--- bin/addons/msf_profile/data/patches.xml 2017-11-28 17:41:34 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2017-12-13 16:51:22 +0000
4@@ -30,6 +30,10 @@
5 <field name="method">us_3516_change_damage_reason_type_incoming_ok</field>
6 </record>
7
8+ <record id="us_3879_set_pricelist_id_for_ir" model="patch.scripts">
9+ <field name="method">us_3879_set_pricelist_id_for_ir</field>
10+ </record>
11+
12 <!-- OLD -->
13
14 <record id="us_3048_patch" model="patch.scripts">
15
16=== modified file 'bin/addons/msf_profile/msf_profile.py'
17--- bin/addons/msf_profile/msf_profile.py 2017-12-06 13:59:39 +0000
18+++ bin/addons/msf_profile/msf_profile.py 2017-12-13 16:51:22 +0000
19@@ -335,6 +335,14 @@
20 cr.execute("UPDATE stock_reason_type SET incoming_ok = 't' WHERE name = 'Damage'")
21 return True
22
23+ def us_3879_set_pricelist_id_for_ir(self, cr, uid, *a, **b):
24+ currency_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
25+ pricelist_id = self.pool.get('product.pricelist').search(cr, uid, [('type', '=', 'sale'),
26+ ('currency_id', '=', currency_id)], limit=1)[0]
27+
28+ cr.execute("UPDATE sale_order SET pricelist_id = %s WHERE procurement_request = 't'" % (pricelist_id,))
29+ return True
30+
31 # OLD patches
32 def us_3048_patch(self, cr, uid, *a, **b):
33 '''
34
35=== modified file 'bin/addons/procurement_request/procurement_request.py'
36--- bin/addons/procurement_request/procurement_request.py 2017-12-01 09:08:44 +0000
37+++ bin/addons/procurement_request/procurement_request.py 2017-12-13 16:51:22 +0000
38@@ -368,6 +368,8 @@
39 if not context:
40 context = {}
41
42+ pricelist_obj = self.pool.get('product.pricelist')
43+
44 if context.get('procurement_request') or vals.get('procurement_request', False):
45 # Get the ISR number
46 if not vals.get('name', False):
47@@ -382,7 +384,8 @@
48 vals['partner_order_id'] = address_id
49 vals['partner_invoice_id'] = address_id
50 vals['partner_shipping_id'] = address_id
51- pl = self.pool.get('product.pricelist').search(cr, uid, [], limit=1)[0]
52+ pl = pricelist_obj.search(cr, uid, [('type', '=', 'sale'),
53+ ('currency_id', '=', company.currency_id.id)], limit=1)[0]
54 vals['pricelist_id'] = pl
55 if 'delivery_requested_date' in vals:
56 vals['ready_to_ship_date'] = compute_rts(self, cr, uid, vals['delivery_requested_date'], 0, 'so', context=context)

Subscribers

People subscribed via source and target branches