odoo14-addon-base-time-parameter


Nameodoo14-addon-base-time-parameter JSON
Version 14.0.3.1.1 PyPI version JSON
download
home_pagehttps://github.com/OCA/server-tools
SummaryTime dependent parameters Adds the feature to define parameters with time based versions.
upload_time2023-07-11 18:41:19
maintainer
docs_urlNone
authorNimarosa, appstogrow, Odoo Community Association (OCA)
requires_python>=3.6
licenseLGPL-3
keywords
VCS
bugtrack_url
requirements astor cryptography dataclasses mako odoo_test_helper odoorpc openpyxl openupgradelib pygount pysftp sentry_sdk unidecode
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============
Time Parameter
==============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
    :target: https://github.com/OCA/server-tools/tree/14.0/base_time_parameter
    :alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_time_parameter
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
    :target: https://runbot.odoo-community.org/runbot/149/14.0
    :alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5| 

A value may change over time.
With this module you may set starting dates and values.

**Table of contents**

.. contents::
   :local:

Configuration
=============

The user needs the access right "Manage Time Parameters".

Usage
=====

Menu: "Settings/Technical/Time Parameters"

Create a parameter with different versions (start date and value).

If model_id is empty, any model/record may get the time parameter.

The value may be a text or reference.

Get the value like this:

.. code-block:: python

    # Pass no date: using today's date
    value = model.get_time_parameter("parameter_code_or_name")
    # Pass a date or datetime
    value = model.get_time_parameter("parameter_code_or_name", date=datetime.datetime.now()))
    # Pass the name of a date/datetime field of the record
    value = record.get_time_parameter("parameter_code_or_name", "date")

Example of implementation in another module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Payroll implementation:

* Menu "Payroll/Configuration/Time Parameters" only shows hr.payslip parameters.
* New parameters will be hr.payslip parameters.
* By default, the model_id field is hidden in the form.

.. code-block:: XML

    <record id="base_time_parameter_action" model="ir.actions.act_window">
        <field name="name">Time Parameters</field>
        <field name="res_model">base.time.parameter</field>
        <field name="view_mode">tree,form</field>
        <field
            name="domain"
            eval="[('model_id', '=', ref('payroll.model_hr_payslip'))]"
        />
        <field
            name="context"
            eval="{'default_model_id': ref('payroll.model_hr_payslip')}"
        />
    </record>
    <menuitem
        id="menu_action_base_time_parameter"
        action="base_time_parameter_action"
        name="Time Parameters"
        parent="payroll_menu_configuration"
        sequence="35"
    />

Reference field implementatiton:

.. code-block:: python

    from odoo import fields, models


    class TimeParameterVersion(models.Model):
        _inherit = "base.time.parameter.version"

        value_reference = fields.Reference(
            selection_add=[("account.account", "Account")],
        )

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_time_parameter%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Nimarosa
* appstogrow

Contributors
~~~~~~~~~~~~

* Nimarosa (Nicolas Rodriguez) <nicolasrsande@gmail.com>
* appstogrow (Henrik Norlin) <henrik@appstogrow.co>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-appstogrow| image:: https://github.com/appstogrow.png?size=40px
    :target: https://github.com/appstogrow
    :alt: appstogrow
.. |maintainer-nimarosa| image:: https://github.com/nimarosa.png?size=40px
    :target: https://github.com/nimarosa
    :alt: nimarosa

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-appstogrow| |maintainer-nimarosa| 

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_time_parameter>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCA/server-tools",
    "name": "odoo14-addon-base-time-parameter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nimarosa, appstogrow, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": "",
    "platform": null,
    "description": "==============\nTime Parameter\n==============\n\n.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html\n    :alt: License: LGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github\n    :target: https://github.com/OCA/server-tools/tree/14.0/base_time_parameter\n    :alt: OCA/server-tools\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n    :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_time_parameter\n    :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png\n    :target: https://runbot.odoo-community.org/runbot/149/14.0\n    :alt: Try me on Runbot\n\n|badge1| |badge2| |badge3| |badge4| |badge5| \n\nA value may change over time.\nWith this module you may set starting dates and values.\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nConfiguration\n=============\n\nThe user needs the access right \"Manage Time Parameters\".\n\nUsage\n=====\n\nMenu: \"Settings/Technical/Time Parameters\"\n\nCreate a parameter with different versions (start date and value).\n\nIf model_id is empty, any model/record may get the time parameter.\n\nThe value may be a text or reference.\n\nGet the value like this:\n\n.. code-block:: python\n\n    # Pass no date: using today's date\n    value = model.get_time_parameter(\"parameter_code_or_name\")\n    # Pass a date or datetime\n    value = model.get_time_parameter(\"parameter_code_or_name\", date=datetime.datetime.now()))\n    # Pass the name of a date/datetime field of the record\n    value = record.get_time_parameter(\"parameter_code_or_name\", \"date\")\n\nExample of implementation in another module\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPayroll implementation:\n\n* Menu \"Payroll/Configuration/Time Parameters\" only shows hr.payslip parameters.\n* New parameters will be hr.payslip parameters.\n* By default, the model_id field is hidden in the form.\n\n.. code-block:: XML\n\n    <record id=\"base_time_parameter_action\" model=\"ir.actions.act_window\">\n        <field name=\"name\">Time Parameters</field>\n        <field name=\"res_model\">base.time.parameter</field>\n        <field name=\"view_mode\">tree,form</field>\n        <field\n            name=\"domain\"\n            eval=\"[('model_id', '=', ref('payroll.model_hr_payslip'))]\"\n        />\n        <field\n            name=\"context\"\n            eval=\"{'default_model_id': ref('payroll.model_hr_payslip')}\"\n        />\n    </record>\n    <menuitem\n        id=\"menu_action_base_time_parameter\"\n        action=\"base_time_parameter_action\"\n        name=\"Time Parameters\"\n        parent=\"payroll_menu_configuration\"\n        sequence=\"35\"\n    />\n\nReference field implementatiton:\n\n.. code-block:: python\n\n    from odoo import fields, models\n\n\n    class TimeParameterVersion(models.Model):\n        _inherit = \"base.time.parameter.version\"\n\n        value_reference = fields.Reference(\n            selection_add=[(\"account.account\", \"Account\")],\n        )\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us smashing it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_time_parameter%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* Nimarosa\n* appstogrow\n\nContributors\n~~~~~~~~~~~~\n\n* Nimarosa (Nicolas Rodriguez) <nicolasrsande@gmail.com>\n* appstogrow (Henrik Norlin) <henrik@appstogrow.co>\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\n.. |maintainer-appstogrow| image:: https://github.com/appstogrow.png?size=40px\n    :target: https://github.com/appstogrow\n    :alt: appstogrow\n.. |maintainer-nimarosa| image:: https://github.com/nimarosa.png?size=40px\n    :target: https://github.com/nimarosa\n    :alt: nimarosa\n\nCurrent `maintainers <https://odoo-community.org/page/maintainer-role>`__:\n\n|maintainer-appstogrow| |maintainer-nimarosa| \n\nThis module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_time_parameter>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n\n\n",
    "bugtrack_url": null,
    "license": "LGPL-3",
    "summary": "Time dependent parameters Adds the feature to define parameters with time based versions.",
    "version": "14.0.3.1.1",
    "project_urls": {
        "Homepage": "https://github.com/OCA/server-tools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4edb6290e2e0092d1b9b66e86f2cad5723a3d8d354f9b99c379b833f56334da6",
                "md5": "f0400dccedbc0a58cc5e32f534ce22f8",
                "sha256": "db4354f51900d600974195236b32eba1d5142904e3d73bde366faa2356935ab7"
            },
            "downloads": -1,
            "filename": "odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f0400dccedbc0a58cc5e32f534ce22f8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 46186,
            "upload_time": "2023-07-11T18:41:19",
            "upload_time_iso_8601": "2023-07-11T18:41:19.421895Z",
            "url": "https://files.pythonhosted.org/packages/4e/db/6290e2e0092d1b9b66e86f2cad5723a3d8d354f9b99c379b833f56334da6/odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-11 18:41:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCA",
    "github_project": "server-tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "astor",
            "specs": []
        },
        {
            "name": "cryptography",
            "specs": []
        },
        {
            "name": "dataclasses",
            "specs": []
        },
        {
            "name": "mako",
            "specs": []
        },
        {
            "name": "odoo_test_helper",
            "specs": []
        },
        {
            "name": "odoorpc",
            "specs": []
        },
        {
            "name": "openpyxl",
            "specs": []
        },
        {
            "name": "openupgradelib",
            "specs": []
        },
        {
            "name": "pygount",
            "specs": []
        },
        {
            "name": "pysftp",
            "specs": []
        },
        {
            "name": "sentry_sdk",
            "specs": [
                [
                    "<=",
                    "1.9.0"
                ]
            ]
        },
        {
            "name": "unidecode",
            "specs": []
        }
    ],
    "lcname": "odoo14-addon-base-time-parameter"
}
        
Elapsed time: 0.47237s