Skip to content

[ADD] contract_invoice_company_domain - #1500

Open
tobiaszehntner wants to merge 1 commit into
OCA:18.0from
acsone:18.0-contract-invoice-company-domain
Open

[ADD] contract_invoice_company_domain#1500
tobiaszehntner wants to merge 1 commit into
OCA:18.0from
acsone:18.0-contract-invoice-company-domain

Conversation

@tobiaszehntner

@tobiaszehntner tobiaszehntner commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This module lets each company control which of its contracts are picked
up by the recurring invoices cron.

Per company you can:

  • Disable recurring invoice generation entirely.
  • Restrict generation to the contracts matching an extra domain, on top
    of the domains contributed by the standard flow and other contract
    modules.

AI:

  • Claude Opus 4.8: conception and writing of code

@tobiaszehntner
tobiaszehntner marked this pull request as draft August 20, 2026 09:26
@OCA-git-bot OCA-git-bot added series:18.0 mod:contract_invoice_company_domain Module contract_invoice_company_domain labels Aug 20, 2026
@tobiaszehntner
tobiaszehntner force-pushed the 18.0-contract-invoice-company-domain branch 3 times, most recently from f412580 to 2284a9d Compare August 21, 2026 10:43
@tobiaszehntner
tobiaszehntner force-pushed the 18.0-contract-invoice-company-domain branch from 2284a9d to cd3beb9 Compare August 21, 2026 10:57
@tobiaszehntner
tobiaszehntner marked this pull request as ready for review August 21, 2026 11:03
if extra_domain:
# The extra domain restricts this company's contracts only.
company_clauses.append(
expression.OR([[("company_id", "!=", company.id)], extra_domain])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be:
company_clauses.append(expression.AND([[("company_id", "=", company.id)], extra_domain]))
?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no because the company_clauses are ANDed together below, so it would exclude contracts of other companies. Other companies should still have their contracts invoiced , and the extra domain should apply to this specific company only, hence [(company != X) OR company-domain]

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

Labels

mod:contract_invoice_company_domain Module contract_invoice_company_domain series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants