Repository navigation
Conversation
Remove menu item, ACL row, PO translations, and code that passed the invoicer object through _generate_gifts and generate_gift_wizard. The invoicer parameter is no longer needed now that recurring.invoicer is removed from compassion-accounting. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…wizard Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request simplifies the gift generation process by removing the recurring.invoicer model and its associated parameters, views, security rules, and translations across the codebase. Feedback on these changes highlights two main improvements: first, the overridden _generate_invoices method in contract_group.py should return the result of the super() call to prevent returning None implicitly; second, the final log message in contracts.py should use gift_type.name instead of gift_type to avoid printing the raw Odoo recordset representation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| def _generate_invoices(self): | ||
| # Exclude gifts from regular generation | ||
| invoicer = super( | ||
| super( | ||
| ContractGroup, self.with_context(open_invoices_sponsorship_only=True) | ||
| )._generate_invoices(invoicer_id) | ||
| )._generate_invoices() | ||
| contracts = self.active_contract_ids | ||
| if contracts: | ||
| contracts._generate_gifts( | ||
| invoicer, self.env.ref("sponsorship_compassion.gift_type_birthday") | ||
| self.env.ref("sponsorship_compassion.gift_type_birthday") | ||
| ) | ||
| contracts._generate_gifts( | ||
| invoicer, self.env.ref("sponsorship_compassion.gift_type_christmas") | ||
| self.env.ref("sponsorship_compassion.gift_type_christmas") | ||
| ) |
There was a problem hiding this comment.
The _generate_invoices method overrides the parent method but does not return its result. If other modules or callers expect a return value (such as the generated invoices or a boolean), this implicit None return could cause issues. It is safer to capture and return the result of the super() call.
| def _generate_invoices(self): | |
| # Exclude gifts from regular generation | |
| invoicer = super( | |
| super( | |
| ContractGroup, self.with_context(open_invoices_sponsorship_only=True) | |
| )._generate_invoices(invoicer_id) | |
| )._generate_invoices() | |
| contracts = self.active_contract_ids | |
| if contracts: | |
| contracts._generate_gifts( | |
| invoicer, self.env.ref("sponsorship_compassion.gift_type_birthday") | |
| self.env.ref("sponsorship_compassion.gift_type_birthday") | |
| ) | |
| contracts._generate_gifts( | |
| invoicer, self.env.ref("sponsorship_compassion.gift_type_christmas") | |
| self.env.ref("sponsorship_compassion.gift_type_christmas") | |
| ) | |
| def _generate_invoices(self): | |
| # Exclude gifts from regular generation | |
| res = super( | |
| ContractGroup, self.with_context(open_invoices_sponsorship_only=True) | |
| )._generate_invoices() | |
| contracts = self.active_contract_ids | |
| if contracts: | |
| contracts._generate_gifts( | |
| self.env.ref("sponsorship_compassion.gift_type_birthday") | |
| ) | |
| contracts._generate_gifts( | |
| self.env.ref("sponsorship_compassion.gift_type_christmas") | |
| ) | |
| return res |
[Medium impact] The code appears safe to merge with the required companion PRs and deployment checks. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Generate group invoices] --> B[Generate regular invoices]
B --> C[Find active contracts]
C --> D[Generate birthday gifts]
C --> E[Generate Christmas gifts]
D --> F[Gift wizard]
E --> F
F --> G[Create and post gift invoices]
Reviews (3) · Last reviewed commit: "[T3284] Merge origin/18.0 into T3284-Rem..." · Reviewed by Greptile |
- Return super() result in _generate_invoices override - Use gift_type.name in log messages instead of recordset repr
|
@greptileai review |
[STAGING REQUIRED] Must be tested on Stage prior to production merge.
T3284 – Remove the recurring.invoicer object
The
recurring.invoicermodel kept a history of generated invoice batches ("Generated invoices") that has no use for the users. This PR removes it and simplifies invoice generation.Related PRs (merge together, in this order):
Changes
recurring_contract (compassion-accounting)
recurring.invoicerandrecurring.invoicer.wizardremoved, along with the "Generated invoices" menu and the link from invoices to their batch.generate_from_cron()directly (no confirmation wizard).invoice_generation_cron(noupdate). The friday cron exists only in the database and is kept as is. Their server actions move torecurring.contract.group. Active state, next call and interval stay unchanged.account_move.recurring_invoicer_id, therecurring_invoicerandrecurring_invoicer_wizardtables, and saved filters whose domain usesrecurring_invoicer_id.sponsorship_compassion (compassion-modules)
_generate_invoices/_generate_gifts. Menu entry removed from the translations.sponsorship_switzerland (compassion-switzerland)
_build_invoice_gen_dataoverride no longer gets the invoicer.gift_wizardis passed as a keyword.Tested locally (stage18_neutralized, 2026-11-19)
recurring.contract.group. Tables, column, saved filter and menus removed.How to test on Stage
At deploy
_generate_invoicesqueue jobs are pending or failed (they would fail with the new signature).🤖 Generated with Claude Code