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

[T1606] FIX: Search partner address from bank data if non-existing #1670

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

robinrolle
Copy link
Contributor

Update table needed and extract Partner address from data
Add translation files

Update table needed and extract Partner address from data
@robinrolle robinrolle self-assigned this Sep 30, 2024
Copy link

sonarcloud bot commented Sep 30, 2024

Copy link
Member

@ecino ecino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, but there are a few conventions in naming the fields that we want to follow. Relational fields should end with the suffix _id for Many2one and _ids for x2Many fields.



class SearchBankAddressWizard(models.TransientModel):
_name = "search.bank.address.wizard"
_description = "Wizard search bank address"

account_bank_statement_line = fields.Many2one(
"account.bank.statement.line",
account_move = fields.Many2one(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
account_move = fields.Many2one(
move_id = fields.Many2one(

readonly=True,
)
date = fields.Date(
"Last time used",
related="account_bank_statement_line.date",
related="account_move.date",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
related="account_move.date",
related="move_id.date",

@api.depends("account_move.narration")
def _compute_partner_address(self):
for record in self:
narration = record.account_move.narration or ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
narration = record.account_move.narration or ""
narration = record.move_id.narration or ""

name="account_bank_statement_line"
invisible="True"
/>
<field name="account_move" invisible="True" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="account_move" invisible="True" />
<field name="move_id" invisible="True" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants