mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -603,8 +603,12 @@ class ContractContract(models.Model):
|
|||||||
# Invoice by companies, so assignation emails get correct context
|
# Invoice by companies, so assignation emails get correct context
|
||||||
companies_to_invoice = self.read_group(domain, ["company_id"], ["company_id"])
|
companies_to_invoice = self.read_group(domain, ["company_id"], ["company_id"])
|
||||||
for row in companies_to_invoice:
|
for row in companies_to_invoice:
|
||||||
contracts_to_invoice = self.search(row["__domain"]).with_context(
|
contracts_to_invoice = (
|
||||||
allowed_company_ids=[row["company_id"][0]]
|
self.search(row["__domain"])
|
||||||
|
.with_context(allowed_company_ids=[row["company_id"][0]])
|
||||||
|
.filtered(
|
||||||
|
lambda a: not a.date_end or a.recurring_next_date <= a.date_end
|
||||||
|
)
|
||||||
)
|
)
|
||||||
invoices |= contracts_to_invoice._recurring_create_invoice(date_ref)
|
invoices |= contracts_to_invoice._recurring_create_invoice(date_ref)
|
||||||
return invoices
|
return invoices
|
||||||
|
|||||||
Reference in New Issue
Block a user