Skip to content

Commit

Permalink
[MIG] fiscal_company_base: Migration to 16.0 (from 12.0)
Browse files Browse the repository at this point in the history
- allow to disable 'with_company' call in odoo, with the key in the context
- adapt code to V16
- remove useless (and not working) code to propagate properties
- move abstract into fiscal_company_base (adding tests)
- restore (partially) disabled accounting dashboard
  • Loading branch information
legalsylvain committed Aug 8, 2024
1 parent 3f073bb commit 117f48d
Show file tree
Hide file tree
Showing 48 changed files with 779 additions and 988 deletions.
11 changes: 4 additions & 7 deletions fiscal_company_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "CAE - Account",
"version": "12.0.1.1.0",
"version": "16.0.1.0.0",
"category": "CAE",
"summary": "Glue Module between CAE and Account modules",
"author": "GRAP",
Expand All @@ -14,18 +14,15 @@
"depends": ["fiscal_company_base", "account"],
"data": [
"security/ir_rule.xml",
"views/menu.xml",
"views/view_account_move.xml",
"views/view_res_partner.xml",
# "views/menu.xml",
# "views/view_account_move.xml",
# "views/view_res_partner.xml",
],
"demo": [
"demo/res_groups.xml",
"demo/account_account.xml",
"demo/account_journal.xml",
"demo/account_tax.xml",
"demo/product_category.xml",
"demo/product_product.xml",
"demo/product_template.xml",
"demo/res_partner.xml",
"demo/ir_property.xml",
],
Expand Down
67 changes: 49 additions & 18 deletions fiscal_company_account/demo/account_account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,96 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)

<record model="account.account" id="account_payable_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">401_CAE</field>
<field name="code">401CAE</field>
<field name="name">CAE - Payable - (test) </field>
<field name="user_type_id" ref="account.data_account_type_payable"/>
<field name="account_type">liability_payable</field>
<field name="reconcile" eval="True" />
</record>

<record model="account.account" id="account_receivable_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">411_CAE</field>
<field name="code">411CAE</field>
<field name="name">CAE - Receivable - (test) </field>
<field name="user_type_id" ref="account.data_account_type_receivable"/>
<field name="account_type">asset_receivable</field>
<field name="reconcile" eval="True" />
</record>

<record model="account.account" id="account_custom_payable_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">401_CAE_CUS</field>
<field name="code">401CAECUSTOM</field>
<field name="name">CAE - Custom Payable - (test) </field>
<field name="user_type_id" ref="account.data_account_type_payable"/>
<field name="account_type">liability_payable</field>
<field name="reconcile" eval="True" />
</record>

<record model="account.account" id="account_custom_receivable_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">411_CAE_CUS</field>
<field name="code">411CAECUSTOM</field>
<field name="name">CAE - Custom Receivable - (test) </field>
<field name="user_type_id" ref="account.data_account_type_receivable"/>
<field name="account_type">asset_receivable</field>
<field name="reconcile" eval="True" />
</record>

<record model="account.account" id="account_vat_deductible_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">4456CAE</field>
<field name="name">CAE - VAT Received - (test) </field>
<field name="account_type">liability_current</field>
<field name="reconcile" eval="True" />
</record>

<record model="account.account" id="account_vat_received_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">4457CAE</field>
<field name="name">CAE - VAT Deductible - (test) </field>
<field name="account_type">liability_current</field>
<field name="reconcile" eval="True" />
</record>

<!-- Bank and Cash Part -->
<record model="account.account" id="account_bank_cae">
<record model="account.account" id="account_bank_default_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">512CAEBANKDEFAULT</field>
<field name="name">CAE - Bank (Default Account) - (test)</field>
<field name="account_type">asset_cash</field>
</record>

<record model="account.account" id="account_bank_suspense_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">512CAEBANKSUSPENSE</field>
<field name="name">CAE - Bank (Suspense Account) - (test)</field>
<field name="account_type">asset_current</field>
</record>

<record model="account.account" id="account_bank_payment_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">CAE_512</field>
<field name="name">CAE - Bank - (test)</field>
<field name="user_type_id" ref="account.data_account_type_liquidity"/>
<field name="code">512CAEBANKPAYMENT</field>
<field name="name">CAE - Bank (Payment Account) - (test)</field>
<field name="account_type">asset_current</field>
<field name="reconcile" eval="True"/>
</record>

<record model="account.account" id="account_cash_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">CAE_581</field>
<field name="code">581CAE</field>
<field name="name">CAE - Cash - (test)</field>
<field name="user_type_id" ref="account.data_account_type_liquidity"/>
<field name="account_type">asset_cash</field>
</record>

