Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import update_journal_lock_dates

View File

@@ -0,0 +1,31 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, _, fields, models
from odoo.exceptions import UserError
class UpdateJournalLockDatesWizard(models.TransientModel):
_name = "update.journal.lock.dates.wizard"
_description = "Mass Update Journal Lock Dates Wizard"
period_lock_date = fields.Date(string="Lock Date for Non-Advisers")
fiscalyear_lock_date = fields.Date(string="Lock Date")
def _check_execute_allowed(self):
self.ensure_one()
has_adviser_group = self.env.user.has_group("account.group_account_manager")
if not (has_adviser_group or self.env.uid == SUPERUSER_ID):
raise UserError(_("You are not allowed to execute this action."))
def action_update_lock_dates(self):
self.ensure_one()
self._check_execute_allowed()
active_ids = self.env.context.get("active_ids", False)
if active_ids:
self.env["account.journal"].browse(active_ids).write(
{
"period_lock_date": self.period_lock_date,
"fiscalyear_lock_date": self.fiscalyear_lock_date,
}
)

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="update_journal_lock_dates_wizard_action" model="ir.actions.act_window">
<field name="name">Update journals lock dates</field>
<field name="res_model">update.journal.lock.dates.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="account.model_account_journal" />
</record>
<record id="update_journal_lock_dates_wizard_view_form" model="ir.ui.view">
<field name="name">update.journal.lock.dates.wizard.form</field>
<field name="model">update.journal.lock.dates.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<group>
<field name="fiscalyear_lock_date" />
</group>
<group>
<field name="period_lock_date" />
</group>
</group>
<footer>
<button
name="action_update_lock_dates"
string="Update"
type="object"
class="btn-primary"
/>
<button string="Cancel" class="btn-secondary" special="cancel" />
</footer>
</form>
</field>
</record>
</odoo>