Skip to content

Commit

Permalink
Merge pull request #427 from acsone/14.0-update-dotfiles-sbi
Browse files Browse the repository at this point in the history
[14.0] update dotfiles
  • Loading branch information
sbidoul authored Mar 29, 2022
2 parents 1ad9112 + 210f6e4 commit 8c836f4
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 123 deletions.
5 changes: 4 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.4.0
_commit: v1.5.2
_src_path: git+https://github.com/OCA/oca-addons-repo-template
ci: GitHub
dependency_installation_mode: PIP
generate_requirements_txt: true
include_wkhtmltopdf: false
odoo_version: 14.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups: []
repo_description: null
repo_name: MIS Builder
repo_slug: mis-builder
repo_website: https://github.com/OCA/mis-builder
travis_apt_packages: []
travis_apt_sources: []
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2019

overrides:
- files:
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ name: pre-commit

on:
pull_request:
branches:
- "14.0*"
push:
branches:
- "14.0"
- "14.0-ocabot-*"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
# The pylint-odoo version we use here does not support python 3.10
# https://github.com/OCA/oca-addons-repo-template/issues/80
# We also need to pin to an older version of python for older odoo versions
# where we are not using black > 21. Older black versions won't work with
# Python 3.9.8+, and we can't bump black without reformatting.
python-version: "3.9.7"
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,27 @@ on:
- "14.0*"
push:
branches:
- "14.0*"
- "14.0"
- "14.0-ocabot-*"

