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. 3
      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. 3
      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

3
web_widget_x2many_2d_matrix_example/views/x2m_demo.xml

@ -48,7 +48,6 @@
<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())

3
web_widget_x2many_2d_matrix_example/wizard/x2m_matrix.xml

@ -7,7 +7,8 @@
<field name="type">form</field> <field name="type">form</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<field name="line_ids" widget="x2many_2d_matrix" field_x_axis="demo_id" field_y_axis="user_id" field_value="value">
<field name="line_ids" widget="x2many_2d_matrix"
field_x_axis="demo_id" field_y_axis="user_id" field_value="value">
<tree> <tree>
<field name="demo_id"/> <field name="demo_id"/>
<field name="user_id"/> <field name="user_id"/>

Loading…
Cancel
Save