From 1012780ced7a51dc4aa6c1fe4aaecaad312c5106 Mon Sep 17 00:00:00 2001 From: Simon Hick Date: Mon, 3 Nov 2025 15:19:48 +0100 Subject: [PATCH 1/7] [REF] cooperator: replace legal_form by partner_company_type --- cooperator/__manifest__.py | 3 +- .../migrations/16.0.2.0.0/end-legal_form.py | 21 +++++++++++++ .../migrations/16.0.2.0.0/pre-legal_form.py | 21 +++++++++++++ cooperator/models/res_partner.py | 1 - cooperator/models/subscription_request.py | 6 ++-- .../readme/newsfragments/167.feature.rst | 1 + cooperator/tests/test_cooperator.py | 30 +++++++++---------- cooperator/views/res_partner_view.xml | 4 --- .../views/subscription_request_view.xml | 2 +- 9 files changed, 63 insertions(+), 26 deletions(-) create mode 100644 cooperator/migrations/16.0.2.0.0/end-legal_form.py create mode 100644 cooperator/migrations/16.0.2.0.0/pre-legal_form.py create mode 100644 cooperator/readme/newsfragments/167.feature.rst diff --git a/cooperator/__manifest__.py b/cooperator/__manifest__.py index 3b495e1b7..cd811be83 100644 --- a/cooperator/__manifest__.py +++ b/cooperator/__manifest__.py @@ -8,7 +8,7 @@ { "name": "Cooperators", "summary": "Manage your cooperators", - "version": "16.0.1.2.4", + "version": "16.0.2.0.0", "depends": [ "account", "base_iban", @@ -16,6 +16,7 @@ "web", # todo split into cooperator_partner_firstname "partner_firstname", + "partner_company_type", # todo split into cooperator partner_contact_birthdate "partner_contact_birthdate", # todo split into cooperator_partner_contact_gender diff --git a/cooperator/migrations/16.0.2.0.0/end-legal_form.py b/cooperator/migrations/16.0.2.0.0/end-legal_form.py new file mode 100644 index 000000000..d2ea4be0a --- /dev/null +++ b/cooperator/migrations/16.0.2.0.0/end-legal_form.py @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # remove temp column after l10n modules used it to map the previous values + cr.execute( + """ + ALTER TABLE res_partner + DROP COLUMN legal_form_deprecated; + """ + ) + + # same operations for subscription_request + cr.execute( + """ + ALTER TABLE subscription_request + DROP COLUMN company_type_deprecated; + """ + ) diff --git a/cooperator/migrations/16.0.2.0.0/pre-legal_form.py b/cooperator/migrations/16.0.2.0.0/pre-legal_form.py new file mode 100644 index 000000000..d51312653 --- /dev/null +++ b/cooperator/migrations/16.0.2.0.0/pre-legal_form.py @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # temp column to keep the values of legal_form after we removed it + cr.execute( + """ + ALTER TABLE res_partner + RENAME COLUMN legal_form to legal_form_deprecated; + """ + ) + + # same operations for subscription_request + cr.execute( + """ + ALTER TABLE subscription_request + RENAME COLUMN company_type to company_type_deprecated; + """ + ) diff --git a/cooperator/models/res_partner.py b/cooperator/models/res_partner.py index 07ec09f68..0a1f0ebe6 100644 --- a/cooperator/models/res_partner.py +++ b/cooperator/models/res_partner.py @@ -195,7 +195,6 @@ def _search_representative_of_member_company(self, operator, value): subscription_request_ids = fields.One2many( "subscription.request", "partner_id", string="Subscription request" ) - legal_form = fields.Selection([], string="Legal form") data_policy_approved = cooperative_membership_field( "data_policy_approved", fields.Boolean, diff --git a/cooperator/models/subscription_request.py b/cooperator/models/subscription_request.py index 04a4fdfba..d3f314879 100644 --- a/cooperator/models/subscription_request.py +++ b/cooperator/models/subscription_request.py @@ -395,8 +395,8 @@ def _compute_subscription_amount(self): readonly=True, states={"draft": [("readonly", False)]}, ) - company_type = fields.Selection( - [], + partner_company_type_id = fields.Many2one( + "res.partner.company.type", string="Company type", readonly=True, states={"draft": [("readonly", False)]}, @@ -627,7 +627,7 @@ def get_partner_company_vals(self): "name": self.company_name, "is_company": self.is_company, "company_register_number": self.company_register_number, - "legal_form": self.company_type, + "partner_company_type_id": self.partner_company_type_id.id, "street": self.address, "zip": self.zip_code, "city": self.city, diff --git a/cooperator/readme/newsfragments/167.feature.rst b/cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/cooperator/tests/test_cooperator.py b/cooperator/tests/test_cooperator.py index 949a5f7f9..cb5e76db7 100644 --- a/cooperator/tests/test_cooperator.py +++ b/cooperator/tests/test_cooperator.py @@ -1426,27 +1426,25 @@ def test_company_type_to_legal_form(self): is copied to the legal form field of the created partner. """ subscription_request_vals = self.get_dummy_company_subscription_requests_vals() - # an existing type cannot be used because they are only defined in - # localization modules. subscription_request_model = self.env["subscription.request"] - res_partner_model = self.env["res.partner"] - subscription_request_company_type = subscription_request_model._fields[ - "company_type" - ] - subscription_request_company_types = subscription_request_company_type.selection - subscription_request_company_type.selection = [("dummy_type", "Dummy Type")] - res_partner_legal_form = res_partner_model._fields["legal_form"] - res_partner_legal_forms = res_partner_legal_form.selection - res_partner_legal_form.selection = [("dummy_type", "Dummy Type")] - subscription_request_vals["company_type"] = "dummy_type" + partner_company_type_model = self.env["res.partner.company.type"] + dummy_partner_company_type_id = partner_company_type_model.create( + { + "name": "Dummy Record", + "shortcut": "DR", + } + ) + subscription_request_vals[ + "partner_company_type_id" + ] = dummy_partner_company_type_id.id subscription_request = subscription_request_model.create( subscription_request_vals ) self.validate_subscription_request_and_pay(subscription_request) - self.assertEqual(subscription_request.partner_id.legal_form, "dummy_type") - # restore previous values - subscription_request_company_type.selection = subscription_request_company_types - res_partner_legal_form.selection = res_partner_legal_forms + self.assertEqual( + subscription_request.partner_id.partner_company_type_id, + dummy_partner_company_type_id, + ) def test_cooperator_register_number_sequence_per_company(self): """ diff --git a/cooperator/views/res_partner_view.xml b/cooperator/views/res_partner_view.xml index 72025d863..f5052cffd 100644 --- a/cooperator/views/res_partner_view.xml +++ b/cooperator/views/res_partner_view.xml @@ -73,10 +73,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later name="representative" attrs="{'invisible': ['|', ('parent_id', '=', False), ('is_company', '=', True)]}" /> - Date: Fri, 7 Nov 2025 02:51:04 +0100 Subject: [PATCH 2/7] [REF] cooperator_website: replace legal_form by partner_company_type --- cooperator_website/README.rst | 11 +++- cooperator_website/__manifest__.py | 2 +- cooperator_website/controllers/main.py | 36 +++++----- cooperator_website/readme/ROADMAP.rst | 1 + .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 65 ++++++++++++------- .../views/subscription_template.xml | 18 +++-- 7 files changed, 84 insertions(+), 50 deletions(-) create mode 100644 cooperator_website/readme/ROADMAP.rst create mode 100644 cooperator_website/readme/newsfragments/167.feature.rst diff --git a/cooperator_website/README.rst b/cooperator_website/README.rst index efdf0f41d..510829891 100644 --- a/cooperator_website/README.rst +++ b/cooperator_website/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =================== Cooperators Website =================== @@ -13,7 +17,7 @@ Cooperators Website .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github @@ -36,6 +40,11 @@ shares online. .. contents:: :local: +Known issues / Roadmap +====================== + +- Update the available company types in the form when a country has been selected + Changelog ========= diff --git a/cooperator_website/__manifest__.py b/cooperator_website/__manifest__.py index fa83fcb81..4fc66508e 100644 --- a/cooperator_website/__manifest__.py +++ b/cooperator_website/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Cooperators Website", - "version": "16.0.1.0.0", + "version": "16.0.2.0.0", "depends": [ "cooperator", "website", diff --git a/cooperator_website/controllers/main.py b/cooperator_website/controllers/main.py index 96539bc5d..26480dddf 100644 --- a/cooperator_website/controllers/main.py +++ b/cooperator_website/controllers/main.py @@ -66,7 +66,7 @@ "nb_parts", "total_parts", "error_msg", - "company_type", + "partner_company_type_id", ] @@ -152,7 +152,7 @@ def get_values_from_user(self, values, is_company): values["company_register_number"] = partner.company_register_number values["company_name"] = partner.name values["company_email"] = partner.email - values["company_type"] = partner.legal_form + values["partner_company_type_id"] = partner.partner_company_type_id.id # contact person values representative = partner.get_representative() values["firstname"] = representative.firstname @@ -186,11 +186,19 @@ def fill_values(self, values, is_company, logged, load_from_user=False): values["is_company"] = "on" if logged: values["logged"] = "on" + values["countries"] = self.get_countries() + if company.default_country_id: + country_id = company.default_country_id.id + else: + country_id = company.country_id.id + if not values.get("country_id"): + values["country_id"] = country_id + values["langs"] = self.get_langs() values["products"] = products - fields_desc = sub_req_obj.sudo().fields_get(["company_type", "gender"]) - values["company_types"] = fields_desc["company_type"]["selection"] + values["partner_company_type_ids"] = self.get_company_types(country_id) + fields_desc = sub_req_obj.sudo().fields_get(["gender"]) values["genders"] = fields_desc["gender"]["selection"] values["company"] = company @@ -201,16 +209,6 @@ def fill_values(self, values, is_company, logged, load_from_user=False): break if not values.get("share_product_id", False) and products: values["share_product_id"] = products[0].id - if not values.get("country_id"): - if company.default_country_id: - values["country_id"] = company.default_country_id.id - else: - values["country_id"] = "20" - if not values.get("activities_country_id"): - if company.default_country_id: - values["activities_country_id"] = company.default_country_id.id - else: - values["activities_country_id"] = "20" if not values.get("lang"): if company.default_lang_id: values["lang"] = company.default_lang_id.code @@ -236,18 +234,24 @@ def fill_values(self, values, is_company, logged, load_from_user=False): def get_products_share(self, is_company): product_obj = request.env["product.template"] products = product_obj.sudo().get_web_share_products(is_company) - return products def get_countries(self): countries = request.env["res.country"].sudo().search([]) - return countries def get_langs(self): langs = request.env["res.lang"].sudo().search([]) return langs + def get_company_types(self, country_id): + company_types = ( + request.env["res.partner.company.type"] + .sudo() + .search([("country_ids", "in", country_id)]) + ) + return company_types + def get_selected_share(self, kwargs): prod_obj = request.env["product.template"] product_id = kwargs.get("share_product_id") diff --git a/cooperator_website/readme/ROADMAP.rst b/cooperator_website/readme/ROADMAP.rst new file mode 100644 index 000000000..8bc3ef0fc --- /dev/null +++ b/cooperator_website/readme/ROADMAP.rst @@ -0,0 +1 @@ +- Update the available company types in the form when a country has been selected \ No newline at end of file diff --git a/cooperator_website/readme/newsfragments/167.feature.rst b/cooperator_website/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/cooperator_website/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/cooperator_website/static/description/index.html b/cooperator_website/static/description/index.html index a6d896e70..3a41229bc 100644 --- a/cooperator_website/static/description/index.html +++ b/cooperator_website/static/description/index.html @@ -1,18 +1,18 @@ - -Cooperators Website +README.rst -
-

Cooperators Website

+
+ + +Odoo Community Association + +
+

Cooperators Website

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

This module adds the cooperator subscription form allowing to subscribe for shares online.

Table of contents

+
+

Known issues / Roadmap

+
    +
  • Update the available company types in the form when a country has been selected
  • +
+
-

Changelog

+

Changelog

-

16.0.1.0.0 (2023-12-04)

+

16.0.1.0.0 (2023-12-04)

Features

  • Use the website.contactus_thanks webpage as a base for the thanks page @@ -418,7 +430,7 @@

    16.0.1.0.0 (2023-12-04)

-

12.0.3.0.0 (2022-06-23)

+

12.0.3.0.0 (2022-06-23)

Deprecations and Removals

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -435,23 +447,25 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
-

Contributors

+

Contributors

  • Coop IT Easy SC
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -460,5 +474,6 @@

Maintainers

+
diff --git a/cooperator_website/views/subscription_template.xml b/cooperator_website/views/subscription_template.xml index e914e4ecc..2e8f8a266 100644 --- a/cooperator_website/views/subscription_template.xml +++ b/cooperator_website/views/subscription_template.xml @@ -533,20 +533,24 @@ SPDX-License-Identifier: AGPL-3.0-or-later />
- + From ac7380392ffb53091376596fcfdd0807ad6449ea Mon Sep 17 00:00:00 2001 From: Simon Hick Date: Fri, 7 Nov 2025 04:14:30 +0100 Subject: [PATCH 3/7] [REF] l10n_be_cooperator: replace legal_form by partner_company_type --- l10n_be_cooperator/README.rst | 6 ++- l10n_be_cooperator/__manifest__.py | 3 +- .../migrations/16.0.2.0.0/post-legal_form.py | 37 ++++++++++++++++ l10n_be_cooperator/models/__init__.py | 2 - l10n_be_cooperator/models/res_partner.py | 28 ------------ .../models/subscription_request.py | 15 ------- .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 43 +++++++++++-------- 8 files changed, 71 insertions(+), 64 deletions(-) create mode 100644 l10n_be_cooperator/migrations/16.0.2.0.0/post-legal_form.py delete mode 100644 l10n_be_cooperator/models/res_partner.py delete mode 100644 l10n_be_cooperator/models/subscription_request.py create mode 100644 l10n_be_cooperator/readme/newsfragments/167.feature.rst diff --git a/l10n_be_cooperator/README.rst b/l10n_be_cooperator/README.rst index e48c3fb9f..1cee6b571 100644 --- a/l10n_be_cooperator/README.rst +++ b/l10n_be_cooperator/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =================== Cooperators Belgium =================== @@ -13,7 +17,7 @@ Cooperators Belgium .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github diff --git a/l10n_be_cooperator/__manifest__.py b/l10n_be_cooperator/__manifest__.py index 5849ed8b8..374579586 100644 --- a/l10n_be_cooperator/__manifest__.py +++ b/l10n_be_cooperator/__manifest__.py @@ -10,11 +10,12 @@ { "name": "Cooperators Belgium", "summary": "Cooperators Belgium Localization", - "version": "16.0.1.2.1", + "version": "16.0.2.0.0", "depends": [ "cooperator", "cooperator_website", "l10n_be", + "l10n_be_partner_company_type", ], "author": "Coop IT Easy SC, Odoo Community Association (OCA)", "category": "Cooperative management", diff --git a/l10n_be_cooperator/migrations/16.0.2.0.0/post-legal_form.py b/l10n_be_cooperator/migrations/16.0.2.0.0/post-legal_form.py new file mode 100644 index 000000000..f74a7382c --- /dev/null +++ b/l10n_be_cooperator/migrations/16.0.2.0.0/post-legal_form.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # Copy the company_type from the deprecated legal_form field and + # use them to give the same company types from the partner_company_type + # module. We're using the fact that the values of the legal_form selection + # field are the same as the xml ids of the records in l10n_be_partner_company_type. + # Make sure all the legal_forms have a corresponding id in the records. + cr.execute( + """ + UPDATE res_partner AS rp + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + rp.legal_form_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_be_partner_company_type' + AND imd.name = rp.legal_form_deprecated + """ + ) + + # Same Operation for subscription_request + cr.execute( + """ + UPDATE subscription_request AS sr + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + sr.company_type_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_be_partner_company_type' + AND imd.name = sr.company_type_deprecated + """ + ) diff --git a/l10n_be_cooperator/models/__init__.py b/l10n_be_cooperator/models/__init__.py index 083381db1..ca77105bf 100644 --- a/l10n_be_cooperator/models/__init__.py +++ b/l10n_be_cooperator/models/__init__.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -from . import res_partner -from . import subscription_request from . import tax_shelter_certificate from . import tax_shelter_certificate_line from . import tax_shelter_declaration diff --git a/l10n_be_cooperator/models/res_partner.py b/l10n_be_cooperator/models/res_partner.py deleted file mode 100644 index 1d96b185d..000000000 --- a/l10n_be_cooperator/models/res_partner.py +++ /dev/null @@ -1,28 +0,0 @@ -# SPDX-FileCopyrightText: 2019 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from odoo import fields, models - - -def get_company_type_selection(): - # this list comes from - # https://www.belgium.be/fr/economie/entreprise/creation/types_de_societe - return [ - ("aisbl", "AISBL"), - ("asbl", "ASBL"), - ("sa", "SA"), - ("sc", "SC"), - ("scomm", "SComm"), - ("snc", "SNC"), - ("srl", "SRL"), - # former types (before 2019) - ("scrl", "SCRL"), - ("sprl", "SPRL"), - ] - - -class ResPartner(models.Model): - _inherit = "res.partner" - - legal_form = fields.Selection(selection_add=get_company_type_selection()) diff --git a/l10n_be_cooperator/models/subscription_request.py b/l10n_be_cooperator/models/subscription_request.py deleted file mode 100644 index 1bdc578aa..000000000 --- a/l10n_be_cooperator/models/subscription_request.py +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2019 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from odoo import fields, models - -from . import res_partner - - -class SubscriptionRequest(models.Model): - _inherit = "subscription.request" - - company_type = fields.Selection( - selection_add=res_partner.get_company_type_selection() - ) diff --git a/l10n_be_cooperator/readme/newsfragments/167.feature.rst b/l10n_be_cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/l10n_be_cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/l10n_be_cooperator/static/description/index.html b/l10n_be_cooperator/static/description/index.html index 17c001fda..517578200 100644 --- a/l10n_be_cooperator/static/description/index.html +++ b/l10n_be_cooperator/static/description/index.html @@ -3,15 +3,16 @@ -Cooperators Belgium +README.rst -
-

Cooperators Belgium

+
+ + +Odoo Community Association + +
+

Cooperators Belgium

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

This is the Belgian localization for the Cooperators module.

Features:

    @@ -397,7 +403,7 @@

    Cooperators Belgium

-

Known issues / Roadmap

+

Known issues / Roadmap

Tax shelter :

According to this @@ -417,16 +423,16 @@

Known issues / Roadmap

wait before adding this information in the report.

-

Changelog

+

Changelog

-

16.0.1.1.0 (2024-03-08)

+

16.0.1.1.0 (2024-03-08)

Features

-

16.0.1.0.0 (2023-12-04)

+

16.0.1.0.0 (2023-12-04)

Features

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -452,23 +458,25 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
-

Contributors

+

Contributors

  • Coop IT Easy SC
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -477,5 +485,6 @@

Maintainers

+
From 5bcddf0af2f49e423f53b4377eede026320fd8bb Mon Sep 17 00:00:00 2001 From: Simon Hick Date: Fri, 7 Nov 2025 04:15:18 +0100 Subject: [PATCH 4/7] [REF] l10n_fr_cooperator: replace legal_form by partner_company_type --- l10n_fr_cooperator/README.rst | 6 ++- l10n_fr_cooperator/__init__.py | 1 - l10n_fr_cooperator/__manifest__.py | 10 ++++- .../migrations/16.0.2.0.0/post-legal_form.py | 37 +++++++++++++++++++ l10n_fr_cooperator/models/__init__.py | 2 - l10n_fr_cooperator/models/partner.py | 20 ---------- .../models/subscription_request.py | 27 -------------- .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 35 +++++++++++------- .../views/subscription_template.xml | 27 ++++++++++++++ 10 files changed, 100 insertions(+), 66 deletions(-) create mode 100644 l10n_fr_cooperator/migrations/16.0.2.0.0/post-legal_form.py delete mode 100644 l10n_fr_cooperator/models/__init__.py delete mode 100644 l10n_fr_cooperator/models/partner.py delete mode 100644 l10n_fr_cooperator/models/subscription_request.py create mode 100644 l10n_fr_cooperator/readme/newsfragments/167.feature.rst create mode 100644 l10n_fr_cooperator/views/subscription_template.xml diff --git a/l10n_fr_cooperator/README.rst b/l10n_fr_cooperator/README.rst index 21fba6d02..3812f264b 100644 --- a/l10n_fr_cooperator/README.rst +++ b/l10n_fr_cooperator/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ============================== Cooperator France Localization ============================== @@ -13,7 +17,7 @@ Cooperator France Localization .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github diff --git a/l10n_fr_cooperator/__init__.py b/l10n_fr_cooperator/__init__.py index 0650744f6..e69de29bb 100644 --- a/l10n_fr_cooperator/__init__.py +++ b/l10n_fr_cooperator/__init__.py @@ -1 +0,0 @@ -from . import models diff --git a/l10n_fr_cooperator/__manifest__.py b/l10n_fr_cooperator/__manifest__.py index 74b06c722..9fa0c0cf3 100644 --- a/l10n_fr_cooperator/__manifest__.py +++ b/l10n_fr_cooperator/__manifest__.py @@ -4,8 +4,13 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).# { "name": "Cooperator France Localization", - "version": "16.0.1.0.0", - "depends": ["cooperator", "cooperator_website", "l10n_fr"], + "version": "16.0.2.0.0", + "depends": [ + "cooperator", + "cooperator_website", + "l10n_fr", + "l10n_fr_partner_company_type", + ], "author": "Coop IT Easy SC, Odoo Community Association (OCA)", "category": "Cooperative management", "website": "https://github.com/OCA/cooperative", @@ -15,6 +20,7 @@ """, "data": [ "views/certificate_template.xml", + "views/subscription_template.xml", ], "installable": True, "auto-install": True, diff --git a/l10n_fr_cooperator/migrations/16.0.2.0.0/post-legal_form.py b/l10n_fr_cooperator/migrations/16.0.2.0.0/post-legal_form.py new file mode 100644 index 000000000..c268812d1 --- /dev/null +++ b/l10n_fr_cooperator/migrations/16.0.2.0.0/post-legal_form.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # Copy the company_type from the deprecated legal_form field and + # use them to give the same company types from the partner_company_type + # module. We're using the fact that the values of the legal_form selection + # field are the same as the xml ids of the records in l10n_fr_partner_company_type. + # Make sure all the legal_forms have a corresponding id in the records. + cr.execute( + """ + UPDATE res_partner AS rp + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + rp.legal_form_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_fr_partner_company_type' + AND imd.name = rp.legal_form_deprecated + """ + ) + + # Same Operation for subscription_request + cr.execute( + """ + UPDATE subscription_request AS sr + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + sr.company_type_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_fr_partner_company_type' + AND imd.name = sr.company_type_deprecated + """ + ) diff --git a/l10n_fr_cooperator/models/__init__.py b/l10n_fr_cooperator/models/__init__.py deleted file mode 100644 index 4f14bd00a..000000000 --- a/l10n_fr_cooperator/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import subscription_request -from . import partner diff --git a/l10n_fr_cooperator/models/partner.py b/l10n_fr_cooperator/models/partner.py deleted file mode 100644 index 92e9af79c..000000000 --- a/l10n_fr_cooperator/models/partner.py +++ /dev/null @@ -1,20 +0,0 @@ -from odoo import fields, models - - -class ResPartner(models.Model): - _inherit = "res.partner" - - legal_form = fields.Selection( - selection_add=[ - ("asso", "Association"), - ("eurl", "EURL / Entreprise individuelle"), - ("sarl", "SARL"), - ("sa", "SA / SAS"), - ], - ondelete={ - "asso": "set null", - "eurl": "set null", - "sarl": "set null", - "sa": "set null", - }, - ) diff --git a/l10n_fr_cooperator/models/subscription_request.py b/l10n_fr_cooperator/models/subscription_request.py deleted file mode 100644 index a1b18c145..000000000 --- a/l10n_fr_cooperator/models/subscription_request.py +++ /dev/null @@ -1,27 +0,0 @@ -from odoo import fields, models - - -class SubscriptionRequest(models.Model): - _inherit = "subscription.request" - - company_type = fields.Selection( - selection_add=[ - ("asso", "Association"), - ("eurl", "EURL / Entreprise individuelle"), - ("sarl", "SARL"), - ("sa", "SA / SAS"), - ], - ondelete={ - "asso": "set null", - "eurl": "set null", - "sarl": "set null", - "sa": "set null", - }, - ) - - def get_required_field(self): - req_fields = super(SubscriptionRequest, self).get_required_field() - if "iban" in req_fields: - req_fields.remove("iban") - - return req_fields diff --git a/l10n_fr_cooperator/readme/newsfragments/167.feature.rst b/l10n_fr_cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/l10n_fr_cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/l10n_fr_cooperator/static/description/index.html b/l10n_fr_cooperator/static/description/index.html index 4332fcc74..aaf2b3e05 100644 --- a/l10n_fr_cooperator/static/description/index.html +++ b/l10n_fr_cooperator/static/description/index.html @@ -3,15 +3,16 @@ -Cooperator France Localization +README.rst -
-

Cooperator France Localization

+
+ + +Odoo Community Association + +
+

Cooperator France Localization

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

This is the French localization for the Cooperators module.

Features:

    @@ -388,7 +394,7 @@

    Cooperator France Localization

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -396,23 +402,25 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
-

Contributors

+

Contributors

  • Coop IT Easy SC
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -421,5 +429,6 @@

Maintainers

+
diff --git a/l10n_fr_cooperator/views/subscription_template.xml b/l10n_fr_cooperator/views/subscription_template.xml new file mode 100644 index 000000000..a35d45245 --- /dev/null +++ b/l10n_fr_cooperator/views/subscription_template.xml @@ -0,0 +1,27 @@ + + + + + + + From 15bf0b8bbc532a959520940318d5159ebd8b31ec Mon Sep 17 00:00:00 2001 From: Simon Hick Date: Fri, 7 Nov 2025 04:15:43 +0100 Subject: [PATCH 5/7] [REF] l10n_de_cooperator: replace legal_form by partner_company_type --- l10n_de_cooperator/README.rst | 6 ++- l10n_de_cooperator/__init__.py | 5 --- l10n_de_cooperator/__manifest__.py | 3 +- .../migrations/16.0.2.0.0/post-legal_form.py | 37 +++++++++++++++++++ l10n_de_cooperator/models/__init__.py | 6 --- l10n_de_cooperator/models/res_partner.py | 20 ---------- .../models/subscription_request.py | 15 -------- .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 35 +++++++++++------- 9 files changed, 67 insertions(+), 61 deletions(-) create mode 100644 l10n_de_cooperator/migrations/16.0.2.0.0/post-legal_form.py delete mode 100644 l10n_de_cooperator/models/__init__.py delete mode 100644 l10n_de_cooperator/models/res_partner.py delete mode 100644 l10n_de_cooperator/models/subscription_request.py create mode 100644 l10n_de_cooperator/readme/newsfragments/167.feature.rst diff --git a/l10n_de_cooperator/README.rst b/l10n_de_cooperator/README.rst index 1b253c4d7..39417a3f9 100644 --- a/l10n_de_cooperator/README.rst +++ b/l10n_de_cooperator/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =================== Cooperators Germany =================== @@ -13,7 +17,7 @@ Cooperators Germany .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github diff --git a/l10n_de_cooperator/__init__.py b/l10n_de_cooperator/__init__.py index a6c9053e3..e69de29bb 100644 --- a/l10n_de_cooperator/__init__.py +++ b/l10n_de_cooperator/__init__.py @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from . import models diff --git a/l10n_de_cooperator/__manifest__.py b/l10n_de_cooperator/__manifest__.py index d6c0a694f..8f5c08a2f 100644 --- a/l10n_de_cooperator/__manifest__.py +++ b/l10n_de_cooperator/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Cooperators Germany", "summary": "German localization for Cooperators module", - "version": "16.0.1.0.0", + "version": "16.0.2.0.0", "category": "Cooperative management", "website": "https://github.com/OCA/cooperative", "author": "Coop IT Easy SC, Odoo Community Association (OCA)", @@ -13,6 +13,7 @@ "depends": [ "cooperator_website", "l10n_de", + "l10n_de_partner_company_type", ], "data": [ "views/subscription_template.xml", diff --git a/l10n_de_cooperator/migrations/16.0.2.0.0/post-legal_form.py b/l10n_de_cooperator/migrations/16.0.2.0.0/post-legal_form.py new file mode 100644 index 000000000..055f537d3 --- /dev/null +++ b/l10n_de_cooperator/migrations/16.0.2.0.0/post-legal_form.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # Copy the company_type from the deprecated legal_form field and + # use them to give the same company types from the partner_company_type + # module. We're using the fact that the values of the legal_form selection + # field are the same as the xml ids of the records in l10n_de_partner_company_type. + # Make sure all the legal_forms have a corresponding id in the records. + cr.execute( + """ + UPDATE res_partner AS rp + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + rp.legal_form_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_de_partner_company_type' + AND imd.name = rp.legal_form_deprecated + """ + ) + + # Same Operation for subscription_request + cr.execute( + """ + UPDATE subscription_request AS sr + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + sr.company_type_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_de_partner_company_type' + AND imd.name = sr.company_type_deprecated + """ + ) diff --git a/l10n_de_cooperator/models/__init__.py b/l10n_de_cooperator/models/__init__.py deleted file mode 100644 index 1ba469515..000000000 --- a/l10n_de_cooperator/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from . import res_partner -from . import subscription_request diff --git a/l10n_de_cooperator/models/res_partner.py b/l10n_de_cooperator/models/res_partner.py deleted file mode 100644 index cb034b249..000000000 --- a/l10n_de_cooperator/models/res_partner.py +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from odoo import fields, models - - -def get_company_type_selection(): - return [ - ("ag", "AG"), - ("eg", "eG"), - ("gmbh", "GmbH"), - ("sdpr", "Stiftung des privaten Rechts"), - ] - - -class ResPartner(models.Model): - _inherit = "res.partner" - - legal_form = fields.Selection(selection_add=get_company_type_selection()) diff --git a/l10n_de_cooperator/models/subscription_request.py b/l10n_de_cooperator/models/subscription_request.py deleted file mode 100644 index 5ead31e17..000000000 --- a/l10n_de_cooperator/models/subscription_request.py +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from odoo import fields, models - -from . import res_partner - - -class SubscriptionRequest(models.Model): - _inherit = "subscription.request" - - company_type = fields.Selection( - selection_add=res_partner.get_company_type_selection() - ) diff --git a/l10n_de_cooperator/readme/newsfragments/167.feature.rst b/l10n_de_cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/l10n_de_cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/l10n_de_cooperator/static/description/index.html b/l10n_de_cooperator/static/description/index.html index 567ff77d1..d3fb71b5f 100644 --- a/l10n_de_cooperator/static/description/index.html +++ b/l10n_de_cooperator/static/description/index.html @@ -3,15 +3,16 @@ -Cooperators Germany +README.rst -
-

Cooperators Germany

+
+ + +Odoo Community Association + +
+

Cooperators Germany

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

German localization for Cooperators module.

Table of contents

@@ -383,7 +389,7 @@

Cooperators Germany

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -391,15 +397,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -419,5 +427,6 @@

Maintainers

+
From e8ab0b4a4a69a0b31b3a69b6fa834ab57906665c Mon Sep 17 00:00:00 2001 From: Simon Hick Date: Fri, 10 Oct 2025 17:14:59 +0200 Subject: [PATCH 6/7] [REF] l10n_ch_cooperator: replace legal_form by partner_company_type --- l10n_ch_cooperator/README.rst | 6 ++- l10n_ch_cooperator/__manifest__.py | 9 ++++- .../migrations/16.0.2.0.0/post-legal_form.py | 37 +++++++++++++++++++ l10n_ch_cooperator/models/__init__.py | 1 - l10n_ch_cooperator/models/res_partner.py | 24 ------------ .../models/subscription_request.py | 12 ++---- .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 24 +++++++----- 8 files changed, 68 insertions(+), 46 deletions(-) create mode 100644 l10n_ch_cooperator/migrations/16.0.2.0.0/post-legal_form.py delete mode 100644 l10n_ch_cooperator/models/res_partner.py create mode 100644 l10n_ch_cooperator/readme/newsfragments/167.feature.rst diff --git a/l10n_ch_cooperator/README.rst b/l10n_ch_cooperator/README.rst index 77fc16cc8..5e8431a85 100644 --- a/l10n_ch_cooperator/README.rst +++ b/l10n_ch_cooperator/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ======================= Cooperators Switzerland ======================= @@ -13,7 +17,7 @@ Cooperators Switzerland .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github diff --git a/l10n_ch_cooperator/__manifest__.py b/l10n_ch_cooperator/__manifest__.py index 0c3ea51df..cb283ebac 100644 --- a/l10n_ch_cooperator/__manifest__.py +++ b/l10n_ch_cooperator/__manifest__.py @@ -7,9 +7,14 @@ { "name": "Cooperators Switzerland", "summary": "Cooperators Switzerland localization", - "version": "16.0.1.0.0", + "version": "16.0.2.0.0", "license": "AGPL-3", - "depends": ["cooperator", "cooperator_website", "l10n_ch"], + "depends": [ + "cooperator", + "cooperator_website", + "l10n_ch", + "l10n_ch_partner_company_type", + ], "author": "Coop IT Easy SC, Odoo Community Association (OCA)", "category": "Cooperative management", "website": "https://github.com/OCA/cooperative", diff --git a/l10n_ch_cooperator/migrations/16.0.2.0.0/post-legal_form.py b/l10n_ch_cooperator/migrations/16.0.2.0.0/post-legal_form.py new file mode 100644 index 000000000..bf107cb70 --- /dev/null +++ b/l10n_ch_cooperator/migrations/16.0.2.0.0/post-legal_form.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +def migrate(cr, version): + # Copy the company_type from the deprecated legal_form field and + # use them to give the same company types from the partner_company_type + # module. We're using the fact that the values of the legal_form selection + # field are the same as the xml ids of the records in l10n_ch_partner_company_type. + # Make sure all the legal_forms have a corresponding id in the records. + cr.execute( + """ + UPDATE res_partner AS rp + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + rp.legal_form_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_ch_partner_company_type' + AND imd.name = rp.legal_form_deprecated + """ + ) + + # Same Operation for subscription_request + cr.execute( + """ + UPDATE subscription_request AS sr + SET partner_company_type_id = imd.res_id + FROM ir_model_data AS imd + WHERE + sr.company_type_deprecated IS NOT NULL + AND imd.model = 'res.partner.company.type' + AND imd.module = 'l10n_ch_partner_company_type' + AND imd.name = sr.company_type_deprecated + """ + ) diff --git a/l10n_ch_cooperator/models/__init__.py b/l10n_ch_cooperator/models/__init__.py index 3241f7822..d8d2ddbc1 100644 --- a/l10n_ch_cooperator/models/__init__.py +++ b/l10n_ch_cooperator/models/__init__.py @@ -2,5 +2,4 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -from . import res_partner from . import subscription_request diff --git a/l10n_ch_cooperator/models/res_partner.py b/l10n_ch_cooperator/models/res_partner.py deleted file mode 100644 index c7488b297..000000000 --- a/l10n_ch_cooperator/models/res_partner.py +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-FileCopyrightText: 2019 Coop IT Easy SC -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -from odoo import fields, models - - -def get_company_type_selection(): - return [ - ("ei", "Individual company"), - ("snc", "Partnership"), - ("sa", "Limited company (SA)"), - ("sarl", "Limited liability company (Ltd)"), - ("sc", "Cooperative"), - ("asso", "Association"), - ("fond", "Foundation"), - ("edp", "Company under public law"), - ] - - -class ResPartner(models.Model): - _inherit = "res.partner" - - legal_form = fields.Selection(selection_add=get_company_type_selection()) diff --git a/l10n_ch_cooperator/models/subscription_request.py b/l10n_ch_cooperator/models/subscription_request.py index c4f26cf86..5dd507aa2 100644 --- a/l10n_ch_cooperator/models/subscription_request.py +++ b/l10n_ch_cooperator/models/subscription_request.py @@ -2,20 +2,14 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -from odoo import fields, models - -from . import res_partner +from odoo import models class SubscriptionRequest(models.Model): _inherit = "subscription.request" - company_type = fields.Selection( - selection_add=res_partner.get_company_type_selection() - ) - def get_required_field(self): - req_fields = super(SubscriptionRequest, self).get_required_field() + req_fields = super().get_required_field() if "iban" in req_fields: req_fields.remove("iban") @@ -23,5 +17,5 @@ def get_required_field(self): def check_iban(self, iban): if iban: - return super(SubscriptionRequest, self).check_iban(iban) + return super().check_iban(iban) return True diff --git a/l10n_ch_cooperator/readme/newsfragments/167.feature.rst b/l10n_ch_cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..c0020e5e4 --- /dev/null +++ b/l10n_ch_cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Use the ``partner_company_type`` module to define company types instead of using a custom selection field. diff --git a/l10n_ch_cooperator/static/description/index.html b/l10n_ch_cooperator/static/description/index.html index 52ff9764f..2747f6dde 100644 --- a/l10n_ch_cooperator/static/description/index.html +++ b/l10n_ch_cooperator/static/description/index.html @@ -3,7 +3,7 @@ -Cooperators Switzerland +README.rst -
-

Cooperators Switzerland

+
+ + +Odoo Community Association + +
+

Cooperators Switzerland

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

This is the Swiss localization for the Cooperators module

Features:

    @@ -388,7 +393,7 @@

    Cooperators Switzerland

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -396,22 +401,22 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -424,5 +429,6 @@

Maintainers

+
From 11afe6afe2de3d2a658f68ec64c633fb6034cbb0 Mon Sep 17 00:00:00 2001 From: hugues de keyzer Date: Mon, 10 Nov 2025 17:05:49 +0100 Subject: [PATCH 7/7] [IMP] fix and improve layout of subscription form * adapt subscription form to changes in cooperator_website. * fix layout of bank account number and vat fields. --- l10n_es_cooperator/README.rst | 6 +++- l10n_es_cooperator/__manifest__.py | 2 +- .../readme/newsfragments/167.feature.rst | 1 + .../static/description/index.html | 26 ++++++++------ .../views/subscription_templates.xml | 35 ++++++++----------- 5 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 l10n_es_cooperator/readme/newsfragments/167.feature.rst diff --git a/l10n_es_cooperator/README.rst b/l10n_es_cooperator/README.rst index bfebd36cf..d6db284ff 100644 --- a/l10n_es_cooperator/README.rst +++ b/l10n_es_cooperator/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ============================= Cooperator Spain Localization ============================= @@ -13,7 +17,7 @@ Cooperator Spain Localization .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github diff --git a/l10n_es_cooperator/__manifest__.py b/l10n_es_cooperator/__manifest__.py index dad9f973d..8933d6ff3 100644 --- a/l10n_es_cooperator/__manifest__.py +++ b/l10n_es_cooperator/__manifest__.py @@ -1,7 +1,7 @@ { "name": "Cooperator Spain Localization", "summary": "Cooperator localization for Spain", - "version": "16.0.1.0.1", + "version": "16.0.1.1.0", "depends": [ "cooperator", "cooperator_website", diff --git a/l10n_es_cooperator/readme/newsfragments/167.feature.rst b/l10n_es_cooperator/readme/newsfragments/167.feature.rst new file mode 100644 index 000000000..5d0eec6c7 --- /dev/null +++ b/l10n_es_cooperator/readme/newsfragments/167.feature.rst @@ -0,0 +1 @@ +Adapt subscription form to changes in ``cooperator_website`` and fix layout of bank account number and VAT fields. diff --git a/l10n_es_cooperator/static/description/index.html b/l10n_es_cooperator/static/description/index.html index e08b0c5d0..0ecc35557 100644 --- a/l10n_es_cooperator/static/description/index.html +++ b/l10n_es_cooperator/static/description/index.html @@ -3,7 +3,7 @@ -Cooperator Spain Localization +README.rst -
-

Cooperator Spain Localization

+
+ + +Odoo Community Association + +
+

Cooperator Spain Localization

-

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/cooperative Translate me on Weblate Try me on Runboat

This addon implements Spanish localization for Cooperator Module

Features:

    @@ -390,12 +395,12 @@

    Cooperator Spain Localization

-

Known issues / Roadmap

+

Known issues / Roadmap

Move this feature to cooperator module - Change property_cooperator_account to not accept deprecated account

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -403,16 +408,16 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Coop IT Easy SC
  • Coopdevs Treball SCCL
-

Contributors

+

Contributors

  • Coopdevs Treball SCCL
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -437,5 +442,6 @@

Maintainers

+
diff --git a/l10n_es_cooperator/views/subscription_templates.xml b/l10n_es_cooperator/views/subscription_templates.xml index 330a986f6..94124ebf1 100644 --- a/l10n_es_cooperator/views/subscription_templates.xml +++ b/l10n_es_cooperator/views/subscription_templates.xml @@ -6,45 +6,40 @@ name="Become company cooperator" priority="150" > - + - +