commit
808508b59d
|
|
@ -97,6 +97,7 @@ class Project(models.Model):
|
|||
task_count_new = fields.Integer(compute='_compute_task_count_new', string="New Task Count")
|
||||
task_count_inprogress = fields.Integer(compute='_compute_task_count_inprogress', string="In progress Task Count")
|
||||
user_id = fields.Many2one('res.users', string='Project Manager', default=lambda self: self.env.user, tracking=True,domain=lambda self: [("groups_id", "in", self.env.ref("project.group_project_manager").id)])
|
||||
project_owner = fields.Many2one('res.users', string='Project Owner', tracking=True)
|
||||
|
||||
privacy_visibility = fields.Selection([
|
||||
('followers', 'Invited internal users'),
|
||||
|
|
|
|||
|
|
@ -189,6 +189,8 @@
|
|||
<group>
|
||||
<field name="contract_number" attrs="{'readonly':[('state','not in',['draft','confirm'])],'required':False}" />
|
||||
<field name="signature_date" attrs="{'readonly':[('state','not in',['draft','confirm'])]}" />
|
||||
<field name="project_owner" attrs="{'readonly':[('state','not in',['draft','confirm'])],'required':False}" />
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="contract_value_untaxed" attrs="{'readonly':[('state','not in',['draft','confirm'])],'required':[('state','not in',['draft','done'])]}" />
|
||||
|
|
@ -271,7 +273,7 @@
|
|||
<xpath expr="//field[@name='allowed_portal_user_ids']" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
</xpath>
|
||||
|
||||
|
||||
</field>
|
||||
</record>
|
||||
<!-- Inherit Project Search -->
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ class ProjectVariationOrder(models.Model):
|
|||
rec.project_phase_ids = False
|
||||
rec.project_invoice_ids = False
|
||||
rec.project_manager = False
|
||||
rec.project_owner = False
|
||||
rec.start = False
|
||||
rec.date = False
|
||||
rec.total_invoiced_amount = 0.0
|
||||
|
|
@ -95,6 +96,8 @@ class ProjectVariationOrder(models.Model):
|
|||
rec.project_phase_ids = rec.project_id.project_phase_ids.ids
|
||||
if rec.project_id and rec.project_id.user_id:
|
||||
rec.project_manager = rec.project_id.user_id.id
|
||||
if rec.project_id and rec.project_id.project_owner:
|
||||
rec.project_owner = rec.project_id.project_owner.id
|
||||
|
||||
if rec.project_id and rec.project_id.invoice_ids:
|
||||
rec.total_invoiced_amount = rec.project_id.total_invoiced_amount
|
||||
|
|
@ -149,6 +152,9 @@ class ProjectVariationOrder(models.Model):
|
|||
|
||||
self.write({'state': 'draft'})
|
||||
|
||||
def action_return_implement(self):
|
||||
self.write({'state': 'implement'})
|
||||
|
||||
def action_confirm(self):
|
||||
self.write({'state': 'confirm'})
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
<button name="action_vo_send" string="Send by Email" type="object" attrs="{'invisible':['|',('state','not in',['confirm']),('mark_vo_as_sent','=',True)]}"/>
|
||||
<button name="action_draft" string="Set to Draft" type="object"
|
||||
attrs="{'invisible':[('state','not in',['confirm','implement','refuse'])]}"/>
|
||||
<button name="action_return_implement" string="Set to Implement" type="object"
|
||||
attrs="{'invisible':[('state','not in',['done'])]}"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,approve,owner_approve,implement,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
|
|
|||
Loading…
Reference in New Issue