Merge pull request #1900 from expsa/041224_project

project notes task
This commit is contained in:
Hamed-exp 2024-12-09 09:00:04 +02:00 committed by GitHub
commit 808508b59d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -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'),

View File

@ -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'])]}" />

View File

@ -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'})

View File

@ -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>