Skip to content

[18.0][MIG] cooperator - #182

Open
marcos-mendez wants to merge 808 commits into
OCA:18.0from
marcos-mendez:18.0-mig-cooperator
Open

[18.0][MIG] cooperator#182
marcos-mendez wants to merge 808 commits into
OCA:18.0from
marcos-mendez:18.0-mig-cooperator

Conversation

@marcos-mendez

@marcos-mendez marcos-mendez commented Aug 12, 2026

Copy link
Copy Markdown

Migration of cooperator to 18.0, with the full 16.0 commit history preserved (292 commits, original authorship kept) and a single migration commit on top.

Restructured from the original multi-module submission following the reviewers' convention of one module per PR. The dependent modules are submitted separately: cooperator_portal, cooperator_website and l10n_br_cooperator #183 (portal), #184 (website) and #185 (l10n_br_cooperator).

Migration highlights

  • attrs/states converted to expression syntax; Python field-level states moved to view-level readonly expressions
  • account.chart.template hook ported to the AbstractModel API — cooperator accounting initialization works on new companies
  • account.account created through with_company(); res.company ported to chart_template / _existing_accounting()
  • mail templates ported to report_template_ids, attachment filenames preserved through print_report_name
  • report layout and invoice report re-anchored on the 18.0 templates
  • account.invoice.report._select() composes SQL objects (string concatenation raised TypeError)

Bugs found and fixed during the migration

  1. block_subscription_request wrote state "block" while the selection defines "blocked" — the Block button raised ValueError when clicked.
  2. The confirmation mail email_to evaluated ", " + False for company requests without a company email, aborting the request creation (guarded; the data file is noupdate).
  3. The partner-create-subscription wizard created the representative with cooperator=True, which raises ValidationError since the cooperative-membership refactor.
  4. cooperative.membership.get_cooperator_from_crn() searched company_register_number on the membership model itself; the field lives on res.partner and the method crashed on every call.

subscription.request.create() also batches properly now (40 records: 307 → 229 queries).

Quality

  • 126 tests for this module, 0 failures (upstream had 85 for the whole family)
  • Coverage 96.5%
  • pre-commit green with the 18.0 branch configuration
  • Running in production on a database migrated from 16.0 via OpenUpgrade

@OCA-git-bot OCA-git-bot added mod:cooperator_website Module cooperator_website mod:cooperator Module cooperator mod:cooperator_portal Module cooperator_portal mod:l10n_br_cooperator Module l10n_br_cooperator series:18.0 labels Aug 12, 2026
@OCA-git-bot OCA-git-bot removed mod:cooperator_website Module cooperator_website mod:cooperator_portal Module cooperator_portal mod:l10n_br_cooperator Module l10n_br_cooperator labels Aug 12, 2026
@marcos-mendez marcos-mendez changed the title [18.0][MIG] cooperator, cooperator_portal, cooperator_website + [ADD] l10n_br_cooperator [18.0][MIG] cooperator Aug 12, 2026
@marcos-mendez
marcos-mendez force-pushed the 18.0-mig-cooperator branch 3 times, most recently from e4bacca to 622a995 Compare August 12, 2026 19:43

@huguesdk huguesdk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your contribution.

first of all, please read this: https://github.com/OCA/.github/blob/master/AI_POLICY.md

i’m not going to read lengthy verbose ai-generated descriptions and commit messages that are probably only partly correct.

important: most modules in this repository had a different name in version 12.0 and earlier (for example, cooperator was called easy_my_coop). please see the full history in 16.0 to find out the previous names. it’s important to keep the full commit history. until now, we did that by providing multiple directories to git format-patch. but a better solution is to rename the directory in the commit history itself by using git filter-branch, as explained here (see “If the module is renamed…”).

also: if an ai agent replies to this, this pr will be closed.

@marcos-mendez

Copy link
Copy Markdown
Author

Ok @huguesdk let me see what i can do here. Sorry for the history coopiteasy lost.

OCA-git-bot and others added 28 commits August 14, 2026 17:07
update share fields values of the internal subscription request of a
transfer operation to a non-member when these values are changed in the
form. this ensures that the values are correct even if the subscription
request is created before the values are set.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: cooperative-16.0/cooperative-16.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator/
fix default value of subscription.request.country_id.
Currently translated at 100.0% (472 of 472 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator/it/
rename obsolete occurrences of the "blocked" subscription.request state
still present as "block".
Currently translated at 100.0% (472 of 472 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator/it/
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
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator/
Currently translated at 100.0% (474 of 474 strings)

Translation: cooperative-16.0/cooperative-16.0-cooperator
Translate-URL: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator/it/
attrs/states converted to expression syntax; account.chart.template
hook ported to the AbstractModel API; mail templates moved to
report_template_ids; account.invoice.report._select() composes SQL
objects instead of concatenating strings.

Fixes four bugs found while migrating:
- block_subscription_request wrote state "block", the selection
  defines "blocked"
- the confirmation mail email_to evaluated ", " + False when a company
  request had no company email, aborting the request
- the partner-create-subscription wizard set cooperator=True on the
  representative, raising ValidationError
- get_cooperator_from_crn() searched company_register_number on the
  membership model; the field is on res.partner

Assisted-by: Claude Opus 5
@huguesdk

Copy link
Copy Markdown
Member

thank you for your (human) answer. ☺️ no worries about the commit history, it’s difficult to find out without knowing.

another thing to pay attention to: although the commit history is there, it seems that the migration commit is based on an quite older version of the code, as it is missing all the changes from the 16.0 branch that happened in the last 2 years: #144, #140, #166, #169, #162, #170, #171, #173 (claiming that it fixed a bug, that was actually already fixed) and #176. please base the migration on the latest version of the 16.0 branch.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.