[REF] hr_expense, creation of accounting entries from hr.expense: a lot of code refac...
[odoo/odoo.git] / addons / hr_expense / hr_expense_view.xml
index dda977a..cb1a740 100644 (file)
         <record id="view_expenses_form" model="ir.ui.view">
             <field name="name">hr.expense.form</field>
             <field name="model">hr.expense.expense</field>
+            <field eval="25" name="priority"/>
             <field name="arch" type="xml">
                 <form string="Expenses Sheet" version="7.0">
                 <header>
                     <button name="confirm" states="draft" string="Submit to Manager" type="workflow" class="oe_highlight"/>
                     <button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
+                    <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
                     <button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
                     <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice" class="oe_highlight"/>
                     <button name="action_view_receipt" states="done" string="Open Receipt" type="object"/>
-                    <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
                 </header>
                 <sheet>
@@ -85,7 +86,7 @@
                     </group>
                     <notebook>
                         <page string="Description">
-                            <field name="line_ids" context="{'currency_id': currency_id}">
+                            <field name="line_ids" context="{'currency_id': currency_id, 'default_analytic_account': context.get('analytic_account')}">
                                 <form string="Expense Lines" version="7.0">
                                     <group>
                                         <group>
                                     <separator string="Notes"/>
                                     <field name="note" placeholder="Free Notes"/>
                                 </div>
-                                <group class="oe_subtotal_footer">
-                                    <field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
+                                <group class="oe_subtotal_footer oe_right">
+                                    <field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"/>
                                 </group>
                             </group>
                         </page>
                             <group>
                                 <group string="Accounting Data">
                                     <field name="journal_id" widget="selection" domain="[('type', '=', 'purchase')]"/>
+                                    <field name="account_move_id"/>
                                     <field name="voucher_id" context="{'form_view_ref': 'account_voucher.view_purchase_receipt_form'}"/>
                                 </group>
                             </group>
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="arch" type="xml">
                 <div name="options" position="inside">
-                    <field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
+                    <field name="hr_expense_ok"/>
                     <label for="hr_expense_ok"/>
                 </div>
             </field>
             <field name="search_view_id" ref="product.product_search_form_view"/>
         </record>
 
-        <menuitem id="menu_product_hr_config_expense" name="Expenses" parent="hr.menu_hr_configuration"/>
-        <menuitem id="menu_hr_product" name="Products" parent="menu_product_hr_config_expense" action="hr_expense_product"/>
+        <menuitem id="menu_hr_product" name="Expense Categories" parent="hr.menu_hr_configuration" action="hr_expense_product"/>
         <menuitem id="next_id_49" name="Expenses" sequence="15" parent="hr.menu_hr_root"/>
         <menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49"/>