hedererjs
(JS Hederer)
September 24, 2021, 1:04pm
1
Hi,
I update some shipments in a transition (from step A to step B) and when closing step B, I want to use ids in “do_C” for an action (in action[‘res_id’]
I’ve tried
Transaction().set_context(shipment_ids = action_ids)
self.records = records
but I can’t recover action_ids or records in “do_C”
ced
(Cédric Krier)
September 24, 2021, 1:18pm
2
This is context manager so context is restored on exit.
hedererjs:
self.records = records
records is a property it can not be modified.
Why not preform all the action in do_C
?
hedererjs
(JS Hederer)
September 24, 2021, 1:22pm
3
Because in step B, I give an abstract of actions (done in “transition_step_A_to_B”)
hedererjs
(JS Hederer)
September 26, 2021, 8:47am
4
With no “standard” solution for this need, I’ve done a “out of the box” solution.
For those who are interested:
in model view of step B, I’ve added a “shipment_ids = fields.Text(‘Shipment ids’, readonly=True)”
in “transition_step_A_to_B” I’ve added “self.result.shipment_ids = str(action_ids)” (action_ids is a list)
in “do_C” I’ve added “action[‘res_id’] = eval(self.result.shipment_ids)”
This is ugly, but it works
system
(system)
Closed
October 26, 2021, 8:48am
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.