Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhongu committed Oct 29, 2024
1 parent a2ce1dc commit 46bb1df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions deltatech_expenses/models/deltatech_expenses_deduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@ def _default_journal(self):
if self._context.get("default_journal_id", False):
return self.env["account.journal"].browse(self._context.get("default_journal_id"))

domain = [("type", "=", "cash")]
domain = [("type", "=", "cash"), ("company_id", "=", self.env.company.id)]
return self.env["account.journal"].search(domain, limit=1)

@api.model
def _default_account_diem(self):
account_pool = self.env["account.account"]
try:
account_id = account_pool.search([("code", "=ilike", "625%")], limit=1) # Cheltuieli cu deplasari
account_id = account_pool.search(
[("code", "=ilike", "625%"), ("company_id", "=", self.env.company.id)], limit=1
) # Cheltuieli cu deplasari
except Exception:
try:
account_id = account_pool.search([("account_type", "=", "expense")], limit=1)
account_id = account_pool.search(
[("account_type", "=", "expense"), ("company_id", "=", self.env.company.id)], limit=1
)
except Exception:
account_id = False
return account_id
Expand Down

0 comments on commit 46bb1df

Please sign in to comment.