<!-- Expense Part-->
<record model="account.account" id="account_expense_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">CAE_601</field>
<field name="code">607CAE</field>
<field name="name">CAE - Expenses - (test)</field>
<field name="user_type_id" ref="account.data_account_type_expenses"/>
<field name="account_type">expense</field>
</record>

<!-- Income Part-->
<record model="account.account" id="account_income_cae">
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="code">CAE_702</field>
<field name="code">707CAE</field>
<field name="name">CAE - Product Sales - (test)</field>
<field name="user_type_id" ref="account.data_account_type_revenue"/>
<field name="account_type">income</field>
</record>

</odoo>
12 changes: 12 additions & 0 deletions fiscal_company_account/demo/account_journal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)
<field name="code">CAE_BANK</field>
<field name="name">CAE - Bank Journal - (test)</field>
<field name="type">bank</field>
<field name="default_account_id" ref="account_bank_default_cae"/>
<field name="suspense_account_id" ref="account_bank_suspense_cae"/>
</record>

<function model="account.payment.method.line" name="write">
<value model="account.payment.method.line" eval="obj().env.ref('fiscal_company_account.journal_bank').inbound_payment_method_line_ids.id"/>
<value eval="{'payment_account_id': ref('fiscal_company_account.account_bank_payment_cae')}"/>
</function>

<function model="account.payment.method.line" name="write">
<value model="account.payment.method.line" eval="obj().env.ref('fiscal_company_account.journal_bank').outbound_payment_method_line_ids.id"/>
<value eval="{'payment_account_id': ref('fiscal_company_account.account_bank_payment_cae')}"/>
</function>

</odoo>
102 changes: 100 additions & 2 deletions fiscal_company_account/demo/account_tax.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- oca-hooks:disable=xml-duplicate-record-id -->
<!--
Copyright (C) 2013-Today GRAP (http://www.grap.coop)
@author Julien Weste
Expand All @@ -7,10 +8,58 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)
-->
<odoo>

<record model="account.tax" id="sale_tax_20">
<!-- Sale Tax 20% -->
<record model="account.tax.repartition.line" id="sale_tax_20_repartition_invoice_base" >
<field name="factor_percent">100</field>
<field name="repartition_type">base</field>
</record>

<record model="account.tax.repartition.line" id="sale_tax_20_repartition_invoice_tax">
<field name="factor_percent">100</field>
<field name="repartition_type">tax</field>
</record>

<record model="account.tax.repartition.line" id="sale_tax_20_repartition_refund_base" >
<field name="factor_percent">100</field>
<field name="repartition_type">base</field>
</record>

<record model="account.tax.repartition.line" id="sale_tax_20_repartition_refund_tax" >
<field name="factor_percent">100</field>
<field name="repartition_type">tax</field>
</record>

<record model="account.tax" id="sale_tax_20" >
<field name="name">Sale Tax 20% (Price Excl.)</field>
<field name="type_tax_use">sale</field>
<field name="amount_type">percent</field>
<field name="amount">20.0</field>
<field name="price_include" eval="False" />
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="country_id" ref="base.fr"/>
<field name="invoice_repartition_line_ids" eval="[
Command.link(ref('fiscal_company_account.sale_tax_20_repartition_invoice_base')),
Command.link(ref('fiscal_company_account.sale_tax_20_repartition_invoice_tax')),
]"/>
<field name="refund_repartition_line_ids" eval="[
Command.link(ref('fiscal_company_account.sale_tax_20_repartition_refund_base')),
Command.link(ref('fiscal_company_account.sale_tax_20_repartition_refund_tax')),
]"/>
</record>


<record model="account.tax.repartition.line" id="sale_tax_20_repartition_invoice_tax" >
<field name="account_id" ref="account_vat_received_cae"/>
</record>

<record model="account.tax.repartition.line" id="sale_tax_20_repartition_refund_tax" >
<field name="account_id" ref="account_vat_received_cae"/>
</record>

<!--
<record model="account.tax" id="sale_tax_20">
<field name="name">Sale Tax (20% Excluded)</field>
<field name="type_tax_use">sale</field>
<field name="amount">20</field>
</record>
Expand All @@ -21,5 +70,54 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)
<field name="amount">20</field>
</record>
-->

<!-- Purchase Tax 20% -->
<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_invoice_base" >
<field name="factor_percent">100</field>
<field name="repartition_type">base</field>
</record>

<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_invoice_tax">
<field name="factor_percent">100</field>
<field name="repartition_type">tax</field>
</record>

<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_refund_base" >
<field name="factor_percent">100</field>
<field name="repartition_type">base</field>
</record>

<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_refund_tax" >
<field name="factor_percent">100</field>
<field name="repartition_type">tax</field>
</record>

