mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_widget_slick_example: Create module
* Create SlickJS widget field in example module for usage instructions * Add security to example slick widget model
This commit is contained in:
32
web_widget_slick_example/README.rst
Executable file
32
web_widget_slick_example/README.rst
Executable file
@@ -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
Executable file
5
web_widget_slick_example/__init__.py
Executable file
@@ -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
Executable file
25
web_widget_slick_example/__openerp__.py
Executable file
@@ -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
Normal file
40
web_widget_slick_example/demo/slick_example_data.xml
Normal file
File diff suppressed because one or more lines are too long
3
web_widget_slick_example/models/__init__.py
Executable file
3
web_widget_slick_example/models/__init__.py
Executable file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import slick_example
|
||||
15
web_widget_slick_example/models/slick_example.py
Executable file
15
web_widget_slick_example/models/slick_example.py
Executable file
@@ -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
Normal file
2
web_widget_slick_example/security/ir.model.access.csv
Normal file
@@ -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
Executable file
BIN
web_widget_slick_example/static/description/icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
12745
web_widget_slick_example/static/description/icon.svg
Executable file
12745
web_widget_slick_example/static/description/icon.svg
Executable file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 932 KiB |
52
web_widget_slick_example/views/slick_example_view.xml
Normal file
52
web_widget_slick_example/views/slick_example_view.xml
Normal file
@@ -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>
|
||||
Reference in New Issue
Block a user