This commit is contained in:
Bakry 2025-05-28 17:34:46 +03:00
parent 988a85b652
commit 3eaa38569b
2 changed files with 5 additions and 4 deletions

View File

@ -61,12 +61,12 @@ class HrSalaryRules(models.Model):
def get_debit_account_id(self, emp_type):
if not self.transfer_by_emp_type: return self.rule_debit_account_id.id
account_mapping = self.account_ids.filtered(lambda a: a.emp_type_id.id == emp_type)
account_mapping = self.sudo().account_ids.filtered(lambda a: a.emp_type_id.id == emp_type)
return account_mapping[0].debit_account_id.id if account_mapping else False
def get_credit_account_id(self, emp_type):
if not self.transfer_by_emp_type: return self.rule_credit_account_id.id
account_mapping = self.account_ids.filtered(lambda a: a.emp_type_id.id == emp_type)
account_mapping = self.sudo().account_ids.filtered(lambda a: a.emp_type_id.id == emp_type)
return account_mapping[0].credit_account_id.id if account_mapping else False
@api.constrains('rules_type', 'category_id')

View File

@ -413,9 +413,10 @@
<field name="name"/>
<field name="department_id"/>
<field name="job_id"/>
<field name="saudi_number" string="Saudi ID"/>
<!--field name="saudi_number" string="Saudi ID"/>
<field name="iqama_number" string="Identity No"/>
<field name="iqama_expiy_date" string="Identity Expiry Date"/>
<field name="iqama_expiy_date" string="Identity Expiry Date"/-->
<field name="identity_number" string="Identity No"/>
<field name="bank_code"/>
<field name="work_location" invisible="1"/>
<field name="state"/>