Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] hr_expense_advance_clearing: fetch the product considering the company so that the correct property can be retrieved (Port From #260 #264

Merged
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
5 changes: 4 additions & 1 deletion hr_expense_advance_clearing/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ def _compute_clearing_residual(self):
emp_advance = sheet._get_product_advance()
residual_company = 0.0
if emp_advance:
property_account_expense_id = emp_advance.with_company(
sheet.company_id
).property_account_expense_id
for line in sheet.sudo().account_move_id.line_ids:
if line.account_id == emp_advance.property_account_expense_id:
if line.account_id == property_account_expense_id:
residual_company += line.amount_residual
sheet.clearing_residual = residual_company

Expand Down
Loading