Skip to main content

Time dependent parameters Adds the feature to define parameters with time based versions.

Project description

Alpha License: LGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

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.

Table of contents

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. 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.

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

Credits

Authors

  • Nimarosa

  • appstogrow

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Current maintainers:

appstogrow nimarosa

This module is part of the OCA/server-tools project on GitHub.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo14_addon_base_time_parameter-14.0.2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo14_addon_base_time_parameter-14.0.2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fe11944c7573bee14bedcc1db4986769d337b53e0cdacd76944ddf1181d9672
MD5 2a2d5b752a2a784ba24cc59481f37c5e
BLAKE2b-256 87844083839805d7fd9fd79c6e24b16bf641e630c7a6a87a62c9462d08257f5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page