diff --git a/om_account_accountant/models/account_move.py b/om_account_accountant/models/account_move.py index 592361ce..ec18e7d9 100644 --- a/om_account_accountant/models/account_move.py +++ b/om_account_accountant/models/account_move.py @@ -1,4 +1,4 @@ -from odoo import fields, models, api +from odoo import models, api class AccountMove(models.Model): diff --git a/om_account_asset/models/account_asset.py b/om_account_asset/models/account_asset.py index c3611397..c8dd9d42 100644 --- a/om_account_asset/models/account_asset.py +++ b/om_account_asset/models/account_asset.py @@ -386,7 +386,6 @@ def _return_disposal_view(self, move_ids): view_mode = 'tree,form' return { 'name': name, - 'view_type': 'form', 'view_mode': view_mode, 'res_model': 'account.move', 'type': 'ir.actions.act_window', @@ -536,7 +535,6 @@ def open_entries(self): move_ids.append(depreciation_line.move_id.id) return { 'name': _('Journal Entries'), - 'view_type': 'form', 'view_mode': 'list,form', 'res_model': 'account.move', 'view_id': False, diff --git a/om_account_asset/views/account_asset_views.xml b/om_account_asset/views/account_asset_views.xml index 381e41cd..23109382 100644 --- a/om_account_asset/views/account_asset_views.xml +++ b/om_account_asset/views/account_asset_views.xml @@ -145,7 +145,7 @@ - +
diff --git a/om_account_asset/views/asset_category_views.xml b/om_account_asset/views/asset_category_views.xml index 3d6c8c4a..d9712f43 100644 --- a/om_account_asset/views/asset_category_views.xml +++ b/om_account_asset/views/asset_category_views.xml @@ -103,7 +103,7 @@ - +
diff --git a/om_account_asset/wizard/asset_depreciation_confirmation_wizard.py b/om_account_asset/wizard/asset_depreciation_confirmation_wizard.py index bb720cf7..38bf3fa7 100644 --- a/om_account_asset/wizard/asset_depreciation_confirmation_wizard.py +++ b/om_account_asset/wizard/asset_depreciation_confirmation_wizard.py @@ -20,7 +20,6 @@ def asset_compute(self): return { 'name': _('Created Asset Moves') if context.get('asset_type') == 'purchase' else _('Created Revenue Moves'), - 'view_type': 'form', 'view_mode': 'list,form', 'res_model': 'account.move', 'view_id': False, diff --git a/om_account_budget/views/account_budget_views.xml b/om_account_budget/views/account_budget_views.xml index 93cb7a32..b70dec08 100644 --- a/om_account_budget/views/account_budget_views.xml +++ b/om_account_budget/views/account_budget_views.xml @@ -179,7 +179,7 @@ - +
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':