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.
Table of contents
Usage
First give your user the access right “Manage Time Parameters”. Then in “Settings/Technical/Time Parameters” you can create a new parameter with different versions (start date and 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))
Payroll implementation: * Payroll configuration only shows payslip parameters. * By default, the model_id field is hidden in the form. * Only payslip model/record may call time_parameter(code).
<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"
/>
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
Hashes for odoo14_addon_base_time_parameter-14.0.2.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c56973d534863225e9128292511f89b45a0c911082aed37d03b673ba1ee54e |
|
MD5 | 552c622aac4da3a4b903a6e2af40001a |
|
BLAKE2b-256 | a7fcf81c9136e9d1138cc075482c28418826ba1850a1aaa975741d25c9c30313 |