Context error when tryting to assign partial shipment
I have a proteus script which tries to assign the waiting shipment outs, but when I use the assign_try function i get the following exception:
Traceback (most recent call last):
File "scripts/aritmos_demo", line 15, in
main(args.database, args.config_file)
File "/home/sergi/projectes/develop/trytond/trytond/modules/aritmos_base/demo.py", line 990, in main
process_out_shipments(config)
File "/home/sergi/projectes/develop/trytond/trytond/modules/aritmos_base/demo.py", line 874, in process_out_shipments
if ShipmentOut.assign_try([shipment.id], config.context):
File "/home/sergi/projectes/develop/proteus/proteus/config.py", line 174, in __call__
result = rpc.result(meth(*args, **kwargs))
File "/home/sergi/projectes/develop/trytond/trytond/model/modelview.py", line 615, in wrapper
return func(cls, *args, **kwargs)
File "/home/sergi/projectes/develop/trytond/trytond/modules/stock/shipment.py", line 1355, in assign_try
for m in s.inventory_moves]):
File "/home/sergi/projectes/develop/trytond/trytond/modules/stock/move.py", line 871, in assign_try
cls.assign(to_assign)
File "/home/sergi/projectes/develop/trytond/trytond/model/modelview.py", line 615, in wrapper
return func(cls, *args, **kwargs)
File "/home/sergi/projectes/develop/trytond/trytond/model/workflow.py", line 34, in wrapper
result = func(cls, filtered, *args, **kwargs)
File "/home/sergi/projectes/develop/trytond/trytond/modules/stock/move.py", line 630, in assign
cls.save(moves)
File "/home/sergi/projectes/develop/trytond/trytond/model/descriptors.py", line 33, in newfunc
return self.func(owner, *args, **kwargs)
File "/home/sergi/projectes/develop/trytond/trytond/model/modelstorage.py", line 1450, in save
assert context == record._context
AssertionError
The main diference on both context is that one have _check_access set and the other doesn't.
This is since changeset 3a17f8e704a7