Skip to content

Commit

Permalink
[FIX] Make sure pre-commit without errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed May 1, 2023
1 parent 2ad9811 commit 98166a4
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 29 deletions.
2 changes: 1 addition & 1 deletion l10n_nl_bank/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"category": "Localisation",
"license": "AGPL-3",
"author": "Odoo Experts, Odoo Community Association (OCA)",
"website": "https://www.odooexperts.nl",
"website": "https://github.com/OCA/l10n-netherlands",
"depends": [
"base",
],
Expand Down
1 change: 1 addition & 0 deletions l10n_nl_country_states/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"name": "Dutch country states (Provincies)",
"version": "11.0.1.0.1",
"author": "Therp BV, Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/l10n-netherlands',
"license": "AGPL-3",
"category": "Localization",
"depends": [
Expand Down
35 changes: 18 additions & 17 deletions l10n_nl_country_states/examples/generate_postcode_regios.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/python
# this script is compatible with a python3 interpreter
# this script generates the data file for postcode state mapping
"""
This expected input is an .xls file, passed as argument.
The .xls file should contain the mapping of postcodes-provinces.
Note: the records of the .xls MUST be sorted by postcode number!
"""

import argparse
import xlrd

'''
This expected input is an .xls file, passed as argument.
The .xls file should contain the mapping of postcodes-provinces.
Note: the records of the .xls MUST be sorted by postcode number!
'''

parser = argparse.ArgumentParser()
parser.add_argument('file', type=open)
Expand All @@ -23,17 +23,18 @@

def get_record_txt():
global province
return str('<record id="zip_%s_%s" model="res.country.state.nl.zip">\n'
' <field name="min_zip">%s</field>\n'
' <field name="max_zip">%s</field>\n'
' <field name="state_id" ref="state_%s" />\n'
'</record>\n'
) % (
str(last_min_zip),
str(last_max_zip),
str(last_min_zip),
str(last_max_zip),
province,
return str(
'<record id="zip_%s_%s" model="res.country.state.nl.zip">\n'
' <field name="min_zip">%s</field>\n'
' <field name="max_zip">%s</field>\n'
' <field name="state_id" ref="state_%s" />\n'
'</record>\n'
) % (
str(last_min_zip),
str(last_max_zip),
str(last_min_zip),
str(last_max_zip),
province,
)


Expand Down Expand Up @@ -63,4 +64,4 @@ def get_record_txt():
last_province = prov

result_text += get_record_txt()
print(result_text)
print(result_text) # pylint: disable=print-used
1 change: 1 addition & 0 deletions l10n_nl_partner_name/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'version': '11.0.0.0.0',
'author': 'Therp BV, Odoo Community Association (OCA)',
'category': 'Contact management',
'website': 'https://github.com/OCA/l10n-netherlands',
'depends': [
'partner_firstname',
'base_view_inheritance_extension',
Expand Down
2 changes: 1 addition & 1 deletion l10n_nl_partner_salutation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'author': 'Therp BV, Odoo Community Association (OCA)',
'category': 'Contact management',
'license': 'AGPL-3',
'website': 'https://github.com/oca/l10n-netherlands.git',
'website': 'https://github.com/OCA/l10n-netherlands',
'depends': [
'partner_contact_gender',
'l10n_nl_partner_name',
Expand Down
2 changes: 1 addition & 1 deletion l10n_nl_tax_invoice_basis/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'version': '11.0.1.0.0',
'category': 'Localization',
'author': 'Onestein, Odoo Community Association (OCA)',
'website': 'http://www.onestein.eu',
'website': 'https://github.com/OCA/l10n-netherlands',
'license': 'AGPL-3',
'depends': [
'account',
Expand Down
29 changes: 20 additions & 9 deletions l10n_nl_tax_statement/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@ def pre_init_hook(cr):
is required, as all values are empty).
"""
logger = logging.getLogger(__name__)
table = "account_move_line"
for column, datatype in (
("l10n_nl_vat_statement_id", "INTEGER"),
("l10n_nl_vat_statement_include", "BOOLEAN")):
if not column_exists(cr, table, column):
logger.info("Precreating %s.%s", table, column)
cr.execute(
"ALTER TABLE {} ADD COLUMN {} {}".format(
table, column, datatype))
if not column_exists(cr, "account_move_line", "l10n_nl_vat_statement_id"):
logger.info(
"Precreating %s.%s",
"account_move_line",
"l10n_nl_vat_statement_id"
)
cr.execute(
"ALTER TABLE account_move_line"
" ADD COLUMN l10n_nl_vat_statement_id INTEGER"
)
if not column_exists(cr, "account_move_line", "l10n_nl_vat_statement_include"):
logger.info(
"Precreating %s.%s",
"account_move_line",
"l10n_nl_vat_statement_include"
)
cr.execute(
"ALTER TABLE account_move_line"
" ADD COLUMN l10n_nl_vat_statement_include BOOLEAN"
)
1 change: 1 addition & 0 deletions l10n_nl_xaf_auditfile_export/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"name": "XAF auditfile export",
"version": "11.0.1.3.0",
"author": "Therp BV, Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/l10n-netherlands',
"license": "AGPL-3",
"category": "Accounting & Finance",
"summary": "Export XAF auditfiles for Dutch tax authorities",
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generated from manifests external_dependencies
mako
pyPostcode
python-stdnum

0 comments on commit 98166a4

Please sign in to comment.