Created on 2016-11-16.10:15:21 by afibanez, last changed 47 months ago by ced.
No it is just behaviour.
Could this be backported in previous versions ? The issue also exists at least on 4.0.
New changeset 1362c57627fc by C?dric Krier in branch 'default': Use original transaction to check created/deleted records in __raise_integrity_error http://hg.tryton.org/trytond/rev/1362c57627fc
The proposed solution is not right because it does not fix the problem in case of deeper nested creation. Indeed the design was already made to take care of this with the created/deleted_records on Transaction but the problem is that __raise_integrity_error is run under a new transaction. So here is review29781002 which ensure the original transaction is used for created/deleted_records.
Ced, the problem is that the many2one record not exists before fails at creation because a required field is not filled. The error is a lot more meaningful if says field required
I'm not sure to understand the problem. If really the value of the Many2One does not exist, the error message is not wrong. Why should the required constraint be necessary the first to check?
Based on your review, it's Many2One, not One2Many
Changed the title, @pokoli pointed to me that only happens when working with One2Many fields
To review in review29741002
When ModelSQL is created, written or deleted checks integrity with the method __raise_integrity_error. This method checks the fields of the model, and assert that required fields are filled and many2one relations are correct. The issue is that if one many2one field is checked before all the required fields are checked, it will raise an error: "The value \"%(value)s\" of field \"%(field)s\" on \"%(model)s\" doesn't exist.", instead of the real error, that is: "The field \"%(field)s\" on \"%(model)s\" is required.". It can be improved by checking first all the required field and after all the relations.
|2016-12-08 15:43:16||ced||set||status: chatting -> resolved|
messages: + msg30618
|2016-12-08 15:36:00||jcavallo||set||status: resolved -> chatting|
nosy: + jcavallo
messages: + msg30616
|2016-11-28 00:01:57||roundup-bot||set||status: testing -> resolved|
nosy: + roundup-bot
messages: + msg30493
|2016-11-26 19:31:53||reviewbot||set||messages: + msg30473|
|2016-11-26 19:16:27||ced||set||reviews: 29741002 -> 29781002|
|2016-11-26 19:16:17||ced||set||assignedto: afibanez -> ced|
messages: + msg30472
|2016-11-16 18:46:11||afibanez||set||messages: + msg30331|
messages: + msg30329
|2016-11-16 18:04:43||reviewbot||set||messages: + msg30328|
|2016-11-16 17:33:18||reviewbot||set||messages: + msg30327|
Showing 10 items. Show all history (warning: this could be VERY long)