<form string="Expense Lines" version="7.0">
<group>
<group>
- <field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" context="{'default_hr_expense_ok':1}"/>
+ <field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
<field name="name"/>
<field name="ref"/>
<field domain="[('type','=','normal')]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
<label for="unit_quantity"/>
<div>
<field name="unit_quantity" class="oe_inline"/>
- <field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" class="oe_inline"/>
+ <field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)" class="oe_inline"/>
</div>
<field name="date_value" />
</group>
</group>
</form>
+ <tree string="Expense Lines" editable="bottom">
+ <field name="sequence" invisible="1"/>
+ <field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
+ <field name="date_value" string="Expense Date"/>
+ <field name="name"/>
+ <field name="ref"/>
+ <field domain="[('type','in',['normal','contract']), ('parent_id','!=',False)]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
+ <field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)"/>
+ <field name="unit_amount"/>
+ <field name="unit_quantity"/>
+ <field name="total_amount" sum="Total"/>
+ </tree>
</field>
<group>
<div>
<field name="note" placeholder="Free Notes"/>
</div>
<group class="oe_subtotal_footer">
- <field name="amount"/>
+ <field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group>
</group>
</page>
<page string="Other Info">
<group>
- <group string="Accounting Data">
+ <group string="Accounting Data" groups="account.group_account_user">
<field name="journal_id" widget="selection" domain="[('type', '=', 'purchase')]"/>
<field name="voucher_id" context="{'form_view_ref': 'account_voucher.view_purchase_receipt_form'}"/>
</group>
<field name="name" string="Expenses"/>
<field name="date"/>
<filter icon="terp-document-new" domain="[('state','=','draft')]" string="New" help="New Expense"/>
- <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" help="Confirmed Expense"/>
+ <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" help="Confirmed Expenses"/>
<filter icon="terp-dolar" domain="[('state','=','accepted')]" string="To Pay" help="Expenses to Invoice"/>
+ <separator/>
+ <filter domain="[('user_id', '=', uid)]" string="My Expenses"/>
<field name="employee_id"/>
<field name="department_id" string="Department" context="{'invisible_department': False}"/>
- <field name="user_id" string="User"/>
<group expand="0" string="Group By...">
<filter string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
- <field name="purchase_ok" position="after">
- <field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
- </field>
+ <field name="purchase_ok" position="before">
+ <field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
+ <label for="hr_expense_ok"/>
+ </field>
</field>
</record>