accountant_cn

This commit is contained in:
2026-11-17 17:57:08 +08:00
parent 9b924747c5
commit 5fc4382687
771 changed files with 18102 additions and 820280 deletions

View File

@@ -0,0 +1,434 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================ year-end closing wizard -->
<record id="view_dn_fiscal_year_closing_form" model="ir.ui.view">
<field name="name">dn.fiscal.year.closing.form</field>
<field name="model">dn.fiscal.year.closing</field>
<field name="arch" type="xml">
<form string="Year-End Closing">
<header>
<button name="action_preview" type="object" string="Preview"
class="btn-secondary"/>
<button name="action_close" type="object" string="Generate Closing Entry"
class="oe_highlight"/>
<field name="move_id" invisible="1"/>
</header>
<sheet>
<div class="alert alert-info" role="alert">
Closing transfers every profit and loss balance of the period to retained
earnings, so income and expense accounts start the new fiscal year at zero.
Assets, liabilities and equity are not affected. Use Preview to check the
amounts before generating the entry.
</div>
<group>
<group string="Period">
<field name="company_id" groups="base.group_multi_company"/>
<field name="fiscal_year_id"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group string="Settings">
<field name="journal_id"/>
<field name="retained_earnings_account_id"/>
<field name="post_move"/>
<field name="lock_after_close"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
<group>
<group string="Result">
<field name="amount"/>
<field name="line_count"/>
</group>
<group string="Generated Entry">
<field name="move_id"/>
</group>
</group>
<notebook>
<page string="Closing Details" name="preview">
<field name="preview_line_ids" readonly="1">
<list>
<field name="account_code"/>
<field name="account_name"/>
<field name="balance"/>
<field name="closing_amount"/>
<field name="currency_id" column_invisible="1"/>
</list>
</field>
<div class="text-muted mt-2" invisible="preview_line_ids">
No preview yet. Click Preview to list the accounts and amounts
that will be closed.
</div>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- ============================ lock date wizard -->
<!--
Layout follows the enterprise `account.change.lock.date` dialog: one
row per lock date, with the effective exception shown inline and a
Revoke link right next to it. The geometry is the same on purpose —
the "For me / For everyone" suffix only makes sense when it sits on
the same line as the date it qualifies, and stacking it underneath
hides the fact that a period is still open for one audience only.
-->
<record id="view_dn_lock_date_wizard_form" model="ir.ui.view">
<field name="name">dn.lock.date.wizard.form</field>
<field name="model">dn.lock.date.wizard</field>
<field name="arch" type="xml">
<form string="Lock Journal Entries">
<sheet>
<group>
<field name="company_id" invisible="1"/>
<field name="show_draft_entries_warning" invisible="1"/>
<div class="alert alert-warning mb-0 d-flex gap-2 flex-wrap"
role="alert" colspan="2"
invisible="not show_draft_entries_warning">
There are still draft entries in the period you want to lock. You should either post or delete them.
<a type="object" class="oe_link fw-bold"
name="action_show_draft_moves_in_locked_period">
Review
</a>
</div>
<field name="show_posted_tax_closing_warning" invisible="1"/>
<div class="alert alert-warning mb-0 d-flex gap-2 flex-wrap"
role="alert" colspan="2"
invisible="not show_posted_tax_closing_warning">
A posted tax return closing entry exists after this tax lock date. You might want to reset the related tax return to non-submitted.
<a type="object" class="oe_link fw-bold"
name="action_show_posted_tax_closing_in_locked_period">
Review
</a>
</div>
<div class="text-muted mb-1 dn_italic" colspan="2">
Lock transactions up to specific dates, inclusive
</div>
<!-- The eight exception pointers are technical: they
are what the Revoke buttons act on, so they have to
be in the view but never in front of the user. -->
<field name="min_sale_lock_date_exception_for_me_id" invisible="1"/>
<field name="min_purchase_lock_date_exception_for_me_id" invisible="1"/>
<field name="min_tax_lock_date_exception_for_me_id" invisible="1"/>
<field name="min_fiscalyear_lock_date_exception_for_me_id" invisible="1"/>
<field name="min_sale_lock_date_exception_for_everyone_id" invisible="1"/>
<field name="min_purchase_lock_date_exception_for_everyone_id" invisible="1"/>
<field name="min_tax_lock_date_exception_for_everyone_id" invisible="1"/>
<field name="min_fiscalyear_lock_date_exception_for_everyone_id" invisible="1"/>
<field name="exception_needed_fields" invisible="1"/>
<label for="sale_lock_date"/>
<div class="d-flex">
<field name="sale_lock_date" placeholder="Not locked"
class="oe_inline"
decoration-info="exception_needed_fields and 'sale_lock_date' in exception_needed_fields"
options="{'warning': 'future'}"/>
<span class="text-muted o_form_label"
invisible="not min_sale_lock_date_exception_for_me_id">
For me:
<field name="sale_lock_date_for_me" nolabel="1" class="oe_inline"
invisible="not sale_lock_date_for_me"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_sale_lock_date_exception_for_me">
Revoke
</a>
</span>
<span class="text-muted o_form_label dn_lock_sep"
invisible="not min_sale_lock_date_exception_for_me_id
or not min_sale_lock_date_exception_for_everyone_id"/>
<span class="text-muted o_form_label"
invisible="not min_sale_lock_date_exception_for_everyone_id">
For everyone:
<field name="sale_lock_date_for_everyone" nolabel="1" class="oe_inline"
invisible="not sale_lock_date_for_everyone"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_sale_lock_date_exception_for_everyone">
Revoke
</a>
</span>
</div>
<label for="purchase_lock_date"/>
<div class="d-flex">
<field name="purchase_lock_date" placeholder="Not locked"
class="oe_inline"
decoration-info="exception_needed_fields and 'purchase_lock_date' in exception_needed_fields"
options="{'warning': 'future'}"/>
<span class="text-muted o_form_label"
invisible="not min_purchase_lock_date_exception_for_me_id">
For me:
<field name="purchase_lock_date_for_me" nolabel="1" class="oe_inline"
invisible="not purchase_lock_date_for_me"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_purchase_lock_date_exception_for_me">
Revoke
</a>
</span>
<span class="text-muted o_form_label dn_lock_sep"
invisible="not min_purchase_lock_date_exception_for_me_id
or not min_purchase_lock_date_exception_for_everyone_id"/>
<span class="text-muted o_form_label"
invisible="not min_purchase_lock_date_exception_for_everyone_id">
For everyone:
<field name="purchase_lock_date_for_everyone" nolabel="1" class="oe_inline"
invisible="not purchase_lock_date_for_everyone"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_purchase_lock_date_exception_for_everyone">
Revoke
</a>
</span>
</div>
<label for="tax_lock_date"/>
<div class="d-flex">
<field name="tax_lock_date" placeholder="Not locked"
class="oe_inline"
decoration-info="exception_needed_fields and 'tax_lock_date' in exception_needed_fields"
options="{'warning': 'future'}"/>
<div class="text-muted dn_italic ms-2"
invisible="min_tax_lock_date_exception_for_me_id or min_tax_lock_date_exception_for_everyone_id">
after a tax closing
</div>
<span class="text-muted o_form_label"
invisible="not min_tax_lock_date_exception_for_me_id">
For me:
<field name="tax_lock_date_for_me" nolabel="1" class="oe_inline"
invisible="not tax_lock_date_for_me"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_tax_lock_date_exception_for_me">
Revoke
</a>
</span>
<span class="text-muted o_form_label dn_lock_sep"
invisible="not min_tax_lock_date_exception_for_me_id
or not min_tax_lock_date_exception_for_everyone_id"/>
<span class="text-muted o_form_label"
invisible="not min_tax_lock_date_exception_for_everyone_id">
For everyone:
<field name="tax_lock_date_for_everyone" nolabel="1" class="oe_inline"
invisible="not tax_lock_date_for_everyone"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_tax_lock_date_exception_for_everyone">
Revoke
</a>
</span>
</div>
<label for="fiscalyear_lock_date"/>
<div class="d-flex">
<field name="fiscalyear_lock_date" placeholder="Not locked"
class="oe_inline"
decoration-info="exception_needed_fields and 'fiscalyear_lock_date' in exception_needed_fields"
options="{'warning': 'future'}"/>
<div class="text-muted dn_italic ms-2"
invisible="min_fiscalyear_lock_date_exception_for_me_id or min_fiscalyear_lock_date_exception_for_everyone_id">
but allow exceptions
</div>
<span class="text-muted o_form_label"
invisible="not min_fiscalyear_lock_date_exception_for_me_id">
For me:
<field name="fiscalyear_lock_date_for_me" nolabel="1" class="oe_inline"
invisible="not fiscalyear_lock_date_for_me"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_fiscalyear_lock_date_exception_for_me">
Revoke
</a>
</span>
<span class="text-muted o_form_label dn_lock_sep"
invisible="not min_fiscalyear_lock_date_exception_for_me_id
or not min_fiscalyear_lock_date_exception_for_everyone_id"/>
<span class="text-muted o_form_label"
invisible="not min_fiscalyear_lock_date_exception_for_everyone_id">
For everyone:
<field name="fiscalyear_lock_date_for_everyone" nolabel="1" class="oe_inline"
invisible="not fiscalyear_lock_date_for_everyone"/>
<a type="object" class="oe_link fw-bold"
name="action_revoke_min_fiscalyear_lock_date_exception_for_everyone">
Revoke
</a>
</span>
</div>
<!-- Exception form. Only shown when the user is trying
to move a lock date backwards: a plain forward
move needs no justification, and showing the form
anyway would suggest it does. -->
<div class="alert alert-info ps-3 mt-2 mb-0 d-flex flex-wrap"
role="alert" colspan="2" style="white-space: pre;"
invisible="not exception_needed_fields">
Exception
<field name="exception_applies_to" class="oe_inline mx-3"/>
<field name="exception_duration" class="oe_inline"/>
<field name="exception_reason" placeholder="Reason..."
class="oe_inline mx-3 flex-grow-1"
widget="text"
options="{'line_breaks': False}"
invisible="exception_applies_to == 'everyone' and exception_duration == 'forever'"/>
</div>
<div class="d-flex justify-content-start" colspan="2">
<div class="alert alert-danger ps-3 mb-3" role="alert">
<div>Need an irreversible lock to ensure inalterability, for all users?</div>
<div class="d-flex">
<label for="hard_lock_date"/>
<field name="hard_lock_date" placeholder="Not locked"
class="oe_inline mx-3"
decoration-info="exception_needed_fields and 'hard_lock_date' in exception_needed_fields"
options="{'warning': 'future'}"/>
<div class="text-danger o_form_label dn_italic"
invisible="hard_lock_date == current_hard_lock_date">
This change is irreversible
</div>
<field name="current_hard_lock_date" invisible="1"/>
</div>
</div>
</div>
<!-- Closing checklist. Not part of the enterprise
dialog, but this module also owns the year-end
closing, and locking a period whose result has
not been transferred yet makes the closing entry
impossible to book. -->
<div class="text-muted mt-2 dn_italic" colspan="2">
Checks before locking
</div>
<group colspan="2">
<group>
<field name="draft_move_count" readonly="1"/>
<button name="action_show_draft_moves" type="object"
string="Show Draft Entries" class="btn-link"
colspan="2" invisible="draft_move_count == 0"/>
</group>
<group>
<field name="unreconciled_count" readonly="1"/>
<button name="action_show_unreconciled" type="object"
string="Show Unreconciled Items" class="btn-link"
colspan="2" invisible="unreconciled_count == 0"/>
<field name="unreconciled_statement_count" readonly="1"/>
<button name="action_show_unreconciled_statements" type="object"
string="Show Unreconciled Bank Transactions" class="btn-link"
colspan="2" invisible="unreconciled_statement_count == 0"/>
</group>
</group>
<div class="alert alert-warning mb-0" role="alert" colspan="2"
invisible="not has_pl_balance">
The period still has a profit and loss balance. Run the year-end closing first, otherwise the closing entry cannot be booked into this period.
</div>
</group>
</sheet>
<footer>
<button string="Save" name="action_apply" type="object"
class="btn-primary" data-hotkey="q"/>
<button class="btn-secondary" special="cancel" data-hotkey="x"/>
</footer>
</form>
</field>
</record>
<!-- ============================ fiscal year registry -->
<record id="view_dn_fiscal_year_list" model="ir.ui.view">
<field name="name">dn.fiscal.year.list</field>
<field name="model">dn.fiscal.year</field>
<field name="arch" type="xml">
<list decoration-success="state == 'closed'"
decoration-warning="state == 'open' and locked">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="profit" sum="Total Period Result"/>
<field name="state" widget="badge"
decoration-success="state == 'closed'"
decoration-info="state == 'open'"/>
<field name="locked"/>
<field name="closing_move_id"/>
<field name="currency_id" column_invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<button name="action_open_closing_wizard" type="object"
string="Close" icon="fa-calculator"
invisible="state == 'closed'"/>
</list>
</field>
</record>
<record id="view_dn_fiscal_year_form" model="ir.ui.view">
<field name="name">dn.fiscal.year.form</field>
<field name="model">dn.fiscal.year</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_open_closing_wizard" type="object"
string="Run Closing" class="oe_highlight"
invisible="state == 'closed'"/>
<button name="action_reopen" type="object"
string="Mark as Open"
invisible="state != 'closed'"
confirm="This only resets the status flag; the closing entry is kept. Continue?"/>
</header>
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="e.g. Fiscal Year 2026"/></h1>
</div>
<group>
<group>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group>
<field name="state"/>
<field name="locked"/>
<field name="profit"/>
<field name="closing_move_id"/>
<field name="currency_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- ============================ actions -->
<record id="action_dn_fiscal_year_closing" model="ir.actions.act_window">
<field name="name">Year-End Closing</field>
<field name="res_model">dn.fiscal.year.closing</field>
<field name="view_mode">form</field>
<field name="target">current</field>
<field name="context">{'create': True}</field>
</record>
<record id="action_dn_lock_date_wizard" model="ir.actions.act_window">
<field name="name">Lock Journal Entries</field>
<field name="res_model">dn.lock.date.wizard</field>
<field name="view_mode">form</field>
<!-- `target=new` like the enterprise action: the dialog is a side
step, the user should land back on the report or list they were
looking at once the lock date is saved. -->
<field name="target">new</field>
<field name="context">{'create': True}</field>
</record>
<record id="action_dn_fiscal_year" model="ir.actions.act_window">
<field name="name">Fiscal Years</field>
<field name="res_model">dn.fiscal.year</field>
<field name="view_mode">list,form</field>
</record>
<!-- ============================ menus -->
<menuitem id="menu_dn_accounting_root" name="Closing &amp; Locking"
parent="account.menu_finance_entries"
sequence="40"
groups="account.group_account_manager"/>
<menuitem id="menu_dn_fiscal_year" name="Fiscal Years"
parent="menu_dn_accounting_root"
action="action_dn_fiscal_year" sequence="10"/>
<!-- Same label as the enterprise menu item so a user migrating from
enterprise finds it where they expect. -->
<menuitem id="menu_dn_lock_date" name="Lock Dates…"
parent="menu_dn_accounting_root"
action="action_dn_lock_date_wizard" sequence="20"
groups="account.group_account_manager"/>
</odoo>

View File

@@ -0,0 +1,241 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================================================
Checks — kanban
The check is worked through one at a time, so the card shows the
description inline rather than hiding it behind a click: the whole
point is that the reviewer reads the instruction.
============================================================ -->
<record id="view_dn_audit_check_kanban" model="ir.ui.view">
<field name="name">dn.audit.check.kanban</field>
<field name="model">dn.audit.check</field>
<field name="arch" type="xml">
<kanban default_group_by="result" records_draggable="1" create="1">
<!-- `name` has to be declared even though the card prints it
through `record.name.raw_value`: the record only carries
the fields the view asks for, so reading a raw_value for
an undeclared field is `undefined.raw_value` and blows the
whole kanban up the moment a record is rendered. -->
<field name="name"/>
<field name="result"/>
<field name="check_type"/>
<field name="cycle_id"/>
<field name="return_id"/>
<field name="attachment_count"/>
<templates>
<t t-name="card" class="o_dn_audit_check_card">
<div class="d-flex flex-column w-100">
<div class="d-flex justify-content-between align-items-start gap-2">
<strong><field name="name"/></strong>
<span t-if="record.check_type.raw_value === 'file'"
class="badge text-bg-secondary flex-shrink-0">Document</span>
</div>
<div t-if="record.cycle_id.raw_value" class="small text-muted mt-1">
<field name="cycle_id"/>
</div>
<div class="small text-muted mt-1" t-if="record.attachment_count.raw_value">
<i class="fa fa-paperclip me-1"/><field name="attachment_count"/>
</div>
</div>
</t>
<t t-name="menu">
<a class="dropdown-item" type="object" name="action_open">Open</a>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_dn_audit_check_form" model="ir.ui.view">
<field name="name">dn.audit.check.form</field>
<field name="model">dn.audit.check</field>
<field name="arch" type="xml">
<form string="Check">
<header>
<!-- Direct method buttons rather than server actions: the
whole job is a one-field write, and referencing a
server action defined further down the same file
resolves at load time, before that record exists. -->
<button name="action_mark_done" type="object"
string="Mark Done" class="btn-primary"
invisible="result in ('done', 'na')"/>
<button name="action_mark_na" type="object"
string="Not Applicable" invisible="result in ('done', 'na')"/>
<field name="result" widget="statusbar"
statusbar_visible="todo,done,na,comment"/>
</header>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="return_id" readonly="1"/>
<field name="cycle_id"/>
<field name="check_type"/>
</group>
<group>
<field name="user_id"/>
<field name="date_review"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
</group>
</group>
<group string="Instructions">
<field name="description" nolabel="1" colspan="2" readonly="1"/>
</group>
<group string="Review">
<field name="comment" nolabel="1" colspan="2"
placeholder="What did you check, and what did you find?"/>
</group>
<group string="Documents"
invisible="check_type != 'file' and not attachment_ids">
<field name="attachment_ids" nolabel="1" colspan="2"
widget="many2many_binary"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_dn_audit_check_list" model="ir.ui.view">
<field name="name">dn.audit.check.list</field>
<field name="model">dn.audit.check</field>
<field name="arch" type="xml">
<list string="Checks" decoration-danger="result == 'todo'"
decoration-success="result in ('done', 'na')">
<field name="return_id"/>
<field name="name"/>
<field name="cycle_id"/>
<field name="check_type"/>
<field name="result" widget="badge"
decoration-danger="result == 'todo'"
decoration-success="result in ('done', 'na')"
decoration-warning="result == 'comment'"/>
<field name="user_id"/>
<field name="date_review"/>
<field name="attachment_count"/>
</list>
</field>
</record>
<record id="view_dn_audit_check_search" model="ir.ui.view">
<field name="name">dn.audit.check.search</field>
<field name="model">dn.audit.check</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="return_id"/>
<field name="cycle_id"/>
<filter name="todo" string="To Do" domain="[('result', '=', 'todo')]"/>
<filter name="done" string="Done" domain="[('result', '=', 'done')]"/>
<filter name="na" string="Not Applicable" domain="[('result', '=', 'na')]"/>
<separator/>
<filter name="mine" string="Assigned to Me"
domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="group_cycle" string="Cycle" context="{'group_by': 'cycle_id'}"/>
<filter name="group_result" string="Result" context="{'group_by': 'result'}"/>
</search>
</field>
</record>
<record id="action_dn_audit_check" model="ir.actions.act_window">
<field name="name">Checks</field>
<field name="res_model">dn.audit.check</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_dn_audit_check_search"/>
<field name="context">{'search_default_todo': 1}</field>
</record>
<!-- Small server actions, so the two statusbar buttons on the check form
do not need a wizard just to write a selection value. -->
<record id="action_dn_audit_check_set_done" model="ir.actions.server">
<field name="name">Mark Check Done</field>
<field name="model_id" ref="model_dn_audit_check"/>
<field name="binding_model_id" ref="model_dn_audit_check"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">records.action_set_result('done')</field>
</record>
<record id="action_dn_audit_check_set_na" model="ir.actions.server">
<field name="name">Mark Check Not Applicable</field>
<field name="model_id" ref="model_dn_audit_check"/>
<field name="binding_model_id" ref="model_dn_audit_check"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">records.action_set_result('na')</field>
</record>
<!-- ============================================================
Cycles and templates — configuration
============================================================ -->
<record id="view_dn_audit_cycle_list" model="ir.ui.view">
<field name="name">dn.audit.cycle.list</field>
<field name="model">dn.audit.cycle</field>
<field name="arch" type="xml">
<list editable="bottom" string="Audit Cycles">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="code"/>
<field name="description"/>
<field name="active" widget="boolean_toggle"/>
</list>
</field>
</record>
<record id="action_dn_audit_cycle" model="ir.actions.act_window">
<field name="name">Audit Cycles</field>
<field name="res_model">dn.audit.cycle</field>
<field name="view_mode">list,form</field>
</record>
<record id="view_dn_audit_check_template_list" model="ir.ui.view">
<field name="name">dn.audit.check.template.list</field>
<field name="model">dn.audit.check.template</field>
<field name="arch" type="xml">
<list editable="bottom" string="Check Templates">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="cycle_id"/>
<field name="check_type"/>
<field name="active" widget="boolean_toggle"/>
</list>
</field>
</record>
<record id="view_dn_audit_check_template_form" model="ir.ui.view">
<field name="name">dn.audit.check.template.form</field>
<field name="model">dn.audit.check.template</field>
<field name="arch" type="xml">
<form string="Check Template">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="cycle_id"/>
<field name="check_type"/>
<field name="sequence"/>
</group>
<group>
<field name="active"/>
</group>
</group>
<group string="Instructions">
<field name="description" nolabel="1" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_dn_audit_check_template" model="ir.actions.act_window">
<field name="name">Check Templates</field>
<field name="res_model">dn.audit.check.template</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Working Files replaces the stop-gap journal-item list that used to sit
under Review > Audit. The xmlid `dn_account_full_menu.menu_action_working_files`
is what the menu tree already points at, so the entry keeps its place
(Review > Audit, sequence 10) and only its target changes. -->
<record id="accountant_cn.menu_action_working_files" model="ir.ui.menu">
<field name="name">Working Files</field>
<field name="action" ref="action_dn_audit_return"/>
</record>
<menuitem id="menu_dn_audit_config" name="Working Files"
parent="account.menu_finance_configuration" sequence="95"
groups="account.group_account_manager">
<menuitem id="menu_dn_audit_cycle" name="Audit Cycles"
action="action_dn_audit_cycle" sequence="10"/>
<menuitem id="menu_dn_audit_check_template" name="Check Templates"
action="action_dn_audit_check_template" sequence="20"/>
<menuitem id="menu_dn_audit_all_returns" name="All Working Files"
action="action_dn_audit_return_all" sequence="30"/>
</menuitem>
</odoo>

