[FIX] add task to project, field required in billing
bzr revid: tfr@openerp.com-20110107090706-sxmlbr7d56750bj6
This commit is contained in:
@@ -128,7 +128,7 @@ class project(osv.osv):
|
||||
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.", ondelete="cascade", required=True),
|
||||
'priority': fields.integer('Sequence', help="Gives the sequence order when displaying the list of projects"),
|
||||
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
|
||||
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
|
||||
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose, but a user has to be member of a project to add a the to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
|
||||
'parent_id': fields.many2one('project.project', 'Parent Project'),
|
||||
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
|
||||
'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.",
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<form string="Task edition">
|
||||
<group colspan="6" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="project_id" select="1" on_change="onchange_project(project_id)" domain="[('user_id','=',uid)]"/>
|
||||
<field name="project_id" select="1" on_change="onchange_project(project_id)" domain="['|',('user_id','=',uid),('members','=',uid)]" />
|
||||
<field name="total_hours" widget="float_time"/>
|
||||
<field name="date_deadline" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
|
||||
<field name="user_id" select="1" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
|
||||
|
||||
@@ -28,16 +28,7 @@ from tools.translate import _
|
||||
|
||||
class project_project(osv.osv):
|
||||
_inherit = 'project.project'
|
||||
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
|
||||
result = super(project_project, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
||||
if result.get('value', False):
|
||||
try:
|
||||
d = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'hr_timesheet_invoice', 'timesheet_invoice_factor1')
|
||||
if d:
|
||||
result['value']['to_invoice'] = d[1]
|
||||
except ValueError, e:
|
||||
pass
|
||||
return result
|
||||
|
||||
project_project()
|
||||
|
||||
class project_work(osv.osv):
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<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" string="Invoice Task Work"/>
|
||||
<field name="to_invoice" widget="selection" string="Invoice Task Work" attrs="{'required':[('partner_id','!=',False)]}"/>
|
||||
<field name="amount_max" groups="base.group_extended"/>
|
||||
<field name="amount_invoiced" groups="base.group_extended"/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user