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

Proposed by jftempo
Status: Merged
Merged at revision: 4855
Proposed branch: lp:~dorian-kemps/unifield-server/US-4151
Merge into: lp:unifield-server
Diff against target: 70 lines (+38/-0)
3 files modified
bin/addons/delivery_mechanism/delivery_mechanism.py (+1/-0)
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+33/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-4151
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+342272@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
=== modified file 'bin/addons/delivery_mechanism/delivery_mechanism.py'
--- bin/addons/delivery_mechanism/delivery_mechanism.py 2017-12-14 15:23:34 +0000
+++ bin/addons/delivery_mechanism/delivery_mechanism.py 2018-03-28 07:26:48 +0000
@@ -1084,6 +1084,7 @@
1084 context=context1084 context=context
1085 )1085 )
1086 out_values['price_unit'] = price_unit1086 out_values['price_unit'] = price_unit
1087 out_values['price_currency_id'] = out_move.price_currency_id.id
10871088
1088 # List the Picking Ticket that need to be created from the Draft Picking Ticket1089 # List the Picking Ticket that need to be created from the Draft Picking Ticket
1089 if out_move.picking_id.type == 'out' \1090 if out_move.picking_id.type == 'out' \
10901091
=== modified file 'bin/addons/msf_profile/data/patches.xml'
--- bin/addons/msf_profile/data/patches.xml 2018-03-15 14:46:24 +0000
+++ bin/addons/msf_profile/data/patches.xml 2018-03-28 07:26:48 +0000
@@ -14,6 +14,10 @@
14 <field name="method">us_4407_update_free_lines_ad</field>14 <field name="method">us_4407_update_free_lines_ad</field>
15 </record>15 </record>
1616
17 <record id="us_4151_change_correct_out_currency" model="patch.scripts">
18 <field name="method">us_4151_change_correct_out_currency</field>
19 </record>
20
17 <!-- UF7.3 -->21 <!-- UF7.3 -->
18 <record id="send_instance_uuid" model="patch.scripts">22 <record id="send_instance_uuid" model="patch.scripts">
19 <field name="method">send_instance_uuid</field>23 <field name="method">send_instance_uuid</field>
2024
=== modified file 'bin/addons/msf_profile/msf_profile.py'
--- bin/addons/msf_profile/msf_profile.py 2018-03-16 09:40:20 +0000
+++ bin/addons/msf_profile/msf_profile.py 2018-03-28 07:26:48 +0000
@@ -106,6 +106,39 @@
106 cr.execute(update_free_1)106 cr.execute(update_free_1)
107 cr.execute(update_free_2)107 cr.execute(update_free_2)
108108
109 def us_4151_change_correct_out_currency(self, cr, uid, *a, **b):
110 '''
111 search the currency_id in FO/IR for each OUT/PICK to set the correct one, doesn't change it if no FO/IR found
112 '''
113 company_curr = self.pool.get('res.company').browse(cr, uid, 1, fields_to_fetch=['currency_id']).currency_id.id
114
115 move_ids_currencies = {}
116 cr.execute('''
117 select m.id, m.price_currency_id, s.procurement_request, pl.currency_id
118 from stock_move m
119 left join stock_picking p on (m.picking_id = p.id)
120 left join sale_order_line sl on (m.sale_line_id = sl.id)
121 left join sale_order s on (sl.order_id = s.id)
122 left join product_pricelist pl on (s.pricelist_id = pl.id)
123 where m.sale_line_id is not null and m.type = 'out' and p.type = 'out' and p.subtype in ('standard', 'picking')
124 ''')
125 for x in cr.fetchall():
126 if x[2]:
127 currency_id_key = company_curr
128 else:
129 currency_id_key = x[3]
130 if x[1] != currency_id_key:
131 if currency_id_key in move_ids_currencies:
132 move_ids_currencies[currency_id_key].append(x[0])
133 else:
134 move_ids_currencies.update({currency_id_key: [x[0]]})
135
136 for currency_id in move_ids_currencies:
137 cr.execute('''update stock_move set price_currency_id = %s where id in %s'''
138 , (currency_id, tuple(move_ids_currencies[currency_id])))
139
140 return True
141
109 # UF7.3142 # UF7.3
110 def flag_pi(self, cr, uid, *a, **b):143 def flag_pi(self, cr, uid, *a, **b):
111 cr.execute('''select distinct i.id, p.default_code from144 cr.execute('''select distinct i.id, p.default_code from

Subscribers

People subscribed via source and target branches