Skip to main content

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

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

Table of contents

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:

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

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

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

Metadata

Release files for odoo14-addon-base-time-parameter 14.0.3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo14-addon-base-time-parameter 14.0.3.1.1
File Interpreter ABI Platform Actions
odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl Python 3 none any Details for odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl

Release files / odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl

Download URL odoo14_addon_base_time_parameter-14.0.3.1.1-py3-none-any.whl
Size 46.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db4354f51900d600974195236b32eba1d5142904e3d73bde366faa2356935ab7
BLAKE2b-256 checksum
How to use checksums
4edb6290e2e0092d1b9b66e86f2cad5723a3d8d354f9b99c379b833f56334da6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for odoo14-addon-base-time-parameter 14.0.3.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page