Skip to content

Commit

Permalink
Merge pull request #57 from akretion/16-fix-env-subcontractor
Browse files Browse the repository at this point in the history
fix env
  • Loading branch information
florian-dacosta authored Nov 18, 2024
2 parents 017a38e + 6c2adb4 commit 1861e12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account_invoice_subcontractor/models/subcontractor_work.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ def _scheduler_action_subcontractor_invoice_create(self, days=7):
if subcontractor.subcontractor_type == "internal":
dest_company = subcontractor.subcontractor_company_id
user = subcontractor.user_id
self = self.with_user(user).with_company(dest_company)
new_self = self.with_user(user).with_company(dest_company)
else:
# Used to group by invoice also for external in case of the cron
self = self.with_context(invoice_create_cron=True)
subcontractor_works = self.search(
new_self = self.with_context(invoice_create_cron=True)
subcontractor_works = new_self.search(
[
("id", "in", all_works.ids),
("employee_id", "=", subcontractor.id),
Expand Down

0 comments on commit 1861e12

Please sign in to comment.