Merge PR #199 into 10.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2019-07-19 07:32:43 +00:00
4 changed files with 13 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'CAMT Format Bank Statements Import',
'version': '10.0.1.1.5',
'version': '10.0.1.1.6',
'license': 'AGPL-3',
'author': 'Odoo Community Association (OCA), Therp BV',
'website': 'https://github.com/OCA/bank-statement-import',

View File

@@ -262,8 +262,8 @@
<Dbtr>
<Nm>3rd party Media</Nm>
<PstlAdr>
<StrtNm>SOMESTREET 570-A</StrtNm>
<TwnNm>1276 ML HOUSCITY</TwnNm>
<AdrLine>SOMESTREET 570-A</AdrLine>
<AdrLine>1276 ML HOUSCITY</AdrLine>
<Ctry>NL</Ctry>
</PstlAdr>
</Dbtr>

View File

@@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'CAMT Debitor Details Bank Statements Import',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'license': 'AGPL-3',
'author': 'Odoo Community Association (OCA), Compassion CH',
'website': 'https://github.com/OCA/bank-statement-import',

View File

@@ -33,6 +33,13 @@ class CamtDetailsParser(models.AbstractModel):
'./ns:BldgNb', namespaces={'ns': ns})
if building_node:
address_values['building'] = building_node[0].text
generic_nodes = address_node[0].xpath(
'./ns:AdrLine', namespaces={'ns': ns})
if generic_nodes:
address_values.update({
'address_line_' + str(i): node.text
for i, node in enumerate(generic_nodes)
})
zip_node = address_node[0].xpath(
'./ns:PstCd', namespaces={'ns': ns})
if zip_node:
@@ -58,7 +65,8 @@ class CamtDetailsParser(models.AbstractModel):
"""
Hook for formatting the partner address read in CAMT bank statement.
:param address_values: dict: all address values found in statement
Possible keys are ['street', 'building', 'zip', 'city']
Possible keys are ['street', 'building', 'address_line_xxx',
'zip', 'city']
Not all keys may be present.
:return: str: formatted address
"""