Reset from and to location for internal packing in state waiting
This commit is contained in:
1 parent
c3b7dba6cb
commit
f5c509ab3f
2 files changed
+14
-7
No files matched your search
+6
-6
@@ -816,12 +816,12 @@ class PackingInternal(OSV):
|
||||
def set_state_waiting(self, cursor, user, packing_id, context=None):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
packing = self.browse(cursor, user, packing_id, context=context)
|
||||
move_obj.write(
|
||||
cursor, user, [m.id for m in packing.moves], {'state': 'draft'},
|
||||
context=context)
|
||||
move_obj.write(
|
||||
cursor, user, [m.id for m in packing.moves],
|
||||
{'planned_date': packing.planned_date}, context=context)
|
||||
move_obj.write(cursor, user, [m.id for m in packing.moves], {
|
||||
'from_location': packing.from_location.id,
|
||||
'to_location': packing.to_location.id,
|
||||
'state': 'draft',
|
||||
'planned_date': packing.planned_date,
|
||||
}, context=context)
|
||||
self.write(
|
||||
cursor, user, packing_id, {'state': 'waiting'}, context=context)
|
||||
|
||||
|
||||
+8
-1
@@ -388,7 +388,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
states="{'invisible': '''state != 'waiting' ''', 'readonly': '''%(group_stock)d not in groups'''}"
|
||||
icon="tryton-go-previous"/>
|
||||
<button string="Waiting" name="waiting"
|
||||
states="{'invisible': '''state not in ('assigned', 'draft')''', 'readonly': '''%(group_stock)d not in groups''', 'icon': '''state == 'assigned' and 'tryton-go-previous' or state == 'draft' and 'tryton-go-next' or False'''}"/>
|
||||
states="{'invisible': '''state not in ('assigned', 'waiting', 'draft')''', 'readonly': '''%(group_stock)d not in groups''', 'icon': '''state == 'assigned' and 'tryton-go-previous' or state == 'waiting' and 'tryton-clear' or state == 'draft' and 'tryton-go-next' or False'''}"/>
|
||||
<button string="Assign" name="%(wizard_packing_internal_assign)d"
|
||||
type="action"
|
||||
states="{'invisible': '''state != 'waiting' ''', 'readonly': '''%(group_stock)d not in groups'''}"
|
||||
@@ -836,6 +836,13 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="group" ref="group_stock"/>
|
||||
<field name="signal">draft</field>
|
||||
</record>
|
||||
<record model="workflow.transition"
|
||||
id="packinginternal_trans_waiting_waiting">
|
||||
<field name="act_from" ref="packinginternal_act_waiting"/>
|
||||
<field name="act_to" ref="packinginternal_act_waiting"/>
|
||||
<field name="group" ref="group_stock"/>
|
||||
<field name="signal">waiting</field>
|
||||
</record>
|
||||
<record model="workflow.transition"
|
||||
id="packinginternal_trans_waiting_assigned">
|
||||
<field name="act_from" ref="packinginternal_act_waiting"/>
|
||||
|
||||
Reference in new issue
Block a user