[IMP] account, account_analytic_analysis: fix labelling incoherences
[odoo/odoo.git] / addons / account_analytic_analysis / account_analytic_analysis_view.xml
index 8d7a89e..8dfcd05 100644 (file)
@@ -23,7 +23,7 @@
             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
             <field eval="40" name="priority"/>
             <field name="arch" type="xml">
-                <xpath expr='//div[@name="duration"]' position="after" version="7.0">
+                <xpath expr='//div[@name="duration"]' position="after">
                     <label for="quantity_max"/>
                     <div>
                         <field name="quantity_max"/>
@@ -36,7 +36,7 @@
                     </div>
                 </xpath>
                 <field name="partner_id" position="attributes">
-                    <attribute name="attrs">{'required': [('type','=','contract'),'|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True)]}</attribute>
+                    <attribute name="attrs">{'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]}</attribute>
                 </field>
                 <xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
                 </xpath>
@@ -85,9 +85,8 @@
                             </td>
                         </tr><tr>
                             <td class="oe_timesheet_grey">
-                                <label for="invoice_on_timesheets"/>
+                                <label string="On Timesheets"/>
                             </td><td class="oe_timesheet_grey">
-                                <field name="invoice_on_timesheets" on_change="onchange_invoice_on_timesheets(invoice_on_timesheets)"/>
                             </td><td>
                                 <field class="oe_inline" name="hours_qtt_est" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                             </td><td>
@@ -98,8 +97,8 @@
                                 <field class="oe_inline" name="ca_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                             </td><td class="oe_timesheet_action" attrs="{'invisible': ['|',('invoice_on_timesheets','=',False),('type','=','template')]}">
                                 <span attrs="{'invisible': [('ca_to_invoice','=',0.0)]}" class="oe_grey">
-                                    <button name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
-                                        type="action"
+                                    <button name="hr_to_invoice_timesheets"
+                                        type="object"
                                         class="oe_link"
                                         string="⇒ Invoice"/>
                                     or view 
                             </td>
                         </tr>
                     </table>
-                    <group name='invoice_on_timesheets' attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
-                        <p class="oe_grey oe_edit_only" colspan="2">
-                            When reinvoicing costs, OpenERP uses the
+                    <group name='invoice_on_timesheets'>
+                        <p name='invoice_on_timesheets_label' class="oe_grey oe_edit_only" colspan="2" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
+                            When reinvoicing costs, Odoo uses the
                             pricelist of the contract which uses the price
                             defined on the product related (e.g timesheet 
                             products are defined on each employee). 
                         <group>
                             <field name="pricelist_id"
                                 class="oe_inline"
-                                attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
+                                attrs="{'required': [('invoice_on_timesheets', '=', True)]}"
+                                domain="[('type', '=', 'sale')]"
+                                groups="product.group_sale_pricelist"/>
                             <field name="to_invoice"
                                 class="oe_inline"
                                 widget="selection"
-                                attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
+                                attrs="{'required': [('invoice_on_timesheets', '=', True)], 'invisible': [('invoice_on_timesheets','=',False)]}"/>
                         </group>
                     </group>
+                    <separator string="Recurring Invoices" attrs="{'invisible': [('recurring_invoices','!=',True)]}"/>
+                    <div>
+                        <div attrs="{'invisible': [('type','!=', 'contract'), ('recurring_invoices', '=', False)]}">
+                            <field name="recurring_invoices" on_change="onchange_recurring_invoices(recurring_invoices, date_start)" class="oe_inline" />
+                            <label for="recurring_invoices" />
+                        </div>
+                        <button class="oe_link" name="recurring_create_invoice" attrs="{'invisible': [('recurring_invoices','!=',True)]}" string="⇒ create invoices" type="object" groups="base.group_no_one"/>
+                    </div>
+                    <group attrs="{'invisible': [('recurring_invoices','!=',True)]}">
+                        <label for="recurring_interval"/>
+                        <div>
+                            <field name="recurring_interval" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/>
+                            <field name="recurring_rule_type" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/>
+                        </div>
+                        <field name="recurring_next_date"/>
+                    </group>
+                    <label for="recurring_invoice_line_ids" attrs="{'invisible': [('recurring_invoices','=',False)]}"/>
+                    <div attrs="{'invisible': [('recurring_invoices','=',False)]}">
+                        <field name="recurring_invoice_line_ids">
+                            <tree string="Account Analytic Lines" editable="bottom">
+                                <field name="product_id" on_change="product_id_change(product_id, uom_id, quantity, False, parent.partner_id, False, parent.pricelist_id, parent.company_id)"/>
+                                <field name="name"/>
+                                <field name="quantity"/>
+                                <field name="uom_id"/>
+                                <field name="price_unit"/>
+                                <field name="price_subtotal"/>
+                            </tree>
+                        </field>
+                    </div>
                  </xpath>
             </field>
         </record>
         <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
             <field name="name">account.analytic.account.list.contract</field>
             <field name="model">account.analytic.account</field>
-            <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
+            <field name="inherit_id" ref="analytic.view_account_analytic_account_list"/>
             <field name="arch" type="xml">
                 <field name="date_start" position="before">
                     <field name="last_invoice_date"/>
                     <field name="date"/>
                     <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
                     <field name="manager_id"/>
-                    <field name="parent_id"/>
+                    <field name="template_id"/>
                     <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="Contracts in progress (open, draft)"/>
                     <filter name="pending" string="To Renew" domain="[('state','=','pending')]" help="Pending contracts"/>
                     <filter name="closed" string="Closed" domain="[('state','=','close')]" help="Closed contracts"/>
-                    <filter name="cancelled" string="Cancelled" domain="[('state','=','cancel')]" help="Cancelled contracts"/>
+                    <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]" help="Cancelled contracts"/>
                     <separator/>
                     <filter
                         string="Expired or consumed"
                     <filter string="Customer Contracts" help="Contracts assigned to a customer." name="has_partner" domain="[('partner_id', '!=', False)]"/>
                     <filter string="Contracts not assigned" help="Contracts that are not assigned to an account manager." domain="[('manager_id', '=', False)]"/>
                     <separator/>
-                    <group expand="0" string="Group By...">
+                    <group expand="0" string="Group By">
                         <filter string="Status" domain="[]" context="{'group_by':'state'}"/>
                         <filter string="Account Manager" domain="[]" context="{'group_by':'manager_id'}"/>
                         <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
                         <filter string="Parent" domain="[]" context="{'group_by':'parent_id'}"/>
                         <filter string="Template" domain="[]" context="{'group_by':'template_id'}"/>
-                        <filter string="Start Date" domain="[]" context="{'group_by' : 'date_start'}" />
-                        <filter string="End Date" domain="[]" context="{'group_by' : 'date'}" />
+                        <filter string="Start Month" domain="[]" context="{'group_by' : 'date_start'}" />
+                        <filter string="End Month" domain="[]" context="{'group_by' : 'date'}" />
                         <filter string="Pricelist" domain="[]" context="{'group_by' : 'pricelist_id'}" />
                     </group>
                 </search>
                     Click to create a new contract.
                 </p><p>
                     Use contracts to follow tasks, issues, timesheets or invoicing based on
-                    work done, expenses and/or sales orders. OpenERP will automatically manage
+                    work done, expenses and/or sales orders. Odoo will automatically manage
                     the alerts for the renewal of the contracts to the right salesperson.
                 </p>
             </field>
         </record>
         <menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/>
-        <menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="7" parent="base.menu_sales"/>
+        <menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="8" parent="base.menu_sales"/>
 
         <!-- Action Sales/Invoicing/Time and Material to Invoice -->
         <record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
             <field name="view_mode">tree,form</field>
             <field name="domain">[('invoice_id','=',False)]</field>
             <field name="context">{'search_default_to_invoice': 1}</field>
-            <field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
+            <field name="search_view_id" ref="analytic.view_account_analytic_line_filter"/>
             <field name="help" type="html">
               <p>
                 You will find here timesheets and purchases you did for
                 end date is passed or the working effort is higher than the
                 maximum authorized one.
               </p><p>
-                OpenERP automatically sets contracts to be renewed in a pending
+                Odoo automatically sets contracts to be renewed in a pending
                 state. After the negociation, the salesman should close or renew
                 pending contracts.
               </p>
                 </p>
             </field>
         </record>
-        <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config"/>
+
+        <menuitem
+            id= "base.menu_sales_config"
+            parent= "base.menu_base_config"
+            sequence= "1"
+            name= "Sales"
+        />
+
+        <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_sales_config" sequence="3"/>
+        
+        <record id="account_analytic_analysis_form_form" model="ir.ui.view">
+            <field name="name">account.analytic.account.invoice.form.inherit</field>
+            <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+            <field eval="20" name="priority"/>
+            <field name="arch" type="xml">
+                <xpath expr='//div[@name="buttons"]' position='inside'>
+                    <button class="oe_inline oe_stat_button" string="Time &amp; Materials to Invoice"
+                        name="%(action_hr_tree_invoiced_all)d"
+                        type="action"
+                        context="{'search_default_account_id': [active_id], 'default_account_id': active_id}"/>
+                </xpath>
+            </field>
+        </record>
 
     </data>
 </openerp>