Invalid shipment cost method domain on old records
Introduced on ee4a5e9b7439 when processing a old sale record that does not match with the domain it raises:
Traceback (most recent call last):
File "<console>", line 2, in <module>
File "/home/vant/Documentos/GitLab/customer/sale.py", line 195, in process
super().process(sales)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/modules/web_shop_woocommerce/web.py", line 535, in process
super().process(sales)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelview.py", line 720, in wrapper
return func(cls, records, *args, **kwargs)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/modules/sale_shipment_cost/sale.py", line 243, in process
super().process(sales)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelview.py", line 720, in wrapper
return func(cls, records, *args, **kwargs)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/modules/sale/sale.py", line 1041, in process
cls._process_state(sales)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/modules/sale/sale.py", line 1127, in _process_state
cls.do(done)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/workflow.py", line 44, in wrapper
cls.write(to_update, {
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelsql.py", line 240, in wrapper
return func(cls, *args, **kwargs)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelsql.py", line 1366, in write
cls._validate(sub_records, field_names=all_field_names)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/transaction.py", line 50, in wrapper
return func(*args, **kwargs)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelstorage.py", line 1374, in _validate
validate_domain(field)
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelstorage.py", line 1274, in validate_domain
validate_relation_domain(
File "/home/vant/Documentos/GitLab/customer/.venv_68/lib/python3.10/site-packages/trytond/model/modelstorage.py", line 1353, in validate_relation_domain
raise DomainValidationError(
trytond.model.modelstorage.DomainValidationError: The value "order" for field "Shipment Cost Method" in "V19555 [22059]" of "Sale" is not valid according to its domain. -
-> raise DomainValidationError(
(Pdb) invalid_domain
[['shipment_cost_method', '=', None]]
(Pdb) invalid_record.shipment_cost_method
'order'
(Pdb) invalid_record.carrier
(Pdb) invalid_record.state
'done'