Merge lp:~mallorymarcot/unifield-server/us-4626 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5124
Proposed branch: lp:~mallorymarcot/unifield-server/us-4626
Merge into: lp:unifield-server
Diff against target: 48 lines (+18/-2)
2 files modified
bin/addons/stock_override/stock.py (+16/-0)
bin/addons/stock_override/stock_view.xml (+2/-2)
To merge this branch: bzr merge lp:~mallorymarcot/unifield-server/us-4626
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+356046@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/stock_override/stock.py'
2--- bin/addons/stock_override/stock.py 2018-08-14 13:03:26 +0000
3+++ bin/addons/stock_override/stock.py 2018-10-03 10:08:57 +0000
4@@ -1386,6 +1386,22 @@
5 'target': 'new',
6 'res_id': wiz_id,
7 'context': context}
8+ if move.type == 'in' and move.purchase_line_id:
9+ vals = {'move_id': ids[0]}
10+
11+ if not move.purchase_line_id.linked_sol_id:
12+ vals['cancel_only'] = True
13+
14+ wiz_id = self.pool.get('stock.move.cancel.wizard').create(cr, uid, vals, context=context)
15+
16+ return {'type': 'ir.actions.act_window',
17+ 'res_model': 'stock.move.cancel.wizard',
18+ 'view_type': 'form',
19+ 'view_mode': 'form',
20+ 'target': 'new',
21+ 'res_id': wiz_id,
22+ 'context': context}
23+
24
25 return self.unlink(cr, uid, ids, context=context)
26
27
28=== modified file 'bin/addons/stock_override/stock_view.xml'
29--- bin/addons/stock_override/stock_view.xml 2018-09-07 14:05:58 +0000
30+++ bin/addons/stock_override/stock_view.xml 2018-10-03 10:08:57 +0000
31@@ -610,7 +610,7 @@
32 colors="grey:scrapped==True; red: inactive_product == True or to_correct_ok == True"
33 string="Stock Moves"
34 hide_new_button="context.get('from_wkf')"
35- hide_delete_button="context.get('from_wkf')"
36+ hide_delete_button="context.get('purchase_id')"
37 >
38 <field name="line_number"/>
39 <field name="product_id" context="{'available_for_restriction': 'consumption', 'search_default_not_restricted': 1}" />
40@@ -640,7 +640,7 @@
41 <field name="price_changed" invisible="1" />
42 <button name="get_price_changed" type="object" string="Price changed" icon="terp-dolar_ok!" attrs="{'invisible': ['|', ('price_changed', '=', False), ('fake_state', '!=', 'done')]}" />
43 <field name="from_wkf" invisible="1" />
44- <button name="call_cancel_wizard" type="object" string="Cancel" attrs="{'invisible': ['|', ('from_wkf', '=', False), ('fake_state', 'in', ('cancel', 'done'))]}" icon="gtk-del" context="{'from_button': True}" />
45+ <button name="call_cancel_wizard" type="object" string="Cancel" attrs="{'invisible': ['|', ('purchase_id', '=', False), ('fake_state', 'in', ('cancel', 'done'))]}" icon="gtk-del" context="{'from_button': True}" />
46 </tree>
47 <form string="Stock Moves" hide_new_button="context.get('from_wkf')">
48 <group colspan="2" col="4">

Subscribers

People subscribed via source and target branches