Commit Graph
59 Commits
Author SHA1 Message Date
David Monjoie 7cb64b5e93 [REF] doc: promisify doc examples
Also remove a file on async stuff as its content is outdated, and
actually not used.
2019-03-06 20:07:17 +01:00
Xavier Morel cca26f7952 [FIX] doc: workarounds for weirdo code & refs
Make UnknownNS more capable (of giving no fucks) so the documentation
builder blows up less on weird-ass code at module toplevels.

UnknownNS should probably be split out from NSDoc though, that requires
odd workarounds in `__getitem__`.
2019-02-18 08:55:57 +00:00
Xavier Morel fe0a27d240 [FIX] doc: P2 bits forgotten in 758382b3a7
closes odoo/odoo#29438
2018-12-12 10:36:37 +00:00
Adrian Torres 758382b3a7 [REM] pycompat: remove python 2 shims and helpers
Odoo no longer supports python 2, thus some of these helpers can and
have been replaced by python 3 built-ins, therefore there is no need for
them to stay defined.

The removed helpers are:
    * izip, imap and ifilter
    * unichr, text_type
    * implements_to_string, implements_iterator
    * string_types, integer_types
    * to_native

The python 2 shims have also been removed, and only the python 3 helpers
have been kept, because they can still be usable (i.e. accepting
both bytes and str for functions that can only accept one of the two)

[REM] pyjsparser: remove PY3 shims

They're no longer necessary as Odoo doesn't officially support python 2
anymore.

