This widget allows you to conveniently display, edit, validate json data on user form. It has multiple display options (tree, text, code). If a field is read-only, the widget opens only for viewing. The widget is based on JSONEditor by Jos de Jong. Usage: # model class Model(models.Model): json_field = fields.Json(string="Your JSON field") # view <form>; .... <field name="json_field" widget="json_widget" /> .... </form>
This widget allows you to display and edit only year or month/year in date fields. Usage: # model class Model(models.Model): json_field = fields.Json(string="Your JSON field") # view <form>; .... <field name="date_year_field" widget="year_picker" /> .... <field name="date_month_field" widget="month_picker" /> .... </form>
This widget allows you to edit text fields in a modal dialog on list or form with optional validation and autofocus support. If a field is read-only, the widget opens only for viewing. # view <form>; .... <field name="comment" widget="textarea_dialog_widget" />; .... </form>; <tree>; .... <field name="comment" widget="textarea_dialog_widget" />; .... </tree>;
This widget allows you to display tree-like hierarchical references, making it easier to organize and navigate complex structures. It works seamlessly on both forms and tree views, allowing users to select and manage hierarchical data directly within Odoo. Usage: # foreign model class YourReferenceModel(models.Model): _name = "your_reference_model" _description = "YourReferenceModel" _inherit = ["tree_widget.mixin"] # main model class YourMainModel(models.Model): _name = "your_main_model" _description = "YourMainModel" name = fields.Char(string="Name") reference_id = fields.Many2one( "your_reference_model", string="Reference", context={"display_full_name": True}, # Set display_full_name=True if you want # the full path of the reference to be displayed. ) # view form <form> .... <field name="reference_id" widget="many2one_tree"/> .... </form> # view list <tree> .... <field name="reference_id" widget="many2one_tree"/> .... </tree>
This module adds tools for working with vaults. Two types of vaults are available: HashiCorp and Secret Manager. Only one type of secret storage is available: key and value. There are json schemas for storing a single key value (KeySecretType), a pair of secrets (KeyPairSecretType) and a login/password (LoginPasswordType) 1. The module provides a new field type VaultSecretField. Thanks to this field the filled data will be stored in the vault and the secret path will be stored in the database. The field can be used in any model, including res.config.settings to store module settings. # Examples of working with vault field: # model class ResConfigSettings(models.TransientModel): _inherit = “res.config.settings” secret = VaultSecretField(secret_type=KeyPairSecretType.type) # view <field name=“arch” type=“xml”> .... <field name=“secret” /> .... </field> 2. The module provides a VaultSecret API class that performs standard CRUD interaction with a vault. # Examples of working with the API class: # Create new_secret = VaultSecret.save_secret( LoginPasswordType.type, login=login, password=password ) # or new_secret = VaultSecret(path="custom/path", secret_type=LoginPasswordType) new_secret.write_secret({"login": login, "password": password}) # Get secret = new_secret.get_secret() login = secret['login'] password = secret['password'] # Write new_secret.write_secret({"login": login, "password": password}) # Delete new_secret.delete_secret()