Skip to content

[18.0] Fix om_fiscal_year duplicate Hard Lock Date labels + journal xpath - #198

Closed
ezoer wants to merge 1 commit into
odoomates:18.0from
ezoer:fix/18.0-fiscal-lock-labels-and-journal-xpath
Closed

ezoer wants to merge 1 commit into
odoomates:18.0from
ezoer:fix/18.0-fiscal-lock-labels-and-journal-xpath

Conversation

@ezoer

@ezoer ezoer commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Two Community accounting issues observed on Odoo 18 production (Elementure):

  1. om_fiscal_year — tax_lock_date / sale_lock_date / purchase_lock_date / hard_lock_date on res.config.settings are all related='company_id.hard_lock_date' without explicit string=. Related fields inherit the comodel label, so Odoo warns that multiple fields share "Hard Lock Date" (and Sentry captures it when logging includes warnings).
  2. om_account_accountant — journal form xpath //field[@name='inbound_payment_method_line_ids']/list/field[@name='payment_account_id'] failed during view combine (ValueError: Element ... cannot be located in parent view) when the payment-method list structure differs (e.g. with account_payment inheritance). Using descendant //field[@name='payment_account_id'] is more resilient and matches patterns already used in Odoo core account_payment views.

Changes

  • om_fiscal_year/models/account_settings.py: set explicit string= on each lock-date related field.
  • om_account_accountant/views/account_journal.xml: change xpath to //field[@name='…_payment_method_line_ids']//field[@name='payment_account_id'].

Test plan

  • Install/upgrade om_fiscal_year on Odoo 18; confirm no Two fields … have the same label: Hard Lock Date warning in logs.
  • Open Accounting → Configuration → Journals form with account_payment installed; confirm no view inheritance error and payment account columns still optional=show.
  • Smoke: Settings → Fiscal Years / lock dates UI still shows distinct labels.

Made with Cursor

Related lock-date fields on res.config.settings inherited the
company_id.hard_lock_date label ("Hard Lock Date"), triggering Odoo's
duplicate-label warning on module upgrade/load.

Journal form xpaths used a rigid /list/field path that can fail when
account_payment (or similar) alters the payment-method list structure;
switch to descendant //field matching.

Co-authored-by: Cursor <cursoragent@cursor.com>
@odoomates

Copy link
Copy Markdown
Owner

hi @ezoer ,
appreciate the PR, we have patched the fix along with other enhancements. without asking for a rebase, we have fixed it, kudoos to you.

thank you

@odoomates odoomates closed this Sep 18, 2026
odoomates added a commit that referenced this pull request Sep 18, 2026
…heck and journal xpath

om_hr_payroll_account
- Confirming a payslip raised "Missing Debit Or Credit Account in Salary Rule"
  whenever no single salary rule carried both accounts, even though the debit
  and the credit side may legitimately come from two different rules. The check
  now looks at the accounts of the whole payslip. Reported in PR #135.

om_account_accountant
- The journal xpath required the payment method fields to sit directly inside a
  <list>, so it broke as soon as another module wrapped or altered it. Reported
  in PR #198.
odoomates added a commit that referenced this pull request Sep 18, 2026
…heck and journal xpath

om_hr_payroll_account
- Confirming a payslip raised "Missing Debit Or Credit Account in Salary Rule"
  whenever no single salary rule carried both accounts, even though the debit
  and the credit side may legitimately come from two different rules. The check
  now looks at the accounts of the whole payslip. Reported in PR #135.

om_account_accountant
- The journal xpath required the payment method fields to sit directly inside a
  <list>, so it broke as soon as another module wrapped or altered it. Reported
  in PR #198.
odoomates added a commit that referenced this pull request Sep 18, 2026
…heck and journal xpath

om_hr_payroll_account
- Confirming a payslip raised "Missing Debit Or Credit Account in Salary Rule"
  whenever no single salary rule carried both accounts, even though the debit
  and the credit side may legitimately come from two different rules. The check
  now looks at the accounts of the whole payslip. Reported in PR #135.

om_account_accountant
- The journal xpath required the payment method fields to sit directly inside a
  <list>, so it broke as soon as another module wrapped or altered it. Reported
  in PR #198.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants