Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
65
account_spread_cost_revenue/views/account_move.xml
Executable file
65
account_spread_cost_revenue/views/account_move.xml
Executable file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_invoice_spread" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//field[@name='invoice_line_ids']/list/field[@name='quantity']"
|
||||
position="before"
|
||||
>
|
||||
<field
|
||||
name="spread_check"
|
||||
column_invisible="1"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
/>
|
||||
<button
|
||||
name="spread_details"
|
||||
type="object"
|
||||
class="btn btn-link"
|
||||
icon="fa-arrow-circle-right"
|
||||
title="Not linked to any spread board"
|
||||
invisible="spread_check != 'unlinked'"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
/>
|
||||
<button
|
||||
name="spread_details"
|
||||
type="object"
|
||||
class="btn btn-success"
|
||||
icon="fa-arrow-circle-right"
|
||||
title="Linked to spread board"
|
||||
invisible="spread_check != 'linked'"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//field[@name='line_ids']/list//button[@name='action_automatic_entry']"
|
||||
position="after"
|
||||
>
|
||||
<field
|
||||
name="spread_check"
|
||||
column_invisible="1"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
/>
|
||||
<button
|
||||
name="spread_details"
|
||||
type="object"
|
||||
class="btn btn-success"
|
||||
icon="fa-arrow-circle-right"
|
||||
title="Linked to spread board"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
invisible="spread_check != 'linked'"
|
||||
column_invisible="parent.move_type == 'entry' or parent.state != 'posted'"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_moves_all_spread" model="ir.actions.act_window">
|
||||
<field name="context">{'journal_type':'general', 'search_default_group_by_move': 0, 'search_default_posted':1, 'name_groupby':1}</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
|
||||
<field name="view_id" ref="account.view_move_line_tree" />
|
||||
<field name="view_mode">list,pivot,graph,form,kanban</field>
|
||||
</record>
|
||||
</odoo>
|
||||
377
account_spread_cost_revenue/views/account_spread.xml
Executable file
377
account_spread_cost_revenue/views/account_spread.xml
Executable file
@@ -0,0 +1,377 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_account_spread" model="ir.ui.view">
|
||||
<field name="model">account.spread</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button
|
||||
name="compute_spread_board"
|
||||
type="object"
|
||||
string="Recalculate unposted lines"
|
||||
class="oe_highlight"
|
||||
invisible="not debit_account_id or not display_recompute_buttons"
|
||||
/>
|
||||
<button
|
||||
name="action_recalculate_spread"
|
||||
type="object"
|
||||
string="Recalculate entire spread"
|
||||
invisible="not debit_account_id or not display_recompute_buttons"
|
||||
groups="account.group_account_manager"
|
||||
/>
|
||||
<button
|
||||
name="action_undo_spread"
|
||||
type="object"
|
||||
string="Undo spread"
|
||||
invisible="not line_ids"
|
||||
groups="account.group_account_manager"
|
||||
/>
|
||||
<button
|
||||
name="action_unlink_invoice_line"
|
||||
type="object"
|
||||
string="Unlink Invoice Line"
|
||||
invisible="not invoice_line_id"
|
||||
groups="account.group_account_manager"
|
||||
/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div name="button_box" class="oe_button_box">
|
||||
<button
|
||||
name="open_posted_view"
|
||||
class="oe_stat_button"
|
||||
icon="fa-bars"
|
||||
type="object"
|
||||
string="Posted entries"
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
<widget
|
||||
name="web_ribbon"
|
||||
title="Archived"
|
||||
bg_color="bg-danger"
|
||||
invisible="active"
|
||||
/>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="Spread Board Name" />
|
||||
<h1>
|
||||
<field
|
||||
name="name"
|
||||
placeholder="e.g. One year offices cleaning contract"
|
||||
/>
|
||||
</h1>
|
||||
</div>
|
||||
<group name="header_info">
|
||||
<group name="spread_definitions">
|
||||
<field name="template_id" />
|
||||
<field name="invoice_type" readonly="invoice_line_id" />
|
||||
<field name="display_recompute_buttons" invisible="1" />
|
||||
<field name="display_move_line_auto_post" invisible="1" />
|
||||
<field name="all_posted" invisible="1" />
|
||||
<field name="active" invisible="1" />
|
||||
<field name="use_invoice_line_account" invisible="1" />
|
||||
</group>
|
||||
</group>
|
||||
<group name="accounts">
|
||||
<group name="debits">
|
||||
<field name="is_debit_account_deprecated" invisible="1" />
|
||||
<label
|
||||
for="debit_account_id"
|
||||
colspan="3"
|
||||
string="Balance sheet account / Spread account"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
/>
|
||||
<label
|
||||
for="debit_account_id"
|
||||
colspan="3"
|
||||
string="Expense account"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
/>
|
||||
<div invisible="use_invoice_line_account" colspan="3">
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
>
|
||||
The Balance Sheet account used for the spreading.<br
|
||||
/>This account is the counterpart of the account in the invoice line.
|
||||
</span>
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
>
|
||||
The Expense account in the vendor bill line.<br
|
||||
/>Usually the same account of the vendor bill line.
|
||||
</span>
|
||||
</div>
|
||||
<div invisible="not use_invoice_line_account" colspan="3">
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
>
|
||||
The Balance Sheet account.<br
|
||||
/>This is the account in the invoice line.
|
||||
</span>
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
>
|
||||
The Expense account used for the spreading.<br
|
||||
/>This account is the counterpart of the account of the vendor bill line.
|
||||
</span>
|
||||
</div>
|
||||
<field
|
||||
name="debit_account_id"
|
||||
required="1"
|
||||
domain="[('deprecated', '=', False), ('account_type', 'not in', ('asset_cash','liability_credit_card')), ('internal_group', '!=', 'off_balance')]"
|
||||
readonly="invoice_line_id"
|
||||
/>
|
||||
<span
|
||||
class="help-block text-danger"
|
||||
colspan="2"
|
||||
invisible="not is_debit_account_deprecated"
|
||||
>
|
||||
This account in deprecated! The reconciliation will be NOT possible.
|
||||
</span>
|
||||
</group>
|
||||
<group name="credits">
|
||||
<field name="is_credit_account_deprecated" invisible="1" />
|
||||
<label
|
||||
for="credit_account_id"
|
||||
colspan="3"
|
||||
string="Revenue account"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
/>
|
||||
<label
|
||||
for="credit_account_id"
|
||||
colspan="3"
|
||||
string="Balance sheet account / Spread account"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
/>
|
||||
<div invisible="use_invoice_line_account" colspan="3">
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
>
|
||||
The Revenue account in the invoice line.<br
|
||||
/>Usually the same account of the invoice line.
|
||||
</span>
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
>
|
||||
The Balance Sheet account used for the spreading.<br
|
||||
/>This account is the counterpart of the account in the vendor bill line.
|
||||
</span>
|
||||
</div>
|
||||
<div invisible="not use_invoice_line_account" colspan="3">
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['out_invoice','in_refund']"
|
||||
>
|
||||
The Revenue account used for the spreading.<br
|
||||
/>This account is the counterpart of the account of the invoice line.
|
||||
</span>
|
||||
<span
|
||||
class="help-block"
|
||||
colspan="2"
|
||||
invisible="invoice_type not in ['in_invoice','out_refund']"
|
||||
>
|
||||
The Balance Sheet account.<br
|
||||
/>This is the account in the vendor bill line.
|
||||
</span>
|
||||
</div>
|
||||
<field
|
||||
name="credit_account_id"
|
||||
required="1"
|
||||
domain="[('deprecated', '=', False), ('account_type', 'not in', ('asset_cash','liability_credit_card')), ('internal_group', '!=', 'off_balance')]"
|
||||
readonly="invoice_line_id"
|
||||
/>
|
||||
<span
|
||||
class="help-block text-danger"
|
||||
colspan="2"
|
||||
invisible="not is_credit_account_deprecated"
|
||||
>
|
||||
This account in deprecated! The reconciliation will be NOT possible.
|
||||
</span>
|
||||
</group>
|
||||
</group>
|
||||
<group name="main_info">
|
||||
<group>
|
||||
<field
|
||||
name="invoice_id"
|
||||
invisible="not invoice_id"
|
||||
readonly="1"
|
||||
/>
|
||||
<field
|
||||
name="invoice_line_id"
|
||||
readonly="1"
|
||||
invisible="not invoice_line_id"
|
||||
/>
|
||||
<field
|
||||
name="estimated_amount"
|
||||
readonly="invoice_line_id"
|
||||
invisible="estimated_amount == 0.0 and invoice_line_id"
|
||||
/>
|
||||
<field
|
||||
name="total_amount"
|
||||
invisible="not invoice_line_id"
|
||||
/>
|
||||
<field
|
||||
name="move_line_auto_post"
|
||||
invisible="not display_move_line_auto_post"
|
||||
/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="period_number" />
|
||||
<field name="period_type" />
|
||||
<field name="spread_date" />
|
||||
<field name="days_calc" />
|
||||
<field name="suitable_journal_ids" invisible="1" />
|
||||
<field
|
||||
name="journal_id"
|
||||
widget="selection"
|
||||
groups="base.group_multi_company"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook name="notebook">
|
||||
<page name="spread_lines" string="Spread lines">
|
||||
<field name="line_ids" readonly="1">
|
||||
<list>
|
||||
<field name="name" readonly="1" />
|
||||
<field
|
||||
name="amount"
|
||||
readonly="move_id"
|
||||
sum="Total"
|
||||
/>
|
||||
<field name="date" readonly="1" />
|
||||
<field name="move_id" readonly="1" />
|
||||
<button
|
||||
name="create_move"
|
||||
icon="fa-play"
|
||||
string="Create Move"
|
||||
type="object"
|
||||
groups="account.group_account_manager"
|
||||
invisible="move_id"
|
||||
/>
|
||||
<button
|
||||
name="open_move"
|
||||
icon="fa-plus-square-o"
|
||||
string="View Move"
|
||||
type="object"
|
||||
invisible="not move_id"
|
||||
/>
|
||||
<button
|
||||
name="unlink_move"
|
||||
icon="fa-times"
|
||||
string="Delete Move"
|
||||
type="object"
|
||||
confirm="This will delete the move. Are you sure ?"
|
||||
groups="account.group_account_manager"
|
||||
invisible="not move_id"
|
||||
/>
|
||||
</list>
|
||||
</field>
|
||||
<group name="extension">
|
||||
<group name="extension_left">
|
||||
</group>
|
||||
<group name="extension_right">
|
||||
<field
|
||||
name="display_create_all_moves"
|
||||
invisible="1"
|
||||
/>
|
||||
<button
|
||||
name="create_all_moves"
|
||||
string="Create All Moves"
|
||||
type="object"
|
||||
icon="fa-play"
|
||||
colspan="2"
|
||||
invisible="not display_create_all_moves"
|
||||
/>
|
||||
<field
|
||||
name="unspread_amount"
|
||||
invisible="unspread_amount == 0"
|
||||
/>
|
||||
<field
|
||||
name="unposted_amount"
|
||||
invisible="unposted_amount == 0"
|
||||
/>
|
||||
<field
|
||||
name="posted_amount"
|
||||
invisible="posted_amount == 0"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page name="details" string="Details">
|
||||
<group name="extra_details">
|
||||
<group>
|
||||
<field
|
||||
name="company_id"
|
||||
groups="base.group_multi_company"
|
||||
options="{'no_create': True}"
|
||||
/>
|
||||
<field
|
||||
name="currency_id"
|
||||
groups="base.group_multi_currency"
|
||||
/>
|
||||
</group>
|
||||
<group>
|
||||
<field
|
||||
name="analytic_distribution"
|
||||
groups="analytic.group_analytic_accounting"
|
||||
widget="analytic_distribution"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<chatter/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_spread_tree" model="ir.ui.view">
|
||||
<field name="model">account.spread</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="name" />
|
||||
<field name="company_id" groups="base.group_multi_company" />
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_spread_search" model="ir.ui.view">
|
||||
<field name="model">account.spread</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="Spread" />
|
||||
<filter
|
||||
string="Archived"
|
||||
name="inactive"
|
||||
domain="[('active','=',False)]"
|
||||
/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_spread_form" model="ir.actions.act_window">
|
||||
<field name="name">Spread Costs/Revenues</field>
|
||||
<field name="res_model">account.spread</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="view_account_spread_tree" />
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_action_account_spread_form"
|
||||
parent="account.menu_finance_entries"
|
||||
action="action_account_spread_form"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
/>
|
||||
</odoo>
|
||||
100
account_spread_cost_revenue/views/account_spread_template.xml
Executable file
100
account_spread_cost_revenue/views/account_spread_template.xml
Executable file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_account_spread_template" model="ir.ui.view">
|
||||
<field name="model">account.spread.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="Spread Template Name" />
|
||||
<h1>
|
||||
<field
|
||||
name="name"
|
||||
placeholder="e.g. Template cleaning contract"
|
||||
/>
|
||||
</h1>
|
||||
</div>
|
||||
<group name="main_info">
|
||||
<group>
|
||||
<field name="spread_type" />
|
||||
<field
|
||||
name="company_id"
|
||||
groups="base.group_multi_company"
|
||||
/>
|
||||
<field name="period_number" />
|
||||
<field name="period_type" />
|
||||
<field name="start_date" />
|
||||
<field name="days_calc" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="use_invoice_line_account" />
|
||||
<field
|
||||
name="spread_account_id"
|
||||
domain="[('deprecated', '=', False), ('account_type', 'not in', ('asset_cash','liability_credit_card')), ('internal_group', '!=', 'off_balance')]"
|
||||
options="{'no_create': True}"
|
||||
required="not use_invoice_line_account"
|
||||
invisible="use_invoice_line_account"
|
||||
/>
|
||||
<field
|
||||
name="exp_rev_account_id"
|
||||
invisible="not use_invoice_line_account"
|
||||
required="use_invoice_line_account"
|
||||
domain="[('deprecated', '=', False)]"
|
||||
options="{'no_create': True}"
|
||||
/>
|
||||
<field name="spread_journal_id" widget="selection" />
|
||||
<field
|
||||
name="analytic_distribution"
|
||||
groups="analytic.group_analytic_accounting"
|
||||
widget="analytic_distribution"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
<div>
|
||||
<field name="auto_spread" />
|
||||
<label for="auto_spread" />
|
||||
</div>
|
||||
<p invisible="not auto_spread">
|
||||
Automatically use this spread template on invoice validation for invoice lines using below product and/or account and/or analytic,
|
||||
</p>
|
||||
<field
|
||||
name="auto_spread_ids"
|
||||
invisible="not auto_spread"
|
||||
nolabel="1"
|
||||
>
|
||||
<list editable="bottom">
|
||||
<field name="name" />
|
||||
<field name="product_id" />
|
||||
<field name="account_id" />
|
||||
</list>
|
||||
</field>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_spread_template_tree" model="ir.ui.view">
|
||||
<field name="model">account.spread.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="name" />
|
||||
<field name="company_id" groups="base.group_multi_company" />
|
||||
<field name="spread_account_id" />
|
||||
<field name="spread_journal_id" />
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_spread_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Spread Templates</field>
|
||||
<field name="res_model">account.spread.template</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="view_account_spread_template_tree" />
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_action_account_spread_template_form"
|
||||
parent="account.account_account_menu"
|
||||
action="action_account_spread_template_form"
|
||||
groups="account.group_account_manager"
|
||||
/>
|
||||
</odoo>
|
||||
42
account_spread_cost_revenue/views/res_company.xml
Executable file
42
account_spread_cost_revenue/views/res_company.xml
Executable file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_company_form" model="ir.ui.view">
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook">
|
||||
<page
|
||||
name="account_spread_cost_revenue"
|
||||
string="Account Spread"
|
||||
groups="account.group_account_manager"
|
||||
>
|
||||
<group>
|
||||
<group
|
||||
string="Default Spread Accounts"
|
||||
name="default_spread_accounts"
|
||||
>
|
||||
<field name="default_spread_revenue_account_id" />
|
||||
<field name="default_spread_expense_account_id" />
|
||||
</group>
|
||||
<group
|
||||
string="Default Spread Journals"
|
||||
name="default_spread_journals"
|
||||
>
|
||||
<field name="default_spread_revenue_journal_id" />
|
||||
<field name="default_spread_expense_journal_id" />
|
||||
</group>
|
||||
</group>
|
||||
<group name="spreading_options">
|
||||
<group name="spreading_options_left">
|
||||
<field name="allow_spread_planning" />
|
||||
</group>
|
||||
<group name="spreading_options_right">
|
||||
<field name="force_move_auto_post" />
|
||||
<field name="auto_archive_spread" />
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user