Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions account_reconcile_compassion_ce/models/bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ def _get_manual_reconcile_vals(self):

def _reconcile_move_line_vals(self, line, move_id=False):
vals = super()._reconcile_move_line_vals(line, move_id=move_id)
vals["product_id"] = line.get("product_id", (False,))[0]
vals["contract_id"] = line.get("contract_id", (False,))[0]
vals["product_id"] = (
line.get("product_id")[0] if line.get("product_id") else False
)
vals["contract_id"] = (
line.get("contract_id")[0] if line.get("contract_id") else False
)
return vals

def _check_line_changed(self, line):
Expand Down
3 changes: 1 addition & 2 deletions account_statement_import_compassion_ee/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"category": "Finance",
"website": "https://github.com/CompassionCH/compassion-accounting",
"depends": [
# OCA/queue
"queue_job",
"queue_job_optional",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Fix dependency name
The manifests now depend on queue_job_optional, but this repository does not add that module and the PR description names the new compatibility module as queue_job_sh_safe. With the current dependency, Odoo cannot install or upgrade account_statement_import_compassion_ee or recurring_contract unless an unrelated addon named queue_job_optional is present in the addons path.

Artifacts

Repro: generated manifest dependency resolver script

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: resolver terminal output showing missing queue_job_optional dependency

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

# OCA/bank-statement-import
"account_bank_statement_import_camt",
# Odoo/enterprise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ def _import_file(self):
_logger.info(
"Launching reconciliation of %d statement lines", len(line_to_reconcile)
)
line_to_reconcile.with_delay(
line_to_reconcile.with_delay_sh(
"_cron_try_auto_reconcile_statement_lines",
channel="root.accounting",
priority=100,
description="Auto Reconcile statement lines",
)._cron_try_auto_reconcile_statement_lines()
)
else:
_logger.warning("No statement lines to reconcile")
return res
3 changes: 1 addition & 2 deletions recurring_contract/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"account_payment_order", # OCA/bank-payment,
"base_automation",
"account_payment_partner", # OCA/bank-payment,
"queue_job", # OCA/queue,
"queue_job_optional",
"utm",
],
"data": [
Expand All @@ -59,7 +59,6 @@
"data/pricelist_item_base_automation.xml",
"data/daily_invoicer_cron.xml",
"data/utm_data.xml",
"data/queue_job.xml",
"security/ir.model.access.csv",
],
"installable": True,
Expand Down
14 changes: 0 additions & 14 deletions recurring_contract/data/queue_job.xml

This file was deleted.

15 changes: 11 additions & 4 deletions recurring_contract/models/contract_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,26 @@ def button_generate_invoices(self):
def generate_invoices(self):
invoicer = self.env["recurring.invoicer"].create({})
for group in self:
group.with_delay(
group.with_delay_sh(
"_generate_invoices",
invoicer.id,
channel="root.accounting",
priority=100,
identity_key=self._name + ".generate_invoices." + str(group.id),
)._generate_invoices(invoicer)
)
return invoicer

def _generate_invoices(self, invoicer):
def _generate_invoices(self, invoicer_id=False):
"""Checks all contracts and generate invoices if needed.
Create an invoice per contract group per date.
"""
_logger.info(
f"Starting generation of invoices for contract groups : {self.ids}"
)
if invoicer_id:
invoicer = self.env["recurring.invoicer"].browse(invoicer_id)
else:
invoicer = self.env["recurring.invoicer"].create({})

# Set to track processed invoices to avoid duplication
processed_invoices = set()
Expand Down Expand Up @@ -326,7 +333,7 @@ def _generate_invoices(self, invoicer):
# Refresh state to check whether invoices are missing in some contracts
self.mapped("active_contract_ids")._compute_missing_invoices()
_logger.info("Process successfully generated invoices")
return True
return invoicer

def _calculate_start_date_and_offset(self):
"""
Expand Down
5 changes: 3 additions & 2 deletions recurring_contract/models/recurring_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,12 @@ def generate_invoices(self):
self.mapped("group_id").generate_invoices()

def cancel_contract_invoices(self):
self.with_delay(
self.with_delay_sh(
"_cancel_invoices",
channel="root.accounting",
priority=500,
identity_key=self._name + ".cancel_contract_invoices." + str(self.ids),
)._cancel_invoices()
)

@api.onchange("partner_id")
def on_change_partner_id(self):
Expand Down
Loading