minor fix recompute lines

This commit is contained in:
wilson gomez sanchez 2021-04-07 15:26:22 -05:00
parent 173de783e3
commit 14f8d89338
3 changed files with 21 additions and 0 deletions

View File

@ -21,3 +21,11 @@ class Configuration(metaclass=PoolMeta):
], required=True)
payment_partial_sunday = fields.Boolean('Payment Partial Sunday')
template_email_confirm = fields.Many2One('email.template', 'Template Email of Confirmation')
period_payroll = fields.Selection([
('1', 'Weekly'),
('2', 'Decennial'),
('3', 'Catorcenal'),
('4', 'Quincenal'),
('5', 'Monthly'),
('6', 'Other')
], 'Period Payroll')

View File

@ -568,6 +568,16 @@ class Payroll(metaclass=PoolMeta):
line_tax = None
deductions = _ZERO
for line in self.lines:
if line.wage_type.provision_cancellation:
amount_line = [m.amount for m in self.lines if m.wage_type == line.wage_type.provision_cancellation]
values = []
for m in line.move_lines:
values.append(abs(m.debit - m.credit))
amount = sum(values) + sum(amount_line)
line.write([line], {
'unit_value': amount,
'amount': amount,
})
if line.wage_type.definition == 'deduction':
deductions += line.amount
if line.wage_type.type_concept == 'tax':

View File

@ -19,5 +19,8 @@ this repository contains the full copyright notices and license terms. -->
expr="/form/field[@name='minimum_salary']" position="after">
<label name="template_email_confirm"/>
<field name="template_email_confirm"/>
<label name="period_payroll"/>
<field name="period_payroll"/>
</xpath>
</data>