From a4be947e42865419622ec2f0c45dbbb138e71d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 29 Nov 2022 15:37:07 +0100 Subject: [PATCH] [IMP] web_widget_many2one_simple: Add a demo view to better test the functionality. TT40367 --- web_widget_many2one_simple/README.rst | 7 +++++++ web_widget_many2one_simple/__manifest__.py | 3 +++ .../demo/res_partner_view.xml | 15 +++++++++++++++ web_widget_many2one_simple/readme/USAGE.rst | 7 +++++++ .../static/description/index.html | 9 ++++++++- 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 web_widget_many2one_simple/demo/res_partner_view.xml diff --git a/web_widget_many2one_simple/README.rst b/web_widget_many2one_simple/README.rst index c5bb37365..dc8ebc0b2 100644 --- a/web_widget_many2one_simple/README.rst +++ b/web_widget_many2one_simple/README.rst @@ -64,6 +64,13 @@ Usage You need to declare the usage of the new widget as follows: ```` +If you have a database with demo data, you can test this widget following these instructions: + +#. Go to Contacts. +#. Create or edit a record. +#. Set "Industry" field (in Sales & Purchase tab). +#. Only if you set the correct industry name ("Administrative" for example), it will be defined. Otherwise, it will try to create one with that name. + Example: ~~~~~~~~ diff --git a/web_widget_many2one_simple/__manifest__.py b/web_widget_many2one_simple/__manifest__.py index d9aca41b2..891426f22 100644 --- a/web_widget_many2one_simple/__manifest__.py +++ b/web_widget_many2one_simple/__manifest__.py @@ -10,6 +10,9 @@ "depends": ["web"], "installable": True, "maintainers": ["Tardo"], + "demo": [ + "demo/res_partner_view.xml", + ], "assets": { "web.assets_backend": [ "web_widget_many2one_simple/static/src/css/many2one_simple.scss", diff --git a/web_widget_many2one_simple/demo/res_partner_view.xml b/web_widget_many2one_simple/demo/res_partner_view.xml new file mode 100644 index 000000000..8fe2c4c56 --- /dev/null +++ b/web_widget_many2one_simple/demo/res_partner_view.xml @@ -0,0 +1,15 @@ + + + + res.partner + + + + many2one_simple + {'search': {'field': 'name', 'oper': '=' }} + + + + diff --git a/web_widget_many2one_simple/readme/USAGE.rst b/web_widget_many2one_simple/readme/USAGE.rst index 49cc6acfb..8c4b598d7 100644 --- a/web_widget_many2one_simple/readme/USAGE.rst +++ b/web_widget_many2one_simple/readme/USAGE.rst @@ -1,6 +1,13 @@ You need to declare the usage of the new widget as follows: ```` +If you have a database with demo data, you can test this widget following these instructions: + +#. Go to Contacts. +#. Create or edit a record. +#. Set "Industry" field (in Sales & Purchase tab). +#. Only if you set the correct industry name ("Administrative" for example), it will be defined. Otherwise, it will try to create one with that name. + Example: ~~~~~~~~ diff --git a/web_widget_many2one_simple/static/description/index.html b/web_widget_many2one_simple/static/description/index.html index c79e3c8a3..786988cdf 100644 --- a/web_widget_many2one_simple/static/description/index.html +++ b/web_widget_many2one_simple/static/description/index.html @@ -3,7 +3,7 @@ - + Simple many2one widget