resolved installation issue of grace period module
This commit is contained in:
parent
adfe801d8e
commit
68e62956b7
|
|
@ -1,5 +1,5 @@
|
|||
from . import resource_calendar_period
|
||||
from . import late_coming_request
|
||||
from . import ot_request
|
||||
from . import attendance_data
|
||||
from . import hr_employee_inherit
|
||||
from . import ot_request
|
||||
|
|
@ -96,7 +96,6 @@ class WeeklyPeriodTimesheets(models.Model):
|
|||
|
||||
for rec in self:
|
||||
if rec.state != 'submitted':
|
||||
|
||||
raise UserError(
|
||||
_("Only submitted timesheets can be approved.")
|
||||
)
|
||||
|
|
@ -110,10 +109,9 @@ class WeeklyPeriodTimesheets(models.Model):
|
|||
)
|
||||
# Validation
|
||||
if (
|
||||
self.env.user != employee_manager
|
||||
and not is_admin
|
||||
self.env.user != employee_manager
|
||||
and not is_admin
|
||||
):
|
||||
|
||||
raise UserError(
|
||||
_("Only Employee Manager or Project Administrator can approve.")
|
||||
)
|
||||
|
|
@ -130,7 +128,6 @@ class WeeklyPeriodTimesheets(models.Model):
|
|||
])
|
||||
|
||||
if pending_lines:
|
||||
|
||||
raise UserError(
|
||||
_("All Project Manager approvals must be completed.")
|
||||
)
|
||||
|
|
@ -226,19 +223,19 @@ class WeeklyPeriodTimesheets(models.Model):
|
|||
analytic_line_ids = fields.One2many(
|
||||
'account.analytic.line',
|
||||
compute='_compute_analytic_lines',
|
||||
inverse='_inverse_analytic_lines',
|
||||
string="Original Timesheets"
|
||||
)
|
||||
|
||||
def _inverse_analytic_lines(self):
|
||||
pass
|
||||
|
||||
@api.depends('employee_id', 'week_line_id')
|
||||
def _compute_analytic_lines(self):
|
||||
|
||||
for rec in self:
|
||||
|
||||
rec.analytic_line_ids = False
|
||||
|
||||
if not rec.employee_id or not rec.week_line_id:
|
||||
continue
|
||||
|
||||
analytic_lines = self.env[
|
||||
'account.analytic.line'
|
||||
].search([
|
||||
|
|
@ -246,13 +243,10 @@ class WeeklyPeriodTimesheets(models.Model):
|
|||
('date', '>=', rec.week_line_id.date_from),
|
||||
('date', '<=', rec.week_line_id.date_to),
|
||||
])
|
||||
|
||||
rec.analytic_line_ids = analytic_lines
|
||||
|
||||
all_pm_approved = fields.Boolean(
|
||||
compute='_compute_all_pm_approved'
|
||||
)
|
||||
|
||||
def _compute_all_pm_approved(self):
|
||||
|
||||
for rec in self:
|
||||
|
|
@ -315,10 +309,9 @@ class AccountAnalyticLine(models.Model):
|
|||
def _compute_pm_approval_required(self):
|
||||
|
||||
for rec in self:
|
||||
|
||||
rec.pm_approval_required = not (
|
||||
rec.task_id.is_generic
|
||||
or rec.project_id.privacy_visibility != 'followers'
|
||||
rec.task_id.is_generic
|
||||
or rec.project_id.privacy_visibility != 'followers'
|
||||
)
|
||||
|
||||
def action_pm_approve(self):
|
||||
|
|
@ -416,7 +409,6 @@ class AccountAnalyticLine(models.Model):
|
|||
], limit=1)
|
||||
|
||||
if weekly_sheet:
|
||||
|
||||
raise ValidationError(
|
||||
"Weekly Timesheet already submitted. "
|
||||
"You cannot create, edit or delete "
|
||||
|
|
@ -450,4 +442,4 @@ class AccountAnalyticLine(models.Model):
|
|||
|
||||
self._check_weekly_submission()
|
||||
|
||||
return super().unlink()
|
||||
return super().unlink()
|
||||
|
|
|
|||
|
|
@ -65,11 +65,8 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Daily Timesheets">
|
||||
<field name="analytic_line_ids"
|
||||
readonly="1">
|
||||
<list create="0"
|
||||
edit="0"
|
||||
delete="0">
|
||||
<field name="analytic_line_ids">
|
||||
<list editable="bottom">
|
||||
<field name="date"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="name"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue