odoo
odoo copied to clipboard
[FW][FIX] repair: Fix sequence auto generation
Issue: In the upgraded version, we have implemented the condition vals['name'] == _('New'). However, the data type of the 'name' field is character and translate = False. Additionally, the default value for the 'name' field is set to 'New', causing this condition to evaluate to false and consequently terminating the execution of the if block.
Solution: To address this, we propose changing the condition to vals['name'] == 'New'
to ensure correct comparison. This modification is warranted due to the
[configuration](https://github.com/odoo/odoo/blob/89fbb75659ba71b8c76dddd62ba331966161f59b/addons/repair/models/repair.py#L31)
of the field:
The field is not translatable.
The field is required and set to readonly true, preventing customers from inputting values.
The default value for the field is set to 'New'.
Before:
Unable to obtain the auto-generated sequence (receiving default value 'New').
After:
The sequence is generated automatically.
OPW-3887638
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#165771
This PR targets 17.0 and is part of the forward-port chain. Further PRs will be created up to master.
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
