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

Proposed by jftempo
Status: Merged
Merged at revision: 6556
Proposed branch: lp:~dorian-kemps/unifield-server/US-11956
Merge into: lp:unifield-server
Diff against target: 46 lines (+26/-0)
2 files modified
bin/addons/msf_profile/data/patches.xml (+5/-0)
bin/addons/msf_profile/msf_profile.py (+21/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-11956
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+451546@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 2023-08-10 14:11:55 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2023-09-18 13:23:54 +0000
4@@ -979,5 +979,10 @@
5 <record id="us_11810_fix_company_logo" model="patch.scripts">
6 <field name="method">us_11810_fix_company_logo</field>
7 </record>
8+
9+ <!-- UF31.0 -->
10+ <record id="us_11956_fix_po_line_reception_destination" model="patch.scripts">
11+ <field name="method">us_11956_fix_po_line_reception_destination</field>
12+ </record>
13 </data>
14 </openerp>
15
16=== modified file 'bin/addons/msf_profile/msf_profile.py'
17--- bin/addons/msf_profile/msf_profile.py 2023-08-10 14:11:55 +0000
18+++ bin/addons/msf_profile/msf_profile.py 2023-09-18 13:23:54 +0000
19@@ -57,6 +57,27 @@
20 'model': lambda *a: 'patch.scripts',
21 }
22
23+ # UF31.0
24+ def us_11956_fix_po_line_reception_destination(self, cr, uid, *a, **b):
25+ '''
26+ Set the Reception Destination to Cross Docking for all PO line by Nomenclature (no product) if they are linked
27+ to a FO or an External IR
28+ '''
29+ cross_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'msf_cross_docking',
30+ 'stock_location_cross_docking')[1]
31+
32+ cr.execute('''
33+ UPDATE purchase_order_line SET reception_dest_id = %s WHERE id IN (
34+ SELECT pl.id FROM purchase_order_line pl
35+ LEFT JOIN sale_order so ON pl.link_so_id = so.id
36+ LEFT JOIN stock_location l ON so.location_requestor_id = l.id
37+ WHERE pl.link_so_id = so.id AND pl.product_id IS NULL AND
38+ (so.procurement_request = 'f' OR (so.location_requestor_id IS NOT NULL AND l.usage = 'customer'))
39+ )''', (cross_id,))
40+ self.log_info(cr, uid, "US-11956: The Line Destination of %s PO line(s) by Nomenclature have been set to 'Cross Docking'" % (cr.rowcount,))
41+
42+ return True
43+
44 # UF30.0
45 def us_11810_fix_company_logo(self, cr, uid, *a, **b):
46 '''

Subscribers

People subscribed via source and target branches