[IMP] project: version 7.0 for the project form view
bzr revid: qdp-launchpad@openerp.com-20120615144835-189jbt84u2z3si8u
This commit is contained in:
parent
b9cbfb9a98
commit
efdbaf4088
|
@ -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:
|
||||
|
|
|
@ -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()
|
|
@ -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>
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
<field name="state" widget="statusbar" statusbar_visible="open,close" statusbar_colors='{"pending":"blue"}' readonly="1"/>
|
||||
</header>
|
||||
<sheet string="Project">
|
||||
<label for="name" class="oe_form_readonly_hidden"/>
|
||||
<h1>
|
||||
<field name="name" string="Project Name"/>
|
||||
</h1>
|
||||
<group>
|
||||
<label for="name" class="oe_form_readonly_hidden"/>
|
||||
<h1>
|
||||
<field name="name" string="Project Name"/>
|
||||
</h1>
|
||||
<group>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
|
||||
<field name="user_id" string="Project Manager" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/>
|
||||
|
@ -51,19 +51,21 @@
|
|||
<field name="parent_id" invisible="1" string="Parent" domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}"/>
|
||||
<field name="privacy_visibility"/>
|
||||
</group>
|
||||
<group col="4">
|
||||
<group>
|
||||
<label string=""/>
|
||||
<field name="use_tasks"/>
|
||||
</group>
|
||||
<group>
|
||||
<button icon="terp-gtk-go-back-rtl" class="oe_btn_width" name="%(base.action_attachment)d" string="Documents" type="action"/>
|
||||
<button icon="terp-gtk-go-back-rtl" class="oe_btn_width" name="%(act_project_project_2_project_task_all)d" string="Tasks" type="action" attrs="{'invisible':[('use_tasks','=', 0)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<table>
|
||||
<tr name="use_tasks_row">
|
||||
<td><group><field name="use_tasks"/></group></td>
|
||||
<td><button icon="terp-gtk-go-back-rtl" name="%(act_project_project_2_project_task_all)d" string="Tasks" type="action" attrs="{'invisible':[('use_tasks','=', 0)]}"/></td>
|
||||
</tr>
|
||||
<tr name="use_attachment_row">
|
||||
<td/>
|
||||
<td><button icon="terp-gtk-go-back-rtl" class="oe_btn_width" name="%(base.action_attachment)d" string="Documents" type="action" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Team" attrs="{'invisible':[('use_tasks','=', 0)]}" name="team">
|
||||
<page string="Team" name="team">
|
||||
<field colspan="4" name="members" widget="many2many_kanban">
|
||||
<kanban quick_create="true" create="false">
|
||||
<field name="name"/>
|
||||
|
|
|
@ -338,27 +338,16 @@
|
|||
<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 name="use_issues_row">
|
||||
<th style="border-right:1px solid #DDD;" width="140px">Issues Tracking</th>
|
||||
<td><field name="use_issues" nolabel="1"/></td>
|
||||
<td style="text-align:right;" width="110px"><button icon="terp-stock_symbol-selection" class="oe_btn_width" name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/></td>
|
||||
<xpath expr='//tr[@name="use_tasks_row"]' position='after'>
|
||||
<tr>
|
||||
<td><group><field name="use_issues"/></group></td>
|
||||
<td><button icon="terp-gtk-go-back-rtl" name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/></td>
|
||||
</tr>
|
||||
</xpath>
|
||||
<field name="priority" position="before">
|
||||
<field name="project_escalation_id"/>
|
||||
<field name="reply_to"/>
|
||||
</field>
|
||||
<xpath expr='//page[@name="team"]' position='replace'>
|
||||
<page name="team" string="Team" attrs="{'invisible':[('use_tasks','=', 0),('use_issues','=', 0)]}">
|
||||
<field colspan="4" name="members" nolabel="1" help="Project's members are users who can have an access to the tasks related to this project.">
|
||||
<tree string="Members">
|
||||
<field name="name"/>
|
||||
<field name="user_email"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
view_type="form"
|
||||
view_mode="tree,form"
|
||||
context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/>
|
||||
|
||||
|
||||
<record id="project_phase_form" model="ir.ui.view">
|
||||
<field name="name">Inherit project form : Phase</field>
|
||||
<field name="model">project.project</field>
|
||||
|
@ -112,10 +112,9 @@
|
|||
<field name="inherit_id" ref="project.edit_project"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//tr[@name="use_tasks_row"]' position='after'>
|
||||
<tr name="use_phases_row">
|
||||
<th style="border-right:1px solid #DDD;" width="140px">Phases Planing</th>
|
||||
<td><field name="use_phases" nolabel="1"/></td>
|
||||
<td style="text-align:right;"><button icon=" terp-emblem-important" class="oe_btn_width" name="%(act_project_phases)d" string="Phases" type="action" attrs="{'invisible':[('use_phases','=', 0)]}"/></td>
|
||||
<tr>
|
||||
<td><group><field name="use_phases"/></group></td>
|
||||
<td><button icon="terp-gtk-go-back-rtl" name="%(act_project_phases)d" string="Phases" type="action" attrs="{'invisible':[('use_phases','=', 0)]}"/></td>
|
||||
</tr>
|
||||
</xpath>
|
||||
</field>
|
||||
|
|
|
@ -50,14 +50,10 @@ class project_project(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"),
|
||||
'amount_to_invoice': fields.function(_to_invoice, string="Amount to Invoice", multi="sums"),
|
||||
'time_to_invoice': fields.function(_to_invoice, string="Time to Invoice", multi="sums"),
|
||||
'timesheet_count': fields.function(_timesheet_count, type='integer', string="Issue"),
|
||||
}
|
||||
_defaults = {
|
||||
'use_timesheets': True,
|
||||
}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
|
||||
res = super(project_project, self).onchange_partner_id(cr, uid, ids, part, context)
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<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 name="use_timesheets_row">
|
||||
<th style="border-right:1px solid #DDD;" width="140px">Timesheets</th>
|
||||
<td><field name="use_timesheets" nolabel="1"/></td>
|
||||
<td style="text-align:right;"><button icon="terp-gtk-go-back-rtl" class="oe_btn_width" name="open_timesheets" string="Timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"/></td>
|
||||
</tr>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">project.project.kanban.inherited</field>
|
||||
|
|
Loading…
Reference in New Issue