Issue 10978

Title
Can not post an invoice from a different company as the contextual
Priority
bug
Status
resolved
Nosy list
ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2021-11-24.19:23:17 by ced, last changed 1 week ago by roundup-bot.

Messages

New changeset e598f7794143 by Cédric Krier in branch '6.2':
Use field with set_move_field to skip and fill move values
https://hg.tryton.org/modules/account/rev/e598f7794143

New changeset 9a9d01bea016 by Cédric Krier in branch '6.0':
Use field with set_move_field to skip and fill move values
https://hg.tryton.org/modules/account/rev/9a9d01bea016
New changeset 0103d67b4110 by Cédric Krier in branch 'default':
Use field with set_move_field to skip and fill move values
https://hg.tryton.org/tryton-env/rev/0103d67b4110
New changeset e453761ac7c5 by Cédric Krier in branch 'default':
Use field with set_move_field to skip and fill move values
https://hg.tryton.org/modules/account/rev/e453761ac7c5
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-24.19:23:17

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.

History
Date User Action Args
2021-11-29 23:36:59roundup-botsetkeyword: - backport
messages: + msg71919
2021-11-28 13:49:56roundup-botsetmessages: + msg71900
2021-11-28 13:49:43roundup-botsetmessages: + msg71899
nosy: + roundup-bot
status: testing -> resolved
2021-11-24 22:35:31reviewbotsetmessages: + msg71847
2021-11-24 19:32:31reviewbotsetmessages: + msg71846
nosy: + reviewbot
2021-11-24 19:24:42cedsetkeyword: + backport, review
reviews: 391201002
status: in-progress -> testing
2021-11-24 19:23:17cedcreate