- Mailing Lists
- Contributors
- Partner Types: refactor partner_firstname and introduce partner_type_base
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Partner Types: refactor partner_firstname and introduce partner_type_base
Hi,
I would like to promote/discuss a small res.partner refactoring I’ve done on partner_firstname.
We are currently unhappy that invoice or shipping address has a firstname. Shipping addresses sometimes needs only a department name, but not necessary Firstname/Lastname.
Therefore I would like to make the UI more flexible and add an overloadable attribute is_individual, where you can control whether firstname/lastname should be visible or not. Other modules could overload the _compute_contact_type method to control the behavior of the different address types.
I also changed the invisible attributes of the UI elements to is_individual and is_address_readonly instead of using directly the address type in the xml views.
The is_address_readonly can be used to control whether the address information is editable for each type. We e.g. added another address type "contact_address" (e.g. for homeoffice addresses) which is is_individual == True, but also has an editable address
like address type "other". We use "other" for office addresses of a company and therefore changed the classification to is_individual == False. With the change of this PR, we just need to adapt the _compute_contact_type method and all the UI fields are rendered
accordingly.
With this change, it is also easier to add additional types like “service” which we use for “support@” addresses. They usually don’t have an address (is_address_readonly== True, is_individual==False) and by configure these attributes, the UI adapts correctly.
What do you think of these changes? Feedback highly appreciated.
[17.0][ADD] partner_type_base by CRogos · Pull Request #1891 · OCA/partner-contact
Best regards,
Christopher
by Christopher Rogos - 01:56 - 16 Nov 2024
Follow-Ups
-
Re: Partner Types: refactor partner_firstname and introduce partner_type_base
Touching to have that 3 level hierarchy is not recommended, as other things depend on that hierarchy, and you won't obtain the desired partner on the corresponding parts.Regards.El dom, 24 nov 2024 a las 16:26, Christopher Rogos (<notifications@odoo-community.org>) escribió:Hi Pedro,
I understand your intension regarding a partner_name_split module, but I am not sure if merging partner_firstname, partner_second_lastname, partner_middlename into one module would make the module to complex. The partner_firstname tests are already complex. Adding more configurable cases could make the module very complex in development, if there is not a very clear definition how the splitting should work in each case.
Maybe we could add a partner_name_split module, which adds some configuration options and controls the installation of these existing modules?
But this is all going a lot further than the change I like to make at this point. I just want to add different address types like “partner_address” (contact with firstname/lastname but editable address) order “service” (only name and no editable address). The idea is to have better filter options and more control, when we have firstname/lastname and when we have only name.
There is also a lot of inconsistencies in Odoo. e.g. you can add a subcontact to a individual, but you cannot select an individual as a parent. Therefore another attribute like “can_be_parent” would be nice, because we use “other address” to track addresses of offices, and want to add the employees to each office. But therefore “other_address” needs to be selectable in “parent_id”, but currently only is_company is selectable in standard.
Best Regards
From: Pedro M. Baeza <notifications@odoo-community.org>
Sent: Montag, 18. November 2024 12:24
To: Contributors <contributors@odoo-community.org>
Subject: Re: Partner Types: refactor partner_firstname and introduce partner_type_baseYeah, I also feel that we should refactor into a "contact name splitting" module, for parameterizing which fields to show and with which goal. For example, having first name and second name, initials, and so on. This can depend on the country or other. I think this also fits with your use case.
Regards.
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Pedro M. Baeza - 08:16 - 25 Nov 2024 -
RE: Partner Types: refactor partner_firstname and introduce partner_type_base
Hi Pedro,
I understand your intension regarding a partner_name_split module, but I am not sure if merging partner_firstname, partner_second_lastname, partner_middlename into one module would make the module to complex. The partner_firstname tests are already complex. Adding more configurable cases could make the module very complex in development, if there is not a very clear definition how the splitting should work in each case.
Maybe we could add a partner_name_split module, which adds some configuration options and controls the installation of these existing modules?
But this is all going a lot further than the change I like to make at this point. I just want to add different address types like “partner_address” (contact with firstname/lastname but editable address) order “service” (only name and no editable address). The idea is to have better filter options and more control, when we have firstname/lastname and when we have only name.
There is also a lot of inconsistencies in Odoo. e.g. you can add a subcontact to a individual, but you cannot select an individual as a parent. Therefore another attribute like “can_be_parent” would be nice, because we use “other address” to track addresses of offices, and want to add the employees to each office. But therefore “other_address” needs to be selectable in “parent_id”, but currently only is_company is selectable in standard.
Best Regards
From: Pedro M. Baeza <notifications@odoo-community.org>
Sent: Montag, 18. November 2024 12:24
To: Contributors <contributors@odoo-community.org>
Subject: Re: Partner Types: refactor partner_firstname and introduce partner_type_baseYeah, I also feel that we should refactor into a "contact name splitting" module, for parameterizing which fields to show and with which goal. For example, having first name and second name, initials, and so on. This can depend on the country or other. I think this also fits with your use case.
Regards.
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Christopher Rogos - 04:25 - 24 Nov 2024 -
Re: Partner Types: refactor partner_firstname and introduce partner_type_base
Yeah, I also feel that we should refactor into a "contact name splitting" module, for parameterizing which fields to show and with which goal. For example, having first name and second name, initials, and so on. This can depend on the country or other. I think this also fits with your use case.Regards.
by Pedro M. Baeza - 12:20 - 18 Nov 2024