Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] use tracking attribute instead of deprecated track_visibility #78

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion attendance_regularization/models/regularization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _get_employee_id(self):
required=True, help='Employee')
state_select = fields.Selection([('draft', 'Draft'), ('requested', 'Requested'), ('reject', 'Rejected'),
('approved', 'Approved')
], default='draft', track_visibility='onchange', string='State',
], default='draft', tracking=True, string='State',
help='State')


Expand Down
10 changes: 5 additions & 5 deletions hr_custody/models/custody.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,28 @@ def validate_return_date(self):
rejected_reason = fields.Text(string='Rejected Reason', copy=False, readonly=1, help="Reason for the rejection")
renew_rejected_reason = fields.Text(string='Renew Rejected Reason', copy=False, readonly=1,
help="Renew rejected reason")
date_request = fields.Date(string='Requested Date', required=True, track_visibility='always', readonly=True,
date_request = fields.Date(string='Requested Date', required=True, tracking=True, readonly=True,
help="Requested date",
states={'draft': [('readonly', False)]}, default=datetime.now().strftime('%Y-%m-%d'))
employee = fields.Many2one('hr.employee', string='Employee', required=True, readonly=True, help="Employee",
default=lambda self: self.env.user.employee_id.id,
states={'draft': [('readonly', False)]})
purpose = fields.Char(string='Reason', track_visibility='always', required=True, readonly=True, help="Reason",
purpose = fields.Char(string='Reason', tracking=True, required=True, readonly=True, help="Reason",
states={'draft': [('readonly', False)]})
custody_name = fields.Many2one('custody.property', string='Property', required=True, readonly=True,
help="Property name",
states={'draft': [('readonly', False)]})
return_date = fields.Date(string='Return Date', required=True, track_visibility='always', readonly=True,
return_date = fields.Date(string='Return Date', required=True, tracking=True, readonly=True,
help="Return date",
states={'draft': [('readonly', False)]})
renew_date = fields.Date(string='Renewal Return Date', track_visibility='always',
renew_date = fields.Date(string='Renewal Return Date', tracking=True,
help="Return date for the renewal", readonly=True, copy=False)
notes = fields.Html(string='Notes')
renew_return_date = fields.Boolean(default=False, copy=False)
renew_reject = fields.Boolean(default=False, copy=False)
state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'),
('returned', 'Returned'), ('rejected', 'Refused')], string='Status', default='draft',
track_visibility='always')
tracking=True)
mail_send = fields.Boolean(string="Mail Send")


Expand Down
2 changes: 1 addition & 1 deletion hr_disciplinary_tracking/models/disciplinary_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DisciplinaryAction(models.Model):
('action', 'Action Validated'),
('cancel', 'Cancelled'),

], default='draft', track_visibility='onchange')
], default='draft', tracking=True)

name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
Expand Down
2 changes: 1 addition & 1 deletion hr_gratuity_settlement/models/employee_gratuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EmployeeGratuity(models.Model):
('validate', 'Validated'),
('approve', 'Approved'),
('cancel', 'Cancelled')],
default='draft', track_visibility='onchange')
default='draft', tracking=True)
name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
employee_id = fields.Many2one('hr.resignation', string='Employee', required=True,
Expand Down
2 changes: 1 addition & 1 deletion hr_gratuity_settlement/models/hr_gratuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class EmployeeGratuity(models.Model):
('submit', 'Submitted'),
('approve', 'Approved'),
('cancel', 'Cancelled')],
default='draft', track_visibility='onchange')
default='draft', tracking=True)
name = fields.Char(string='Reference', required=True, copy=False,
readonly=True,
default=lambda self: _('New'))
Expand Down
2 changes: 1 addition & 1 deletion hr_gratuity_settlement/models/other_settlements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OtherSettlements(models.Model):
('validate', 'Validated'),
('approve', 'Approved'),
('cancel', 'Cancelled'),
], default='draft', track_visibility='onchange')
], default='draft', tracking=True)

