Merge pull request #413 from expsa/bakry_edit

fix
This commit is contained in:
bakry 2024-07-29 11:57:48 +03:00 committed by GitHub
commit 36e216ddda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 6 deletions

View File

@ -1 +0,0 @@
,odoo,bakry,15.07.2024 13:37,file:///home/odoo/.config/libreoffice/4;

View File

@ -37,10 +37,9 @@
states="direct_manager" groups="hr.group_hr_user"/>
<button name="refused" string="Refuse" class="oe_highlight" type="object"
states="direct_manager" groups="hr.group_hr_user"/>
<button name="draft_state" string="RE-Draft" class="oe_highlight" type="object"
states="approve" groups="hr.group_hr_user"/>
<button name="draft_state" string="RE-Draft" class="oe_highlight" type="object"
states="refused" groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
states="refused,approve" groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>

View File

@ -14,6 +14,7 @@ class HrPayslip(models.Model):
_name = 'hr.payslip'
_description = 'Pay Slip'
_order = 'id desc'
_inherit = ['mail.thread', 'mail.activity.mixin']
struct_id = fields.Many2one('hr.payroll.structure', string='Structure',
readonly=True, states={'draft': [('readonly', False)]},
@ -565,6 +566,7 @@ class HrPayslipInput(models.Model):
class HrPayslipRun(models.Model):
_name = 'hr.payslip.run'
_description = 'Payslip Batches'
_inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char(required=True, readonly=True, states={'draft': [('readonly', False)]})
slip_ids = fields.One2many('hr.payslip', 'payslip_run_id', string='Payslips', readonly=True,

View File

@ -276,6 +276,11 @@
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
@ -421,6 +426,11 @@
<separator string="Payslips"/>
<field name="slip_ids"/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>

View File

@ -281,13 +281,21 @@ class HrEmployee(models.Model):
def _check_parent_id(self):
for employee in self:
if not employee._check_recursion():
employee.parent_id = False
parent_id = employee.sudo().department_id.parent_id.manager_id
if parent_id:
employee.parent_id = parent_id
else:
employee.parent_id = False
@api.constrains('coach_id')
def _check_coach_id(self):
for employee in self:
if not employee._check_recursion():
employee.coach_id = False
parent_id = employee.sudo().department_id.parent_id.manager_id
if parent_id:
employee.parent_id = parent_id
else:
employee.coach_id = False
@api.onchange('department_id')
def _onchange_department(self):