-
-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Names order configuration options #210
Comments
This should be part of localization (the address format in the country) which might conflict with your current proposal. |
@elicoidal but this implies a module per localization, most of them implementing the same, isn't it? |
@antespi You could have a default module for common behavior and have an extra per localization. Where I am not completely sure is whether it should be at country level or at language level... (I think more the later actually) |
@elicoidal This approach doesn't allow to Odoo Admin to configure the behavior he wants. I'm imaging a german customer that wants one order and other german customer with other, both have germany localization. Are you proposing to configure this for all partners in all companies using addons?. If so, I don't understand why use language or country model. BTW, maybe language is a good place where configure names order, but sometimes partner has no lang configured. What could happen then? |
@antespi I dont think language order/placement is an administrator decision but rather a localization decision.
|
Thanks @elicoidal your second propose (use lang model to add a field for defining names order) sounds good for me. And the rule for defining default behavior is flexible enought Any other opinion? The goal of this issue is get the most consensual way to do it, thanks. |
My opinion is: Need is clear, it must be a module in partner-contact and not in localization. This is not a localization need. Apple could want to have names like "Jobs, Steve" and not Steve Jobs. Who is interested, customer which would like to change order. Customer could use one or both of next modules:
I don't think any customer will say:
I think customer could say I would like to change order in my CRM for purposes like, letters, exports, lists In other CRMs and Office Suites you can choose this, is very common. But you choose this globally. Ex. Dynamics, Outlook, ... |
In the Dutch version of this, we do something quite similar: https://github.com/OCA/l10n-netherlands/blob/8.0/l10n_nl_partner_name/model/res_partner.py#L45 If we read the name template from a field on the language, we're done I'd say. |
Oracle defines the name format as dependent of country and language at the same time (data that is held at country + language they call it locale): I think that it is more of a country setting: While in Odoo you will have all the countries defined, you might only have a few languages installed. |
Well, after listening all opinions we can now vote for one, then A. Implementation
B. Configuration fields (only if A2 or A3)
C. Selection algorithm (only if A2 or A3)
Thanks for your opinions |
My vote is:
|
👍 agree |
A3 |
A1 |
A3, B5, C3, because you will have problems defining a configuration per company because the display_name is not a property (and it shouldn't be), so it won't behave correctly when a partner is shared across multiple companies. |
A3, B2. The reason being, the format of the name is a cultural aspect of the country that this person belongs to, not a policy of a company. If you send an invoice to a US customer as "Sebastian Bach, Johan", it will not be well perceived by the recipient of the invoice. So I agree with @elicoidal that should be a country setting. |
I live in a country where the "official" template would be last1 last2, first, but most people prefer first last1 last2, so it should be configurable, either by language or by company. But if a user must remember which company is the partner in, or which language it chose, and has to remember how to write each first/last names combination, that will lead to problems for sure, and @pedrobaeza's and @jbeficent's comments are quite insightful IMO. To fix all those problems, I think the best way would be to make it depend on current context lang. But that would force you to recalculate name on each request instead of saving it to the database, and that would slow too much almost any Odoo operation. So here comes my question: Can computed fields be translatable? If so: A3 + B1 + C4. Being C4 = This way, DB searches will be quick, a user will always write names in the way his language is set up, a company can set up custom formats per lang, and a customer will receive documents with the format preferred in their language. |
I'm afraid not, or at least not the regular way. |
I think this is mostly a reporting issue, similar to addresses. |
According to @elicoidal, @yajo and @pedrobaeza then we have two scenarios:
Here we are discussing the first point. After this, we can go with second point. Everyone agree? |
I think we are discussing both. Partner's name is by far the most used field everywhere. The only way to know what layout is expected is context, that's why I suggest using that. The problem with what @elicoidal says is that you cannot use a function every time you search for a partner, it's very time-consuming. You need to have a value stored in the database to allow fast searches. And partner searches are used too often. And the problem with reports is that there are a lot. You cannot change all one of them that call
Do you mean there is another way? If so, even if it is complicated, I still think it will be the best solution. If there is absolutely no way, then my vote goes for A3 + B1. Companies can still customize the layout for the main language they use. BTW, I forgot to mention one detail: all current tests must pass (at least in |
The other way is very nasty: to write directly to the translations table, which invalidates cache system and other possible side effects. |
That's what I was thinking in the first place. Good tests should ensure no strange things happen. And I hope many methods from core translation system could be reused (still blind guess though). My vote goes for that then. |
@yajo think in impact to database where you have 50.000 partners and 4 languages, then you'll have at least 200.000 entries in |
What's the problem? Disk is cheap, CPU not. Think about calling a python function 50.000 times each time you want to search a partner's name. |
@yajo Why would you need to modify your name search? Your name_search is not impacted by my proposal. |
@elicoidal You cannot use a different string for searching and for displaying, because users will try to search by what they see. Example: View displays name as Sheldon Cooper, but DB stores it as Cooper Sheldon; users will have a problem when they search for Sheldon Cooper: it will not be found. And if you do not change the |
@yajo I understand but this is a matter of balance between performance and usability here, not what I would like in the perfect world (which is a stored value of the expected format with search function, propagated in all views and reports) |
Well we are discussing here to get to the best solution, the closest one to "perfect". Anyway using different values for display and search is not a good idea IMHO, not usable. Users need to be able to search by what they see. |
Hi everyone, Thanks all for your opinions. IMHO, this has been a good collaboration exercise. By now we have implement a minimal (but functional) approach: Configure names order at system level. You can review here: #227 After this, anyone can go forward and implement any other approach commented here, in OCA or in a custom addon for fitting customer needs, now it's simpler because:
|
Hello, When will this be released for V9? |
Sorry, this is fixed in #227. Please somebody close this. |
Hi everyone,
We want to add a new feature in OCA/partner-contact: Odoo admin configures partner names orders when partner_firstname or partner_second_lastname addons are installed
We have two ways to do it:
I prefer the first way
BTW, there are several ways to allow Odoo admin to configure names order, for example with a partner:
María José Espinosa de los Monteros
we will have this:María José
Espinosa
de los Monteros
We can allow these possible configurations:
Espinosa de los Monteros María José
María José Espinosa de los Monteros
Espinosa de los Monteros, María José
An we have several ways to configure this:
I propose 1, because I think it should be a company policy.
We can add a migration script in order to migrate all instances to the default configuration (last_first).
Any opinion or suggestion?
The text was updated successfully, but these errors were encountered: