-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: 14.0
Are you sure you want to change the base?
Conversation
Update table needed and extract Partner address from data
Quality Gate passedIssues Measures |
There was a problem hiding this 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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="account_move" invisible="True" /> | |
<field name="move_id" invisible="True" /> |
Update table needed and extract Partner address from data
Add translation files