Create initial stock moves with proteus

Hi Maxime,

Thanks for your prompt reply, I have added the implementation of __lt__ in proteus/__init__.py, however if I am not mistaken that alone doesn’t fix the fact that a different warning key is generated, so I am still getting the Warning raised as you mentioned in the post, is there something else needed to complete the solution?

The one thing I can do is catch the Warning, get the name and save the warning before issuing the “do” command again.

Like so:

    try:
        self.Move.click(moves, 'do')
    except trytond.modules.stock.exceptions.MoveOriginWarning as e:
        print(f"raised {e.name} so we are saving this before retrying")
        self.Warning(user=self.admin_user, name=e.name, always=True).save()
        self.Move.click(moves, 'do')  # This call will succeed

This works actually, but did you have anything better?