closes odoo/odoo#28519
2018-11-29 09:28:17 +00:00
Adrian Torres 52f5528cfb [REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for
python 2 <-> python 3 interoperability for python 3 builtins, as python
2 is no longer officially supported by Odoo.

This includes:
    * calls to imap/izip/ifilter replaced by map/zip/filter
    * uses of text_type replaced by str
    * uses of unichr replaced by chr
    * calls to implements_to_string, implements_iterator removed
    * string_types and integer_types replaced by str, int respectively
    * calls to to_native replaced by calls to to_text

This is done in preparation to the removal of these deprecated helpers
in the following commit.
2018-11-29 09:28:17 +00:00
Christophe Simonis 5e055a2afd [MERGE] forward port branch saas-11.4 up to f6ca72b3ce 2018-11-02 10:52:55 +01:00
Christophe Simonis ee0ff262f0 [MERGE] forward port branch saas-15 up to 953dfe92c2
closes odoo/odoo#28255
2018-10-29 14:16:45 +00:00
xmo-odoo 71cb425d00 [FIX] doc: translator under Sphinx 1.5
In Sphinx 1.5 (fairly specifically), the warner thing takes a `type` kw,
and building the doc blows up if that parameter is not provided.
2018-10-25 11:08:35 +02:00
Martin Trigaux a0050c323c [FIX] doc: backport of ac37ca39ea to 10.0
To be compatible with sphinx >= 1.8
2018-10-23 16:17:58 +02:00
Martin Trigaux 27cc2ae3a9 [FIX] doc: backport of 9a07a4599c to 10.0
To be compatible with sphinx >= 1.6
2018-10-23 16:17:58 +02:00
Xavier Morel 35bb8304ab [FIX] doc: building on Python 3.6.7, 3.7.1, possibly 2.7.???
https://bugs.python.org/issue33899

tokenize.generate_tokens was altered to match the C tokenizer,
previously it would end the tokenization with just an ENDMARKER, in the
titled releases it adds a NEWLINE before the ENDMARKER if none is
present, this broke the parsing of jsdoc type specifications as Python's
tokenizer is used under the cover.

closes odoo/odoo#28056
2018-10-23 10:39:22 +00:00
mreficent dddd4072de [FIX] v12 urls
Was still pointing to old links

closes odoo/odoo#27443
2018-10-09 13:44:38 +00:00
Xavier Morel 00eefae98d [FIX] doc: implement delegation/inheritance in JS documenter
Else website_sale_wishlist.wishlist blows up the documenter:
``events`` is set to sAnimations.Class.events but that is not an "own
property" of sAnimation.Class, it is instead inherited from Widget.

If delegation is not implemented, the value resolves to <nothing>,
which blows up when trying to set its name to the "property name" (by
calling ``set_name``).
2018-10-01 17:31:41 +02:00
Xavier Morel ac37ca39ea [FIX] doc: github_link compatibility with Sphinx 1.8 2018-09-25 16:28:18 +02:00
Xavier Morel 8eb8495710 [FIX] doc: backport of ac37ca39e
github_link compatibility with Sphinx 1.8

Backport to 11.0
2018-09-28 12:23:41 +02:00
Xavier Morel 0e307f8280 [FIX] doc building and warnings
doc:

* fix incorrect doc comments (documenting params which don't exist)
* correctly quote non-refs
* fix role label syntax (backticks must be escaped)
* add newline to fix warning

JS doc parser:

* fix handling of already-resolved objects
* fix handling of non-string properties (e.g. foo[0] at module toplevel)
* don't blow up if subject of .include call can't be resolved (just ignore)

Others:

* add translator support for ``problematic`` node (apparently used for
  some refs by recent Sphinx)
2018-08-27 12:55:21 +02:00
Xavier Morel a56372a4ca [FIX] various broken JS docstrings
Resulting in sphinx warnings or ill-formatted doc all the way to the
doc not building at all.
2018-07-24 12:06:13 +02:00
Martin Trigaux a87dc3111c [IMP] doc: specify the API examples are in python2
Odoo 11 is python 3 but the xmlrpc interface works with python 2 too.
The example should probably be migrated to use python 3.
In the meantime specify exactly these examples are python 2 to avoid the
confusion.

Fixes #24232
2018-04-17 13:59:50 +02:00
Xavier Morel 4e784adbf7 [FIX] doc: non-module JS autodocumenters
Also when there is both a docstring and directive-level content put
the docstring first. That seems to match what Sphinx's autodoc does
and looks less odd.

Possible future improvement: a parameter to suppress the docstring?
Possibly a way to reorder the non-docstring content (e.g. members
documentation)?
2018-04-05 12:31:27 +02:00
Christophe Simonis 4715d7e35a [MERGE] forward port branch saas-15 up to 0d55241185 2018-03-19 19:29:58 +01:00
Jeremy Kersten 4252cd7053 [FIX] doc: update footer links
Synchronize footer from odoo.com with the documentation.
2018-03-13 15:51:15 +01:00
Jeremy Kersten 7179008ffa [FIX] doc: fix link to our website
Remove wrong slash trailing

Now, in V11, matching of page are done on the exact name.

Previously, the error was transparent because we was using a
dedicated controller that allow trailing slash.
https://github.com/odoo/odoo/blob/11.0/odoo/http.py#L936

https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html

    http://example.com/foo/ (with trailing slash, conventionally a directory)
    http://example.com/foo (without trailing slash, conventionally a file)

    Google treats each URL above separately     (and equally) regardless of
    whether it’s a file or a directory, or it contains a trailing slash or
    it doesn’t contain a trailing slash.

    Different content on / and no-/ URLs okay for Google, often less ideal for users

   Special case for homepage
       Rest assured that for your root URL specifically,
       http://example.com is equivalent to
       http://example.com/ and can’t be redirected even if you’re Chuck Norris.
2018-02-23 10:36:15 +01:00
Xavier Morel f1143b4073 [FIX] doc: tokenization of nested generics in JS docstrings
With more than 1 level of generic type, the "closure" of generic
parameters would get tokenized by python as a single right shift (>>)
rather than two gt (>, >) leading to our own tokenizing pass getting
lost and blowing up.

Fix by explicitly recognizing and splitting (>>) into (>, >). We could
consider writing the entire tokenizer ourselves instead of
post-processing Python's but given the entire post-processing function
is currently shorter than just Pythons' tokenizer's regexes...

Anyway issue found by vsc while trying to write better docstrings.
2018-02-19 13:22:58 +01:00
Xavier Morel f7323dbe23 [FIX] doc: informal sub-params
Revert 6cb12273e2 which reverted
08d48b0fff.

Issue was the support for sub-parameters (aka @param {type} foo.bar)
where the "parent" parameter was not formal (only present in a
function's docstring, but not in the function's parameters list),
subtype creation would fail to find a root parameter to attach the
sub-parameter to.

This has not actually been fixed, but for the specific case where the
formal parameters list is *completely empty* we fall back on a list of
the docstring's parameters, which works well enough for this case.
2018-01-10 12:36:58 +01:00
Miquel Raïch a578531ca3 [FIX] v11 urls
Was still pointing to old links

Closes #21590
2017-12-12 17:19:01 +01:00
stefanorigano c201cf2b77 [IMP] doc: revamp documentation design
A comprehensive theme’s revamp, details:

=== New features ===
- Show titles permalink markers on hover
- “Scrollspy” effect for the sidebar

=== Fixes ===
- Solve an issue causing the sidebar to flicker on scroll
- Hide the sidebar if less then two links

=== Design ===
- Improve typography vertical rhythm and line height
- Visually increase separation between sections
- Review alerts and <dl> design
- Reduce cover’s size
- Reduce overall paddings/margins.

Closes #21304
2017-12-01 10:51:53 +01:00
xmo-odoo b62bb5add2 IAP doc: tutorial (#20317)
* [ADD] doc: iap tutorial

Should be easier to approach than the raw APIDoc. 
contains:
- overview of the flow
- tutorial (coalroller) with guidelines
- technical description of objects/helpers
2017-11-02 19:06:33 +01:00
Xavier Morel e8dc72fd69 [FIX] doc: handle unknown browser globals better
Before this, if a new global was added to JS code (module toplevel,
function bodies are not considered) it would blow up when attempting
to resolve variable refs & uses.

Make the toplevel scope a defaultdict such that if e.g. a "foo" is
looked up in a module but not a local variable of that module it's
assumed to be an UnknownNS object (from which further UnknownNS can be
deref'd).
2017-10-30 16:16:41 +01:00
Martin Trigaux 25ac56eaf6 [FIX] doc: undefined variable toctree 2017-10-13 15:21:16 +02:00
Xavier Morel db0cb1b092 [FIX] doc: various
* fix Sphinx 1.6 compatibility leading to the "tiles" on the home page
  not working anymore: 1.6 replaces BuildEnvironment.reolve_toctree by
  TocTree().resolve(), while the method still exists it's not actually
  called anymore
* rejigger some CSS as the second section went from one big tile to 3
  smaller tiles, and got laid out as a row rather than a second 2x2
  block. Recode the entire mess with flexbox, remove some stuff which
  conflicted with boostrap (this screen should probably be
  de-boostrapped and completely converted to flexbox or grid)
* add building CSS from LESS to the makefile, all Odoo devs should
  have less installed locally (for assets)
2017-10-12 15:11:26 +02:00
Xavier Morel 40ca8557e9 [FIX] building documentation with P3
* fix P3 incompatibilities in doc/_extensions
* vendor pyjsdoc, strip out everything we're not using and make what's
  left P3-compatible (upstream is not P3 compliant)
* drop undeclared dependency on attrs as it turns out not to be much
  used
2017-10-10 13:29:11 +02:00
Antony Lesuisse 6b22476e20 [ADD] iap: In app purchase
IAP allow app publishers to charge for ongoing services. In that context, Odoo
acts mostly as a payment platform between the service user (client) and the service
provider (Odoo App developer).
2017-10-04 20:22:22 +02:00
Xavier Morel 313f69e948 [ADD] doc: JS document extraction system
* Fix a bunch of ill-documented/incomplete/incorrect method docs
* add start of Sphinx extension to extract & integrate jsdoc into
  Sphinx documentation:

  - parse JS files (and don't blow up), uses a fork of pyjsparser as
    the project currently does not parse comments
  - extract cross-module dependency information
  - parse JsDoc comments using pyjsdoc and infer structure from code &
    jsdoc
  - ``ast`` CLI printing a simplified AST of the input files
  - ``dependencies`` creating a dependency graph of either all modules
    in the provided input files or the modules matching the specified
    filters (warning: will not work if missing dependencies),
    generates a .dot file
  - ``extractor`` generating a plain text module documentation (mix of
    rst and markdown styles, not anything formal)
* sphinx extension with an "automodule" directive taking a module name
  and generating the documentation for it
2017-09-18 11:54:36 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Xavier Morel 7dd062f835 [FIX] P3: text model types
* remove references to basestring & unicode (use relevant pycompat
  helpers)
* remove some str calls (either entirely or replaced by relevant
  helper, either text or native)
* use better API to avoid unnecessary conversions
* remove some XML declarations in views
2017-08-20 23:25:54 +02:00
Moisés López 0819d3f116 [FIX] doc: Sphinx 1.2 support in html_domain
9a07a459 added "override=True" to silence a Sphinx warning in about
the address node already existing, however the override=True parameter
was added in Sphinx 1.4 (alongside the warning), so this breaks in
1.2.

Only pass in override=True if we're in 1.4 or later.

Closes #18232
2017-08-10 16:18:29 +02:00
Xavier Morel 9a07a4599c [FIX] doc warnings
* add Sphinx 1.6 compatibility (use app.set_translator when
  available as in that case programmatically setting
  html_translator_class is broken)
* fix a bunch of code block lexers to avoid warnings & get better
  coloration
* add a few options which were referred to without being actually
  defined
* fix some rST formatting
2017-07-03 11:49:03 +02:00
Xavier Morel 01e3514147 [FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.

Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.

A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
2017-05-15 12:26:30 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Martin Trigaux 2257acbeb1 [FIX] doc: v10ification 2016-12-19 14:19:26 +01:00
Martin Trigaux 731fe1c9ab [FIX] doc: avoid conflict on extenstion and odoo folder 2016-10-11 12:09:28 +02:00
Raphael Collet cdd03c3afe [FIX] in all python code, rename openerp to odoo 2016-09-07 14:45:08 +02:00
Denis Vermylen (dve) e9426b03e7 Revert "[IMP] website, doc: replace eCommerce by e-Commerce"
This reverts commit b4d7b7e6dc.
Odoo always uses term eCommerce
2016-09-06 13:55:12 +02:00
Denis Vermylen (dve) b4d7b7e6dc [IMP] website, doc: replace eCommerce by e-Commerce 2016-09-02 17:42:42 +02:00
Stefano Rigano d1663f06e7 [IMP] doc: define a layout for 'category index' pages
These pages were indexed by google but did not have any layout defined.
2016-08-11 16:26:49 +02:00
Martin Trigaux e07fa2601e [FIX] doc: update css file to reflect 8ce16c3 2016-05-26 10:24:28 +02:00
Martin Trigaux 8ce16c3abe [FIX] doc: white h2 title
Cherry-pick from odoo/documentation-user@d193f7c0
2016-05-18 10:54:32 +02:00
Martin Trigaux 036e3cc253 [IMP] doc: uniform design with user documentation
Apply the same changes from functionnal documentation to dev doc:
odoo/documentation-user@4316470
2016-05-17 12:02:12 +02:00
Xavier Morel 92d1ecdefb [IMP] doc: note about XMLRPC + Odoo Online
Also added some styling for guilabel as it was indistinguishable from
regular body text.
2015-10-08 12:03:01 +02:00