From f53b5cb0d0bab26545c3afcdb319258d079e916a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 24 Jul 2024 11:53:54 +0200 Subject: [PATCH] Update documentation of account credit limit --- modules/account_credit_limit/CHANGELOG | 18 +++++++ modules/account_credit_limit/doc/design.rst | 47 +++++++++++++++++++ modules/account_credit_limit/doc/index.rst | 13 ++--- .../account_credit_limit/doc/reference.rst | 12 +++++ modules/account_credit_limit/doc/releases.rst | 7 +++ modules/account_credit_limit/setup.py | 8 +++- 6 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 modules/account_credit_limit/doc/design.rst create mode 100644 modules/account_credit_limit/doc/reference.rst create mode 100644 modules/account_credit_limit/doc/releases.rst diff --git a/modules/account_credit_limit/CHANGELOG b/modules/account_credit_limit/CHANGELOG index 06fcab00f4..8948b6a797 100644 --- a/modules/account_credit_limit/CHANGELOG +++ b/modules/account_credit_limit/CHANGELOG @@ -20,57 +20,75 @@ Version 6.6.0 - 2022-10-31 * Bug fixes (see mercurial logs for details) Version 6.4.0 - 2022-05-02 +-------------------------- * Bug fixes (see mercurial logs for details) * Add support for Python 3.10 * Remove support for Python 3.6 Version 6.2.0 - 2021-11-01 +-------------------------- * Bug fixes (see mercurial logs for details) Version 6.0.0 - 2021-05-03 +-------------------------- * Bug fixes (see mercurial logs for details) Version 5.8.0 - 2020-11-02 +-------------------------- * Bug fixes (see mercurial logs for details) * Remove support for Python 3.5 Version 5.6.0 - 2020-05-04 +-------------------------- * Bug fixes (see mercurial logs for details) Version 5.4.0 - 2019-11-04 +-------------------------- * Bug fixes (see mercurial logs for details) Version 5.2.0 - 2019-05-06 +-------------------------- * Bug fixes (see mercurial logs for details) Version 5.0.0 - 2018-10-01 +-------------------------- * Bug fixes (see mercurial logs for details) * Remove support for Python 2.7 Version 4.8.0 - 2018-04-23 +-------------------------- * Bug fixes (see mercurial logs for details) Version 4.6.0 - 2017-10-30 +-------------------------- * Bug fixes (see mercurial logs for details) Version 4.4.0 - 2017-05-01 +-------------------------- * Bug fixes (see mercurial logs for details) Version 4.2.0 - 2016-11-28 +-------------------------- * Bug fixes (see mercurial logs for details) Version 4.0.0 - 2016-05-02 +-------------------------- * Bug fixes (see mercurial logs for details) * Add Python3 support Version 3.8.0 - 2015-11-02 +-------------------------- * Bug fixes (see mercurial logs for details) Version 3.6.0 - 2015-04-20 +-------------------------- * Bug fixes (see mercurial logs for details) * Add support for PyPy + Version 3.4.0 - 2014-10-20 +-------------------------- * Bug fixes (see mercurial logs for details) Version 3.2.0 - 2014-04-21 +-------------------------- * Initial release diff --git a/modules/account_credit_limit/doc/design.rst b/modules/account_credit_limit/doc/design.rst new file mode 100644 index 0000000000..0364b20336 --- /dev/null +++ b/modules/account_credit_limit/doc/design.rst @@ -0,0 +1,47 @@ +****** +Design +****** + +The *Account Credit Limit Module* extends the following concepts: + +.. _model-account.configuration: + +Account Configuration +===================== + +When the *Account Credit Limit Module* is activated, the *Account +Configuration* receives a new property which is used to store the default +credit limit in the `Company `'s currency. + +.. seealso:: + + The `Account Configuration ` concept is + introduced by the :doc:`Account Module `. + +.. _model-party.party: + +Party +===== + +When the *Account Credit Limit Module* is activated, the *Party* gets a new +property that is used to limit how much credit a party can have. + +.. seealso:: + + The `Party ` concept is introduced by the + :doc:`Party Module `. + +.. _model-account.dunning.level: + +Dunning Level +============= + +When the *Account Credit Limit Module* is activated, the *Dunning Level* can be +flagged to block any additional credit for the `Parties +` who have at least one pending `Dunning +` at that level. + +.. seealso:: + + The `Dunning Level ` concept is + introduced by the :doc:`Account Dunning Module `. diff --git a/modules/account_credit_limit/doc/index.rst b/modules/account_credit_limit/doc/index.rst index 5dc6443b82..d548117757 100644 --- a/modules/account_credit_limit/doc/index.rst +++ b/modules/account_credit_limit/doc/index.rst @@ -1,11 +1,12 @@ +#################### Account Credit Limit #################### -The account_credit_limit module manages credit limit of parties. A "Credit -Limit Amount" is added on Party. The module allows to check for a party: +The *Account Credit Limit Module* manages credit limits for parties. - * If an amount will exceed his limit. - * If a dunning has reached a limit level. +.. toctree:: + :maxdepth: 2 -and then raises an error message or a warning if the user is part of the -"Account Credit Limit" group. + design + reference + releases diff --git a/modules/account_credit_limit/doc/reference.rst b/modules/account_credit_limit/doc/reference.rst new file mode 100644 index 0000000000..c1e7470c29 --- /dev/null +++ b/modules/account_credit_limit/doc/reference.rst @@ -0,0 +1,12 @@ +************* +API Reference +************* + +Party +===== + +.. method:: Party.check_credit_limit(amount[, origin]) + + Raise an error if the amount, when credited to the party, reaches the credit + limit. + If origin is set then a warning is raised instead of an error. diff --git a/modules/account_credit_limit/doc/releases.rst b/modules/account_credit_limit/doc/releases.rst new file mode 100644 index 0000000000..21b13c4745 --- /dev/null +++ b/modules/account_credit_limit/doc/releases.rst @@ -0,0 +1,7 @@ +.. _releases-index: + +============= +Release notes +============= + +.. include:: ../CHANGELOG diff --git a/modules/account_credit_limit/setup.py b/modules/account_credit_limit/setup.py index 2d73bd5419..13e887235d 100755 --- a/modules/account_credit_limit/setup.py +++ b/modules/account_credit_limit/setup.py @@ -11,9 +11,12 @@ from setuptools import find_packages, setup def read(fname): - return io.open( + content = io.open( os.path.join(os.path.dirname(__file__), fname), 'r', encoding='utf-8').read() + content = re.sub( + r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) + return content def get_require_version(name): @@ -59,7 +62,8 @@ setup(name=name, download_url=download_url, project_urls={ "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', + "Documentation": ( + 'https://docs.tryton.org/latest/modules-account-credit-limit'), "Forum": 'https://www.tryton.org/forum', "Source Code": 'https://code.tryton.org/tryton', },