Choosing party identifier type

Hi!

This commit introduced many party identifiers. The problem we face is that the list is so long that it is cumbersome to simply choose which one the user needs because in practice only a very small set of types is actually used.

We initially simply added a patch to just leave eu_vat but we’re looking for alternatives that avoid the patch or a module that we end up installing to all customers.

We’ve thought that one improvement over the current core situation would be to allow configuring the default type.

Yet I wonder what others are doing about this and if somebody has a better idea on something that could be implemented in party module itself.

Opinions? Ideas?

We’ve got similar feedback from our customers. The list is long but explaning that we are an ERP designed globablly and we support all identifiers types they understand it.

I do not think there is a default value that will work for all.

I think we can sort the identifiers to show the most relevant ones first. For example, if I’m creating a Spanish party I want to see the identifiers on this order:

  • The spanish one’s
  • The european one’s
  • All other identifers.

When creating a german customer then it will make sense to include first the German identifers instead of the Spanish one.

This will allow users to easly find the right identifier most of the times on the first options and let the other identifiers available for special cases.

As it is a Selection field, the options (and the order) are common for all the views/record.
I think it could probably be done using a second function field with an on_change_selection but the drawback will be that the method will need to be called very often even for consultation.

For me the best thing would be to treat them as it is currently done with currencies and countries.

It would allow each installation to upload the necessary ones, also replacing the selection with a Many2One the search options are better.

we had that feedback from several customers problem and are working in an implementation like Address Subdivision Types on party module to allow to select identifier types depend company country.

I do not really see how it could be. Those values are directly linked to python-stdnum.

Not sure it will be a good solution because for example a company from a specific country could have also a VAT number for another countries. This happens if it does a lot of businesses in that other countries.

I’m wondering if a good solution would not be that the system tries to guess automatically the type when the code is filled.

I agree it should not be loaded by a separate script but I think we could import them using records currencies and countries were loaded in the past.

I see two problems with this:

  • The type is not required so if the code is wrong, the type would be left blank and we would not warn the user.
  • It could be slow. In fact, another reason we patched the party module is to made upgrade process from older versions faster as it tries to check if what is the type of the previous vat code.

An alternative solution would be to improve the useability of Selection widgets to be as goo as Many2One widgets. M2o allow users to choose among thousands of records without problems so in fact the problem is not that there are many options but that the widget is not good enough.

For me the best thing would be a datalist [1][2] to find “the option”

[1] https://www.w3schools.com/tags/tag_datalist.asp
[2] https://derickbailey.com/2016/03/23/get-a-data-attribute-value-from-the-selected-datalist-option/