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. 20
      web_widget_slick_example/views/slick_example_view.xml

3
web_widget_slick_example/README.rst

@ -6,7 +6,8 @@
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
===========

5
web_widget_slick_example/__manifest__.py

@ -4,7 +4,8 @@
{
"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",
"category": "Hidden",
"website": "https://laslabs.com/",
@ -13,7 +14,7 @@
"application": False,
"installable": True,
"depends": [
"web_widget_slick",
"web_widget_slickroom",
],
"data": [
'views/slick_example_view.xml',

7
web_widget_slick_example/demo/slick_example_data.xml

@ -4,11 +4,16 @@
<odoo noupdate="1">
<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_fonz2'),
ref('web_widget_slick_example.rec_slick_example_fonz3'),
])]</field>
</record>
<record id="rec_slick_example_fonz1" model="ir.attachment">
<field name="name">Fonz1.png</field>

9
web_widget_slick_example/models/slick_example.py

@ -9,8 +9,13 @@ class SlickExample(models.Model):
_name = 'slick.example'
_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',
inverse_name='res_id',
)

20
web_widget_slick_example/views/slick_example_view.xml

@ -7,12 +7,24 @@
<field name="name">slick.example.view.form</field>
<field name="model">slick.example</field>
<field name="arch" type="xml">
<form string="Slick Example">
<form string="Slick / Slickroom Examples">
<header />
<sheet>
<group>
<field name="image_ids" widget="one2many_slick_images"
options="{'slidesToShow': 2}" />
<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}" />
</group>
</sheet>
<footer />

Loading…
Cancel
Save