diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2012-06-15 16:48:35 +0200 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2012-06-15 16:48:35 +0200 |
| commit | efdbaf40888dbbd8dd1fe1fae06130ccd25de28a (patch) | |
| tree | 537e7eb4fc07f951358bb8b562a8dcd3b959a783 /addons/analytic_contract_project | |
| parent | b9cbfb9a98b5b1187d92ca5b0f8e5d2d60017d3e (diff) | |
[IMP] project: version 7.0 for the project form view
bzr revid: qdp-launchpad@openerp.com-20120615144835-189jbt84u2z3si8u
Diffstat (limited to 'addons/analytic_contract_project')
3 files changed, 131 insertions, 71 deletions
diff --git a/addons/analytic_contract_project/__init__.py b/addons/analytic_contract_project/__init__.py index 2aefd8b3c11..dd60ac32096 100644 --- a/addons/analytic_contract_project/__init__.py +++ b/addons/analytic_contract_project/__init__.py @@ -19,5 +19,6 @@ # ############################################################################## -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +import analytic_contract_project +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_contract_project/analytic_contract_project.py b/addons/analytic_contract_project/analytic_contract_project.py new file mode 100644 index 00000000000..21654868218 --- /dev/null +++ b/addons/analytic_contract_project/analytic_contract_project.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from osv import fields, osv + +class project_project(osv.osv): + _inherit = 'project.project' + _columns = { + # 'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"), + } + _defaults = { + 'use_timesheets': True, + } +project_project() diff --git a/addons/analytic_contract_project/analytic_contract_project_view.xml b/addons/analytic_contract_project/analytic_contract_project_view.xml index fff5e002f0f..7fe0e2abbbd 100644 --- a/addons/analytic_contract_project/analytic_contract_project_view.xml +++ b/addons/analytic_contract_project/analytic_contract_project_view.xml @@ -8,78 +8,105 @@ <field name="inherit_id" ref="project.edit_project"/> <field eval="18" name="priority"/> <field name="arch" type="xml"> - <xpath expr='//page[@name="team"]' position='before'> + <xpath expr='//page[@name="team"]' position='after'> <page string="Contract Data"> - <group col="4" colspan="4"> - <group colspan="2" col= "2" class="oe_form_group_label_border"> - <separator colspan="2" string="Validity"/> - <field name="date_start"/> - <field name="date"/> - <group col="6" colspan="2" class="oe_form_group_label_border"> - <field name="quantity_max"/> - <field name="company_uom_id" nolabel="1" readonly="1"/> - <field name="remaining_hours" string="/ Remaining"/> - </group> - </group> - <group colspan="2" col= "2" class="oe_form_group_label_border"> - <separator colspan="2" string="Invoice Rate"/> - <field name="manager_id" /> - <field name="pricelist_id" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/> - <field name="to_invoice" widget="selection" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/> - </group> - </group> - <separator colspan="4" string="Invoicing"/> - <group colspan="4" col="6"> - <!-- header --> - <div class="oe_field_label" colspan="2"/> - <group colspan="4" col="6"> - <div class="oe_field_label_bold">Est.Tot</div> - <div class="oe_field_label_bold">Invoiced</div> - <div class="oe_field_label_bold">Remaining</div> - <div class="oe_field_label_bold">To Invoice</div> - <div class="oe_btn_width_small"/> - <div class="oe_btn_width"/> + <group> + <group string="Validity"> + <field name="date_start"/> + <field name="date"/> + <label for="quantity_max"/> + <div> + <field name="quantity_max" class="oe_form_inline"/> + <field name="company_uom_id" readonly="1" class="oe_form_inline"/> / Remaining: + <field name="remaining_hours" class="oe_form_inline"/> + <field name="company_uom_id" readonly="1" class="oe_form_inline"/> + </div> + </group> + <group string="Invoice Options"> + <field name="manager_id" /> + <field name="pricelist_id" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/> + <field name="to_invoice" widget="selection" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/> + </group> </group> - - <!-- center --> - - <field class="oe_field_label" name="fix_price_invoices" /> - <group colspan="4" col="6" attrs="{'invisible': [('fix_price_invoices','=',False)]}"> - <field class="oe_float_field" name="amount_max" nolabel="1" /> - <field class="oe_float_field" name="ca_invoiced" nolabel="1" /> - <field class="oe_float_field" name="remaining_ca" nolabel="1" /> - <field class="oe_float_field" name="ca_to_invoice" nolabel="1" /> - <div><button class="oe_btn_width_small" icon="terp-check" name="%(account_analytic_analysis.action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}"/></div> - <div><button class="oe_btn_width" icon="terp-dolar_ok!" name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}"/></div> - </group> - - <field class="oe_field_label" name="invoice_on_timesheets"/> - <group colspan="4" col="6" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"> - <field class="oe_float_field" name="hours_qtt_est" nolabel="1" /> - <field class="oe_float_field" name="hours_qtt_invoiced" nolabel="1"/> - <field class="oe_float_field" name="remaining_hours_to_invoice" nolabel="1" /> - <field class="oe_float_field" name="hours_qtt_non_invoiced" nolabel="1" /> - <div><button class="oe_btn_width_small" icon="terp-go-week" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" /></div> - <div><button class="oe_btn_width" icon="terp-dolar" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action"/></div> - </group> - - <!-- footer --> - - <div class="oe_field_label oe_border_right" style="max-width:200px;" colspan="2">Total </div> - <group colspan="4" col="6" > - <field name="est_total" nolabel="1" class="oe_float_field oe_border_top"/> - <field name="invoiced_total" nolabel="1" class="oe_float_field oe_border_top"/> - <field name="remaining_total" nolabel="1" class="oe_float_field oe_border_top"/> - <field name="toinvoice_total" nolabel="1" class="oe_float_field oe_border_top"/> - <div class="oe_btn_width_small"/> - <div class="oe_btn_width"/> - </group> - </group> - <separator string="Terms and Conditions" colspan="4" name="description"/> - <field colspan="4" name="description" nolabel="1"/> - </page> - </xpath> - </field> + <separator name="toinvoice" string="Invoicing"/> + <table width="100%%"> + <tr> + <th></th> + <th></th> + <th><label string="Est.Tot"/></th> + <th><label string="Invoiced"/></th> + <th><label string="Remaining"/></th> + <th><label string="To Invoice"/></th> + <th></th> + </tr><tr> + <td> + <label for="fix_price_invoices"/> + </td><td> + <field name="fix_price_invoices" class="oe_form_inline"/> + </td><td> + <field class="oe_form_inline" name="amount_max" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="ca_invoiced" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="remaining_ca" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="ca_to_invoice" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/> + </td><td> + <button name="%(account_analytic_analysis.action_sales_order)d" string="All Sales" type="action" context="{'default_partner_id': [partner_id], 'search_default_partner_id': [partner_id]}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/> + <button name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/></td> + </tr><tr nameattrs="{'invisible':[('use_timesheets','=',False)]}"> + <td> + <label for="invoice_on_timesheets"/> + </td><td> + <field name="invoice_on_timesheets"/> + </td><td> + <field class="oe_form_inline" name="hours_qtt_est" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="hours_qtt_invoiced" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="remaining_hours_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td><td> + <field class="oe_form_inline" name="hours_qtt_non_invoiced" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td><td> + <button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="All Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}" context="{'default_account_id': active_id,'search_default_account_id': active_id}"/> + <button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Timesheets to Invoice" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td> + </tr><tr> + <th> + <label string="Total"/> + </th><td> + </td><td> + <field name="est_total" class="oe_form_inline" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/> + </td><td> + <field name="invoiced_total" class="oe_form_inline"/> + </td><td> + <field name="remaining_total" class="oe_form_inline"/> + </td><td> + <field name="toinvoice_total" class="oe_form_inline"/> + </td><td> + </td> + </tr> + </table> + <separator string="Terms and Conditions" name="description"/> + <field name="description"/> + </page> + </xpath> + </field> + </record> + + <record id="project_invoice_form" model="ir.ui.view"> + <field name="name">Inherit project form : Invoicing Data</field> + <field name="model">project.project</field> + <field name="type">form</field> + <field name="inherit_id" ref="project.edit_project"/> + <field name="arch" type="xml"> + <xpath expr='//tr[@name="use_tasks_row"]' position='after'> + <tr> + <td><group><field name="use_timesheets"/></group></td> + <td><button icon="terp-gtk-go-back-rtl" name="open_timesheets" string="Timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"/></td> + </tr> + </xpath> + </field> </record> </data> </openerp> |
