Merge lp:~unifield-team/unifield-server/us-1359 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4186
Proposed branch: lp:~unifield-team/unifield-server/us-1359
Merge into: lp:unifield-server
Diff against target: 140 lines (+63/-0)
5 files modified
bin/addons/msf_outgoing/msf_outgoing.py (+42/-0)
bin/addons/msf_outgoing/msf_outgoing_view.xml (+3/-0)
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+8/-0)
bin/addons/msf_profile/msf_profile.py (+6/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-1359
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+316440@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jftempo (jfb-tempo-consulting) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_outgoing/msf_outgoing.py'
2--- bin/addons/msf_outgoing/msf_outgoing.py 2017-01-31 10:50:12 +0000
3+++ bin/addons/msf_outgoing/msf_outgoing.py 2017-02-06 11:06:51 +0000
4@@ -4717,6 +4717,37 @@
5
6 return res
7
8+ def _get_pick_shipment_id(self, cr, uid, ids, field_name, args, context=None):
9+ """
10+ Link the shipment where a stock move is to this stock move
11+ """
12+ if isinstance(ids, (int, long)):
13+ ids = [ids]
14+
15+ if context is None:
16+ context = {}
17+
18+ res = {}
19+ for move in self.browse(cr, uid, ids, context=context):
20+ res[move.id] = False
21+ if move.picking_id and move.picking_id.shipment_id:
22+ res[move.id] = move.picking_id.shipment_id.id
23+
24+ return res
25+
26+ def _get_picking(self, cr, uid, ids, context=None):
27+ """
28+ Return the list of stock.move to update
29+ """
30+ if isinstance(ids, (int, long)):
31+ ids = [ids]
32+
33+ if context is None:
34+ context = {}
35+
36+ picking_ids = self.pool.get('stock.picking').search(cr, uid, [('id', 'in', ids), ('shipment_id', '!=', False)], order='NO_ORDER', context=context)
37+ return self.pool.get('stock.move').search(cr, uid, [('picking_id', '=', picking_ids)], order='NO_ORDER', context=context)
38+
39 _columns = {'from_pack': fields.integer(string='From p.'),
40 'to_pack': fields.integer(string='To p.'),
41 'pack_type': fields.many2one('pack.type', string='Pack Type'),
42@@ -4743,6 +4774,17 @@
43 'sale_order_line_number': fields.function(_vals_get,
44 method=True, type='integer', string='Sale Order Line Number',
45 multi='get_vals_integer',), # old_multi get_vals
46+ 'pick_shipment_id': fields.function(
47+ _get_pick_shipment_id,
48+ method=True,
49+ type='many2one',
50+ relation='shipment',
51+ string='Shipment',
52+ store={
53+ 'stock.move': (lambda obj, cr, uid, ids, c={}: ids, ['picking_id'], 10),
54+ 'stock.picking': (_get_picking, ['shipment_id'], 10),
55+ }
56+ ),
57 # Fields used for domain
58 'location_virtual_id': fields.many2one('stock.location', string='Virtual location'),
59 'location_output_id': fields.many2one('stock.location', string='Output location'),
60
61=== modified file 'bin/addons/msf_outgoing/msf_outgoing_view.xml'
62--- bin/addons/msf_outgoing/msf_outgoing_view.xml 2017-01-16 14:20:41 +0000
63+++ bin/addons/msf_outgoing/msf_outgoing_view.xml 2017-02-06 11:06:51 +0000
64@@ -1397,6 +1397,7 @@
65 <separator orientation="vertical"/>
66 <field name="name"/>
67 <field name="partner_id2" />
68+ <field name="picking_ids" />
69 </group>
70 <newline/>
71 <group expand="0" string="Group By..." colspan="4" col="8">
72@@ -1450,6 +1451,7 @@
73 <tree string="Closed shipped lines" editable="top" noteditable="1" hide_delete_button="1" hide_new_button="1" colors="red: not_shipped">
74 <field name="origin"/>
75 <field name="picking_id" string="Pack"/>
76+ <field name="pick_shipment_id" string="Shipment" />
77 <field name="line_number"/>
78 <field name="product_id"/>
79 <field name="product_qty" />
80@@ -1472,6 +1474,7 @@
81 <search string="Shipment">
82 <field name="name"/>
83 <field name="picking_id" string="Pack" domain="[('already_shipped','=',True), ('shipment_id','!=',False)]"/>
84+ <field name="pick_shipment_id" string="Shipment" />
85 <field name="origin"/>
86 <field name="prodlot_id"/>
87 <field name="asset_id"/>
88
89=== modified file 'bin/addons/msf_profile/data/patches.xml'
90--- bin/addons/msf_profile/data/patches.xml 2017-01-31 16:17:06 +0000
91+++ bin/addons/msf_profile/data/patches.xml 2017-02-06 11:06:51 +0000
92@@ -158,5 +158,9 @@
93 <record id="us_1721_dates_on_products" model="patch.scripts">
94 <field name="method">us_1721_dates_on_products</field>
95 </record>
96+
97+ <record id="us_1359_update_move_shipment" model="patch.scripts">
98+ <field name="method">us_1359_update_move_shipment</field>
99+ </record>
100 </data>
101 </openerp>
102
103=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
104--- bin/addons/msf_profile/i18n/fr_MF.po 2017-01-31 16:17:06 +0000
105+++ bin/addons/msf_profile/i18n/fr_MF.po 2017-02-06 11:06:51 +0000
106@@ -3367,10 +3367,18 @@
107 #: model:stock.location,name:msf_outgoing.stock_location_dispatch
108 #: field:stock.picking,shipment_id:0
109 #: view:sale.order.line.followup:0
110+#: field:return.pack.shipment.processor,shipment_id:0
111+#: field:return.shipment.processor,shipment_id:0
112+#: view:shipment:0
113+#: field:shipment.additionalitems,shipment_id:0
114+#: field:shipment.processor,shipment_id:0
115+#: view:stock.move:0
116+#: field:stock.move,pick_shipment_id:0
117 #, python-format
118 msgid "Shipment"
119 msgstr "Expédition"
120
121+
122 #. module: product
123 #: help:product.packaging,weight_ul:0
124 msgid "The weight of the empty UL"
125
126=== modified file 'bin/addons/msf_profile/msf_profile.py'
127--- bin/addons/msf_profile/msf_profile.py 2017-01-31 16:17:06 +0000
128+++ bin/addons/msf_profile/msf_profile.py 2017-02-06 11:06:51 +0000
129@@ -1116,6 +1116,12 @@
130 cr.execute("""UPDATE product_product SET uf_write_date = write_date, uf_create_date = create_date""")
131 return True
132
133+ def us_1359_update_move_shipment(self, cr, uid, *a, **b):
134+ """
135+ Fill the 'pick_shipment_id' value for stock move in a shipment
136+ """
137+ cr.execute("""UPDATE stock_move sm SET pick_shipment_id = sp.shipment_id FROM stock_picking sp WHERE sm.picking_id = sp.id AND sp.shipment_id IS NOT NULL""")
138+ return True
139
140 patch_scripts()
141

Subscribers

People subscribed via source and target branches

to all changes: