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 translation in hr_custody & ohrms_loan & ohrms_loan_accounting #41

Open
wants to merge 3 commits into
base: 12.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
4 changes: 2 additions & 2 deletions hr_custody/models/custody.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def set_to_return(self):
@api.constrains('return_date')
def validate_return_date(self):
if self.return_date < self.date_request:
raise Warning('Please Give Valid Return Date')
raise Warning(_('Please Give Valid Return Date'))

name = fields.Char(string='Code', copy=False)
company_id = fields.Many2one('res.company', 'Company', readonly=True,
Expand Down Expand Up @@ -197,7 +197,7 @@ def validate_return_date(self):
context = self._context
custody_obj = self.env['hr.custody'].search([('id', '=', context.get('custody_id'))])
if self.returned_date <= custody_obj.date_request:
raise Warning('Please Give Valid Renewal Date')
raise Warning(_('Please Give Valid Renewal Date'))

@api.multi
def proceed(self):
Expand Down
4 changes: 2 additions & 2 deletions ohrms_loan/models/hr_loan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from odoo import models, fields, api,_
from odoo import models, fields, api, _
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.exceptions import ValidationError, UserError
Expand Down Expand Up @@ -100,7 +100,7 @@ def unlink(self):
for loan in self:
if loan.state not in ('draft', 'cancel'):
raise UserError(
'You cannot delete a loan which is not in draft or cancelled state')
_('You cannot delete a loan which is not in draft or cancelled state'))
return super(HrLoan, self).unlink()

@api.multi
Expand Down
16 changes: 8 additions & 8 deletions ohrms_loan_accounting/models/hr_loan_acc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import time
from odoo import models, api
from odoo import models, api, _
from odoo.exceptions import UserError


Expand All @@ -14,16 +14,16 @@ def action_approve(self):
loan_approve = self.env['ir.config_parameter'].sudo().get_param('account.loan_approve')
contract_obj = self.env['hr.contract'].search([('employee_id', '=', self.employee_id.id)])
if not contract_obj:
raise UserError('You must Define a contract for employee')
raise UserError(_('You must Define a contract for employee'))
if not self.loan_lines:
raise UserError('You must compute installment before Approved')
raise UserError(_('You must compute installment before Approved'))
if loan_approve:
self.write({'state': 'waiting_approval_2'})
else:
if not self.emp_account_id or not self.treasury_account_id or not self.journal_id:
raise UserError("You must enter employee account & Treasury account and journal to approve ")
raise UserError(_("You must enter employee account & Treasury account and journal to approve "))
if not self.loan_lines:
raise UserError('You must compute Loan Request before Approved')
raise UserError(_('You must compute Loan Request before Approved'))
timenow = time.strftime('%Y-%m-%d')
for loan in self:
amount = loan.loan_amount
Expand Down Expand Up @@ -68,9 +68,9 @@ def action_double_approve(self):
"""This create account move for request in case of double approval.
"""
if not self.emp_account_id or not self.treasury_account_id or not self.journal_id:
raise UserError("You must enter employee account & Treasury account and journal to approve ")
raise UserError(_("You must enter employee account & Treasury account and journal to approve "))
if not self.loan_lines:
raise UserError('You must compute Loan Request before Approved')
raise UserError(_('You must compute Loan Request before Approved'))
timenow = time.strftime('%Y-%m-%d')
for loan in self:
amount = loan.loan_amount
Expand Down Expand Up @@ -121,7 +121,7 @@ def action_paid_amount(self):
timenow = time.strftime('%Y-%m-%d')
for line in self:
if line.loan_id.state != 'approve':
raise UserError("Loan Request must be approved")
raise UserError(_("Loan Request must be approved"))
amount = line.amount
loan_name = line.employee_id.name
reference = line.loan_id.name
Expand Down