Skip to main content

Report Qweb Field Option

Project description

Odoo Community Association

Report Qweb Field Option

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

This module allows administrators to define the decimal precision of float fields and add option values to fields (e.g., adding a date widget option to datetime fields) for QWeb report and view presentation.

Table of contents

Configuration

Go to Settings > Technical > Reporting > Qweb Field Options, and create records according to your needs.

For each record:

  • Set Model and Field (required)

  • Set UoM and UoM Field, or Currency and Currency Field only for fields of float type (optional)

  • Set Domain to specify a domain for more specific filtering (e.g., [('secondary_uom_id', '=', 1)] to apply only when a specific secondary UoM is used) (optional)

  • Set Company (optional)

  • Set Options as a string representation of a dictionary. E.g., {"widget": "date"}, {"widget": "monetary"}, or {"widget": "contact", "fields": ["name", "phone"]}

  • Set Digits (only for float-type fields). The value is ignored if Options is set

Usage

Print a QWeb report (quotation, invoice, purchase order, etc.), and the value presentation for fields like line quantity, price unit and date order are adjusted according to the Qweb Field Options configuration.

Note that among matching configuration records, the one with the strictest condition will be applied.

Known issues / Roadmap

#. QWeb field option settings only apply to fields rendered with t-field.
They don’t work with t-esc or other expressions not using t-field.

As a workaround, you could create a module that adds a computed field holding the same value currently computed and displayed in the QWeb report using t-esc, and adjust the report template to display the field value using t-field. This would allow you to adjust the decimal precision as needed.

#. Assigning Options in a QWeb Field Options record can cause UI issues if a field is defined twice with different widgets in a view.

For example, adding {"widget": "date"} to the date_approve field in a purchase order can result in two dates appearing under the Confirmation Date column in the portal view. This occurs because the field is defined twice with different widgets.

Reference: https://github.com/odoo/odoo/blob/5eec379/addons/purchase/views/portal_templates.xml#L101-L102

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 to smash it by providing a detailed and welcomed feedback.

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

Credits

Authors

  • Quartile

Contributors

  • Quartile:

    • Yoshi Tashiro

    • Aung Ko Ko Lin

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.

This module is part of the OCA/reporting-engine 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 odoo_addon_report_qweb_field_option-18.0.1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_report_qweb_field_option-18.0.1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bccf5798172d3109f804a98d08a846e3d3f3368cda99f8402273e7234a5dc87
MD5 e0b19087cec80439d551b955cd818ee3
BLAKE2b-256 e8b6d6db1825ccf78401a0a5a808f334cd874a5cbf28abbf869283a089a06502

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