Merge branch 'pawan_branch' into 'development'

add parent project in timesheet

See merge request prakash.jain/cor-odoo!97
This commit is contained in:
pawan.sharma 2021-01-28 21:30:28 -08:00
commit 5861a65d6d
2 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,17 @@ class AccountAnalyticLine(models.Model):
start_time = fields.Float(string='Start Time', digits=(16, 2))
end_time = fields.Float(string='End Time', digits=(16, 2))
unit_amount = fields.Float('Duration', default=0.0)
sub_project = fields.Many2one('project.project', string='Sub Project', related='project_id.sub_project', readonly=True)
parent_project = fields.Many2one('project.project', string='Parent Project')
#sub_project = fields.Many2one('project.project', string='Sub Project')
@api.onchange('project_id')
def _onchange_parent_project_id(self):
if self.project_id and self.project_id.sub_project:
self.parent_project = self.project_id.sub_project.id
else:
self.parent_project = False
@api.onchange('employee_id')
def _onchange_employee_id(self):

View File

@ -51,7 +51,7 @@
<field name="end_time" widget="float_time"/>
</xpath>
<xpath expr="//field[@name='unit_amount']" position="after">
<field name="sub_project"/>
<field name="parent_project"/>
</xpath>
</field>
</record>