Skip to content
Snippets Groups Projects
Commit 56863a32554d authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

QoL updates according to module template

parent 8418ced6ef59
No related branches found
No related tags found
1 merge request!35QoL updates according to module template
Pipeline #62466 passed
# Configuration for known file extensions
[*.{css,htm,html,js,json,jsx,less,markdown,md,py,rst,sass,scss,toml,xml,yaml,yml}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{json,yml,yaml,rst,markdown,md,toml}]
indent_size = 2
# Do not configure editor for libs
[{*/static/{lib,src/lib}/**}]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = false
trim_trailing_whitespace = false
[flake8]
per-file-ignores=
__init__.py:F401
__manifest__.py:B018
include: include:
- project: xcg/ci-templates - project: xcg/ci-templates
file: /odoo/11.0/gitlab-ci.yaml file: /odoo/11.0/gitlab-ci.yaml
syntax: glob syntax: glob
**/*.pyc
*.pyc
*.pyo
*.swp
.tmp*
*~
.~*
*.egg-info
dist/*
build/*
lib/*
output/*
*.orig
*.log
.settings/*
storage/*
.project
.idea
.pydevproject
*.db
.ropeproject/*
.mob
./doc/_build ./doc/_build
./doc/autotodo ./doc/autotodo
...@@ -24,5 +2,2 @@ ...@@ -24,5 +2,2 @@
./doc/_build ./doc/_build
./doc/autotodo ./doc/autotodo
./doc/manifest
pyproject.toml
.isort.cfg
# Defaults for all prettier-supported languages.
# Prettier will complete this with settings from .editorconfig file.
bracketSpacing: false
printWidth: 88
proseWrap: always
semi: true
trailingComma: "es5"
xmlWhitespaceSensitivity: "ignore"
rules:
document-start: disable
indentation:
indent-sequences: true
=========
Changelog
=========
11.0.1.2 11.0.1.2
-------- --------
......
.. _README:
Accounting Periods Accounting Periods
================== ==================
......
# flake8: noqa
from . import models, wizards from . import models, wizards
############################################################################## ##############################################################################
# #
# Accounting Periods, for Odoo # Accounting Periods, for Odoo
# Copyright (C) 2018, 2020 XCG Consulting <http://odoo.consulting> # Copyright (C) 2018, 2020 XCG Consulting <https://xcg-consulting.fr>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"version": "11.0.1.2", "version": "11.0.1.2",
"category": "Accounting", "category": "Accounting",
"author": "XCG Consulting", "author": "XCG Consulting",
"website": "http://odoo.consulting/", "website": "https://orbeet.io/",
"depends": ["account"], "depends": ["account"],
"data": [ "data": [
"security/ir.model.access.csv", "security/ir.model.access.csv",
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
<odoo> <odoo>
<!-- Load default fiscal years and periods when building a demo database. This <!-- Load default fiscal years and periods when building a demo database. This
matters when running automated tests. --> matters when running automated tests. -->
...@@ -27,8 +26,10 @@ ...@@ -27,8 +26,10 @@
<field name="fiscalyear_id" ref="data_fiscalyear" /> <field name="fiscalyear_id" ref="data_fiscalyear" />
<field name="date_start" eval="time.strftime('%Y')+'-02-01'" /> <field name="date_start" eval="time.strftime('%Y')+'-02-01'" />
<!-- Last day of February: 1 day before March 1st. --> <!-- Last day of February: 1 day before March 1st. -->
<field name="date_stop" <field
eval="(DateTime.today().replace(month=3, day=1) - timedelta(days=1)).strftime('%Y-%m-%d')" /> name="date_stop"
eval="(DateTime.today().replace(month=3, day=1) - timedelta(days=1)).strftime('%Y-%m-%d')"
/>
<field name="company_id" ref="base.main_company" /> <field name="company_id" ref="base.main_company" />
</record> </record>
<record id="period_3" model="account.period"> <record id="period_3" model="account.period">
...@@ -111,5 +112,4 @@ ...@@ -111,5 +112,4 @@
<field name="date_stop" eval="time.strftime('%Y')+'-12-31'" /> <field name="date_stop" eval="time.strftime('%Y')+'-12-31'" />
<field name="company_id" ref="base.main_company" /> <field name="company_id" ref="base.main_company" />
</record> </record>
</odoo> </odoo>
# Makefile for Sphinx documentation # Minimal makefile for Sphinx documentation
# #
...@@ -2,13 +2,16 @@ ...@@ -2,13 +2,16 @@
# #
# You can set these variables from the command line. # You can set these variables from the command line, and also
SPHINXOPTS = # from the environment for the first two.
SPHINXBUILD = sphinx-build SPHINXOPTS ?=
PAPER = SPHINXBUILD ?= sphinx-build
BUILDDIR = _build SOURCEDIR = .
BUILDDIR = _build
LANGUAGE ?= en
BUILDDIRSUFFIX =
# User-friendly check for sphinx-build # User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif endif
...@@ -9,9 +12,8 @@ ...@@ -9,9 +12,8 @@
# User-friendly check for sphinx-build # User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif endif
project:=$(shell basename $(shell readlink -f ..)) .PHONY: help Makefile gettext clean
branch:=$(shell hg identify --branch)
...@@ -17,10 +19,3 @@ ...@@ -17,10 +19,3 @@
# Internal variables. # Put it first so that "make" without argument is like "make help".
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help: help:
...@@ -26,27 +21,3 @@ ...@@ -26,27 +21,3 @@
help: help:
@echo "Please use \`make <target>' where <target> is one of" @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)/$(LANGUAGE)$(BUILDDIRSUFFIX)" $(SPHINXOPTS) $(O)
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
...@@ -52,4 +23,3 @@ ...@@ -52,4 +23,3 @@
.PHONY: clean
clean: clean:
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
...@@ -54,69 +24,4 @@ ...@@ -54,69 +24,4 @@
clean: clean:
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
rm -f autotodo manifest rm -f autotodo
.PHONY: html
html: manifest autotodo
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml: manifest autotodo
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml: manifest autotodo
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp: manifest autotodo
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
...@@ -122,74 +27,5 @@ ...@@ -122,74 +27,5 @@
.PHONY: text # depends on autotodo.py but that does not work well with the catch-all below
text: autotodo:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
autotodo: autotodo.py
@./autotodo.py ../ .py TODO,FIXME,XXX @./autotodo.py ../ .py TODO,FIXME,XXX
...@@ -194,5 +30,5 @@ ...@@ -194,5 +30,5 @@
@./autotodo.py ../ .py TODO,FIXME,XXX @./autotodo.py ../ .py TODO,FIXME,XXX
manifest: ../__manifest__.py manifest.py gettext: Makefile
@./manifest.py @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)$(BUILDDIRSUFFIX)" $(SPHINXOPTS) $(O)
...@@ -198,1 +34,9 @@ ...@@ -198,1 +34,9 @@
# Use to update *.po files
update_locale: Makefile gettext
@sphinx-intl update -p "$(BUILDDIR)$(BUILDDIRSUFFIX)/gettext" -l $(LANGUAGE)
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile autotodo
@$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)/$@/$(LANGUAGE)$(BUILDDIRSUFFIX)" -d "$(BUILDDIR)$(BUILDDIRSUFFIX)/doctrees/$(LANGUAGE)" $(SPHINXOPTS) -D language=$(LANGUAGE) $(O)
account\_period.models package
==============================
Submodules
----------
account\_period.models.account\_fiscalyear module
-------------------------------------------------
.. automodule:: odoo.addons.account_period.models.account_fiscalyear
:members:
:undoc-members:
:show-inheritance:
account\_period.models.account\_move module
-------------------------------------------
.. automodule:: odoo.addons.account_period.models.account_move
:members:
:undoc-members:
:show-inheritance:
account\_period.models.account\_move\_line module
-------------------------------------------------
.. automodule:: odoo.addons.account_period.models.account_move_line
:members:
:undoc-members:
:show-inheritance:
account\_period.models.account\_period module
---------------------------------------------
.. automodule:: odoo.addons.account_period.models.odoo.addons.account_period
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: odoo.addons.account_period.models
:members:
:undoc-members:
:show-inheritance:
account\_period package
=======================
Subpackages
-----------
.. toctree::
account_period.models
account_period.tests
account_period.wizards
Module contents
---------------
.. automodule:: account_period
:members:
:undoc-members:
:show-inheritance:
account\_period.tests package
=============================
Subpackages
-----------
.. toctree::
account_period.tests.util
Submodules
----------
account\_period.tests.test\_account\_fiscalyear module
------------------------------------------------------
.. automodule:: odoo.addons.account_period.tests.test_account_fiscalyear
:members:
:undoc-members:
:show-inheritance:
account\_period.tests.test\_account\_period module
--------------------------------------------------
.. automodule:: odoo.addons.account_period.tests.test_account_period
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: odoo.addons.account_period.tests
:members:
:undoc-members:
:show-inheritance:
account\_period.tests.util package
==================================
Submodules
----------
account\_period.tests.util.odoo\_tests module
---------------------------------------------
.. automodule:: odoo.addons.account_period.tests.util.odoo_tests
:members:
:undoc-members:
:show-inheritance:
account\_period.tests.util.singleton module
-------------------------------------------
.. automodule:: odoo.addons.account_period.tests.util.singleton
:members:
:undoc-members:
:show-inheritance:
account\_period.tests.util.uuidgen module
-----------------------------------------
.. automodule:: odoo.addons.account_period.tests.util.uuidgen
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: odoo.addons.account_period.tests.util
:members:
:undoc-members:
:show-inheritance:
account\_period.wizards package
===============================
Submodules
----------
account\_period.wizards.account\_period\_close module
-----------------------------------------------------
.. automodule:: odoo.addons.account_period.wizards.account_period_close
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: odoo.addons.account_period.wizards
:members:
:undoc-members:
:show-inheritance:
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2014, 2018 XCG Consulting # Copyright (C) 2014, 2018, 2022 XCG Consulting
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
tags = sys.argv[3].split(",") tags = sys.argv[3].split(",")
todolist = {tag: [] for tag in tags} todolist = {tag: [] for tag in tags}
for root, dirs, files in os.walk(folder): for root, _dirs, files in os.walk(folder):
scan_folder((exts, tags, todolist), root, files) scan_folder((exts, tags, todolist), root, files)
create_autotodo(folder, todolist) create_autotodo(folder, todolist)
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
def create_autotodo(folder, todolist): def create_autotodo(folder, todolist):
with open("autotodo", "w+") as f: with open("autotodo", "w+") as f:
for tag, info in todolist.items(): for tag, info in list(todolist.items()):
f.write("%s\n%s\n\n" % (tag, "=" * len(tag))) f.write("%s\n%s\n\n" % (tag, "=" * len(tag)))
write_info(f, info, folder) write_info(f, info, folder)
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
(root, ext) = os.path.splitext(name) (root, ext) = os.path.splitext(name)
if ext in exts: if ext in exts:
file_info = scan_file(os.path.join(dirname, name), tags) file_info = scan_file(os.path.join(dirname, name), tags)
for tag, info in file_info.items(): for tag, info in list(file_info.items()):
if info: if info:
res[tag].extend(info) res[tag].extend(info)
......
# Accounting periods documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 30 16:15:00 2018.
#
# This file is execfile()d with the current directory set to its # This file is execfile()d with the current directory set to its
# containing dir. # containing dir.
# #
...@@ -17,6 +14,8 @@ ...@@ -17,6 +14,8 @@
import odoo import odoo
from odoo_scripts.config import Configuration
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
...@@ -24,9 +23,6 @@ ...@@ -24,9 +23,6 @@
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
...@@ -36,8 +32,7 @@ ...@@ -36,8 +32,7 @@
"sphinx.ext.intersphinx", "sphinx.ext.intersphinx",
"sphinx.ext.todo", "sphinx.ext.todo",
"sphinx.ext.coverage", "sphinx.ext.coverage",
"sphinx.ext.ifconfig", "sphinx.ext.graphviz",
"sphinx.ext.viewcode",
"sphinxodoo.ext.autodoc", "sphinxodoo.ext.autodoc",
] ]
...@@ -46,6 +41,5 @@ ...@@ -46,6 +41,5 @@
# The suffix(es) of source filenames. # The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = ".rst" source_suffix = ".rst"
...@@ -50,8 +44,5 @@ ...@@ -50,8 +44,5 @@
source_suffix = ".rst" source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = "index" master_doc = "index"
...@@ -69,7 +60,7 @@ ...@@ -69,7 +60,7 @@
# General information about the project. # General information about the project.
project = d["name"] project = d["name"]
copyright = "2018, XCG Consulting" copyright = "2023 XCG Consulting"
author = d["author"] author = d["author"]
module_nospace = project.replace(" ", "") module_nospace = project.replace(" ", "")
module_description = d.get("summary", "") module_description = d.get("summary", "")
...@@ -82,13 +73,9 @@ ...@@ -82,13 +73,9 @@
# Usually you set "language" from the command line for these cases. # Usually you set "language" from the command line for these cases.
language = None language = None
# There are two options for replacing |today|: either, you set today to some locale_dirs = ["locale"]
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = ["_build"] exclude_patterns = ["_build"]
...@@ -90,23 +77,8 @@ ...@@ -90,23 +77,8 @@
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = ["_build"] exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx" pygments_style = "sphinx"
...@@ -110,12 +82,6 @@ ...@@ -110,12 +82,6 @@
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx" pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True todo_include_todos = True
...@@ -126,32 +92,8 @@ ...@@ -126,32 +92,8 @@
# a list of builtin themes. # a list of builtin themes.
html_theme = "default" html_theme = "default"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or
# 32x32 pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"] html_static_path = ["_static"]
...@@ -153,70 +95,10 @@ ...@@ -153,70 +95,10 @@
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"] html_static_path = ["_static"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
# html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
# html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = "%sdoc" % module_nospace htmlhelp_basename = "%sdoc" % module_nospace
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
...@@ -218,18 +100,9 @@ ...@@ -218,18 +100,9 @@
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = "%sdoc" % module_nospace htmlhelp_basename = "%sdoc" % module_nospace
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
latex_elements = { latex_elements = {}
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, # (source start file, target name, title,
...@@ -244,27 +117,6 @@ ...@@ -244,27 +117,6 @@
) )
] ]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------- # -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
...@@ -273,10 +125,6 @@ ...@@ -273,10 +125,6 @@
(master_doc, module_lowercase, "%s Documentation" % project, [author], 1) (master_doc, module_lowercase, "%s Documentation" % project, [author], 1)
] ]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output ------------------------------------------- # -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples # Grouping the document tree into Texinfo files. List of tuples
...@@ -285,6 +133,6 @@ ...@@ -285,6 +133,6 @@
texinfo_documents = [ texinfo_documents = [
( (
master_doc, master_doc,
"AccountingPeriods", module_nospace,
u"Accounting periods documentation", "%s Documentation" % project,
author, author,
...@@ -290,9 +138,7 @@ ...@@ -290,9 +138,7 @@
author, author,
"AccountingPeriods", module_nospace,
""" module_description,
Accounting periods
""",
"Miscellaneous", "Miscellaneous",
) )
] ]
...@@ -295,19 +141,7 @@ ...@@ -295,19 +141,7 @@
"Miscellaneous", "Miscellaneous",
) )
] ]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/3/": None} intersphinx_mapping = {"https://docs.python.org/3/": None}
...@@ -335,7 +169,10 @@ ...@@ -335,7 +169,10 @@
if os.path.isfile(setup_path): if os.path.isfile(setup_path):
c = configparser.ConfigParser() c = configparser.ConfigParser()
c.read(setup_path) c.read(setup_path)
if not c.has_section("odoo_scripts"): if c.has_section("odoo_scripts"):
# reload with odoo_scripts
c = Configuration(setup_path)
else:
c = None c = None
if not c: if not c:
if os.path.dirname(directory) != directory: if os.path.dirname(directory) != directory:
...@@ -343,6 +180,6 @@ ...@@ -343,6 +180,6 @@
else: else:
directory = None directory = None
sphinxodoo_addons_path = list() sphinxodoo_addons_path = []
if c: if c:
...@@ -347,9 +184,6 @@ ...@@ -347,9 +184,6 @@
if c: if c:
addon_dirs = set( addon_dirs = set(os.path.dirname(path) for path in c.modules)
os.path.dirname(path)
for path in c.get("odoo_scripts", "modules").split()
)
for line in addon_dirs: for line in addon_dirs:
sphinxodoo_addons_path.append(os.path.join(directory, line)) sphinxodoo_addons_path.append(os.path.join(directory, line))
...@@ -353,3 +187,12 @@ ...@@ -353,3 +187,12 @@
for line in addon_dirs: for line in addon_dirs:
sphinxodoo_addons_path.append(os.path.join(directory, line)) sphinxodoo_addons_path.append(os.path.join(directory, line))
else:
# add this directory top dir
sphinxodoo_addons_path.append(
os.path.dirname(os.path.dirname(os.getenv("PWD")))
)
other_addons = os.getenv("ODOO_ADDONS_PATH", default=None)
if other_addons:
for addon_path in other_addons.split(","):
sphinxodoo_addons_path.append(addon_path)
.. include:: manifest .. include:: README.rst
Contents: Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
Contents: Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
README
modules modules
NEWS NEWS
TODO TODO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment