Issue 10494

Title
Crash scenario account_fr that you cannot modify posted move "2"
Priority
bug
Status
unread
Nosy list
resteve
Assigned to
Keywords

Created on 2021-06-08.12:26:00 by resteve, last changed 6 days ago by pokoli.

Messages

Author: [hidden] (resteve)
Date: 2021-06-08.12:26:00
File "/home/raimon/projectes/nandev/nancore/trytond/trytond/modules/account_fr/tests/scenario_fec.rst", line 187, in scenario_fec.rst
Failed example:
    move_line.move.click('post')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.7/doctest.py", line 1329, in __run
        compileflags, 1), test.globs)
      File "<doctest scenario_fec.rst[118]>", line 1, in <module>
        move_line.move.click('post')
      File "/home/raimon/projectes/nandev/nancore/proteus/proteus/__init__.py", line 102, in newfunc
        return self.func(owner, [instance], *args, **kwargs)
      File "/home/raimon/projectes/nandev/nancore/proteus/proteus/__init__.py", line 908, in click
        return getattr(proxy, button)([r.id for r in records], context)
      File "/home/raimon/projectes/nandev/nancore/proteus/proteus/config.py", line 188, in __call__
        result = rpc.result(meth(*args, **kwargs))
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/model/modelview.py", line 774, in wrapper
        return func(cls, records, *args, **kwargs)
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/modules/account/move.py", line 442, in post
        cls.save(moves)
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/model/descriptors.py", line 33, in newfunc
        return self.func(owner, *args, **kwargs)
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/model/modelstorage.py", line 1792, in save
        (([r], save_values[r]) for r in to_write), ()))
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/modules/account/move.py", line 263, in write
        cls.check_modify(moves)
      File "/home/raimon/projectes/nandev/nancore/trytond/trytond/modules/account/move.py", line 239, in check_modify
        move=move.rec_name))
    trytond.model.modelstorage.AccessError: You cannot modify posted move "2". - 

Debug:

> <doctest scenario_fec.rst[118]>(1)<module>()->None
-> import pdb;pdb.set_trace()
(Pdb) move_line.state
'valid'
(Pdb) move_line.move.state
'posted'
(Pdb) move_line.move.click('post')
*** trytond.model.modelstorage.AccessError: You cannot modify posted move "2". -
History
Date User Action Args
2021-06-10 08:33:40pokolisetstatus: chatting -> unread
2021-06-08 12:26:00restevecreate

Showing 10 items. Show all history (warning: this could be VERY long)