Skip to content

Commit

Permalink
[FIX] sustainability*: demo data needs fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
jguenat committed Dec 23, 2024
1 parent 92cb819 commit 7e3da38
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion sustainability/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"demo/carbon_factor_type.xml",
"demo/carbon_factor.xml",
"demo/carbon_factor_value.xml",
"demo/demo.xml",
# "demo/demo.xml",
],
"installable": True,
"application": True,
Expand Down
14 changes: 1 addition & 13 deletions sustainability/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- TODO : fix demo data in V16 -->
<data noupdate="1">
<record id="account_expense_demo" model="account.account">
<field name="name">Expenses Demo</field>
Expand Down Expand Up @@ -109,18 +110,5 @@
<function model="account.move" name="action_recompute_carbon">
<value model="account.move" eval="obj().search([('move_type', 'in', ['out_invoice', 'in_invoice', 'out_refund', 'in_refund'])]).ids" />
</function>

<!-- For commuting demo data -->
<record id="account_journal_carbon" model="account.journal">
<field name="name">Carbon</field>
<field name="type">purchase</field>
<field name="code">CO2</field>
<field name="currency_id" ref="base.USD" />
</record>
<record id="account_account_carbon" model="account.account">
<field name="name">Carbon extra-accounting</field>
<field name="account_type">expense</field>
<field name="code">640000</field>
</record>
</data>
</odoo>
23 changes: 17 additions & 6 deletions sustainability_employee_commuting/data/demo.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data noupdate="1">
<record id="account_journal_carbon" model="account.journal">
<field name="name">Carbon</field>
<field name="type">purchase</field>
<field name="code">CO2</field>
<field name="currency_id" ref="base.USD" />
</record>
<record id="account_account_carbon" model="account.account">
<field name="name">Carbon extra-accounting</field>
<field name="account_type">expense</field>
<field name="code">640000</field>
</record>
<record id="base.main_company" model="res.company">
<field name="employee_commuting_carbon_factor_id" ref="sustainability.carbon_factor_transportation" />
<field name="employee_commuting_journal_id" ref="sustainability.account_journal_carbon" />
<field name="employee_commuting_account_id" ref="sustainability.account_account_carbon" />
<field name="employee_commuting_journal_id" ref="sustainability_employee_commuting.account_journal_carbon" />
<field name="employee_commuting_account_id" ref="sustainability_employee_commuting.account_account_carbon" />
<field name="employee_commuting_carbon_cronjob_active" eval="True" />
</record>

Expand Down Expand Up @@ -34,14 +45,14 @@
<field name="employee_id" ref="hr.employee_fme" />
</record>

<function model="res.company" name="_cron_carbon_commuting_account_move_create">
<!--<function model="res.company" name="_cron_carbon_commuting_account_move_create">
<value eval="[ref('base.main_company')]" />
</function>
<function model="account.move" name="action_post">
<value model="account.move" eval="obj().search([('journal_id', '=', ref('sustainability.account_journal_carbon'))]).ids" />
<value model="account.move" eval="obj().search([('journal_id', '=', ref('sustainability_employee_commuting.account_journal_carbon'))]).ids" />
</function>
<function model="account.move" name="action_recompute_carbon">
<value model="account.move" eval="obj().search([('journal_id', '=', ref('sustainability.account_journal_carbon'))]).ids" />
</function>
<value model="account.move" eval="obj().search([('journal_id', '=', ref('sustainability_employee_commuting.account_journal_carbon'))]).ids" />
</function>-->
</data>
</odoo>

0 comments on commit 7e3da38

Please sign in to comment.