mirror of
https://github.com/bringout/oca-hr.git
synced 2026-04-23 00:32:00 +02:00
Reorganized 67 HR-related modules for better structure: - Moved all odoo-bringout-oca-hr-* packages from packages/oca-technical/ - Now organized in dedicated packages/oca-hr/ submodule - Includes attendance, expense, holiday, employee, and contract modules - Maintains all module functionality while improving project organization This creates a cleaner separation between general technical modules and HR-specific functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
18 lines
739 B
Python
18 lines
739 B
Python
# Copyright 2019 Tecnativa - Ernesto Tejeda
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import SUPERUSER_ID, api
|
|
|
|
|
|
def post_init_hook(cr, registry):
|
|
"""Trying to fill the source expense sheet in payments"""
|
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
sheets = env["hr.expense.sheet"].search([("payment_mode", "=", "own_account")])
|
|
for sheet in sheets:
|
|
amls = sheet.account_move_id.mapped("line_ids")
|
|
reconcile = amls.mapped("full_reconcile_id")
|
|
aml_payment = reconcile.mapped("reconciled_line_ids").filtered(
|
|
lambda r: r not in amls
|
|
)
|
|
payment = aml_payment.mapped("payment_id")
|
|
payment.write({"expense_sheet_ids": sheet.ids})
|