View File

@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================================================
Working file — kanban
Grouped by review status, because that is the question a reviewer
asks first ("what is still open?"), not "which period is this".
============================================================ -->
<record id="view_dn_audit_return_kanban" model="ir.ui.view">
<field name="name">dn.audit.return.kanban</field>
<field name="model">dn.audit.return</field>
<field name="arch" type="xml">
<kanban default_group_by="review_state" class="o_kanban_mobile"
records_draggable="0" create="1">
<field name="review_state"/>
<field name="is_completed"/>
<field name="is_late"/>
<field name="check_count"/>
<field name="resolved_check_count"/>
<field name="progress"/>
<templates>
<t t-name="card" class="o_dn_audit_card">
<div class="d-flex flex-column w-100 h-100">
<div class="d-flex flex-row justify-content-between w-100 px-2 py-2 gap-2">
<h5 class="text-truncate mb-0" t-att-title="record.name.raw_value">
<field name="name"/>
</h5>
<span t-if="record.is_late.raw_value"
class="badge rounded-pill text-bg-danger flex-shrink-0"
title="Past its deadline">Late</span>
</div>
<div class="d-flex flex-column w-100 px-2 gap-2">
<div class="d-flex justify-content-between small text-muted">
<span><field name="date_from"/></span>
<span>→</span>
<span><field name="date_to"/></span>
</div>
<div class="w-100">
<div class="d-flex justify-content-between small">
<span>Checks</span>
<span class="text-muted">
<field name="resolved_check_count"/> / <field name="check_count"/>
</span>
</div>
<div class="progress mt-1" style="height: 6px;">
<div class="progress-bar bg-success" role="progressbar"
t-att-style="'width: ' + record.progress.raw_value + '%'"
t-att-aria-valuenow="record.progress.raw_value"
aria-valuemin="0" aria-valuemax="100"/>
</div>
</div>
</div>
<div class="d-flex flex-row-reverse w-100 mt-auto px-2 py-2 align-items-center">
<field name="activity_ids" widget="kanban_activity"/>
</div>
</div>
</t>
<t t-name="menu">
<a class="dropdown-item" type="object" name="action_pause"
t-if="record.review_state.raw_value === 'ongoing'">Pause</a>
<a class="dropdown-item" type="object" name="action_resume"
t-if="record.review_state.raw_value === 'paused'">Resume</a>
<a class="dropdown-item" type="object" name="action_mark_done"
t-if="!record.is_completed.raw_value">Mark as Done</a>
<a class="dropdown-item" type="object" name="action_reset_to_ongoing"
t-if="record.is_completed.raw_value">Reset to Ongoing</a>
<a class="dropdown-item" type="object" name="action_load_templates">Load Check Templates</a>
<a class="dropdown-item" type="object" name="action_view_checks">Open Checks</a>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ============================================================
Working file — form
============================================================ -->
<record id="view_dn_audit_return_form" model="ir.ui.view">
<field name="name">dn.audit.return.form</field>
<field name="model">dn.audit.return</field>
<field name="arch" type="xml">
<form string="Working File">
<header>
<button name="action_mark_done" type="object"
string="Mark as Done" class="btn-primary"
invisible="is_completed"/>
<button name="action_pause" type="object" string="Pause"
invisible="review_state != 'ongoing'"/>
<button name="action_resume" type="object" string="Resume"
invisible="review_state != 'paused'"/>
<button name="action_reset_to_ongoing" type="object"
string="Reset to Ongoing" invisible="not is_completed"/>
<button name="action_load_templates" type="object"
string="Load Check Templates"/>
<field name="review_state" widget="statusbar"
statusbar_visible="ongoing,paused,done"/>
</header>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="e.g. 2026-10 Close"/></h1>
</div>
<group>
<group string="Period">
<field name="date_from"/>
<field name="date_to"/>
<field name="date_deadline"/>
</group>
<group string="Organisation">
<field name="company_id" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
<field name="cycle_ids" widget="many2many_tags"
options="{'no_create': True}"/>
</group>
</group>
<div class="d-flex gap-3 my-3">
<div class="alert alert-info mb-0 flex-grow-1" role="status">
<strong><field name="resolved_check_count"/> / <field name="check_count"/></strong>
checks resolved —
<strong><field name="unresolved_check_count"/></strong> outstanding.
</div>
</div>
<notebook>
<page string="Checks" name="checks">
<field name="check_ids" nolabel="1">
<list editable="bottom" decoration-danger="result == 'todo'"
decoration-success="result in ('done', 'na')">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="cycle_id"/>
<field name="check_type"/>
<field name="result"/>
<field name="user_id"/>
<field name="date_review"/>
<field name="comment" optional="hide"/>
</list>
</field>
</page>
<page string="Notes" name="notes">
<field name="notes" placeholder="Working notes for this period..."/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ============================================================
Working file — list
============================================================ -->
<record id="view_dn_audit_return_list" model="ir.ui.view">
<field name="name">dn.audit.return.list</field>
<field name="model">dn.audit.return</field>
<field name="arch" type="xml">
<list string="Working Files"
decoration-danger="is_late"
decoration-muted="is_completed">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="date_deadline"/>
<field name="review_state" widget="badge"
decoration-info="review_state == 'ongoing'"
decoration-warning="review_state == 'paused'"
decoration-success="review_state == 'done'"/>
<field name="check_count" string="Checks"/>
<field name="unresolved_check_count" string="Issues"/>
<field name="progress" widget="progressbar" optional="show"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
</list>
</field>
</record>
<!-- ============================================================
Working file — search
============================================================ -->
<record id="view_dn_audit_return_search" model="ir.ui.view">
<field name="name">dn.audit.return.search</field>
<field name="model">dn.audit.return</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="date_deadline"/>
<field name="cycle_ids"/>
<filter name="ongoing" string="Ongoing"
domain="[('review_state', '=', 'ongoing')]"/>
<filter name="paused" string="Paused"
domain="[('review_state', '=', 'paused')]"/>
<filter name="done" string="Done"
domain="[('review_state', '=', 'done')]"/>
<separator/>
<!-- `is_late` is a non-stored computed field, so it cannot be
used in a search domain. The equivalent domain compares
the deadline against today directly, which also keeps the
semantics honest: a file is late because its deadline has
passed, not because a cached flag says so. -->
<filter name="late" string="Late"
domain="[('date_deadline', '&lt;', 'today'), ('is_completed', '=', False)]"/>
<filter name="archived" string="Archived"
domain="[('active', '=', False)]"/>
<separator/>
<filter name="group_cycle" string="Cycle"
context="{'group_by': 'cycle_ids'}"/>
<filter name="group_state" string="Review Status"
context="{'group_by': 'review_state'}"/>
<filter name="group_company" string="Company"
context="{'group_by': 'company_id'}"
groups="base.group_multi_company"/>
</search>
</field>
</record>
<!-- ============================================================
Actions
============================================================ -->
<record id="action_dn_audit_return" model="ir.actions.act_window">
<field name="name">Working Files</field>
<field name="res_model">dn.audit.return</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_dn_audit_return_search"/>
<field name="context">{'search_default_ongoing': 1, 'search_default_paused': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">No pending working files</p>
<p>Create a working file to start your next period review.</p>
</field>
</record>
<record id="action_dn_audit_return_all" model="ir.actions.act_window">
<field name="name">All Working Files</field>
<field name="res_model">dn.audit.return</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_dn_audit_return_search"/>
</record>
</odoo>

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================ reconciliation session form -->
<record id="view_dn_bank_rec_wizard_form" model="ir.ui.view">
<field name="name">dn.bank.rec.wizard.form</field>
<field name="model">dn.bank.rec.wizard</field>
<field name="arch" type="xml">
<form string="Bank Reconciliation">
<header>
<button name="action_match_selected" type="object"
string="Match Selected" class="oe_highlight"/>
<button name="action_create_counterpart" type="object"
string="Create Entry and Reconcile"/>
<button name="action_apply_rules" type="object"
string="Apply Rules"/>
<button name="action_unreconcile" type="object"
string="Undo Reconciliation"
confirm="Undo the reconciliation of this bank transaction?"/>
<button name="action_refresh_candidates" type="object"
string="Recompute Suggestions" class="btn-link"/>
</header>
<sheet>
<div class="oe_title">
<h2><field name="payment_ref" readonly="1" placeholder="No label"/></h2>
</div>
<group>
<group string="Bank Transaction">
<field name="date" readonly="1"/>
<field name="journal_id" readonly="1"/>
<field name="partner_id" readonly="1"/>
<field name="amount" readonly="1"/>
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
</group>
<group string="Progress">
<field name="remaining_amount" readonly="1"/>
<field name="suggestion_count" readonly="1"/>
</group>
</group>
<notebook>
<page string="Suggested Matches" name="candidates">
<field name="candidate_ids" nolabel="1">
<list create="0" delete="0"
decoration-success="selected">
<field name="score" string="Score"/>
<field name="reason" string="Why"/>
<field name="date"/>
<field name="move_name"/>
<field name="label"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="amount_residual" sum="Total"/>
<field name="selected" widget="boolean_toggle"/>
<field name="currency_id" column_invisible="True"/>
<field name="move_line_id" column_invisible="True"/>
</list>
</field>
<div class="text-muted small mt-2">
Flag the rows to settle and press Match Selected. Several rows can be
selected to split one bank transaction across multiple documents.
</div>
</page>
<page string="Manual Entry" name="manual">
<group>
<group string="Counterpart">
<field name="counterpart_account_id"/>
<field name="manual_label"/>
<field name="manual_partner_id"/>
</group>
<group string="Amount and Tax">
<field name="manual_amount"/>
<field name="manual_tax_id"/>
</group>
</group>
<div class="text-muted small">
Fill this in and press Create Entry and Reconcile: a counterpart line
is added to the bank transaction's entry and reconciled right away.
</div>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- ============================ statement line workspace -->
<record id="view_dn_statement_line_list" model="ir.ui.view">
<field name="name">dn.statement.line.list</field>
<field name="model">account.bank.statement.line</field>
<field name="arch" type="xml">
<list string="Bank Transactions" create="0" delete="0"
decoration-success="is_reconciled"
decoration-warning="not is_reconciled">
<field name="date"/>
<field name="journal_id"/>
<field name="payment_ref"/>
<field name="partner_id"/>
<field name="amount" sum="Total"/>
<field name="currency_id" column_invisible="True"/>
<field name="is_reconciled" widget="boolean_toggle"/>
<button name="action_open_dn_reconciliation" type="object"
string="Reconcile" icon="fa-handshake-o"
invisible="is_reconciled"/>
</list>
</field>
</record>
<record id="view_dn_statement_line_search" model="ir.ui.view">
<field name="name">dn.statement.line.search</field>
<field name="model">account.bank.statement.line</field>
<field name="arch" type="xml">
<search>
<field name="payment_ref"/>
<field name="partner_id"/>
<field name="journal_id"/>
<filter name="unreconciled" string="Unreconciled"
domain="[('is_reconciled', '=', False)]"/>
<filter name="reconciled" string="Reconciled"
domain="[('is_reconciled', '=', True)]"/>
<group>
<filter name="group_journal" string="Journal"
context="{'group_by': 'journal_id'}"/>
<filter name="group_date" string="Date"
context="{'group_by': 'date'}"/>
</group>
</search>
</field>
</record>
<record id="action_dn_statement_line_workspace" model="ir.actions.act_window">
<field name="name">Bank Transaction Matching</field>
<field name="res_model">account.bank.statement.line</field>
<field name="view_mode">list</field>
<field name="search_view_id" ref="view_dn_statement_line_search"/>
<field name="domain">[('is_reconciled', '=', False)]</field>
</record>
<record id="action_dn_bank_rec_wizard" model="ir.actions.act_window">
<field name="name">Bank Reconciliation</field>
<field name="res_model">dn.bank.rec.wizard</field>
<field name="view_mode">form</field>
<field name="target">current</field>
<field name="context">{'create': False}</field>
</record>
<!-- ============================ menus -->
<menuitem id="menu_dn_bank_rec_root" name="Bank Reconciliation"
parent="account.menu_finance_entries"
sequence="35"
groups="account.group_account_user"/>
<menuitem id="menu_dn_bank_rec_workspace" name="Transactions to Match"
parent="menu_dn_bank_rec_root"
action="action_dn_statement_line_workspace" sequence="10"/>
</odoo>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================ client actions, one per report -->
<record id="action_dn_fr_view" model="ir.actions.client">
<field name="name">Financial Report Preview</field>
<field name="tag">dn_fr_view</field>
</record>
<record id="action_dn_fr_tb" model="ir.actions.client">
<field name="name">Trial Balance</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_TB'}"/>
</record>
<record id="action_dn_fr_pl" model="ir.actions.client">
<field name="name">Profit and Loss</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_PL'}"/>
</record>
<record id="action_dn_fr_bs" model="ir.actions.client">
<field name="name">Balance Sheet</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_BS'}"/>
</record>
<record id="action_dn_fr_gl" model="ir.actions.client">
<field name="name">General Ledger</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_GL'}"/>
</record>
<record id="action_dn_fr_partner" model="ir.actions.client">
<field name="name">Partner Ledger</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_PARTNER'}"/>
</record>
<record id="action_dn_fr_ar" model="ir.actions.client">
<field name="name">Aged Receivable</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_AR'}"/>
</record>
<record id="action_dn_fr_ap" model="ir.actions.client">
<field name="name">Aged Payable</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_AP'}"/>
</record>
<record id="action_dn_fr_cf" model="ir.actions.client">
<field name="name">Cash Flow Statement</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_CF'}"/>
</record>
<record id="action_dn_fr_journal" model="ir.actions.client">
<field name="name">Journal Audit</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_JOURNAL'}"/>
</record>
<record id="action_dn_fr_tax" model="ir.actions.client">
<field name="name">Tax Summary</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_TAX'}"/>
</record>
<record id="action_dn_fr_sales" model="ir.actions.client">
<field name="name">Sales Analysis</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_SALES'}"/>
</record>
<record id="action_dn_fr_exec" model="ir.actions.client">
<field name="name">Executive Summary</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_EXEC'}"/>
</record>
<record id="action_dn_fr_open_items" model="ir.actions.client">
<field name="name">Open Items</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_OPEN_ITEMS'}"/>
</record>
<record id="action_dn_fr_statement" model="ir.actions.client">
<field name="name">Customer Statement</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_STATEMENT'}"/>
</record>
<record id="action_dn_fr_deferred" model="ir.actions.client">
<field name="name">Deferred Revenues and Expenses</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_DEFERRED'}"/>
</record>
<record id="action_dn_fr_deferred_revenue" model="ir.actions.client">
<field name="name">Deferred Revenues</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_DEFERRED_REV'}"/>
</record>
<record id="action_dn_fr_deferred_expense" model="ir.actions.client">
<field name="name">Deferred Expenses</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_DEFERRED_EXP'}"/>
</record>
<record id="action_dn_fr_fx" model="ir.actions.client">
<field name="name">Unrealized Currency Gains and Losses</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_FX'}"/>
</record>
<record id="action_dn_fr_interco" model="ir.actions.client">
<field name="name">Intercompany Comparison</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_INTERCO'}"/>
</record>
<record id="action_dn_fr_bankrec" model="ir.actions.client">
<field name="name">Bank Reconciliation Status</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_BANKREC'}"/>
</record>
<record id="action_dn_fr_annual" model="ir.actions.client">
<field name="name">Annual Statements</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_ANNUAL'}"/>
</record>
<record id="action_dn_fr_depreciation" model="ir.actions.client">
<field name="name">Depreciation Schedule</field>
<field name="tag">dn_fr_view</field>
<field name="params" eval="{'report_code': 'DN_DEPRECIATION'}"/>
</record>
<!-- ============================ windows -->
<record id="action_dn_fr_config" model="ir.actions.act_window">
<field name="name">Report Definitions</field>
<field name="res_model">dn.fr</field>
<field name="view_mode">list,form</field>
</record>
<record id="action_dn_fr_external_value" model="ir.actions.act_window">
<field name="name">Report Manual Values</field>
<field name="res_model">dn.fr.external.value</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Report entries live under the Enterprise report groups, mounted by
`dn_account_full_menu` (REPORTING > Statement Reports / Ledgers /
Partner Reports / Taxes & Fiscal / Management / Review). The menus in
this file are therefore kept only as a switchable "flat" alternative
and are inactive by default, so a report never appears twice.
Action xmlids are unchanged: `dn_account_full_menu` points at them.
-->
<menuitem id="menu_dn_fr_root" name="DN Financial Reports (flat)"
parent="account.menu_finance_reports"
sequence="95"
active="False"
groups="account.group_account_readonly"/>
<menuitem id="menu_dn_fr_exec" name="Executive Summary" parent="menu_dn_fr_root"
action="action_dn_fr_exec" sequence="5" active="False"/>
<menuitem id="menu_dn_fr_financial" name="Financial Statements"
parent="menu_dn_fr_root" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_bs" name="Balance Sheet" parent="menu_dn_fr_financial"
action="action_dn_fr_bs" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_pl" name="Profit and Loss" parent="menu_dn_fr_financial"
action="action_dn_fr_pl" sequence="20" active="False"/>
<menuitem id="menu_dn_fr_cf" name="Cash Flow Statement" parent="menu_dn_fr_financial"
action="action_dn_fr_cf" sequence="30" active="False"/>
<menuitem id="menu_dn_fr_tb" name="Trial Balance" parent="menu_dn_fr_financial"
action="action_dn_fr_tb" sequence="40" active="False"/>
<menuitem id="menu_dn_fr_annual" name="Annual Statements" parent="menu_dn_fr_financial"
action="action_dn_fr_annual" sequence="50" active="False"/>
<menuitem id="menu_dn_fr_ledgers" name="Ledgers" parent="menu_dn_fr_root"
sequence="20" active="False"/>
<menuitem id="menu_dn_fr_gl" name="General Ledger" parent="menu_dn_fr_ledgers"
action="action_dn_fr_gl" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_partner" name="Partner Ledger" parent="menu_dn_fr_ledgers"
action="action_dn_fr_partner" sequence="20" active="False"/>
<menuitem id="menu_dn_fr_journal" name="Journal Audit" parent="menu_dn_fr_ledgers"
action="action_dn_fr_journal" sequence="30" active="False"/>
<menuitem id="menu_dn_fr_partner_reports" name="Receivables and Payables"
parent="menu_dn_fr_root" sequence="30" active="False"/>
<menuitem id="menu_dn_fr_ar" name="Aged Receivable" parent="menu_dn_fr_partner_reports"
action="action_dn_fr_ar" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_ap" name="Aged Payable" parent="menu_dn_fr_partner_reports"
action="action_dn_fr_ap" sequence="20" active="False"/>
<menuitem id="menu_dn_fr_open_items" name="Open Items" parent="menu_dn_fr_partner_reports"
action="action_dn_fr_open_items" sequence="30" active="False"/>
<menuitem id="menu_dn_fr_statement" name="Customer Statement"
parent="menu_dn_fr_partner_reports"
action="action_dn_fr_statement" sequence="40" active="False"/>
<menuitem id="menu_dn_fr_tax_group" name="Taxes and Sales" parent="menu_dn_fr_root"
sequence="40" active="False"/>
<menuitem id="menu_dn_fr_tax" name="Tax Summary" parent="menu_dn_fr_tax_group"
action="action_dn_fr_tax" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_sales" name="Sales Analysis" parent="menu_dn_fr_tax_group"
action="action_dn_fr_sales" sequence="20" active="False"/>
<menuitem id="menu_dn_fr_adjust" name="Adjustments and Reconciliation"
parent="menu_dn_fr_root" sequence="50" active="False"/>
<menuitem id="menu_dn_fr_deferred" name="Deferred Revenues and Expenses"
parent="menu_dn_fr_adjust"
action="action_dn_fr_deferred" sequence="10" active="False"/>
<menuitem id="menu_dn_fr_fx" name="Unrealized Currencies" parent="menu_dn_fr_adjust"
action="action_dn_fr_fx" sequence="20" active="False"/>
<menuitem id="menu_dn_fr_interco" name="Intercompany Comparison"
parent="menu_dn_fr_adjust"
action="action_dn_fr_interco" sequence="30" active="False"/>
<menuitem id="menu_dn_fr_bankrec" name="Bank Reconciliation Status"
parent="menu_dn_fr_adjust"
action="action_dn_fr_bankrec" sequence="40" active="False"/>
<!-- Configuration, managers only: this one stays visible, it is the place
where report definitions are edited. -->
<menuitem id="menu_dn_fr_config" name="Report Definitions"
parent="account.account_account_menu"
action="action_dn_fr_config" sequence="95"/>
<menuitem id="menu_dn_fr_external_value" name="Report Manual Values"
parent="account.account_account_menu"
action="action_dn_fr_external_value" sequence="96"/>
</odoo>

View File

@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ============================ report configuration -->
<record id="view_dn_fr_list" model="ir.ui.view">
<field name="name">dn.fr.list</field>
<field name="model">dn.fr</field>
<field name="arch" type="xml">
<list>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="code"/>
<field name="active"/>
</list>
</field>
</record>
<record id="view_dn_fr_form" model="ir.ui.view">
<field name="name">dn.fr.form</field>
<field name="model">dn.fr</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_open" type="object" string="Preview Report"
class="oe_highlight"/>
</header>
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="Report Name"/></h1>
</div>
<group>
<group string="Identification">
<field name="code"/>
<field name="sequence"/>
<field name="active"/>
</group>
<group string="Default Period">
<field name="default_date_from"/>
<field name="default_date_to"/>
</group>
</group>
<group string="Feature Toggles">
<group>
<field name="allow_comparison"/>
<field name="allow_custom_periods"/>
<field name="allow_hierarchy"/>
<field name="allow_export"/>
</group>
<group>
<field name="allow_unreconciled_only"/>
<field name="allow_draft_entries"/>
<field name="allow_journal_filter"/>
<field name="allow_partner_filter"/>
<field name="allow_multi_company"/>
</group>
</group>
<group string="Display Options">
<field name="hide_zero_lines"/>
<field name="unfold_all_by_default"/>
</group>
<field name="description" placeholder="Report Description"/>
<notebook>
<page string="Report Lines" name="lines">
<field name="line_ids" nolabel="1">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="code"/>
<field name="name"/>
<field name="parent_id"/>
<field name="is_total"/>
<field name="figure_type"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dn_fr_search" model="ir.ui.view">
<field name="name">dn.fr.search</field>
<field name="model">dn.fr</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="code"/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<!-- ============================ line form -->
<record id="view_dn_fr_line_form" model="ir.ui.view">
<field name="name">dn.fr.line.form</field>
<field name="model">dn.fr.line</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="report_id"/>
<field name="parent_id"/>
<field name="code"/>
</group>
<group>
<field name="sequence"/>
<field name="figure_type"/>
<field name="is_total"/>
<field name="hide_if_zero"/>
</group>
</group>
<group>
<field name="name"/>
<field name="action_id"/>
</group>
<notebook>
<page string="Expressions" name="expressions">
<field name="expression_ids" nolabel="1">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="label"/>
<field name="engine"/>
<field name="measure"/>
<field name="sign"/>
<field name="date_scope"/>
<field name="formula"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- ============================ external values -->
<record id="view_dn_fr_external_value_list" model="ir.ui.view">
<field name="name">dn.fr.external.value.list</field>
<field name="model">dn.fr.external.value</field>
<field name="arch" type="xml">
<list editable="bottom">
<field name="date"/>
<field name="name"/>
<field name="expression_id"/>
<field name="amount" sum="Total"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="currency_id" column_invisible="True"/>
</list>
</field>
</record>
<record id="view_dn_fr_external_value_form" model="ir.ui.view">
<field name="name">dn.fr.external.value.form</field>
<field name="model">dn.fr.external.value</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="date"/>
<field name="expression_id"/>
<field name="amount"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_dn_fr_external_value_search" model="ir.ui.view">
<field name="name">dn.fr.external.value.search</field>
<field name="model">dn.fr.external.value</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="expression_id"/>
<filter name="this_year" string="This Year"
domain="[('date', '&gt;=', (context_today() + relativedelta(day=1, month=1)).strftime('%Y-%m-%d'))]"/>
</search>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ==================================================================
Amortization schedule analysis
================================================================== -->
<record id="dn_loan_line_list_view" model="ir.ui.view">
<field name="name">dn.loan.line.list</field>
<field name="model">dn.loan.line</field>
<field name="arch" type="xml">
<list string="Installments" create="0"
decoration-info="not is_payment_move_posted">
<field name="currency_id" column_invisible="1"/>
<field name="loan_id"/>
<field name="sequence" optional="hide"/>
<field name="date"/>
<field name="principal" sum="Total Principal"/>
<field name="interest" sum="Total Interest"/>
<field name="payment" sum="Total Payment"/>
<field name="outstanding_balance"/>
<field name="long_term_theoretical_balance" optional="hide"/>
<field name="short_term_theoretical_balance" optional="hide"/>
</list>
</field>
</record>
<record id="dn_loan_line_search_view" model="ir.ui.view">
<field name="name">dn.loan.line.search</field>
<field name="model">dn.loan.line</field>
<field name="arch" type="xml">
<search string="Search Installment">
<field name="loan_name" string="Loan"
filter_domain="[('loan_name', 'ilike', self)]"/>
<filter string="Current" name="current"
domain="[('loan_state', 'in', ('draft', 'running'))]"
help="Installments of draft and running loans"/>
<filter string="Closed" name="closed"
domain="[('loan_state', '=', 'closed')]"/>
<separator/>
<filter string="Due Date" name="due_date" date="date"/>
<group>
<filter string="Loan" name="group_loan" domain="[]"
context="{'group_by': 'loan_id'}"/>
<filter string="Due Date" name="group_date" domain="[]"
context="{'group_by': 'date'}"/>
<filter string="Loan Status" name="group_state" domain="[]"
context="{'group_by': 'loan_state'}"/>
</group>
</search>
</field>
</record>
<record id="dn_loan_line_pivot_view" model="ir.ui.view">
<field name="name">dn.loan.line.pivot</field>
<field name="model">dn.loan.line</field>
<field name="arch" type="xml">
<pivot string="Loans Analysis" sample="1">
<field name="date" interval="year" type="col"/>
<field name="loan_id" type="row"/>
<field name="principal" type="measure"/>
<field name="interest" type="measure"/>
<field name="payment" type="measure"/>
</pivot>
</field>
</record>
<record id="dn_loan_line_graph_view" model="ir.ui.view">
<field name="name">dn.loan.line.graph</field>
<field name="model">dn.loan.line</field>
<field name="arch" type="xml">
<graph type="bar" stacked="1" sample="1">
<field name="date" interval="year"/>
<field name="loan_id"/>
<field name="principal" type="measure"/>
<field name="interest" type="measure"/>
</graph>
</field>
</record>
<record id="action_dn_loan_line_analysis" model="ir.actions.act_window">
<field name="name">Loans Analysis</field>
<field name="res_model">dn.loan.line</field>
<field name="search_view_id" ref="dn_loan_line_search_view"/>
<field name="context">{'search_default_current': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'pivot', 'view_id': ref('dn_loan_line_pivot_view')}),
(0, 0, {'view_mode': 'graph', 'view_id': ref('dn_loan_line_graph_view')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('dn_loan_line_list_view')}),
]"/>
</record>
<!-- Under "Reporting > Management", beside the invoice and cashflow
analyses: it answers the same question for the liability side. -->
<menuitem id="menu_dn_loan_line_analysis"
action="action_dn_loan_line_analysis"
parent="account.account_reports_management_menu"
sequence="30"
groups="account.group_account_readonly"/>
</odoo>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- A dedicated list of the loan entries, ordered by date rather than by
entry number: the loan is read chronologically, and the numbering of
a journal says nothing about when an installment falls due. -->
<record id="dn_loan_move_list_view" model="ir.ui.view">
<field name="name">dn.loan.move.list</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//list" position="attributes">
<attribute name="default_order">date, name</attribute>
</xpath>
<xpath expr="//list" position="inside">
<field name="is_loan_payment_move" optional="show"/>
</xpath>
</field>
</record>
<record id="dn_loan_move_form_view" model="ir.ui.view">
<field name="name">dn.loan.move.form</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_open_dn_loan" string="Loan" type="object"
class="btn-secondary"
invisible="not dn_loan_id"
groups="account.group_account_readonly"/>
</xpath>
<xpath expr="//sheet" position="inside">
<field name="dn_loan_id" invisible="not dn_loan_id" readonly="1"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,315 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ==================================================================
Loans
================================================================== -->
<record id="dn_loan_form_view" model="ir.ui.view">
<field name="name">dn.loan.form</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<form string="Loan">
<header>
<button name="action_confirm" string="Confirm" type="object"
class="btn-primary" groups="account.group_account_invoice"
invisible="state != 'draft'" data-hotkey="q"/>
<button name="action_open_compute_wizard" string="Compute Schedule"
type="object" class="btn-secondary"
groups="account.group_account_manager"
invisible="state != 'draft'"/>
<button name="action_upload_amortization_schedule" string="Import"
type="object" class="btn-secondary"
groups="account.group_account_manager"
invisible="state != 'draft'"/>
<button name="action_reset_schedule" string="Clear Schedule"
type="object" class="btn-secondary"
groups="account.group_account_manager"
invisible="state != 'draft' or not line_ids"
confirm="This deletes the whole amortization schedule. Continue?"/>
<button name="action_close" string="Close" type="object"
class="btn-secondary" groups="account.group_account_manager"
invisible="state != 'running'"/>
<button name="action_cancel" string="Cancel" type="object"
class="btn-secondary" groups="account.group_account_manager"
invisible="state != 'running'"
confirm="The generated entries will be reversed. Continue?"/>
<button name="action_set_to_draft" string="Set to Draft" type="object"
class="btn-secondary" groups="account.group_account_manager"
invisible="state in ('draft', 'running')"/>
<button name="action_reopen" string="Reopen" type="object"
class="btn-secondary" groups="account.group_account_manager"
invisible="state != 'closed'"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,running,closed"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" icon="fa-list-alt" type="object"
name="action_open_loan_entries"
invisible="state == 'draft'">
<field string="Posted Entries" name="nb_posted_entries"
widget="statinfo"/>
</button>
</div>
<!-- Needed so the company and its currency are available
when the record is still being created. -->
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="is_wrong_date" invisible="1"/>
<field name="amount_borrowed_difference" invisible="1"/>
<field name="interest_difference" invisible="1"/>
<field name="duration_difference" invisible="1"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" placeholder="Loan name"/>
</h1>
</div>
<group>
<group>
<field name="amount_borrowed" widget="monetary"
readonly="state != 'draft'"
decoration-danger="amount_borrowed_difference != 0"/>
<field name="interest" widget="monetary"
readonly="state != 'draft'"
decoration-danger="interest_difference != 0"/>
<field name="outstanding_balance" widget="monetary"/>
</group>
<group>
<field name="date" readonly="state != 'draft'"
decoration-danger="is_wrong_date"/>
<label for="duration"/>
<div class="o_row">
<field name="duration" readonly="state != 'draft'"
decoration-danger="duration_difference != 0"
class="oe_inline"/>
<div class="text-muted ms-1 oe_inline"
invisible="duration != 1">month</div>
<div class="text-muted ms-1 oe_inline"
invisible="duration == 1">months</div>
</div>
<field name="method" readonly="state != 'draft'"/>
</group>
</group>
<field name="loan_properties" columns="2"/>
<notebook>
<page string="Amortization Schedule" name="schedule">
<field name="line_ids" readonly="state != 'draft'"
context="{'default_loan_id': id}">
<list editable="bottom" limit="120"
decoration-info="not is_payment_move_posted"
decoration-muted="is_payment_move_posted">
<field name="currency_id" column_invisible="1"/>
<field name="sequence" width="40px"/>
<field name="date"/>
<field name="principal" sum="Total Principal"/>
<field name="interest" sum="Total Interest"/>
<field name="payment" sum="Total Payment"/>
<field name="outstanding_balance"/>
<field name="long_term_theoretical_balance"
optional="show"/>
<field name="short_term_theoretical_balance"
optional="show"/>
<field name="is_payment_move_posted"
widget="boolean_toggle" optional="hide"/>
</list>
</field>
</page>
<page string="Settings" name="settings">
<group>
<group string="Accounts">
<field name="long_term_account_id"
readonly="state != 'draft'"
options="{'no_create': True}"/>
<field name="short_term_account_id"
readonly="state != 'draft'"
options="{'no_create': True}"/>
<field name="expense_account_id"
readonly="state != 'draft'"
options="{'no_create': True}"/>
</group>
<group string="Booking">
<field name="journal_id" readonly="state != 'draft'"
options="{'no_create': True}"/>
<field name="skip_until_date"
readonly="state != 'draft'"
placeholder="No installment skipped"/>
<field name="analytic_distribution"
widget="analytic_distribution"
readonly="state != 'draft'"/>
<field name="company_id" groups="base.group_multi_company"
readonly="1" force_save="1"/>
</group>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="dn_loan_list_view" model="ir.ui.view">
<field name="name">dn.loan.list</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<list string="Loans"
decoration-info="state == 'draft'"
decoration-muted="state in ('closed', 'cancelled')">
<field name="currency_id" column_invisible="1"/>
<field name="name"/>
<field name="date" string="Start Date"/>
<field name="end_date"/>
<field name="amount_borrowed" sum="Total Amounts Borrowed"/>
<field name="outstanding_balance" sum="Total Outstanding Balance"/>
<field name="state" widget="badge"
decoration-info="state == 'draft'"
decoration-success="state == 'running'"
decoration-danger="state in ('closed', 'cancelled')"/>
<field name="method" optional="hide"/>
<field name="long_term_account_id" optional="hide"/>
<field name="short_term_account_id" optional="hide"/>
<field name="expense_account_id" optional="hide"/>
<field name="company_id" groups="base.group_multi_company"
optional="hide"/>
</list>
</field>
</record>
<record id="dn_loan_kanban_view" model="ir.ui.view">
<field name="name">dn.loan.kanban</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="currency_id"/>
<templates>
<t t-name="card">
<div class="row mb-2">
<field name="name" class="fw-bold fs-5 col-9"/>
<div class="col-3 text-end">
<field name="state" widget="label_selection"
options="{'classes': {'draft': 'primary',
'running': 'success',
'closed': 'secondary',
'cancelled': 'danger'}}"/>
</div>
</div>
<div class="row">
<div class="col-6">
<field name="amount_borrowed" widget="monetary"/>
</div>
<div class="col-6 text-end text-muted">
<field name="date"/>
</div>
</div>
<div class="row mt-1">
<div class="col-12 text-muted">
<div class="oe_inline">Outstanding: </div>
<field name="outstanding_balance" widget="monetary"/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="dn_loan_search_view" model="ir.ui.view">
<field name="name">dn.loan.search</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<search string="Search Loan">
<field name="name" string="Loan"
filter_domain="['|', ('name', 'ilike', self),
('display_name', 'ilike', self)]"/>
<field name="loan_properties"/>
<filter string="Current" name="current"
domain="[('state', 'in', ('draft', 'running'))]"
help="Draft and running loans"/>
<filter string="Running" name="running"
domain="[('state', '=', 'running')]"/>
<filter string="Closed" name="closed"
domain="[('state', '=', 'closed')]"/>
<separator/>
<filter string="Loan Date" name="loan_date" date="date"/>
<group>
<filter string="Status" name="group_state" domain="[]"
context="{'group_by': 'state'}"/>
<filter string="Method" name="group_method" domain="[]"
context="{'group_by': 'method'}"/>
<filter string="Loan Date" name="group_date" domain="[]"
context="{'group_by': 'date'}"/>
</group>
</search>
</field>
</record>
<record id="dn_loan_pivot_view" model="ir.ui.view">
<field name="name">dn.loan.pivot</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<pivot sample="1">
<field name="date" interval="year" type="col"/>
<field name="name" type="row"/>
<field name="amount_borrowed" type="measure"/>
</pivot>
</field>
</record>
<record id="dn_loan_graph_view" model="ir.ui.view">
<field name="name">dn.loan.graph</field>
<field name="model">dn.loan</field>
<field name="arch" type="xml">
<graph type="line" sample="1">
<field name="date" interval="year"/>
<field name="name"/>
<field name="amount_borrowed" type="measure"/>
<field name="interest" type="measure"/>
</graph>
</field>
</record>
<!-- ==================================================================
Actions
================================================================== -->
<record id="action_dn_loan" model="ir.actions.act_window">
<field name="name">Loans</field>
<field name="res_model">dn.loan</field>
<field name="search_view_id" ref="dn_loan_search_view"/>
<field name="context">{'search_default_current': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'list', 'view_id': ref('dn_loan_list_view')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('dn_loan_form_view')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('dn_loan_kanban_view')}),
(0, 0, {'view_mode': 'pivot', 'view_id': ref('dn_loan_pivot_view')}),
(0, 0, {'view_mode': 'graph', 'view_id': ref('dn_loan_graph_view')}),
]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Record your first loan
</p>
<p>
Enter the amount, the rate and the term, then let the schedule be
computed: the interest and principal entries are posted
automatically, and the part of the principal falling due within a
year is reclassified to the short term account every month.
</p>
</field>
</record>
<!-- ==================================================================
Menus
================================================================== -->
<!-- Under "Assets & Liabilities", next to the assets: a loan is the mirror
image of an asset, so it belongs in the same group. Sequence 62 is what
Enterprise uses, leaving 60 for the asset register. -->
<menuitem id="menu_dn_loan"
action="action_dn_loan"
parent="accountant_cn.account_assets_liabilities_menu"
sequence="62"
groups="account.group_account_readonly"/>
</odoo>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Client actions are declared in their own file, loaded before the views,
because a form button may reference them by external id.
-->
<!-- Generic viewer: the report is resolved from report_code / report_id -->
<record id="action_dn_report_view" model="ir.actions.client">
<field name="name">Report Preview</field>
<field name="tag">dn_report_view</field>
<field name="params" eval="{'report_id': False}"/>
</record>
<record id="action_dn_report_tb" model="ir.actions.client">
<field name="name">Trial Balance (DN)</field>
<field name="tag">dn_report_view</field>
<field name="params" eval="{'report_code': 'DN_TB'}"/>
</record>
<record id="action_dn_report_pl" model="ir.actions.client">
<field name="name">Profit and Loss (DN)</field>
<field name="tag">dn_report_view</field>
<field name="params" eval="{'report_code': 'DN_PL'}"/>
</record>
<record id="action_dn_report_bs" model="ir.actions.client">
<field name="name">Balance Sheet (DN)</field>
<field name="tag">dn_report_view</field>
<field name="params" eval="{'report_code': 'DN_BS'}"/>
</record>
</odoo>

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
The three statements of this module overlap with the ones mounted by
`dn_account_full_menu` under REPORTING > Statement Reports / Ledgers.
Keeping both would show the same report twice, so the menu tree here is
inactive by default; only the configuration entry stays reachable.
Set `active` to True (or use the list view with the "Archived" filter)
if you prefer this lightweight engine as the only report source.
-->
<menuitem id="menu_dn_reporting_root"
name="DN Financial Reports (Core)"
parent="account.menu_finance_reports"
sequence="96"
active="False"
groups="account.group_account_readonly"/>
<menuitem id="menu_dn_report_tb"
name="Trial Balance"
parent="menu_dn_reporting_root"
action="action_dn_report_tb"
sequence="10"
active="False"/>
<menuitem id="menu_dn_report_pl"
name="Profit and Loss"
parent="menu_dn_reporting_root"
action="action_dn_report_pl"
sequence="20"
active="False"/>
<menuitem id="menu_dn_report_bs"
name="Balance Sheet"
parent="menu_dn_reporting_root"
action="action_dn_report_bs"
sequence="30"
active="False"/>
<!-- Configuration: Accounting > Configuration > DN Report Builder -->
<menuitem id="menu_dn_report_config"
name="DN Report Builder"
parent="account.menu_account_config"
action="action_dn_report_config"
sequence="90"
groups="account.group_account_manager"/>
</odoo>

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================= Expression ================= -->
<record id="view_dn_expression_list" model="ir.ui.view">
<field name="name">dn.report.expression.list</field>
<field name="model">dn.report.expression</field>
<field name="arch" type="xml">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="label"/>
<field name="engine"/>
<field name="formula"/>
<field name="figure_type"/>
</list>
</field>
</record>
<!-- ================= Line ================= -->
<record id="view_dn_line_form" model="ir.ui.view">
<field name="name">dn.report.line.form</field>
<field name="model">dn.report.line</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="code"/>
<field name="parent_id"/>
</group>
<group>
<field name="sequence"/>
<field name="is_total"/>
</group>
</group>
<notebook>
<page string="Expressions" name="expressions">
<field name="expression_ids" nolabel="1">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="label"/>
<field name="engine"/>
<field name="formula"/>
<field name="figure_type"/>
</list>
</field>
<div class="text-muted small mt-2">
Engine reference: domain = journal item domain;
account_codes = comma separated account code prefixes (e.g. 60,62);
aggregation = arithmetic over other expression labels (e.g. CA + RE);
text = static label.
</div>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dn_line_list" model="ir.ui.view">
<field name="name">dn.report.line.list</field>
<field name="model">dn.report.line</field>
<field name="arch" type="xml">
<list>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="code"/>
<field name="parent_id"/>
<field name="is_total"/>
</list>
</field>
</record>
<!-- ================= Report ================= -->
<record id="view_dn_report_form" model="ir.ui.view">
<field name="name">dn.report.form</field>
<field name="model">dn.report</field>
<field name="arch" type="xml">
<form>
<header>
<button name="%(action_dn_report_view)d" type="action"
string="Preview Report" class="oe_highlight"
context="{'active_id': id, 'report_id': id}"/>
</header>
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="Report Name"/></h1>
</div>
<group>
<group>
<field name="code"/>
<field name="sequence"/>
<field name="active"/>
</group>
<group>
<field name="group_by_account"/>
</group>
</group>
<field name="description" placeholder="Description"/>
<notebook>
<page string="Report Lines" name="lines">
<field name="line_ids" nolabel="1">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="code"/>
<field name="parent_id"/>
<field name="is_total"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dn_report_list" model="ir.ui.view">
<field name="name">dn.report.list</field>
<field name="model">dn.report</field>
<field name="arch" type="xml">
<list>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="code"/>
<field name="active"/>
</list>
</field>
</record>
<record id="action_dn_report_config" model="ir.actions.act_window">
<field name="name">DN Report Configuration</field>
<field name="res_model">dn.report</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,460 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="menu_accounting"
name="Accounting"
groups="account.group_account_readonly,account.group_account_invoice"
web_icon="dn_account_full_menu,static/description/icon.png"
sequence="55"/>
<!-- ================== move the community branches ================== -->
<record id="account.menu_board_journal_1" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">1</field>
</record>
<record id="account.menu_finance_receivables" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">2</field>
</record>
<record id="account.menu_finance_payables" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">3</field>
</record>
<record id="account.menu_finance_entries" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">4</field>
</record>
<record id="account.account_audit_menu" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">5</field>
</record>
<record id="account.menu_finance_reports" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">6</field>
</record>
<record id="account.menu_finance_configuration" model="ir.ui.menu">
<field name="parent_id" ref="menu_accounting"/>
<field name="sequence">7</field>
</record>
<!-- The community "Invoicing" root is now empty: every branch it used to
hold was re-parented above. Enterprise leaves it behind as a blank
app tile; on a Community database that reads as a bug ("a second
accounting app with nothing in it"), so we archive it. The menu record
still exists, it is simply not rendered.
Re-activate it from Settings > Technical > User Interface > Menu Items
if you ever want the flat Invoicing app back. -->
<record id="account.menu_finance" model="ir.ui.menu">
<field name="active" eval="False"/>
</record>
<!-- ============================================================= -->
<!-- ACCOUNTING > ASSETS & LIABILITIES -->
<!-- Enterprise: accountant/views/accountant_menuitem.xml -->
<!-- ============================================================= -->
<menuitem id="account_assets_liabilities_menu"
name="Assets &amp; Liabilities"
parent="account.menu_finance_entries"
sequence="10"/>
<!-- Enterprise fills this group from `account_asset` (a full asset register
with a depreciation board per record), which does not exist in
Community. Rather than pointing "Assets" at a miscellaneous journal
(which shows every entry, not the assets), we expose the journal items
that actually sit on a Fixed Assets account. It is the same population
Enterprise's register posts to, and it keeps the menu where users
expect it. Sequence 60 matches `account_asset/data/menuitems.xml`. -->
<record id="action_dn_fixed_assets" model="ir.actions.act_window">
<field name="name">Assets</field>
<field name="res_model">account.move.line</field>
<field name="path">assets</field>
<field name="view_mode">list,pivot,graph</field>
<field name="domain">[
('display_type', 'not in', ('line_section', 'line_subsection', 'line_note')),
('account_id.account_type', 'in', ('asset_fixed', 'asset_non_current')),
]</field>
<field name="context">{'search_default_group_by_account': 1, 'search_default_posted': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">No asset entries yet</p>
<p>Every journal item booked on a Fixed Assets account shows up here,
together with the depreciation charged against it.</p>
</field>
</record>
<menuitem id="menu_assets_fixed"
name="Assets"
parent="account_assets_liabilities_menu"
action="action_dn_fixed_assets"
sequence="60"/>
<!-- ============================================================= -->
<!-- REPORTING > STATEMENT REPORTS -->
<!-- Enterprise: accountant_menuitem.xml + account_asset/data/menuitems.xml -->
<!-- ============================================================= -->
<menuitem id="menu_report_balance_sheet"
name="Balance Sheet"
parent="account.account_reports_legal_statements_menu"
action="accountant_cn.action_dn_fr_bs"
groups="account.group_account_readonly,account.group_account_basic"
sequence="10"/>
<menuitem id="menu_report_profit_loss"
name="Profit and Loss"
parent="account.account_reports_legal_statements_menu"
action="accountant_cn.action_dn_fr_pl"
groups="account.group_account_readonly,account.group_account_basic"
sequence="15"/>
<menuitem id="menu_report_depreciation"
name="Depreciation Schedule"
parent="account.account_reports_legal_statements_menu"
action="accountant_cn.action_dn_fr_depreciation"
groups="account.group_account_readonly"
sequence="20"/>
<menuitem id="menu_report_cash_flow"
name="Cash Flow Statement"
parent="account.account_reports_legal_statements_menu"
action="accountant_cn.action_dn_fr_cf"
groups="account.group_account_readonly,account.group_account_basic"
sequence="30"/>
<menuitem id="menu_report_annual"
name="Annual Statements"
parent="account.account_reports_legal_statements_menu"
action="accountant_cn.action_dn_fr_annual"
groups="account.group_account_readonly,account.group_account_basic"
sequence="40"/>
<!-- ============================================================= -->
<!-- REPORTING > LEDGERS -->
<!-- Enterprise: accountant_menuitem.xml, `account_reports_audit_menu` -->
<!-- Only two entries: Journal Audit lives under Review > Control. -->
<!-- ============================================================= -->
<menuitem id="account_reports_audit_menu"
name="Ledgers"
parent="account.menu_finance_reports"
sequence="2">
<menuitem id="menu_report_trial_balance"
name="Trial Balance"
action="accountant_cn.action_dn_fr_tb"
groups="account.group_account_readonly,account.group_account_basic"
sequence="10"/>
<menuitem id="menu_report_general_ledger"
name="General Ledger"
action="accountant_cn.action_dn_fr_gl"
groups="account.group_account_readonly,account.group_account_basic"
sequence="20"/>
</menuitem>
<!-- ============================================================= -->
<!-- REPORTING > PARTNER REPORTS (was an empty group) -->
<!-- ============================================================= -->
<menuitem id="menu_report_partner_ledger"
name="Partner Ledger"
parent="account.account_reports_partners_reports_menu"
action="accountant_cn.action_dn_fr_partner"
groups="account.group_account_readonly,account.group_account_basic"
sequence="10"/>
<menuitem id="menu_report_customer_statement"
name="Customer Statement"
parent="account.account_reports_partners_reports_menu"
action="accountant_cn.action_dn_fr_statement"
groups="account.group_account_readonly,account.group_account_basic"
sequence="20"/>
<menuitem id="menu_report_aged_receivable"
name="Aged Receivable"
parent="account.account_reports_partners_reports_menu"
action="accountant_cn.action_dn_fr_ar"
groups="account.group_account_readonly,account.group_account_basic"
sequence="30"/>
<menuitem id="menu_report_aged_payable"
name="Aged Payable"
parent="account.account_reports_partners_reports_menu"
action="accountant_cn.action_dn_fr_ap"
groups="account.group_account_readonly,account.group_account_basic"
sequence="40"/>
<menuitem id="menu_report_open_items"
name="Open Items"
parent="account.account_reports_partners_reports_menu"
action="accountant_cn.action_dn_fr_open_items"
groups="account.group_account_readonly,account.group_account_basic"
sequence="50"/>
<!-- ============================================================= -->
<!-- REPORTING > TAXES & FISCAL (was an empty group) -->
<!-- ============================================================= -->
<menuitem id="menu_report_tax"
name="Tax Report"
parent="account.account_reports_taxes_and_fiscal_menu"
action="accountant_cn.action_dn_fr_tax"
groups="account.group_account_readonly,account.group_account_basic"
sequence="10"/>
<menuitem id="menu_report_sales"
name="Sales Analysis"
parent="account.account_reports_taxes_and_fiscal_menu"
action="accountant_cn.action_dn_fr_sales"
groups="account.group_account_readonly,account.group_account_basic"
sequence="20"/>
<!-- ============================================================= -->
<!-- REPORTING > MANAGEMENT (adds to the community entries) -->
<!-- ============================================================= -->
<menuitem id="menu_report_exec_summary"
name="Executive Summary"
parent="account.account_reports_management_menu"
action="accountant_cn.action_dn_fr_exec"
groups="account.group_account_readonly,account.group_account_basic"
sequence="1"/>
<menuitem id="menu_report_interco"
name="Intercompany Comparison"
parent="account.account_reports_management_menu"
action="accountant_cn.action_dn_fr_interco"
groups="account.group_account_readonly,account.group_account_basic"
sequence="40"/>
<!-- ============================================================= -->
<!-- REVIEW -->
<!-- Enterprise: account_menuitem.xml (Control) -->
<!-- account_reports/data/menuitems.xml (the rest) -->
<!-- ============================================================= -->
<!-- Review > Control. Journal Audit is a control report, not a ledger:
Enterprise keeps it here (account_reports/data/menuitems.xml:18) with
sequence 10, next to the audit trail. The audit trail itself has no
sequence in Enterprise, which makes it sort last; we give it an
explicit 20 so the order does not depend on the creation id. -->
<menuitem id="menu_report_journal_audit"
name="Journal Audit"
parent="account.account_audit_control_menu"
action="accountant_cn.action_dn_fr_journal"
groups="account.group_account_readonly"
sequence="10"/>
<record id="account.account_audit_trail_menu" model="ir.ui.menu">
<field name="sequence">20</field>
</record>
<!-- Review > Audit > Working Files.
Enterprise backs this with `account.return` (period review files with a
full state machine). Community has no such model and the review
workflow is a separate feature, so the menu is created here to keep the
tree identical, and it opens the journal items that still need a
decision. That is the entry point people actually need from this group:
what is left to look at before closing the period. -->
<record id="action_dn_working_files" model="ir.actions.act_window">
<field name="name">Working Files</field>
<field name="res_model">account.move.line</field>
<field name="view_mode">list,pivot</field>
<field name="domain">[
('parent_state', '=', 'posted'),
('display_type', 'not in', ('line_section', 'line_subsection', 'line_note')),
('account_id.account_type', 'in', (
'asset_receivable', 'liability_payable',
'asset_cash', 'liability_credit_card',
)),
('full_reconcile_id', '=', False),
]</field>
<field name="context">{'search_default_group_by_account': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">Nothing left to review</p>
<p>Journal items still open on a reconciliation account show up here:
receivables, payables and cash that have not been matched yet.</p>
</field>
</record>
<menuitem id="account_audit_working_file_menu"
parent="account.account_audit_menu"
name="Audit"
sequence="30"
groups="account.group_account_readonly">
<menuitem id="menu_action_working_files"
name="Working Files"
action="action_dn_working_files"/>
</menuitem>
<!-- Review > Inventory. Enterprise fills this group with "Inventory
Valuation" (account_reports); the community `account` module already
ships that report as a client action, so we mount it directly. -->
<menuitem id="account_audit_inventory_entries_menu"
parent="account.account_audit_menu"
name="Inventory"
sequence="40"
groups="account.group_account_readonly">
<menuitem id="menu_report_stock_valuation"
name="Inventory Valuation"
action="account.action_report_stock_valuation"
groups="account.group_account_readonly"
sequence="10"/>
</menuitem>
<!-- Review > Regularization Entries.
Enterprise has exactly three entries here: Unrealized Currencies,
Deferred Revenues and Deferred Expenses. We used to ship a combined
"Deferred Revenues and Expenses" report (one menu entry instead of two)
and an extra "Bank Reconciliation Status" that Enterprise does not have
in this group at all, so both are corrected. -->
<menuitem id="account_audit_regularization_entries_menu"
parent="account.account_audit_menu"
name="Regularization Entries"
sequence="50"
groups="account.group_account_readonly">
<menuitem id="menu_report_fx"
name="Unrealized Currencies"
action="accountant_cn.action_dn_fr_fx"
groups="account.group_account_readonly"
sequence="10"/>
<menuitem id="menu_report_deferred_revenue"
name="Deferred Revenues"
action="accountant_cn.action_dn_fr_deferred_revenue"
groups="account.group_account_readonly"
sequence="20"/>
<menuitem id="menu_report_deferred_expense"
name="Deferred Expenses"
action="accountant_cn.action_dn_fr_deferred_expense"
groups="account.group_account_readonly"
sequence="30"/>
</menuitem>
<!-- ============================================================= -->
<!-- ACCOUNTING > CLOSING -->
<!-- Enterprise: account_menuitem.xml creates the group empty and -->
<!-- these modules fill it: -->
<!-- account_accountant Reconcile seq 65 -->
<!-- account_reports Tax Returns seq 67 -->
<!-- account_accountant Lock Dates… seq 70 -->
<!-- account Secure Entries seq 80 -->
<!-- Community already ships "Secure Entries" there. -->
<!-- ============================================================= -->
<!-- Reconcile: the journal items still open on a reconciliation account.
Enterprise opens its full reconciliation widget from here; Community
has the same model but no matching widget, so this lists exactly the
items that widget would show. -->
<record id="action_dn_reconcile" model="ir.actions.act_window">
<field name="name">Journal Items to reconcile</field>
<field name="res_model">account.move.line</field>
<field name="view_mode">list</field>
<field name="domain">[
('display_type', 'not in', ('line_section', 'line_subsection', 'line_note')),
('account_id.reconcile', '=', True),
('full_reconcile_id', '=', False),
('parent_state', '=', 'posted'),
]</field>
<field name="context">{'search_default_group_by_account': 1, 'search_default_group_by_partner': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">Everything is reconciled</p>
<p>Posted journal items on a reconciliation account that still have no
matching number show up here.</p>
</field>
</record>
<menuitem id="menu_account_reconcile"
name="Reconcile"
parent="account.account_closing_menu"
action="action_dn_reconcile"
sequence="65"
groups="account.group_account_user"/>
<!-- Lock Dates…: the period locking wizard of dn_accounting, which is the
Community equivalent of Enterprise's `account.change.lock.date`. -->
<menuitem id="menu_dn_lock_date_in_closing"
name="Lock Dates…"
parent="account.account_closing_menu"
action="accountant_cn.action_dn_lock_date_wizard"
sequence="70"
groups="account.group_account_manager"/>
<!-- The two period-management groups belong under Closing, not under
Accounting: Enterprise has no separate top-level entries for them, and
closing the period is literally what they do. -->
<record id="accountant_cn.menu_dn_bank_rec_root" model="ir.ui.menu">
<field name="parent_id" ref="account.account_closing_menu"/>
<field name="sequence">35</field>
</record>
<record id="accountant_cn.menu_dn_accounting_root" model="ir.ui.menu">
<field name="parent_id" ref="account.account_closing_menu"/>
<field name="sequence">40</field>
</record>
<!-- Two menu records from the previous layout are gone for good. They are
deleted rather than reassigned because keeping them would leave a
duplicate entry in the tree: Odoo never removes an `ir.ui.menu` whose
XML declaration disappears, it only stops updating it.
* `menu_report_deferred` — replaced by the two separate Deferred
Revenues / Deferred Expenses entries Enterprise ships.
* `menu_report_bankrec_status` — Enterprise has no such entry under
Regularization Entries; the reconciliation workspace lives under
Closing > Bank Reconciliation instead. -->
<delete model="ir.ui.menu" id="menu_report_deferred"/>
<delete model="ir.ui.menu" id="menu_report_bankrec_status"/>
<!-- ============================================================= -->
<!-- CONFIGURATION -->
<!-- ============================================================= -->
<menuitem id="account.menu_account_config"
name="Settings"
parent="account.menu_finance_configuration"
sequence="0"
groups="base.group_system"/>
<!-- Community creates `account_report_folder` ("Reporting") under
Configuration > Accounting but never puts anything in it: Enterprise
uses it for the report designer and the report line definitions.
We park our own report configuration there, which also removes the two
entries that used to sit flat next to "Taxes" and "Journals". -->
<record id="account.account_report_folder" model="ir.ui.menu">
<field name="name">Reporting</field>
<field name="sequence">4</field>
</record>
<record id="accountant_cn.menu_dn_fr_config" model="ir.ui.menu">
<field name="parent_id" ref="account.account_report_folder"/>
<field name="sequence">10</field>
</record>
<record id="accountant_cn.menu_dn_fr_external_value" model="ir.ui.menu">
<field name="parent_id" ref="account.account_report_folder"/>
<field name="sequence">20</field>
</record>
<record id="accountant_cn.menu_dn_report_config" model="ir.ui.menu">
<field name="parent_id" ref="account.account_report_folder"/>
<field name="name">DN Report Builder</field>
<field name="sequence">30</field>
</record>
</odoo>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="dn_loan_close_wizard_view" model="ir.ui.view">
<field name="name">dn.loan.close.wizard.form</field>
<field name="model">dn.loan.close.wizard</field>
<field name="arch" type="xml">
<form string="Close Loan">
<field name="currency_id" invisible="1"/>
<group>
<field name="loan_id" readonly="1" force_save="1"/>
<field name="date"/>
</group>
<div class="alert alert-info mb-0" role="alert">
Draft entries dated after the close date are deleted. Posted
entries are kept: they are already in the ledger and have to be
reversed deliberately if they are no longer wanted.
</div>
<footer>
<button name="action_save" string="Close Loan" type="object"
class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="dn_loan_compute_wizard_view" model="ir.ui.view">
<field name="name">dn.loan.compute.wizard.form</field>
<field name="model">dn.loan.compute.wizard</field>
<field name="arch" type="xml">
<form string="Compute Loan">
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<group>
<group string="Loan">
<field name="loan_id" readonly="1" force_save="1"/>
<field name="loan_amount" widget="monetary"/>
<field name="interest_rate" widget="percentage"/>
<field name="method"/>
</group>
<group string="Schedule">
<field name="loan_term"/>
<field name="payments_per_year"/>
<field name="start_date"/>
<field name="first_payment_date"/>
<field name="day_count"/>
</group>
</group>
<separator string="Preview"/>
<field name="preview" readonly="1" nolabel="1"
class="text-monospace small"/>
<footer>
<button name="action_save" string="Save Schedule" type="object"
class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
</odoo>