Skip to content

[19.0][MIG] account_cutoff_base#357

Open
alexis-via wants to merge 154 commits into
OCA:19.0from
akretion:19-mig-account_cutoff_base
Open

[19.0][MIG] account_cutoff_base#357
alexis-via wants to merge 154 commits into
OCA:19.0from
akretion:19-mig-account_cutoff_base

Conversation

@alexis-via

Copy link
Copy Markdown
Contributor

No description provided.

Alexis de Lattre and others added 30 commits January 19, 2026 12:10
Use assert
Remove .keys()
No space before colon
PEP8/Flake8 : getting closer to compliancy
…de domains)

On account.account, type must be <> 'view' and <> 'closed'
…a single warning left !

Add translation template files.
The signature of existing methods is preserved.
Extract a new module account_invoice_start_end_dates from account_cutoff_prepaid
Use triple double quotes for docstring
Replace <openerp> by <odoo> in XML
Remove <data> tags in XML
Remove POT files
Currently translated at 100,0% (73 of 73 strings)

Translation: account-closing-11.0/account-closing-11.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-11-0/account-closing-11-0-account_cutoff_base/de/
mymage and others added 20 commits January 19, 2026 12:10
Currently translated at 100.0% (133 of 133 strings)

Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/it/
Currently translated at 100.0% (133 of 133 strings)

Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/sv/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/
Currently translated at 100.0% (132 of 132 strings)

Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/it/
Add record rules for cutoff lines and cutoff tax lines
On account.cutoff, the domain for the cutoff journal has
type='general', like on the default value the accounting config page
Fix license in manifest which was set to LGPL by mistake in the
migration commit from v16 to v17
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/
Currently translated at 100.0% (132 of 132 strings)

Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/it/
Currently translated at 100.0% (132 of 132 strings)

Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/fr/
Currently translated at 100.0% (132 of 132 strings)

Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base
Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/es_AR/
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 24, 2026

@petrus-v petrus-v left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm approving with some improvement suggestions. Also I would love to see more tests in this module, as an independent module it should cover its code.

_check_company_auto = True
_description = "Account Cut-off Line"

parent_id = fields.Many2one("account.cutoff", string="Cut-off", ondelete="cascade")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would have called it account_cutoff_id, parent/child are mainly used when model is pointing to itself

Comment on lines +392 to +404
def _get_mapping_dict(self):
"""return a dict with:
key = ID of account,
value = ID of cutoff_account"""
self.ensure_one()
mappings = self.env["account.cutoff.mapping"].search(
Domain(
[
("company_id", "=", self.company_id.id),
("cutoff_type", "in", ("all", self.cutoff_type)),
]
)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I can see this method is used in account_cutoff_start_and_end dates module but I would rather prepare the mapping record with concerned record only so this method could use an optionnal source accounts.

Suggested change
def _get_mapping_dict(self):
"""return a dict with:
key = ID of account,
value = ID of cutoff_account"""
self.ensure_one()
mappings = self.env["account.cutoff.mapping"].search(
Domain(
[
("company_id", "=", self.company_id.id),
("cutoff_type", "in", ("all", self.cutoff_type)),
]
)
)
def _get_mapping_dict(self, source_accounts=None):
"""return a dict with:
key = ID of account,
value = ID of cutoff_account"""
self.ensure_one()
domain = Domain(
[
("company_id", "=", self.company_id.id),
("cutoff_type", "in", ("all", self.cutoff_type)),
]
)
if source_accounts:
domain &= Domain("account_id", "in", source_accounts.ids)
mappings = self.env["account.cutoff.mapping"].search(
)

@AnizR AnizR left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for your contribution!

Code LGTM, just some nit picking.

options="{'no_create': True}"
readonly="state == 'done'"
/>
<field name="company_currency_id" invisible="1" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can be safely removed since odoo/odoo#137031

Suggested change
<field name="company_currency_id" invisible="1" />

<field name="cutoff_date" decoration-bf="1" />
<field name="move_ref" optional="hide" />
<field name="total_cutoff_amount" />
<field name="company_currency_id" column_invisible="1" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can be safely removed

Suggested change
<field name="company_currency_id" column_invisible="1" />

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@petrus-v

Copy link
Copy Markdown

@alexis-via I've propose a PR on top of yours to take care of main reviews here.

the last but not least is the field renaming (parent_id to cutoff_id and cutoff_line_id), I've a commit that do it, it is working but will impact other modules, so do you think we can do it in this version or do you prefer to do it in the next version ?

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.