jobs:
unreleased-deps:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v2
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
grep "^[^#].*/" ${reqfile} || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
fi
fi
done
test:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down Expand Up @@ -120,7 +120,7 @@ repos:
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
rev: v2.11.1
hooks:
- id: pylint
name: pylint with optional checks
Expand All @@ -129,7 +129,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- pylint-odoo==5.0.5
- id: pylint
name: pylint with mandatory checks
args:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/mis-builder&target_branch=14.0)
[![Pre-commit Status](https://github.com/OCA/mis-builder/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/mis-builder/actions/workflows/pre-commit.yml?query=branch%3A14.0)
[![Build Status](https://github.com/OCA/mis-builder/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/mis-builder/actions/workflows/test.yml?query=branch%3A14.0)
Expand Down Expand Up @@ -65,12 +66,11 @@ addon | version | maintainers | summary

This repository is licensed under [AGPL-3.0](LICENSE).

However, each module can have a totally different license, as long as they adhere to OCA
However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA)
policy. Consult each module's `__manifest__.py` file, which contains a `license` key
that explains its license.

----

OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit
organization whose mission is to support the collaborative development of Odoo features
and promote its widespread use.
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

# -- Project information -----------------------------------------------------

project = u"MIS Builder"
project = "MIS Builder"
year = datetime.now().year
copyright = u"%s, Odoo Community Association (OCA)" % year
author = u"Odoo Community Association (OCA)"
copyright = "%s, Odoo Community Association (OCA)" % year
author = "Odoo Community Association (OCA)"

# The short X.Y version
version = u"3.2"
version = "3.2"
# The full version, including alpha/beta/rc tags
release = version

Expand Down Expand Up @@ -63,7 +63,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [u"_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
Expand Down Expand Up @@ -145,8 +145,8 @@
(
master_doc,
"MISBuilder.tex",
u"MIS Builder Documentation",
u"Odoo Community Association (OCA)",
"MIS Builder Documentation",
"Odoo Community Association (OCA)",
"manual",
)
]
Expand All @@ -156,7 +156,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "misbuilder", u"MIS Builder Documentation", [author], 1)]
man_pages = [(master_doc, "misbuilder", "MIS Builder Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -168,7 +168,7 @@
(
master_doc,
"MISBuilder",
u"MIS Builder Documentation",
"MIS Builder Documentation",
author,
"MISBuilder",
"One line description of project.",
Expand Down
10 changes: 5 additions & 5 deletions mis_builder/models/kpimatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ def set_values_detail_account(
self.lang, row.style_props, kpi.type, val
)
if row.kpi.multi and subcol.subkpi:
val_comment = u"{}.{} = {}".format(
val_comment = "{}.{} = {}".format(
row.kpi.name,
subcol.subkpi.name,
row.kpi._get_expression_str_for_subkpi(subcol.subkpi),
)
else:
val_comment = u"{} = {}".format(row.kpi.name, row.kpi.expression)
val_comment = "{} = {}".format(row.kpi.name, row.kpi.expression)
cell_style_props = row.style_props
if row.kpi.style_expression:
# evaluate style expression
Expand Down Expand Up @@ -313,7 +313,7 @@ def compute_comparisons(self):
)
)
if not label:
label = u"{} vs {}".format(col.label, base_col.label)
label = "{} vs {}".format(col.label, base_col.label)
comparison_col = KpiMatrixCol(
cmpcol_key,
label,
Expand Down Expand Up @@ -470,9 +470,9 @@ def _load_account_names(self):
self._account_names = {a.id: self._get_account_name(a) for a in accounts}

def _get_account_name(self, account):
result = u"{} {}".format(account.code, account.name)
result = "{} {}".format(account.code, account.name)
if self._multi_company:
result = u"{} [{}]".format(result, account.company_id.name)
result = "{} [{}]".format(result, account.company_id.name)
return result

def get_account_name(self, account_id):
Expand Down
2 changes: 1 addition & 1 deletion mis_builder/models/mis_kpi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _compute_name(self):
subkpi_name = "." + subkpi_name
else:
subkpi_name = ""
rec.name = u"{}{}: {} - {}".format(
rec.name = "{}{}: {} - {}".format(
rec.kpi_expression_id.kpi_id.name,
subkpi_name,
rec.date_from,
Expand Down
6 changes: 3 additions & 3 deletions mis_builder/models/mis_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class MisReportKpi(models.Model):
def name_get(self):
res = []
for rec in self:
name = u"{} ({})".format(rec.description, rec.name)
name = "{} ({})".format(rec.description, rec.name)
res.append((rec.id, name))
return res

Expand All @@ -171,7 +171,7 @@ def _compute_expression(self):
for expression in kpi.expression_ids:
if expression.subkpi_id:
exprs.append(
u"{}\xa0=\xa0{}".format(
"{}\xa0=\xa0{}".format(
expression.subkpi_id.name, expression.name
)
)
Expand Down Expand Up @@ -308,7 +308,7 @@ def name_get(self):
kpi = rec.kpi_id
subkpi = rec.subkpi_id
if subkpi:
name = u"{} / {} ({}.{})".format(
name = "{} / {} ({}.{})".format(
kpi.description, subkpi.description, kpi.name, subkpi.name
)
else:
Expand Down
26 changes: 13 additions & 13 deletions mis_builder/models/mis_report_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ def render_num(
):
# format number following user language
if value is None or value is AccountingNone:
return u""
return ""
value = round(value / float(divider or 1), dp or 0) or 0
r = lang.format("%%%s.%df" % (sign, dp or 0), value, grouping=True)
r = r.replace("-", u"\N{NON-BREAKING HYPHEN}")
r = r.replace("-", "\N{NON-BREAKING HYPHEN}")
if prefix:
r = prefix + u"\N{NO-BREAK SPACE}" + r
r = prefix + "\N{NO-BREAK SPACE}" + r
if suffix:
r = r + u"\N{NO-BREAK SPACE}" + suffix
r = r + "\N{NO-BREAK SPACE}" + suffix
return r

@api.model
Expand All @@ -194,7 +194,7 @@ def render_pct(self, lang, value, dp=1, sign="-"):
@api.model
def render_str(self, lang, value):
if value is None or value is AccountingNone:
return u""
return ""
return unicode(value)

@api.model
Expand Down Expand Up @@ -275,20 +275,20 @@ def to_xlsx_style(self, type, props, no_indent=False):
("bg_color", props.background_color),
]
if type == TYPE_NUM:
num_format = u"#,##0"
num_format = "#,##0"
if props.dp:
num_format += u"."
num_format += u"0" * props.dp
num_format += "."
num_format += "0" * props.dp
if props.prefix:
num_format = u'"{} "{}'.format(props.prefix, num_format)
num_format = '"{} "{}'.format(props.prefix, num_format)
if props.suffix:
num_format = u'{}" {}"'.format(num_format, props.suffix)
num_format = '{}" {}"'.format(num_format, props.suffix)
xlsx_attributes.append(("num_format", num_format))
elif type == TYPE_PCT:
num_format = u"0"
num_format = "0"
if props.dp:
num_format += u"."
num_format += u"0" * props.dp
num_format += "."
num_format += "0" * props.dp
num_format += "%"
xlsx_attributes.append(("num_format", num_format))
if props.indent_level is not None and not no_indent:
Expand Down
4 changes: 2 additions & 2 deletions mis_builder/report/mis_report_instance_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def generate_xlsx_report(self, workbook, data, objects):
style_obj = self.env["mis.report.style"]

# create worksheet
report_name = u"{} - {}".format(
objects[0].name, u", ".join([a.name for a in objects[0].query_company_ids])
report_name = "{} - {}".format(
objects[0].name, ", ".join([a.name for a in objects[0].query_company_ids])
)
sheet = workbook.add_worksheet(report_name[:31])
row_pos = 0
Expand Down
Loading

0 comments on commit 8c836f4

Please sign in to comment.