Can not post an invoice from a different company as the contextual
This is because the account.move.line
has Function
fields with setter
to modify the parent move and the company
field is defined like that. And as it has also a default value from the context, when the move is saved with his lines, the line has no company
set so the ORM fill it with the contextual one which modify the one from the already saved move.
For the invoice case, this raise an invalid domain because the period has an invalid domain now.
So for me the Line.create
must set None
as value for all fields with the set_move_field
method just like we already do for date
field.