-
Notifications
You must be signed in to change notification settings - Fork 90
Home
EXAMPLE with CRM Lead
Create a form for a CRM Lead, and have it autofill certain information such as the customer info.
At least the following modules are required:
-
formio_data_api
(makes the data loading possible) -
formio_crm
(ensures the linking between a Form and CRM Lead).
Configuration necessities:
- In the Odoo form-view ensure the field "Resource Model" contains "CRM Lead" (
crm.lead
). - Go to the Form Builder, edit some input component and open the "API" tab.
- To use the Lead
name
field, fill in (setting field) Property Name:Odoo__name
(double underscore is required to traverse fields).
About the prefixes:
-
Odoo
: Uses the stored value after the Form has been submitted (state != pending). -
OdooRF
: Refreshes the data even if the Form has been completed (for every state).
Possible use case:
Use a select field/component to load and provide the Odoo customers (display name), available in the res.partner
model.
Important, not supported: To keep data secure, this currently only works in the Odoo backend and portal. In case you want to use this on the website (public user) this won't work (yet).
Required setup/actions:
- Drop a Select component on the Form Builder
- Edit Select component and open the Data tab
- Fill in the field Data Source URL:
/data
- Fill in the field Filter Query:
model=res.partner&label=name
This Filter Query will get all partners. It's also possible to filter certain partners, by adding extra URL query-params. Following example loads data into Select Component, whereby choices are the partner names with city "Sittard".
Filter Query: model=res.partner&label=name&domain_fields=city&city=Sittard