hr_expense_usability: re-write account move generation and fix multi-currency
This commit is contained in:
@@ -23,9 +23,40 @@
|
||||
<field name="payment_mode" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="tax_ids" position="attributes">
|
||||
<attribute name="groups"></attribute>
|
||||
<attribute name="domain">[('type_tax_use', '=', 'purchase'), ('price_include', '=', True)]</attribute>
|
||||
</field>
|
||||
<field name="total_amount" position="before">
|
||||
<field name="untaxed_amount_usability"/>
|
||||
<field name="tax_amount"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='total_amount']/.." position="after">
|
||||
<group name="company_currency">
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="untaxed_amount_company_currency"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="total_amount_company_currency"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_expenses_tree" model="ir.ui.view">
|
||||
<field name="name">usability.hr.expense.tree</field>
|
||||
<field name="model">hr.expense</field>
|
||||
<field name="inherit_id" ref="hr_expense.view_expenses_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="total_amount" position="attributes">
|
||||
<attribute name="sum"></attribute>
|
||||
</field>
|
||||
<field name="total_amount" position="after">
|
||||
<field name="total_amount_company_currency" sum="Total"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_expense_sheet_form" model="ir.ui.view">
|
||||
<field name="name">usability.hr.expense.sheet.form</field>
|
||||
<field name="model">hr.expense.sheet</field>
|
||||
@@ -34,8 +65,51 @@
|
||||
<field name="payment_mode" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="company_id" position="after">
|
||||
<field name="untaxed_amount_company_currency" groups="account.group_account_user"/>
|
||||
<field name="tax_amount_company_currency" groups="account.group_account_user"/>
|
||||
<field name="total_amount_company_currency"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='expense_line_ids']/tree/field[@name='total_amount']" position="after">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="untaxed_amount_company_currency" sum="Untaxed Total"/>
|
||||
<field name="total_amount_company_currency" sum="Total"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='expense_line_ids']/tree/field[@name='total_amount']" position="attributes">
|
||||
<attribute name="sum"></attribute>
|
||||
</xpath>
|
||||
<field name="account_move_id" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
<attribute name="groups">account.group_account_user</attribute>
|
||||
<attribute name="states">post</attribute>
|
||||
</field>
|
||||
<button name="action_open_journal_entries" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
<attribute name="invisible">1</attribute>
|
||||
</button>
|
||||
<button name="%(hr_expense.hr_expense_register_payment_wizard_action)d" position="attributes">
|
||||
<attribute name="context">{'default_amount': total_amount_company_currency, 'partner_id': address_id}</attribute>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_expense_sheet_tree" model="ir.ui.view">
|
||||
<field name="name">usability.hr.expense.sheet.tree</field>
|
||||
<field name="model">hr.expense.sheet</field>
|
||||
<field name="inherit_id" ref="hr_expense.view_hr_expense_sheet_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- total_amount in sheet in completely wrong (sums several currencies without conversion) -->
|
||||
<field name="total_amount" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="total_amount" position="after">
|
||||
<field name="total_amount_company_currency"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user