3
0
Fork 0

[IMP] web_widget_many2one_simple: Add a demo view to better test the functionality.

TT40367
15.0-ocabot-merge-pr-2789-by-pedrobaeza-bump-patch
Víctor Martínez 2022-11-29 15:37:07 +01:00
parent 74db246f0b
commit a4be947e42
5 changed files with 40 additions and 1 deletions

View File

@ -64,6 +64,13 @@ Usage
You need to declare the usage of the new widget as follows:
``<field name="xxx" widget="many2one_simple" options="...">``
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:
~~~~~~~~

View File

@ -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",

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="industry_id" position="attributes">
<attribute name="widget">many2one_simple</attribute>
<attribute
name="options"
>{'search': {'field': 'name', 'oper': '=' }}</attribute>
</field>
</field>
</record>
</odoo>

View File

@ -1,6 +1,13 @@
You need to declare the usage of the new widget as follows:
``<field name="xxx" widget="many2one_simple" options="...">``
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:
~~~~~~~~

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Simple many2one widget</title>
<style type="text/css">
@ -422,6 +422,13 @@ without any extra features (no autocomplete and no partial search).</p>
<h1><a class="toc-backref" href="#id4">Usage</a></h1>
<p>You need to declare the usage of the new widget as follows:
<tt class="docutils literal">&lt;field <span class="pre">name=&quot;xxx&quot;</span> <span class="pre">widget=&quot;many2one_simple&quot;</span> <span class="pre">options=&quot;...&quot;&gt;</span></tt></p>
<p>If you have a database with demo data, you can test this widget following these instructions:</p>
<ol class="arabic simple">
<li>Go to Contacts.</li>
<li>Create or edit a record.</li>
<li>Set “Industry” field (in Sales &amp; Purchase tab).</li>
<li>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.</li>
</ol>
<div class="section" id="example">
<h2><a class="toc-backref" href="#id5">Example:</a></h2>
<pre class="code xml literal-block">