[IMP] hr_timesheet_invoice: improved color of button based on business flow
[odoo/odoo.git] / addons / hr_timesheet_invoice / hr_timesheet_invoice_view.xml
index 0980f4e..e97fcd0 100644 (file)
@@ -7,17 +7,32 @@
             <field name="type">form</field>
             <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
             <field name="arch" type="xml">
-                <field name="user_id" position="after">
-                    <group colspan="4" col="4">
-                        <separator colspan="4" string="Invoicing Data"/>
-                        <field name="pricelist_id" domain="[('type','=','sale')]" widget="selection"/>
-                        <field name="to_invoice" widget="selection" />
+                <field name="partner_id" position="replace">
+                    <field name="partner_id" on_change="on_change_partner_id(partner_id, context)"/>
+                </field>
+                <group name="contract" position="after">
+                    <group name="invoice_data">
+                        <separator colspan="2" string="Invoicing Data"/>
+                        <field name="to_invoice" widget="selection"/>
+                        <field name="pricelist_id" groups="product.group_sale_pricelist" domain="[('type','=','sale')]" attrs="{'required':[('to_invoice','!=',False)]}"/>
                         <field name="amount_max"/>
+                    </group>
+                    <group name="invoice_stats">
+                        <separator colspan="4" string="Invoicing Statistics"/>
                         <field name="amount_invoiced"/>
-                        <separator colspan="4" string="State"/>
-                        <field name="state"/>
                     </group>
-                </field>
+                </group>
+                <xpath expr="/form/sheet" position='before'>
+                    <header>
+                        <button name="set_pending" string="Pending" type="object" states="open" class="oe_form_button_return_flow"/>
+                        <button name="set_close" string="Close" type="object" states="open,pending" class="oe_form_button_active_flow"/>
+                        <button name="set_open" string="Re-open project" type="object" states="pending,close" class="oe_form_button_return_flow"/>
+                        <button name="set_open" string="Re-open project" type="object" states="cancelled,draft"/>
+                        <button name="set_cancel" string="Cancel" type="object" states="open,pending"/>
+                        <field name="state" readonly="1" widget="statusbar"
+                            statusbar_visible="open,pending,close" statusbar_colors='{"pending":"red", "template":"blue"}'/>
+                    </header>
+                </xpath>
             </field>
         </record>
 
             <field name="type">form</field>
             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
             <field name="arch" type="xml">
-                <xpath expr='//separator[@string="Invoicing"]' position='after'>
-                    <field name="to_invoice"/>
-                    <field name="invoice_id"/>
+                <xpath expr="//group[@string='Accounting']" position='after'>
+                    <group string="Invoicing">
+                        <field name="to_invoice"/>
+                        <field name="invoice_id"/>
+                    </group>
                 </xpath>
             </field>
         </record>
@@ -41,7 +58,7 @@
             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
             <field name="arch" type="xml">
                 <field name="account_id" position="replace">
-                    <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)" select="1"/>
+                    <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
                 </field>
             </field>
         </record>
             <field name="type">search</field>
             <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
             <field name="arch" type="xml">
-                <filter name="others" position="after">
+                <field name="date" position="before">
+                    <filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
+                    <filter name="invoiced" string="Invoiced" domain="[('invoice_id','!=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/> 
                     <separator orientation="vertical"/>
-                    <filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False),('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
-                </filter>
+                </field>
             </field>
         </record>
 
                 </field>
             </field>
         </record>
-
-        <record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
+          <record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
             <field name="name">account.analytic.line.form.to_invoice</field>
             <field name="model">account.analytic.line</field>
             <field name="type">form</field>
             </field>
         </record>
 
-       <record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view">
-            <field name="name">account.analytic.line.form.account_id</field>
-            <field name="model">account.analytic.line</field>
-            <field name="type">tree</field>
-            <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
-            <field name="arch" type="xml">
-                <field name="account_id"  position="replace">
-                    <field name="account_id" string="Project"/>
-                </field>
-            </field>
-        </record>
-
-       <record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view">
-            <field name="name">account.analytic.line.tree.account_id</field>
-            <field name="model">account.analytic.line</field>
-            <field name="type">tree</field>
-            <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
-            <field name="arch" type="xml">
-                <field name="account_id"  position="replace">
-                    <field name="account_id" string="Project"/>
-                </field>
-            </field>
-        </record>
-
         <!-- Menus -->
         <record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
             <field name="name">Bill Tasks Works</field>
             <field name="view_mode">tree,form</field>
             <field name="domain">[]</field>
             <field name="context">{'search_default_to_invoice': 1}</field>
-            <field name="help">This lists show you every task work you can invoice to the customer. Select the lines in order to generate the invoices automatically.</field>
+            <field name="search_view_id" ref="account.view_account_analytic_line_filter"/>            
+            <field name="help">This list shows you every task you can invoice to the customer. Select the lines and click the Action button to generate the invoices automatically.</field>
         </record>
         <menuitem
             action="action_hr_analytic_timesheet_open_tree"
             <field name="model">hr_timesheet_invoice.factor</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Type of invoicing">
-                    <field colspan="1" name="name"/>
-                    <field colspan="1" name="customer_name"/>
-                    <field colspan="2" name="factor"/>
+                <form string="Type of invoicing" version="7.0">
+                    <group col="4">
+                        <field name="name"/>
+                        <field name="customer_name"/>
+                        <field name="factor"/>
+                    </group>
                 </form>
             </field>
         </record>
             <field name="view_type">form</field>
             <field name="view_id" ref="view_hr_timesheet_invoice_factor_tree"/>
             <field name="search_view_id" ref="view_hr_timesheet_invoice_factor_search"/>
-            <field name="help">OpenERP allows you to create default invoicing types. You could need to regularly make discounts based on a specific contract or agreement with a customer. From this menu, you can create additional default types of invoicing that will speed up your invoicing.</field>
+            <field name="help">OpenERP allows you to create default invoicing types. You might have to regularly assign discounts because of a specific contract or agreement with a customer. From this menu, you can create additional types of invoicing to speed up your invoicing.</field>
         </record>
         <menuitem
             action="action_hr_timesheet_invoice_factor_form"
             id="hr_timesheet_invoice_factor_view"
-            parent="account.menu_low_level"/>
+            parent="account.menu_configuration_misc" sequence="25" groups="base.group_no_one"/>
 
     </data>
 </openerp>