Skip to content

Commit

Permalink
[T1606] Fix pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
robinrolle committed Sep 30, 2024
1 parent bf10f7a commit 55c0fb5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
6 changes: 1 addition & 5 deletions partner_compassion/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ msgstr "Nachname"
#. module: partner_compassion
#: model:ir.model.fields,field_description:partner_compassion.field_search_bank_address_wizard__date
msgid "Last time used"
msgstr ""
msgstr "Letzte Nutzung"

#. module: partner_compassion
#: model_terms:ir.ui.view,arch_db:partner_compassion.view_partner_form_compassion_ch
Expand Down Expand Up @@ -1608,10 +1608,6 @@ msgstr ""
msgid "Existing partner info in bank data (May be unavailable)"
msgstr "Partnerinformationen in Bankdaten (können nicht verfügbar sein)"

#. module: partner_compassion
#: model:ir.model.fields,field_description:partner_compassion.field_search_bank_address_wizard__date
msgid "Last time used"
msgstr "Letzte Nutzung"

#. module: partner_compassion
#: code:addons/partner_compassion/wizards/search_bank_address_wizard.py:0
Expand Down
8 changes: 1 addition & 7 deletions partner_compassion/i18n/fr_CH.po
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ msgstr "Nom de famille"
#. module: partner_compassion
#: model:ir.model.fields,field_description:partner_compassion.field_search_bank_address_wizard__date
msgid "Last time used"
msgstr ""
msgstr "Dernière utilisation"

#. module: partner_compassion
#: model_terms:ir.ui.view,arch_db:partner_compassion.view_partner_form_compassion_ch
Expand Down Expand Up @@ -1613,9 +1613,3 @@ msgstr "Infos partenaire données bancaires (peut être indisponible)"
#, python-format
msgid "Partner Address"
msgstr "Adresse partenaire"


#. module: partner_compassion
#: model:ir.model.fields,field_description:partner_compassion.field_search_bank_address_wizard__date
msgid "Last time used"
msgstr "Dernière utilisation"
33 changes: 17 additions & 16 deletions partner_compassion/views/search_bank_address_wizard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,31 @@
<field name="arch" type="xml">
<form>
<div class="oe_title">
<h3>Existing Partner info in bank data (May be unavailable)</h3>
<h3
>Existing Partner info in bank data (May be unavailable)</h3>
</div>
<group>
<field name="account_move" invisible="True"/>
<field name="partner_address"/>
<field name="date"/>
<field name="account_move" invisible="True" />
<field name="partner_address" />
<field name="date" />
</group>
<group>
<field name="overwriting_street"/>
<field name="overwriting_zip_id"/>
<field name="overwriting_street" />
<field name="overwriting_zip_id" />
</group>
<footer>
<button
name="change_address"
type="object"
string="Change address"
class="btn-primary"
/>
name="change_address"
type="object"
string="Change address"
class="btn-primary"
/>
<button
name="cancel_change"
type="object"
string="Cancel change"
class="btn-default"
/>
name="cancel_change"
type="object"
string="Cancel change"
class="btn-default"
/>
</footer>
</form>
</field>
Expand Down
13 changes: 7 additions & 6 deletions partner_compassion/wizards/search_bank_address_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#
##############################################################################

from odoo import _, fields, models, api
import re

from odoo import _, api, fields, models


class SearchBankAddressWizard(models.TransientModel):
_name = "search.bank.address.wizard"
Expand All @@ -22,12 +23,12 @@ class SearchBankAddressWizard(models.TransientModel):
default=lambda self: self._get_default(),
)
partner_address = fields.Text(
_("Partner Address"),
"Partner Address",
compute="_compute_partner_address",
readonly=True,
)
date = fields.Date(
_("Last time used"),
"Last time used",
related="account_move.date",
)

Expand All @@ -54,15 +55,15 @@ def _extract_address_from_narration(self, narration):
"""
Extract Postal Address from account_move.narration field
"""
match = re.search(r'Postal Address\s*\(PstlAdr\):\s*(.*)', narration)
match = re.search(r"Postal Address\s*\(PstlAdr\):\s*(.*)", narration)
if match:
return match.group(1).strip()
return ""

@api.depends('account_move.narration')
@api.depends("account_move.narration")
def _compute_partner_address(self):
for record in self:
narration = record.account_move.narration or ''
narration = record.account_move.narration or ""
record.partner_address = self._extract_address_from_narration(narration)

def change_address(self):
Expand Down

0 comments on commit 55c0fb5

Please sign in to comment.