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] [IMP] account_reconcile_oca: pass default name for lines created through reconciliation models #720

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 account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,16 +481,19 @@ def _inverse_reconcile_data_info(self):
def _reconcile_data_by_model(self, data, reconcile_model, reconcile_auxiliary_id):
new_data = []
liquidity_amount = 0.0
default_name = ""
for line_data in data:
if line_data["kind"] == "suspense":
continue
new_data.append(line_data)
liquidity_amount += line_data["amount"]

if line_data["kind"] == "liquidity":
default_name = line_data["name"]
for line in reconcile_model._get_write_off_move_lines_dict(
-liquidity_amount, self._retrieve_partner().id
):
new_line = line.copy()
new_line["name"] = new_line.get("name") or default_name
amount = line.get("balance")
if self.foreign_currency_id:
amount = self.foreign_currency_id.compute(
Expand Down
Loading