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

Clean deletion of analytic_tag_id setting parameter and pre-commit cleanings #236

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion account_analytic_compassion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
],
"data": [
"views/product_view.xml",
"views/res_config_setting_view.xml",
"views/account_asset_view.xml",
],
"demo": ["analytic_account_data.xml"],
Expand Down
23 changes: 0 additions & 23 deletions account_analytic_compassion/views/res_config_setting_view.xml

This file was deleted.

21 changes: 13 additions & 8 deletions account_offbalance_sponsorship/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,22 @@ def get_account_offbalance(self, company):
)

def reconcile(self):
# check if there is a currency diff and relaod the invoice with the rate received
# check if there is a currency diff
# and reload the invoice with the rate received
filtered_item = self.filtered(
lambda l: l.journal_id != self.company_id.currency_exchange_journal_id
lambda line: line.journal_id != self.company_id.currency_exchange_journal_id
)
total = total_curr = 0
for l in filtered_item:
total = l.debit - l.credit + total
total_curr = l.amount_currency + total_curr
for line in filtered_item:
total = line.debit - line.credit + total
total_curr = line.amount_currency + total_curr
if total != 0 and total_curr == 0:
inv_to_refresh = filtered_item.filtered(
lambda l: l.move_id.journal_id.type == "sale"
lambda line: line.move_id.journal_id.type == "sale"
).move_id
nr = filtered_item.filtered(lambda l: l.move_id.journal_id.type != "sale")
nr = filtered_item.filtered(
lambda line: line.move_id.journal_id.type != "sale"
)
new_rate = sum(n.amount_currency for n in nr) / sum(
n.debit - n.credit for n in nr
)
Expand Down Expand Up @@ -96,7 +99,9 @@ def remove_off_balance_lines(self, inv_move, pmt_move):
ids_to_unlink = self.env["account.move.line"]
for move_name in inv_move.mapped("name"):
ids_to_unlink += rec_lines.filtered(
lambda l: l.account_id.id != off_rec and l.name == move_name
lambda line, current_name=move_name: line.account_id.id
!= off_rec
and line.name == current_name
)
pmt.line_ids -= ids_to_unlink
pmt.write({"state": "posted"})
Expand Down
Loading