diff --git a/om_account_followup/wizard/followup_print.py b/om_account_followup/wizard/followup_print.py
index 6bf998a9..81ccc9d0 100644
--- a/om_account_followup/wizard/followup_print.py
+++ b/om_account_followup/wizard/followup_print.py
@@ -154,7 +154,6 @@ def do_process(self):
'report_data': restot['action']})
return {
'name': _('Send Letters and Emails: Actions Summary'),
- 'view_type': 'form',
'context': context,
'view_mode': 'list,form',
'res_model': 'followup.sending.results',
diff --git a/om_fiscal_year/models/account_settings.py b/om_fiscal_year/models/account_settings.py
index d06569ce..4a2ffaf1 100644
--- a/om_fiscal_year/models/account_settings.py
+++ b/om_fiscal_year/models/account_settings.py
@@ -1,30 +1,17 @@
-from odoo import api, fields, models
+from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
- fiscalyear_last_day = fields.Integer(
- related='company_id.fiscalyear_last_day', readonly=False
- )
- fiscalyear_last_month = fields.Selection(
- related='company_id.fiscalyear_last_month', readonly=False
- )
- tax_lock_date = fields.Date(
- related='company_id.hard_lock_date', readonly=False
- )
- sale_lock_date = fields.Date(
- related='company_id.hard_lock_date', readonly=False
- )
- purchase_lock_date = fields.Date(
- related='company_id.hard_lock_date', readonly=False
- )
- hard_lock_date = fields.Date(
- related='company_id.hard_lock_date', readonly=False
- )
- fiscalyear_lock_date = fields.Date(
- related='company_id.fiscalyear_lock_date', readonly=False
- )
- group_fiscal_year = fields.Boolean(
- string='Fiscal Years', implied_group='om_fiscal_year.group_fiscal_year'
- )
+ fiscalyear_last_day = fields.Integer(related='company_id.fiscalyear_last_day', readonly=False,
+ string="Fiscal Year Last Day")
+ fiscalyear_last_month = fields.Selection(related='company_id.fiscalyear_last_month', readonly=False,
+ string="Fiscal Year Last Month")
+ tax_lock_date = fields.Date(related='company_id.hard_lock_date', readonly=False, string="Tax Lock Date")
+ sale_lock_date = fields.Date(related='company_id.hard_lock_date', readonly=False, string="Sale Lock Date")
+ purchase_lock_date = fields.Date(related='company_id.hard_lock_date', readonly=False, string="Purchase Lock Date")
+ hard_lock_date = fields.Date(related='company_id.hard_lock_date', readonly=False, string="Hard Lock Date")
+ fiscalyear_lock_date = fields.Date(related='company_id.fiscalyear_lock_date', readonly=False,
+ string="Fiscal Year Lock Date")
+ group_fiscal_year = fields.Boolean(string='Fiscal Years', implied_group='om_fiscal_year.group_fiscal_year')
diff --git a/om_hr_payroll/models/hr_payslip.py b/om_hr_payroll/models/hr_payslip.py
index 9bbfd020..3dba7da7 100644
--- a/om_hr_payroll/models/hr_payslip.py
+++ b/om_hr_payroll/models/hr_payslip.py
@@ -94,7 +94,6 @@ def refund_sheet(self):
'name': (_("Refund Payslip")),
'view_mode': 'list, form',
'view_id': False,
- 'view_type': 'form',
'res_model': 'hr.payslip',
'type': 'ir.actions.act_window',
'target': 'current',
@@ -415,11 +414,22 @@ def onchange_employee_id(self, date_from, date_to, employee_id=False, contract_i
}
if (not employee_id) or (not date_from) or (not date_to):
return res
+
ttyme = datetime.combine(fields.Date.from_string(date_from), time.min)
employee = self.env['hr.employee'].browse(employee_id)
locale = self.env.context.get('lang') or 'en_US'
+
res['value'].update({
- 'name': _('Salary Slip of %s for %s') % (employee.name, tools.ustr(babel.dates.format_date(date=ttyme, format='MMMM-y', locale=locale))),
+ 'name': _('Salary Slip of %s for %s') % (
+ employee.name,
+ str(
+ babel.dates.format_date(
+ date=ttyme,
+ format='MMMM-y',
+ locale=locale
+ )
+ )
+ ),
'company_id': employee.company_id.id,
})
@@ -468,7 +478,16 @@ def onchange_employee(self):
ttyme = datetime.combine(fields.Date.from_string(date_from), time.min)
locale = self.env.context.get('lang') or 'en_US'
- self.name = _('Salary Slip of %s for %s') % (employee.name, tools.ustr(babel.dates.format_date(date=ttyme, format='MMMM-y', locale=locale)))
+ self.name = _('Salary Slip of %s for %s') % (
+ employee.name,
+ str(
+ babel.dates.format_date(
+ date=ttyme,
+ format='MMMM-y',
+ locale=locale
+ )
+ )
+ )
self.company_id = employee.company_id
if not self.env.context.get('contract') or not self.contract_id:
diff --git a/om_hr_payroll/views/hr_payslip_views.xml b/om_hr_payroll/views/hr_payslip_views.xml
index 35a902ce..c7d06769 100644
--- a/om_hr_payroll/views/hr_payslip_views.xml
+++ b/om_hr_payroll/views/hr_payslip_views.xml
@@ -92,7 +92,7 @@
-
+
@@ -370,7 +370,7 @@
-
+
diff --git a/om_hr_payroll/views/hr_salary_rule_views.xml b/om_hr_payroll/views/hr_salary_rule_views.xml
index 1dce05b9..d18f0652 100644
--- a/om_hr_payroll/views/hr_salary_rule_views.xml
+++ b/om_hr_payroll/views/hr_salary_rule_views.xml
@@ -21,7 +21,7 @@
-
+
@@ -184,7 +184,7 @@
-
+
@@ -277,7 +277,7 @@
-
+
diff --git a/om_hr_payroll/views/report_contribution_register_templates.xml b/om_hr_payroll/views/report_contribution_register_templates.xml
index 30472cb9..693732f5 100644
--- a/om_hr_payroll/views/report_contribution_register_templates.xml
+++ b/om_hr_payroll/views/report_contribution_register_templates.xml
@@ -49,11 +49,11 @@
+ t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
|
+ t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
|
@@ -68,7 +68,7 @@
+ t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
|
diff --git a/om_hr_payroll/views/report_payslip_details_templates.xml b/om_hr_payroll/views/report_payslip_details_templates.xml
index 2714ae56..70553559 100644
--- a/om_hr_payroll/views/report_payslip_details_templates.xml
+++ b/om_hr_payroll/views/report_payslip_details_templates.xml
@@ -88,7 +88,7 @@
+ t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
|
@@ -121,7 +121,7 @@
+ t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
|
diff --git a/om_recurring_payments/models/recurring_payment.py b/om_recurring_payments/models/recurring_payment.py
index b5e2dfee..7384d588 100644
--- a/om_recurring_payments/models/recurring_payment.py
+++ b/om_recurring_payments/models/recurring_payment.py
@@ -6,7 +6,7 @@
class RecurringPayment(models.Model):
_name = 'recurring.payment'
- _description = 'Recurring Payment('
+ _description = 'Recurring Payment'
_rec_name = 'name'
name = fields.Char('Name', readonly=True)
@@ -86,6 +86,9 @@ def action_generate_payment(self):
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
+ if vals.get('amount', 0) <= 0:
+ raise ValidationError(_('Amount must be a non-zero positive number.'))
+
if 'company_id' in vals:
vals['name'] = self.env['ir.sequence'].with_context(force_company=vals['company_id']).next_by_code(
'recurring.payment') or _('New')
@@ -93,11 +96,6 @@ def create(self, vals_list):
vals['name'] = self.env['ir.sequence'].next_by_code('recurring.payment') or _('New')
return super(RecurringPayment, self).create(vals)
- @api.constrains('amount')
- def _check_amount(self):
- if self.amount <= 0:
- raise ValidationError(_('Amount Must Be Non-Zero Positive Number'))
-
def unlink(self):
for rec in self:
if rec.state == 'done':