Browse Source

[ADD] web_widget_slick_example: Create module

* Create SlickJS widget field in example module for usage instructions
* Add security to example slick widget model
pull/706/head
Dave Lasley 9 years ago
parent
commit
b3ffddfb95
No known key found for this signature in database GPG Key ID: 7DDBA4BA81B934CF
  1. 32
      web_widget_slick_example/README.rst
  2. 5
      web_widget_slick_example/__init__.py
  3. 25
      web_widget_slick_example/__openerp__.py
  4. 40
      web_widget_slick_example/demo/slick_example_data.xml
  5. 3
      web_widget_slick_example/models/__init__.py
  6. 15
      web_widget_slick_example/models/slick_example.py
  7. 2
      web_widget_slick_example/security/ir.model.access.csv
  8. BIN
      web_widget_slick_example/static/description/icon.png
  9. 12745
      web_widget_slick_example/static/description/icon.svg
  10. 52
      web_widget_slick_example/views/slick_example_view.xml

32
web_widget_slick_example/README.rst

@ -0,0 +1,32 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
====================
Slick Widget Example
====================
This module provides an example of how to implement the web_widget_slick module
Credits
=======
Images
------
* LasLabs: `Icon <https://repo.laslabs.com/projects/TEM/repos/odoo-module_template/browse/module_name/static/description/icon.svg?raw>`_.
Contributors
------------
* Dave Lasley <dave@laslabs.com>
Maintainer
----------
.. image:: https://laslabs.com/logo.png
:alt: LasLabs Inc.
:target: https://laslabs.com
This module is maintained by LasLabs Inc.

5
web_widget_slick_example/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2016-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

25
web_widget_slick_example/__openerp__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# © 2016-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Slick Widget Example",
"summary": "Example usage of the web_widget_slick module",
"version": "9.0.1.0.0",
"category": "Hidden",
"website": "https://laslabs.com/",
"author": "LasLabs",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"web_widget_slick",
],
"data": [
'views/slick_example_view.xml',
'security/ir.model.access.csv',
],
"demo": [
'demo/slick_example_data.xml',
]
}

40
web_widget_slick_example/demo/slick_example_data.xml
File diff suppressed because it is too large
View File

3
web_widget_slick_example/models/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import slick_example

15
web_widget_slick_example/models/slick_example.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# © 2016-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class SlickExample(models.Model):
_name = 'slick.example'
_description = 'Slick Example Model'
image_ids = fields.One2many(
name='Images',
comodel_name='ir.attachment',
inverse_name='res_id',
)

2
web_widget_slick_example/security/ir.model.access.csv

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
slick_example_manager,slick.example.manager,web_widget_slick_example.model_slick_example,base.group_no_one,1,1,1,1

BIN
web_widget_slick_example/static/description/icon.png

After

Width: 600  |  Height: 518  |  Size: 10 KiB

12745
web_widget_slick_example/static/description/icon.svg
File diff suppressed because it is too large
View File

52
web_widget_slick_example/views/slick_example_view.xml

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016-TODAY LasLabs, Inc. [https://laslabs.com]
@author Dave Lasley <dave@laslabs.com>
@license AGPL-3
-->
<openerp>
<data>
<record id="slick_example_view_form" model="ir.ui.view">
<field name="name">slick.example.view.form</field>
<field name="model">slick.example</field>
<field name="arch" type="xml">
<form string="Slick Example">
<header />
<sheet>
<field name="image_ids" widget="one2many_slick_images"
options="{'slidesToShow': 2}" />
</sheet>
<footer />
</form>
</field>
</record>
<record id="slick_example_view_tree" model="ir.ui.view">
<field name="name">slick.example.view.tree</field>
<field name="model">slick.example</field>
<field name="arch" type="xml">
<tree string="Slick Example">
<field name="id" />
</tree>
</field>
</record>
<record id="slick_example_action" model="ir.actions.act_window">
<field name="name">Slick Examples</field>
<field name="res_model">slick.example</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="slick_example_menu"
name="Slick"
parent="base.menu_custom"
action="slick_example_action"
sequence="1" />
</data>
</openerp>
Loading…
Cancel
Save