forked from Techsystech/web
[MIG] web_widget_x2many_2d_matrix_example: Migration to 12.0.
parent
22441ad62f
commit
4aafcfa5a5
|
@ -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,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
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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 +1,2 @@
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
from . import x2m_demo
|
from . import x2m_demo
|
||||||
|
|
|
@ -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')
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
* Simone Orsi <simone.orsi@camptocamp.com>
|
||||||
|
* Anand Kansagra <kansagraanand@hotmail.com>
|
|
@ -0,0 +1 @@
|
||||||
|
Install it and click on the menu item `Demo x2m matrix widget`.
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
|
@ -8,19 +8,19 @@
|
||||||
<form>
|
<form>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
<field name="name" />
|
<field name="name"/>
|
||||||
<field name="line_ids">
|
<field name="line_ids">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name" />
|
<field name="name"/>
|
||||||
<field name="value" />
|
<field name="value"/>
|
||||||
<field name="user_id" />
|
<field name="user_id"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button name="open_x2m_matrix" type="object"
|
<button name="open_x2m_matrix" type="object"
|
||||||
string="Try x2m 2d matrix"
|
string="Try x2m 2d matrix"
|
||||||
class="oe_stat_button" icon="fa-edit" />
|
class="oe_stat_button" icon="fa-edit"/>
|
||||||
</footer>
|
</footer>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<field name="model">x2m.demo</field>
|
<field name="model">x2m.demo</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name" />
|
<field name="name"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -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>
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
from . import demo_wizard
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from . import x2m_matrix
|
||||||
|
|
|
@ -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())
|
|
@ -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…
Reference in New Issue