name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
Expand Down
6 changes: 3 additions & 3 deletions hr_resignation/models/hr_resignation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class HrResignation(models.Model):
help='Department of the employee')
resign_confirm_date = fields.Date(string="Confirmed Date",
help='Date on which the request is confirmed by the employee.',
track_visibility="always")
tracking=True)
approved_revealing_date = fields.Date(string="Approved Last Day Of Employee",
help='Date on which the request is confirmed by the manager.',
track_visibility="always")
tracking=True)
joined_date = fields.Date(string="Join Date", store=True,
help='Joining date of the employee.i.e Start date of the first contract')

Expand All @@ -35,7 +35,7 @@ class HrResignation(models.Model):
notice_period = fields.Char(string="Notice Period")
state = fields.Selection(
[('draft', 'Draft'), ('confirm', 'Confirm'), ('approved', 'Approved'), ('cancel', 'Rejected')],
string='Status', default='draft', track_visibility="always")
string='Status', default='draft', tracking=True)
resignation_type = fields.Selection(selection=RESIGNATION_TYPE, help="Select the type of resignation: normal "
"resignation or fired by the company")
read_only = fields.Boolean(string="check field")
Expand Down
2 changes: 1 addition & 1 deletion hr_reward_warning/models/hr_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HrAnnouncementTable(models.Model):
state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'),
('approved', 'Approved'), ('rejected', 'Refused'), ('expired', 'Expired')],
string='Status', default='draft',
track_visibility='always')
tracking=True)
requested_date = fields.Date(string='Requested Date', default=datetime.now().strftime('%Y-%m-%d'),
help="Create Date of Record")
attachment_id = fields.Many2many('ir.attachment', 'doc_warning_rel', 'doc_id', 'attach_id4',
Expand Down
2 changes: 1 addition & 1 deletion oh_appraisal/models/hr_appraisal_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _default_stage_id(self):
tot_comp_survey = fields.Integer(string="Count Answers", compute="_compute_completed_survey")
tot_sent_survey = fields.Integer(string="Count Sent Questions")
created_by = fields.Many2one('res.users', string="Created By", default=lambda self: self.env.uid)
state = fields.Many2one('hr.appraisal.stages', string='Stage', track_visibility='onchange', index=True,
state = fields.Many2one('hr.appraisal.stages', string='Stage', tracking=True, index=True,
default=lambda self: self._default_stage_id(),
group_expand='_read_group_stage_ids')
# for coloring the kanban box
Expand Down
10 changes: 5 additions & 5 deletions oh_hr_lawsuit_management/models/legal_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def set_party2(self):
states={'draft': [('readonly', False)]})
hearing_date = fields.Date(string='Hearing Date',
help='Upcoming hearing date')
court_name = fields.Char(string='Court Name', track_visibility='always',
court_name = fields.Char(string='Court Name', tracking=True,
states={'won': [('readonly', True)]},
help='Name of the Court')
judge = fields.Char(string='Judge', track_visibility='always', states={'won': [('readonly', True)]},
judge = fields.Char(string='Judge', tracking=True, states={'won': [('readonly', True)]},
help='Name of the Judge')
lawyer = fields.Many2one('res.partner', string='Lawyer', track_visibility='always',
lawyer = fields.Many2one('res.partner', string='Lawyer', tracking=True,
help='Choose the contact of Layer from the contact list',
states={'won': [('readonly', True)]})
party1 = fields.Many2one('res.company', string='Party 1', required=1, readonly=1,
Expand All @@ -69,14 +69,14 @@ def set_party2(self):
help='Choose the partner')
other_name = fields.Char(string='Name', help='Enter the details of other type')
party2_name = fields.Char(compute='set_party2', string='Name', store=True)
case_details = fields.Html(string='Case Details', copy=False, track_visibility='always',
case_details = fields.Html(string='Case Details', copy=False, tracking=True,
help='More details of the case')
state = fields.Selection([('draft', 'Draft'),
('running', 'Running'),
('cancel', 'Cancelled'),
('fail', 'Failed'),
('won', 'Won')], string='Status',
default='draft', track_visibility='always', copy=False,
default='draft', tracking=True, copy=False,
help='Status')


Expand Down
4 changes: 2 additions & 2 deletions ohrms_holidays_approval/models/leave_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class HrLeave(models.Model):
leave_approvals = fields.One2many('leave.validation.status',
'holiday_status',
string='Leave Validators',
track_visibility='always',
tracking=True,
help="Leave approvals")
multi_level_validation = fields.Boolean(
string='Multiple Level Approval',
Expand Down Expand Up @@ -226,7 +226,7 @@ class LeaveValidationStatus(models.Model):
domain="[('share','=',False)]")
validation_status = fields.Boolean(string='Approve Status', readonly=True,
default=False,
track_visibility='always', help="Status")
tracking=True, help="Status")
leave_comments = fields.Text(string='Comments', help="Comments")

@api.onchange('validating_users')
Expand Down
2 changes: 1 addition & 1 deletion ohrms_loan/models/hr_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _compute_loan_amount(self):
('approve', 'Approved'),
('refuse', 'Refused'),
('cancel', 'Canceled'),
], string="State", default='draft', track_visibility='onchange', copy=False, )
], string="State", default='draft', tracking=True, copy=False, )

