Metadata-Version: 2.1
Name: odoo14-addon-base-time-parameter
Version: 14.0.2.0.0
Summary: Time dependent parameters Adds the feature to define parameters with time based versions.
Home-page: https://github.com/OCA/server-tools
Author: Nimarosa, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
License: AGPL-3
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 14.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 3 - Alpha
Requires-Python: >=3.6
Requires-Dist: odoo (<14.1dev,>=14.0a)

==============
Time Parameter
==============

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
    :target: https://odoo-community.org/page/development-status
    :alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-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| 

This module adds support for time dependent parameters.
It doesn't provide any additional functionality when installed alone. You should use it in the developing of other modules which might favor of the functionality provided.
It allows you to get time dependent parameters from any model in Odoo.
The functionality is useful for cases when you have static parameters values which changes depending of the date of the record or todays date.

TODO:  Write tests.

.. IMPORTANT::
   This is an alpha version, the data model and design can change at any time without warning.
   Only for development or testing purpose, do not use in production.
   `More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
   :local:

Usage
=====

First give your user the access right "Manage Time Parameters".
Then you can create new parameters in "Settings/Technical/Time Parameters".

The parameters need a code and a description (which is optional). Then you can create new versions of this parameters
when you define a "from_date" and a value.

Then you can access current parameter value like this:
.. code-block:: python
# using today's date when no date is passed
value = model.get_time_parameter('my_parameter_name')
# hr.payslip: use payslip.date_to
value = payslip.get_time_parameter('my_parameter_name', payslip.date_to)
# account.tax: use tax_date (https://github.com/apps2grow/apps/tree/14.0/account_tax_python_with_date)
tax_rate = float(company.get_time_parameter('tax_high_rate', tax_date))

Finally i recomend that if you use this parameters in another modules, you create a view which filter by module_name so
you can have a view for each module that needs to change this parameters and the user can only view the parameters
of the module that he is looking to change.

Note: You can see a usage case of this module in OCA Payroll Module.
More information in this PR: https://github.com/OCA/payroll/pull/31

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

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.


