Browse Source

[ADD] Demo data for testing

pull/729/head
Stefan Rijnhart 7 years ago
parent
commit
e08bd6520a
  1. 2
      web_ir_actions_act_window_page/README.md
  2. 3
      web_ir_actions_act_window_page/__manifest__.py
  3. 35
      web_ir_actions_act_window_page/demo/demo_action.xml

2
web_ir_actions_act_window_page/README.md

@ -22,6 +22,8 @@ A use case could be the case of a validation flow. As a developer, you set up a
Usage
=====
See the 'Previous Partner' and 'Next Partner' buttons that this module's demo data adds to the partner form view.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0

3
web_ir_actions_act_window_page/__manifest__.py

@ -14,6 +14,9 @@
'data': [
'views/assets.xml',
],
'demo': [
'demo/demo_action.xml',
],
'installable': True,
'license': 'AGPL-3',
'url': 'https://github.com/oca/web',

35
web_ir_actions_act_window_page/demo/demo_action.xml

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record model="ir.actions.server" id="demo_pager_previous">
<field name="name">Previous partner</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="code">action = {"type": "ir_actions_act_window_page_prev"}</field>
</record>
<record model="ir.actions.server" id="demo_pager_next">
<field name="name">Next partner</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="code">action = {"type": "ir_actions_act_window_page_next"}</field>
</record>
<!-- Adding some redundant buttons to the partner form so that this module can be tested on runbot.
You might be more interested in returning this action type from a method in your code. -->
<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button name="%(web_ir_actions_act_window_page.demo_pager_previous)d"
type="action" string="Previous Partner"
icon="fa-arrow-left"
class="oe_stat_button"/>
<button name="%(web_ir_actions_act_window_page.demo_pager_next)d"
type="action" string="Next Partner"
icon="fa-arrow-right"
class="oe_stat_button"/>
</div>
</field>
</record>
</odoo>
Loading…
Cancel
Save