Closed aisopuro closed 5 years ago
I think that bug belongs in https://github.com/OCA/partner-contact/tree/11.0/partner_identification @mlaitinen . This module only provides the logic for validation: it does not control when validation happens. I agree that it seems like changing the country should trigger validation, but the actual constraint is defined separately, and only triggers on changes to fields on the res.partner.id_number
record itself: https://github.com/OCA/partner-contact/blob/11.0/partner_identification/models/res_partner_id_number.py#L18.
The implementation of this whole thing isn't exactly standard. It might be because OCA doesn't think that this is a failure situation, but who knows.
I don't think it belongs to the partner_identification
module because this is a custom identification field that we have created. partner_identification
couldn't possibly know when to trigger the validation, so I think we need to do it in this module.
I think we should have our own constraint that validates all of the identifiers connected to the partner if the country is changed.
But the whole point of the partner_identification
module is to provide a unified base on which to build these kinds of country-specific code validations. It seems to me that if it doesn't provide a mechanism for checking something when a partner's country is changed, that's a bug in the base functionality.
Fair point.
Ping @jarmokortetjarvi would it be possible to have this reviewed/accepted?
Ping @jarmokortetjarvi would it be possible to have this reviewed/accepted?
Just rebuilt the runbot and reviewing :)
Coverage remained the same at 100.0% when pulling faf9853d2b3ea51009b67b6930ed490c4bc5df60 on avoinsystems:11.0-mig-l10n_fi_business_code into ceab2827b1ed1e56f3a1299ee6ad7115520c292d on OCA:11.0.