Browse Source

[IMP] web_widget_slick_example: Add slickroom support

* Add slickroom dependency, example to example module
pull/853/head
Brenton Hughes 7 years ago
committed by Jairo Llopis
parent
commit
00601026a7
  1. 3
      web_widget_slick_example/README.rst
  2. 5
      web_widget_slick_example/__manifest__.py
  3. 7
      web_widget_slick_example/demo/slick_example_data.xml
  4. 9
      web_widget_slick_example/models/slick_example.py
  5. 18
      web_widget_slick_example/views/slick_example_view.xml

3
web_widget_slick_example/README.rst

@ -6,7 +6,8 @@
Slick Carousel Widget Example Slick Carousel Widget Example
============================= =============================
This module provides an example of how to implement the web_widget_slick module.
This module provides example implementations of the web_widget_slick and
web_widget_slickroom modules.
Bug Tracker Bug Tracker
=========== ===========

5
web_widget_slick_example/__manifest__.py

@ -4,7 +4,8 @@
{ {
"name": "Slick Carousel Widget Example", "name": "Slick Carousel Widget Example",
"summary": "Example usage of the web_widget_slick module",
"summary": "Example usage of the web_widget_slick and "
"web_widget_slickroom modules",
"version": "10.0.1.0.0", "version": "10.0.1.0.0",
"category": "Hidden", "category": "Hidden",
"website": "https://laslabs.com/", "website": "https://laslabs.com/",
@ -13,7 +14,7 @@
"application": False, "application": False,
"installable": True, "installable": True,
"depends": [ "depends": [
"web_widget_slick",
"web_widget_slickroom",
], ],
"data": [ "data": [
'views/slick_example_view.xml', 'views/slick_example_view.xml',

7
web_widget_slick_example/demo/slick_example_data.xml

@ -4,7 +4,12 @@
<odoo noupdate="1"> <odoo noupdate="1">
<record id="rec_slick_example" model="slick.example"> <record id="rec_slick_example" model="slick.example">
<field name="image_ids">[(6, 0, [
<field name="slick_image_ids">[(6, 0, [
ref('web_widget_slick_example.rec_slick_example_fonz1'),
ref('web_widget_slick_example.rec_slick_example_fonz2'),
ref('web_widget_slick_example.rec_slick_example_fonz3'),
])]</field>
<field name="slickroom_image_ids">[(6, 0, [
ref('web_widget_slick_example.rec_slick_example_fonz1'), ref('web_widget_slick_example.rec_slick_example_fonz1'),
ref('web_widget_slick_example.rec_slick_example_fonz2'), ref('web_widget_slick_example.rec_slick_example_fonz2'),
ref('web_widget_slick_example.rec_slick_example_fonz3'), ref('web_widget_slick_example.rec_slick_example_fonz3'),

9
web_widget_slick_example/models/slick_example.py

@ -9,8 +9,13 @@ class SlickExample(models.Model):
_name = 'slick.example' _name = 'slick.example'
_description = 'Slick Example Model' _description = 'Slick Example Model'
image_ids = fields.One2many(
name='Images',
slick_image_ids = fields.One2many(
name='Slick Images',
comodel_name='ir.attachment',
inverse_name='res_id',
)
slickroom_image_ids = fields.One2many(
name='Slickroom Images',
comodel_name='ir.attachment', comodel_name='ir.attachment',
inverse_name='res_id', inverse_name='res_id',
) )

18
web_widget_slick_example/views/slick_example_view.xml

@ -7,11 +7,23 @@
<field name="name">slick.example.view.form</field> <field name="name">slick.example.view.form</field>
<field name="model">slick.example</field> <field name="model">slick.example</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Slick Example">
<form string="Slick / Slickroom Examples">
<header /> <header />
<sheet> <sheet>
<group>
<field name="image_ids" widget="one2many_slick_images"
<group col="2">
<separator string="Slick Carousel" />
<newline />
<field name="slick_image_ids"
nolabel="1"
colspan="2"
widget="one2many_slick_images"
options="{'slidesToShow': 2}" />
<separator string="Slickroom Carousel" />
<newline />
<field name="slickroom_image_ids"
nolabel="1"
colspan="2"
widget="slickroom"
options="{'slidesToShow': 2}" /> options="{'slidesToShow': 2}" />
</group> </group>
</sheet> </sheet>

Loading…
Cancel
Save