Skip to content
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
2 changes: 1 addition & 1 deletion om_account_accountant/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo import fields, models, api
from odoo import models, api


class AccountMove(models.Model):
Expand Down
2 changes: 0 additions & 2 deletions om_account_asset/models/account_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion om_account_asset/views/account_asset_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<field name="date"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_global_click">
<div class="row mb4">
<div class="col-6">
Expand Down
2 changes: 1 addition & 1 deletion om_account_asset/views/asset_category_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<field name="journal_id"/>
<field name="method"/>
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="row mb4">
<div class="col-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion om_account_budget/views/account_budget_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<field name="user_id"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_global_click">
<div class="row mb4">
<div class="col-8">
Expand Down
1 change: 0 additions & 1 deletion om_account_followup/wizard/followup_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
37 changes: 12 additions & 25 deletions om_fiscal_year/models/account_settings.py
Original file line number Diff line number Diff line change
@@ -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')
25 changes: 22 additions & 3 deletions om_hr_payroll/models/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
})

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions om_hr_payroll/views/hr_payslip_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-6">
Expand Down Expand Up @@ -370,7 +370,7 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-6">
Expand Down
6 changes: 3 additions & 3 deletions om_hr_payroll/views/hr_salary_rule_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-12">
Expand Down Expand Up @@ -184,7 +184,7 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-12">
Expand Down Expand Up @@ -277,7 +277,7 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
</td>
<td class="text-right">
<span t-esc="line.amount"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</td>
<td class="text-right">
<span t-esc="line.total"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</td>
</tr>
</tbody>
Expand All @@ -68,7 +68,7 @@
</td>
<td class="text-right">
<span t-esc="lines_total.get(o.id)"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions om_hr_payroll/views/report_payslip_details_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</td>
<td class="text-right">
<span t-esc="h['total']"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -121,7 +121,7 @@
</td>
<td class="text-right">
<span t-esc="p.get('total', 0)"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</td>
</tr>
</tbody>
Expand Down
10 changes: 4 additions & 6 deletions om_recurring_payments/models/recurring_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -86,18 +86,16 @@ 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')
else:
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':
Expand Down