23 lines
629 B
Python
23 lines
629 B
Python
from odoo import api, fields, models, _
|
|
from odoo.exceptions import ValidationError, UserError
|
|
import json
|
|
from odoo.tools import date_utils
|
|
import logging
|
|
|
|
|
|
|
|
class InheritHrPayslipLine(models.Model):
|
|
_inherit = 'hr.payslip.line'
|
|
|
|
is_amount = fields.Boolean(string='金额是否一至', default=False)
|
|
|
|
@api.onchange('total')
|
|
def _onchange_total(self):
|
|
for rec in self:
|
|
if rec.total != 0:
|
|
if rec.total != rec.amount:
|
|
rec.is_amount = True
|
|
else:
|
|
rec.is_amount = False
|
|
else:
|
|
rec.is_amount = False |