<record model="account.tax" id="purchase_tax_20" >
<field name="name">Purchase Tax 20% (Price Excl.)</field>
<field name="type_tax_use">purchase</field>
<field name="amount_type">percent</field>
<field name="amount">20.0</field>
<field name="price_include" eval="False" />
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="country_id" ref="base.fr"/>
<field name="invoice_repartition_line_ids" eval="[
Command.link(ref('fiscal_company_account.purchase_tax_20_repartition_invoice_base')),
Command.link(ref('fiscal_company_account.purchase_tax_20_repartition_invoice_tax')),
]"/>
<field name="refund_repartition_line_ids" eval="[
Command.link(ref('fiscal_company_account.purchase_tax_20_repartition_refund_base')),
Command.link(ref('fiscal_company_account.purchase_tax_20_repartition_refund_tax')),
]"/>
</record>


<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_invoice_tax" >
<field name="account_id" ref="account_vat_deductible_cae"/>
</record>

<record model="account.tax.repartition.line" id="purchase_tax_20_repartition_refund_tax" >
<field name="account_id" ref="account_vat_deductible_cae"/>
</record>

</odoo>
52 changes: 48 additions & 4 deletions fiscal_company_account/demo/ir_property.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,76 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)
-->
<odoo>

<!-- Partner Properties -->
<record id="property_account_receivable_CH1" model="ir.property">
<field name="name">CAE - property_account_receivable CH1</field>
<field name="name">property_account_receivable_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_1"/>
<field name="fields_id" ref="account.field_res_partner__property_account_receivable_id"/>
<field name="value" eval="'account.account,'+str(account_receivable_cae)"/>
</record>

<record id="property_account_receivable_CH2" model="ir.property">
<field name="name">CAE - property_account_receivable CH2</field>
<field name="name">property_account_receivable_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_2"/>
<field name="fields_id" ref="account.field_res_partner__property_account_receivable_id"/>
<field name="value" eval="'account.account,'+str(account_receivable_cae)"/>
</record>

<record id="property_account_payable_CH1" model="ir.property">
<field name="name">CAE - property_account_payable CH1</field>
<field name="name">property_account_payable_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_1"/>
<field name="fields_id" ref="account.field_res_partner__property_account_payable_id"/>
<field name="value" eval="'account.account,'+str(account_payable_cae)"/>
</record>

<record id="property_account_payable_CH2" model="ir.property">
<field name="name">CAE - property_account_payable CH2</field>
<field name="name">property_account_payable_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_2"/>
<field name="fields_id" ref="account.field_res_partner__property_account_payable_id"/>
<field name="value" eval="'account.account,'+str(account_payable_cae)"/>
</record>

<!-- Product Category Properties -->
<record id="property_account_income_categ_id_CAE" model="ir.property">
<field name="name">property_account_income_categ_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="fields_id" ref="account.field_product_category__property_account_income_categ_id"/>
<field name="value" eval="'account.account,'+str(account_income_cae)"/>
</record>

<record id="property_account_income_categ_id_CH1" model="ir.property">
<field name="name">property_account_income_categ_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_1"/>
<field name="fields_id" ref="account.field_product_category__property_account_income_categ_id"/>
<field name="value" eval="'account.account,'+str(account_income_cae)"/>
</record>

<record id="property_account_income_categ_id_CH2" model="ir.property">
<field name="name">property_account_income_categ_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_2"/>
<field name="fields_id" ref="account.field_product_category__property_account_income_categ_id"/>
<field name="value" eval="'account.account,'+str(account_income_cae)"/>
</record>

<record id="property_account_expense_categ_id_CAE" model="ir.property">
<field name="name">property_account_expense_categ_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_mother"/>
<field name="fields_id" ref="account.field_product_category__property_account_expense_categ_id"/>
<field name="value" eval="'account.account,'+str(account_expense_cae)"/>
</record>

<record id="property_account_expense_categ_id_CH1" model="ir.property">
<field name="name">CAE - property_account_expense_categ_id CH1</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_1"/>
<field name="fields_id" ref="account.field_product_category__property_account_expense_categ_id"/>
<field name="value" eval="'account.account,'+str(account_expense_cae)"/>
</record>

<record id="property_account_expense_categ_id_CH2" model="ir.property">
<field name="name">property_account_expense_categ_id</field>
<field name="company_id" ref="fiscal_company_base.company_fiscal_child_2"/>
<field name="fields_id" ref="account.field_product_category__property_account_expense_categ_id"/>
<field name="value" eval="'account.account,'+str(account_expense_cae)"/>
</record>

</odoo>
16 changes: 0 additions & 16 deletions fiscal_company_account/demo/product_category.xml

This file was deleted.

Loading

0 comments on commit 117f48d

Please sign in to comment.