minor fix remove lines quantity zero
This commit is contained in:
parent
2e4c4569e1
commit
3ab07cdae5
|
@ -379,8 +379,6 @@ class Payroll(metaclass=PoolMeta):
|
|||
MoveLine = pool.get('account.move.line')
|
||||
PayrollLine = pool.get('staff.payroll.line')
|
||||
LoanLine = pool.get('staff.loan.line')
|
||||
Configuration = Pool().get('staff.configuration')
|
||||
configuration = Configuration(1)
|
||||
|
||||
for line in self.lines:
|
||||
to_write = {}
|
||||
|
@ -418,8 +416,6 @@ class Payroll(metaclass=PoolMeta):
|
|||
'move_lines': [('add', lines_to_reconcile)]
|
||||
}
|
||||
PayrollLine.write([line], to_write)
|
||||
if not configuration.allow_zero_quantities and line.quantity == 0:
|
||||
PayrollLine.delete([line])
|
||||
|
||||
def process_loans_to_pay(self, line, LoanLine, PayrollLine, MoveLine):
|
||||
|
||||
|
@ -485,6 +481,8 @@ class Payroll(metaclass=PoolMeta):
|
|||
|
||||
def set_preliquidation(self, extras, discounts=None):
|
||||
PayrollLine = Pool().get('staff.payroll.line')
|
||||
Configuration = Pool().get('staff.configuration')
|
||||
configuration = Configuration(1)
|
||||
discounts = self.set_events()
|
||||
ctx = {
|
||||
'absenteeism_days': self.absenteeism_days
|
||||
|
@ -499,6 +497,9 @@ class Payroll(metaclass=PoolMeta):
|
|||
|
||||
self.update_wage_no_salary()
|
||||
self.recompute_lines()
|
||||
for line in self.lines:
|
||||
if not configuration.allow_zero_quantities and line.quantity == 0:
|
||||
PayrollLine.delete([line])
|
||||
|
||||
def set_events(self):
|
||||
pool = Pool()
|
||||
|
|
Loading…
Reference in New Issue