Time dependent parameters Adds the feature to define parameters with time based versions.
Project description
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 Dependent 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_dependent_parameter(‘my_parameter_name’) # hr.payslip: use payslip.date_to value = payslip.get_time_dependent_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_dependent_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
Contributors
Nimarosa (Nicolas Rodriguez) <nicolasrsande@gmail.com>
appstogrow (Henrik Norlin) <henrik@appstogrow.co>
Maintainers
This module is maintained by the OCA.
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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file odoo14_addon_base_time_dependent_parameter-14.0.1.0.1.dev3-py3-none-any.whl
.
File metadata
- Download URL: odoo14_addon_base_time_dependent_parameter-14.0.1.0.1.dev3-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed982a0f466645e126ae6d507a1bed28821c12db526595e4206b0a798ea24046 |
|
MD5 | 5a7380e23a45ecd3cb81340b24b6d299 |
|
BLAKE2b-256 | c3ab7c625ad75d3d8bdfc3fe583801a8173516c04de52fc32749523485252989 |