On odoo 18.0, odoo has checked on account code, they not allow hypens on account code ex. 1000-01
As I checked on commit they said
The new account report engine requires account codes to only contain alphanumeric characters and dots.
Add two new constrains on account_account and account_account_template to block the creation of accounts with codes that would cause issues in account reports.
ACCOUNT_CODE_REGEX = re.compile(r'^[A-Za-z0-9.]+$')
@api.constrains('code')
def _check_account_code(self):
for account in self:
if not re.match(ACCOUNT_CODE_REGEX, account.code):
raise ValidationError(_(
"The account code can only contain alphanumeric characters and dots."
))
Have any suggestion if I want to use account code like 1000-01, 2100-22
Thanks in advance.