Skip to content

Commit

Permalink
Merge pull request #495 from Trust-Code/10.0
Browse files Browse the repository at this point in the history
10.0
  • Loading branch information
marinaGD committed Jul 24, 2018
2 parents 35f46cc + d32f864 commit 33e2fa2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions br_hr_payroll/model/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ def week_of_month(self, dt):
def get_worked_day_lines(self, contract_ids, date_from, date_to):
res = super(HrPayslip, self).get_worked_day_lines(
contract_ids, date_from, date_to)
employee = self.employee_id
contract = self.env['hr.contract'].browse(
self.get_contract(employee, date_from, date_to))
if contract:
for contract in contract_ids:
leaves = self.env['hr.holidays'].search(
[('employee_id', '=', self.employee_id.id),
('date_from', '>=', date_from),
Expand All @@ -36,7 +33,6 @@ def get_worked_day_lines(self, contract_ids, date_from, date_to):
('type', '=', 'remove')])
dsr = {}
for leave in leaves:
# BUG: Fazer validação da falta
if leave.holiday_status_id.name == 'Unpaid':
leave_start = fields.Datetime.from_string(leave.date_from)
dsr[self.week_of_month(leave_start)] = leave_start
Expand All @@ -45,8 +41,8 @@ def get_worked_day_lines(self, contract_ids, date_from, date_to):
'sequence': 8,
'code': 'DSR',
'number_of_days': len(dsr),
'contract_id': contract.id,
'contract_id': contract,
}
if dsr_dict['number_of_days'] != 0:
res += [dsr_dict]
return res
return res
2 changes: 1 addition & 1 deletion br_purchase/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _prepare_tax_context(self):
'icms_st_aliquota_deducao': self.icms_st_aliquota_deducao,
}

@api.depends('taxes_id', 'product_qty', 'price_unit',
@api.depends('taxes_id', 'product_qty', 'price_unit', 'discount',
'icms_aliquota_reducao_base', 'icms_st_aliquota_reducao_base',
'ipi_reducao_bc', 'icms_st_aliquota_deducao',
'incluir_ipi_base', 'icms_st_aliquota_mva')
Expand Down
2 changes: 1 addition & 1 deletion br_purchase_stock/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def _amount_all(self):
order.update({
'amount_total': order.total_bruto + order.total_tax +
order.total_frete + order.total_seguro +
order.total_despesas,
order.total_despesas - order.total_desconto,
})

def _calc_ratio(self, qty, total):
Expand Down

0 comments on commit 33e2fa2

Please sign in to comment.