@api.model
def create(self, values):
Expand Down
2 changes: 1 addition & 1 deletion ohrms_loan_accounting/models/hr_loan_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HrLoanAcc(models.Model):
('approve', 'Approved'),
('refuse', 'Refused'),
('cancel', 'Canceled'),
], string="State", default='draft', track_visibility='onchange', copy=False, )
], string="State", default='draft', tracking=True, copy=False, )

def action_approve(self):
"""This create account move for request.
Expand Down
2 changes: 1 addition & 1 deletion ohrms_salary_advance/models/salary_advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SalaryAdvancePayment(models.Model):
('waiting_approval', 'Waiting Approval'),
('approve', 'Approved'),
('cancel', 'Cancelled'),
('reject', 'Rejected')], string='Status', default='draft', track_visibility='onchange')
('reject', 'Rejected')], string='Status', default='draft', tracking=True)
debit = fields.Many2one('account.account', string='Debit Account')
credit = fields.Many2one('account.account', string='Credit Account')
journal = fields.Many2one('account.journal', string='Journal')
Expand Down
4 changes: 2 additions & 2 deletions ohrms_service_request/models/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _get_employee_id(self):
('assign', 'Assigned'),
('check', 'Checked'),
('reject', 'Rejected'),
('approved', 'Approved')], default='draft', track_visibility='onchange', help="State")
('approved', 'Approved')], default='draft', tracking=True, help="State")
service_executer = fields.Many2one('hr.employee', string='Service Executer', help="Service executer")
read_only = fields.Boolean(string="check field", compute='get_user')
tester = fields.One2many('service.execute', 'test', string='tester', help="Tester")
Expand Down Expand Up @@ -111,7 +111,7 @@ class Executer(models.Model):
execute_date = fields.Datetime(string="Date Of Reporting", help="Date of reporting")
state_execute = fields.Selection([('draft', 'Draft'), ('requested', 'Requested'), ('assign', 'Assigned')
, ('check', 'Checked'), ('reject', 'Rejected'),
('approved', 'Approved')], track_visibility='onchange')
('approved', 'Approved')], tracking=True)
test = fields.Many2one('service.request', string='test', help="Test")
notes = fields.Text(string="Internal notes", help="Internal Notes")
executer_product = fields.Char(string='Service Item', help="service item")
Expand Down
6 changes: 3 additions & 3 deletions saudi_gosi/models/gosi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class Saudi(models.Model):
department = fields.Char(string="Department", required=True, help="Department")
position = fields.Char(string='Job Position', required=True, help="Job Position")
nationality = fields.Char(string='Nationality', required=True, help="Nationality")
type_gosi = fields.Char(string='Type', required=True, track_visibility='onchange', help="Gosi Type")
type_gosi = fields.Char(string='Type', required=True, tracking=True, help="Gosi Type")
dob = fields.Char(string='Date Of Birth', required=True, help="Date Of Birth")
gos_numb = fields.Char(string='GOSI Number', required=True, track_visibility='onchange', help="Gosi number")
issued_dat = fields.Char(string='Issued Date', required=True, track_visibility='onchange', help="Issued date")
gos_numb = fields.Char(string='GOSI Number', required=True, tracking=True, help="Gosi number")
issued_dat = fields.Char(string='Issued Date', required=True, tracking=True, help="Issued date")
name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))

Expand Down