commit
5a030f29f6
|
|
@ -219,15 +219,18 @@ class employee_overtime_request(models.Model):
|
|||
'account_id': item.journal_id.default_account_id.id,
|
||||
'partner_id': record.employee_id.user_id.partner_id.id
|
||||
}
|
||||
move = record.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': item.journal_id.id,
|
||||
'date': item.request_date,
|
||||
'ref': record.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
})
|
||||
if not record.move_id:
|
||||
move = record.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': item.journal_id.id,
|
||||
'date': item.request_date,
|
||||
'ref': record.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'employee.overtime.request',
|
||||
'res_id': self.id
|
||||
})
|
||||
|
||||
record.move_id = move.id
|
||||
record.move_id = move.id
|
||||
self.state = "validated"
|
||||
if self.transfer_type == 'payroll':
|
||||
# last_day_of_current_month = date.today().replace(day=calendar.monthrange(date.today().year, date.today().month)[1])
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ msgstr "بند الصرف"
|
|||
|
||||
#. module: exp_official_mission
|
||||
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_employee__account_move_id
|
||||
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_especially_line_form_view
|
||||
msgid "Account Move"
|
||||
msgstr "القيود المحاسبيه"
|
||||
|
||||
|
|
|
|||
|
|
@ -525,15 +525,18 @@ class HrOfficialMission(models.Model):
|
|||
'account_id': self.mission_type.journal_id.default_account_id.id,
|
||||
'partner_id': item.employee_id.user_id.partner_id.id
|
||||
}
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': self.mission_type.journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Official mission for employee "%s" ' % item.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
})
|
||||
# fill account move for each employee
|
||||
item.write({'account_move_id': move.id})
|
||||
if not item.account_move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': self.mission_type.journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Official mission for employee "%s" ' % item.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.official.mission',
|
||||
'res_id': self.id
|
||||
})
|
||||
# fill account move for each employee
|
||||
item.write({'account_move_id': move.id})
|
||||
else:
|
||||
raise exceptions.Warning(
|
||||
_('You do not have account or journal in mission type "%s" ') % self.mission_type.name)
|
||||
|
|
@ -596,7 +599,9 @@ class HrOfficialMission(models.Model):
|
|||
'partner_id': item.partner_id.id,
|
||||
'invoice_date': date.today(),
|
||||
'ref': 'Training Cost for Course Name %s ' % item.course_name.name,
|
||||
'invoice_line_ids': [(0, 0, invoice_line_vals)]
|
||||
'invoice_line_ids': [(0, 0, invoice_line_vals)],
|
||||
'res_model': 'hr.official.mission',
|
||||
'res_id': self.id
|
||||
})
|
||||
item.write({'Tra_cost_invo_id': invoice.id})
|
||||
|
||||
|
|
|
|||
|
|
@ -208,6 +208,11 @@
|
|||
|
||||
<field name="date_from" readonly="1"/>
|
||||
<field name="date_to" readonly="1"/>
|
||||
<field name="account_move_id" string="Account Move" readonly="1" force_save="1"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
|
||||
('parent.move_type','!=','accounting')]}"/>
|
||||
|
||||
|
||||
</group>
|
||||
<group>
|
||||
|
|
|
|||
|
|
@ -130,15 +130,18 @@ class EmployeeReward(models.Model):
|
|||
'account_id': record.journal_id.default_account_id.id,
|
||||
'partner_id': record.employee_id.user_id.partner_id.id
|
||||
}
|
||||
move = record.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.journal_id.id,
|
||||
'date': item.date,
|
||||
'ref': record.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
})
|
||||
if not record.move_id:
|
||||
move = record.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.journal_id.id,
|
||||
'date': item.date,
|
||||
'ref': record.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.employee.reward',
|
||||
'res_id': self.id
|
||||
})
|
||||
|
||||
record.move_id = move.id
|
||||
record.move_id = move.id
|
||||
self.state = "done"
|
||||
for line in self.line_ids_reward:
|
||||
line.reward_state = "done"
|
||||
|
|
|
|||
|
|
@ -255,14 +255,15 @@ class SalaryRuleInput(models.Model):
|
|||
'partner_id': self.employee_id.user_id.partner_id.id,
|
||||
'credit': total,
|
||||
})
|
||||
move = self.env['account.move'].create({
|
||||
'journal_id': journal.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_to,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in total_list]
|
||||
})
|
||||
self.move_id = move.id
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'journal_id': journal.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_to,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in total_list]
|
||||
})
|
||||
self.move_id = move.id
|
||||
self.write({'state': 'transfered'})
|
||||
|
||||
def compute_totals(self):
|
||||
|
|
@ -3058,17 +3059,18 @@ class HrPayslipRun(models.Model):
|
|||
|
||||
merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
|
||||
|
||||
########################## per_analytic_account ###########
|
||||
|
|
@ -3184,17 +3186,18 @@ class HrPayslipRun(models.Model):
|
|||
new_rec_loan_list = record.get('loans')
|
||||
merged_list = self.new_merge_lists(new_record_list, 'name', 'account_id', 'analytic_account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
'date': self.date_end,
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
'date': self.date_end,
|
||||
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
|
||||
# import pdb
|
||||
# pdb.set_trace()
|
||||
|
|
@ -3275,18 +3278,19 @@ class HrPayslipRun(models.Model):
|
|||
new_record_list = record.get('list_ids')
|
||||
# merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
# record_final_item = merged_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'partner_id': line.employee_id.user_id.partner_id.id,
|
||||
'journal_id': line.contract_id.journal_id.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': line.name,
|
||||
'line_ids': [(0, 0, item) for item in new_record_list],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
if not line.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'partner_id': line.employee_id.user_id.partner_id.id,
|
||||
'journal_id': line.contract_id.journal_id.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': line.name,
|
||||
'line_ids': [(0, 0, item) for item in new_record_list],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
|
||||
else:
|
||||
bank_id = ''
|
||||
|
|
@ -3448,17 +3452,18 @@ class HrPayslipRun(models.Model):
|
|||
new_rec_loan_list = record.get('loans')
|
||||
merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': bank_id,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
if not line.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': bank_id,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
|
||||
for line in self.slip_ids:
|
||||
payslip = self.env['hr.payslip'].search([('state', '=', line.state)])
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
<data>
|
||||
<template id="report_payroll_bank_pdf_docx"><t t-foreach="data" t-as="v"><t>IFH,IFILE,CSV,ABCD5953001,SASABBGSA003888815,<t><t t-esc="random_char"/></t><t t-set="date_value" t-value="pay_date"/><t t-esc="date_value.replace('-', '').replace('/', '').replace(':', '')"/>00,</t><t t-esc="datestamp" widget="datetime"></t>,<t><t t-esc="timestamp" widget="datetime"></t></t><t>,P,1.0,</t><t><t t-esc="number_of_records"/></t>
|
||||
<t>BATHDR,ACH-CR,<t><t t-esc="counter"/></t>,,,,<t><t t-esc="salary_type"/></t>,Salary,,@1ST@,<t t-set="date_value" t-value="pay_date"/><t t-esc="date_value.replace('-', '').replace('/', '')"/>,00<t t-esc="company_pay_no"></t>,<t t-esc="currency"></t>,<t t-esc="round(total_amount_salary,2)"></t>,,,,,,,<t t-esc="company_id"></t>,<t><t t-esc="company_hr_no"/></t>,<t><t t-esc="company_registry"/></t>,,,,<t><t t-esc="random_char2"/></t><t t-set="date_value" t-value="timestamp" widget="datetime"/><t t-esc="date_value.replace('-', '').replace('/', '').replace(':', '')"/>00</t><t t-if="bank_type=='rajhi'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t t-elif="bank_type=='alahli'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t t-elif="bank_type=='riyadh'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o+['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o+['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t></t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -114,18 +114,21 @@ class HrTicketing(models.Model):
|
|||
'account_id': self.journal_id.default_account_id.id,
|
||||
'partner_id': self.employee_id.user_id.partner_id.id
|
||||
}
|
||||
move_id = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': self.journal_id.id,
|
||||
'date': self.request_date,
|
||||
'ref': 'Ticket Request for "%s" ' % self.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
})
|
||||
if not self.move_id :
|
||||
move_id = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': self.journal_id.id,
|
||||
'date': self.request_date,
|
||||
'ref': 'Ticket Request for "%s" ' % self.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.ticket.request',
|
||||
'res_id': self.id
|
||||
})
|
||||
|
||||
self.write({
|
||||
'state': 'done',
|
||||
'move_id': move_id.id
|
||||
})
|
||||
self.write({
|
||||
'state': 'done',
|
||||
'move_id': move_id.id
|
||||
})
|
||||
else:
|
||||
self.write({'state': 'done'})
|
||||
|
||||
|
|
|
|||
|
|
@ -121,14 +121,17 @@ class hr_exit_return(models.Model):
|
|||
'account_id': item.account_journal_id.default_account_id.id,
|
||||
'partner_id': item.employee_id.user_id.partner_id.id
|
||||
}
|
||||
move_id = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': item.account_journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Exit and Return',
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
})
|
||||
self.account_move_id = move_id.id
|
||||
if not item.account_move_id:
|
||||
move_id = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': item.account_journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Exit and Return',
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.exit.return',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.account_move_id = move_id.id
|
||||
|
||||
self.state = 'done'
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,9 @@ class HrSalaryAdvance(models.Model):
|
|||
'journal_id': item.request_type.journal_id.id,
|
||||
'date': item.date,
|
||||
'ref': 'Loan',
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.loan.salary.advance',
|
||||
'res_id': self.id
|
||||
})
|
||||
if not item.moves_ids:
|
||||
self.env['hr.account.moves'].create({
|
||||
|
|
|
|||
|
|
@ -917,7 +917,9 @@ class HrTermination(models.Model):
|
|||
'journal_id': self.journal.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Termination of "%s" ' % self.employee_id.name,
|
||||
'line_ids': [(0, 0, value) for value in line_vals]
|
||||
'line_ids': [(0, 0, value) for value in line_vals],
|
||||
'res_model': 'hr.termination',
|
||||
'res_id': self.id
|
||||
})
|
||||
|
||||
for item in self.loans_ids:
|
||||
|
|
|
|||
Loading…
Reference in New Issue