Browse Source

[MIG] web_widget_x2many_2d_matrix_example: Migration to 12.0.

pull/1146/head
Anand Kansagra 6 years ago
parent
commit
4aafcfa5a5
  1. 2
      web_widget_x2many_2d_matrix_example/README.rst
  2. 1
      web_widget_x2many_2d_matrix_example/__init__.py
  3. 3
      web_widget_x2many_2d_matrix_example/__manifest__.py
  4. 2
      web_widget_x2many_2d_matrix_example/i18n/web_widget_x2many_2d_matrix_example.pot
  5. 1
      web_widget_x2many_2d_matrix_example/models/__init__.py
  6. 3
      web_widget_x2many_2d_matrix_example/models/x2m_demo.py
  7. 2
      web_widget_x2many_2d_matrix_example/readme/CONTRIBUTORS.rst
  8. 1
      web_widget_x2many_2d_matrix_example/readme/DESCRIPTION.rst
  9. BIN
      web_widget_x2many_2d_matrix_example/static/description/icon.png
  10. 87
      web_widget_x2many_2d_matrix_example/views/x2m_demo.xml
  11. 3
      web_widget_x2many_2d_matrix_example/wizard/__init__.py
  12. 4
      web_widget_x2many_2d_matrix_example/wizard/x2m_matrix.py
  13. 31
      web_widget_x2many_2d_matrix_example/wizard/x2m_matrix.xml

2
web_widget_x2many_2d_matrix_example/README.rst

@ -23,7 +23,7 @@ Contributors
------------ ------------
* Simone Orsi <simone.orsi@camptocamp.com> * Simone Orsi <simone.orsi@camptocamp.com>
* Anand Kansagra <kansagraanand@hotmail.com>
Maintainer Maintainer
---------- ----------

1
web_widget_x2many_2d_matrix_example/__init__.py

@ -1,2 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models from . import models
from . import wizard from . import wizard

3
web_widget_x2many_2d_matrix_example/__manifest__.py

@ -1,7 +1,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'web_widget_x2many_2d_matrix example', 'name': 'web_widget_x2many_2d_matrix example',
'summary': "A small example on how to use `web_widget_x2many_2d_matrix`.", 'summary': "A small example on how to use `web_widget_x2many_2d_matrix`.",
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"author": "Camptocamp, " "author": "Camptocamp, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",

2
web_widget_x2many_2d_matrix_example/i18n/web_widget_x2many_2d_matrix_example.pot

@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"

1
web_widget_x2many_2d_matrix_example/models/__init__.py

@ -1 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import x2m_demo from . import x2m_demo

3
web_widget_x2many_2d_matrix_example/models/x2m_demo.py

@ -1,8 +1,10 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api, fields from odoo import models, api, fields
class X2MDemo(models.Model): class X2MDemo(models.Model):
_name = 'x2m.demo' _name = 'x2m.demo'
_description = 'X2Many Demo'
name = fields.Char() name = fields.Char()
line_ids = fields.One2many('x2m.demo.line', 'demo_id') line_ids = fields.One2many('x2m.demo.line', 'demo_id')
@ -24,6 +26,7 @@ class X2MDemo(models.Model):
class X2MDemoLine(models.Model): class X2MDemoLine(models.Model):
_name = 'x2m.demo.line' _name = 'x2m.demo.line'
_description = 'X2Many Demo Line'
name = fields.Char() name = fields.Char()
demo_id = fields.Many2one('x2m.demo') demo_id = fields.Many2one('x2m.demo')

2
web_widget_x2many_2d_matrix_example/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Simone Orsi <simone.orsi@camptocamp.com>
* Anand Kansagra <kansagraanand@hotmail.com>

1
web_widget_x2many_2d_matrix_example/readme/DESCRIPTION.rst

@ -0,0 +1 @@
Install it and click on the menu item `Demo x2m matrix widget`.

BIN
web_widget_x2many_2d_matrix_example/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

