Created on 2021-03-31.19:25:13 by albertca, last changed 1 week ago by albertca.
No I realize that I mistakenly talked about on_change_supplier() but in fact the problem is in on_change_with_supplier_location() which is also the getter of the supplier_location function field. So showing the field and allow the user changing is not possible.
Also it is possible to make the application crash if the field supplier_location is removed after creating the shipment.
So I guess that on_change_with_supplier_location() should get the first location (of type 'supplier') it finds, if the party has none assigned.
Supplier Location and Customer Location fields are not required in party form but on_change_supplier() on stock.shipment.in and on_change_customer() on stock.shipment.out and stock.shipment.out.return expect the field to be not null, and crash otherwise.
This can be checked by in the demo server by:
I'm not sure what is the best solution, because we cannot raise a UserError in the on_change.
So not sure if the best option is to add the location field in the shipment, so the user will not be able to save, and thus, can fix it.
Making the field required does not seem a proper solution as it is a MultiValue and thus may become NULL when creating a new party and use it in another company.
|2021-03-31 19:33:41||albertca||set||messages: + msg65956|
Showing 10 items. Show all history (warning: this could be VERY long)