Skip to content

[18.0][ADD] l10n_br_cooperator - #185

Closed
marcos-mendez wants to merge 425 commits into
OCA:18.0from
marcos-mendez:18.0-add-l10n_br_cooperator
Closed

[18.0][ADD] l10n_br_cooperator#185
marcos-mendez wants to merge 425 commits into
OCA:18.0from
marcos-mendez:18.0-add-l10n_br_cooperator

Conversation

@marcos-mendez

Copy link
Copy Markdown

New module: Brazilian localization for the cooperator flow, following the pattern of l10n_es_cooperator.

Stacked on #182 (includes its commits — please review only the last commit here). Depends on cooperator being merged first.

  • CPF/CNPJ on the subscription request — backoffice and public website form — validated through the official l10n_br_base checker (country-aware and honoring the kill-switch parameter, so foreign cooperators keep working), with automatic formatting on change
  • The document becomes the cooperator identity: partner matching by vat instead of email, avoiding duplicate members
  • company_register_number filled from the CNPJ instead of hidden — the cooperator flow uses it to match company partners, and hiding it (as the Spanish localization does) breaks that path
  • iban removed from the required fields: Brazil does not use IBAN and the base website form only ships an empty iban container for localizations, which made the public form impossible to submit

Tests: 24 cases, 100% coverage. Pre-commit green.

carmenbianca and others added 30 commits August 12, 2026 16:16
Previously, these functions were only called on one record. The new
configuration correctly searches all records.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: cooperative-14.0/cooperative-14.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-14-0/cooperative-14-0-cooperator/
Currently translated at 18.6% (78 of 418 strings)

Translation: cooperative-14.0/cooperative-14.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-14-0/cooperative-14-0-cooperator/it/
Currently translated at 42.5% (178 of 418 strings)

Translation: cooperative-14.0/cooperative-14.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-14-0/cooperative-14-0-cooperator/it/
Currently translated at 100.0% (418 of 418 strings)

Translation: cooperative-14.0/cooperative-14.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-14-0/cooperative-14-0-cooperator/it/
* fix xml declarations.
* pad the contents of <odoo> tags with an empty line.
* update email templates to the default odoo layout (what also makes
  them shorter).
* fix the company name in confirmation email template: display the name
  of the company that made the subscription request instead of the name
  of the cooperative.
* add a description to email templates.
* merge the confirmation email template for individuals and companies
  into one.
* update translations.
* refactor subscription.request.create() and use model_create_multi
  decorator on it and on res.company.create().
* remove subscription.request.create_comp_sub_req() and
  subscription.request.check_empty_string().
only display shares for the current company on the cooperator
certificate.
* fix the layout of all reports by rewriting them from the default
  invoice layout.
* make the capital release request report inherit from the invoice
  report instead of copying and modifying it.
* rename xml ids to improve consistency.
ensure reversals of capital release requests use a name prefix to not
clash with normal entries ("RSUBJ" instead of "SUBJ").
fix copyright statements: add missing ones and use the same format
everywhere.
fix the display of the first name in email templates and add tests to
cover this.
* add operation requests tests.
* fix small issues.
* remove the useless "subscription" operation request type.
* fix the display of the first name in share transfer email for
  companies.
* improve the code to get the first name in mail templates for
  companies.
* refactor subscription.request.validate_subscription_request().
fix subscription requests created by transfer operations: ensure that no
confirmation email is sent, that they don't appear in the list of
subscription requests and cannot be erroneously validated.
fix required company fields on subscription request form.
rename internal string value of "blocked" subscription request state
from "block" to "blocked".
prevent to create a subscription request where email and company email
have the same value, to avoid trying to create a recursive partner
hierarchy when validating the subscription request (the partner being
the parent of itself).
Ivorra78 and others added 27 commits August 12, 2026 17:05
Currently translated at 100.0% (56 of 56 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/es/
Currently translated at 100.0% (56 of 56 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/it/
Currently translated at 1.7% (1 of 56 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/ca/
Currently translated at 8.9% (5 of 56 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/ca/
co-authored-by: hugues de keyzer <odoo@hugues.info>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/
Currently translated at 100.0% (57 of 57 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/
remove useless if statement and pass created subscription request to
.get_subscription_response()
ensure that the ordered_parts field can correctly be passed as an
argument to the subscription form and that its value is kept in case of
errors when submitting the form.
Currently translated at 100.0% (58 of 58 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator_website
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website/it/
- the thanks page was redesigned in 18.0: the positional xpath into
  the old markup was replaced by an anchor on p.lead
- the form javascript ported from odoo.define/web.ajax (removed API)
  to an ES module with publicWidget and rpc, renamed to .esm.js per
  the repository eslint convention; behavior preserved: share price,
  minimum quantity and total recomputed on the form
- end-to-end HttpCase suite: public and logged-in subscription flows
  for individuals and companies (share increase, unmix share types,
  identity document upload with attachment), every error path
  (missing required fields, mismatched emails, existing user, IBAN,
  maximum amount), localization-aware payloads through
  get_required_field()

Tests: 20 HTTP cases; coverage 98.9%. Pre-commit green.
CPF/CNPJ on the subscription request, validated through the official
l10n_br_base checker (country-aware and honoring the kill-switch
parameter, so foreign cooperators keep working), with automatic
formatting on change. The document becomes the cooperator identity:
partner matching by vat instead of email, avoiding duplicate members.

company_register_number is filled from the CNPJ instead of hidden
(the cooperator flow uses it to match company partners), and iban is
removed from the required fields: Brazil does not use IBAN and the
base website form only ships an empty iban container for
localizations, which made the public form impossible to submit.

Tests: 24 cases, 100% coverage. Pre-commit green.
@marcos-mendez
marcos-mendez force-pushed the 18.0-add-l10n_br_cooperator branch from cb54266 to 1914eb0 Compare August 12, 2026 20:05
@marcos-mendez

Copy link
Copy Markdown
Author

Will submit after #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:cooperator_portal Module cooperator_portal mod:cooperator_website Module cooperator_website mod:cooperator Module cooperator mod:l10n_br_cooperator Module l10n_br_cooperator series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.