87
web_widget_x2many_2d_matrix_example/views/x2m_demo.xml

@ -1,54 +1,53 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="view_x2m_demo_form" model="ir.ui.view">
<field name="name">x2m.demo.form</field>
<field name="model">x2m.demo</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name" />
<field name="line_ids">
<tree>
<field name="name" />
<field name="value" />
<field name="user_id" />
</tree>
</field>
</group>
<footer>
<button name="open_x2m_matrix" type="object"
string="Try x2m 2d matrix"
class="oe_stat_button" icon="fa-edit" />
</footer>
</sheet>
</form>
</field>
</record>
<record id="view_x2m_demo_form" model="ir.ui.view">
<field name="name">x2m.demo.form</field>
<field name="model">x2m.demo</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="line_ids">
<tree>
<field name="name"/>
<field name="value"/>
<field name="user_id"/>
</tree>
</field>
</group>
<footer>
<button name="open_x2m_matrix" type="object"
string="Try x2m 2d matrix"
class="oe_stat_button" icon="fa-edit"/>
</footer>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_x2m_demo_tree">
<field name="name">Demo - Tree</field>
<field name="model">x2m.demo</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_x2m_demo_tree">
<field name="name">Demo - Tree</field>
<field name="model">x2m.demo</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
</tree>
</field>
</record>
<record id="action_x2m_demo" model="ir.actions.act_window">
<field name="name">Demo</field>
<field name="res_model">x2m.demo</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_x2m_demo_tree"/>
</record>
<record id="action_x2m_demo" model="ir.actions.act_window">
<field name="name">Demo</field>
<field name="res_model">x2m.demo</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_x2m_demo_tree"/>
</record>
<menuitem
<menuitem
id="base_matrix_widget_menu" id="base_matrix_widget_menu"
name="Demo x2m matrix widget" name="Demo x2m matrix widget"
action="action_x2m_demo"
/>
action="action_x2m_demo"/>
</odoo> </odoo>

3
web_widget_x2many_2d_matrix_example/wizard/__init__.py

@ -1 +1,2 @@
from . import demo_wizard
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import x2m_matrix

4
web_widget_x2many_2d_matrix_example/wizard/demo_wizard.py → web_widget_x2many_2d_matrix_example/wizard/x2m_matrix.py

@ -1,8 +1,10 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models from odoo import fields, models
class DemoWizard(models.TransientModel):
class X2mMatrixDemoWiz(models.TransientModel):
_name = 'x2m.matrix.demo.wiz' _name = 'x2m.matrix.demo.wiz'
_description = 'X2Many Matrix Demo Wizard'
line_ids = fields.Many2many( line_ids = fields.Many2many(
'x2m.demo.line', default=lambda self: self._default_line_ids()) 'x2m.demo.line', default=lambda self: self._default_line_ids())

31
web_widget_x2many_2d_matrix_example/wizard/x2m_matrix.xml

@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="x2many_2d_matrix_demo" model="ir.ui.view">
<field name="name">x2m.matrix.demo.wiz</field>
<field name="model">x2m.matrix.demo.wiz</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<field name="line_ids" widget="x2many_2d_matrix" field_x_axis="demo_id" field_y_axis="user_id" field_value="value">
<tree>
<field name="demo_id"/>
<field name="user_id"/>
<field name="value"/>
</tree>
<record id="x2many_2d_matrix_demo" model="ir.ui.view">
<field name="name">x2m.matrix.demo.wiz</field>
<field name="model">x2m.matrix.demo.wiz</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<field name="line_ids" widget="x2many_2d_matrix"
field_x_axis="demo_id" field_y_axis="user_id" field_value="value">
<tree>
<field name="demo_id"/>
<field name="user_id"/>
<field name="value"/>
</tree>
</field>
</form>
</field> </field>
</form>
</field>
</record>
</record>
</odoo> </odoo>
Loading…
Cancel
Save