Quentin Tawry
3 years ago
committed by
Ashish Hirpara
6 changed files with 99 additions and 90 deletions
-
5server_action_navigate/__manifest__.py
-
20server_action_navigate/demo/ir_actions_server.xml
-
58server_action_navigate/models/ir_actions_server.py
-
27server_action_navigate/models/ir_actions_server_navigate_line.py
-
30server_action_navigate/tests/test_module.py
-
49server_action_navigate/views/view_ir_actions_server.xml
@ -1,32 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!-- |
|||
Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) |
|||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
--> |
|||
|
|||
<odoo> |
|||
|
|||
<record id="navigate_partner_2_tags" model="ir.actions.server"> |
|||
<field name="name">See tags of Partners</field> |
|||
<field name="state">navigate</field> |
|||
<field name="model_id" ref="base.model_res_users"/> |
|||
<field name="model_id" ref="base.model_res_users" /> |
|||
</record> |
|||
|
|||
<record id="navigate_line_1" model="ir.actions.server.navigate.line"> |
|||
<field name="action_id" ref="navigate_partner_2_tags"/> |
|||
<field name="action_id" ref="navigate_partner_2_tags" /> |
|||
<field name="sequence">1</field> |
|||
<field name="field_id" ref="base.field_res_users__partner_id"/> |
|||
<field name="field_id" ref="base.field_res_users__partner_id" /> |
|||
</record> |
|||
|
|||
<record id="navigate_line_2" model="ir.actions.server.navigate.line"> |
|||
<field name="action_id" ref="navigate_partner_2_tags"/> |
|||
<field name="action_id" ref="navigate_partner_2_tags" /> |
|||
<field name="sequence">2</field> |
|||
<field name="field_id" ref="base.field_res_partner__category_id"/> |
|||
<field name="field_id" ref="base.field_res_partner__category_id" /> |
|||
</record> |
|||
|
|||
<function model="ir.actions.server" name="create_action"> |
|||
<value eval="[ref('navigate_partner_2_tags')]"/> |
|||
<value eval="[ref('navigate_partner_2_tags')]" /> |
|||
</function> |
|||
|
|||
</odoo> |
@ -1,40 +1,55 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!-- |
|||
Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) |
|||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
--> |
|||
|
|||
<odoo> |
|||
|
|||
<record id="view_ir_actions_server_form" model="ir.ui.view"> |
|||
<field name="model">ir.actions.server</field> |
|||
<field name="inherit_id" ref="base.view_server_action_form"/> |
|||
|
|||
<field name="inherit_id" ref="base.view_server_action_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//page[@name='code']" position="after"> |
|||
<page string="Navigation Options" name='page_navigate' autofocus="autofocus" |
|||
attrs="{'invisible': [('state', '!=', 'navigate')]}"> |
|||
<page |
|||
string="Navigation Options" |
|||
name='page_navigate' |
|||
autofocus="autofocus" |
|||
attrs="{'invisible': [('state', '!=', 'navigate')]}" |
|||
> |
|||
<group> |
|||
<field name="max_navigate_line_sequence" invisible="1"/> |
|||
<field name="max_navigate_line_model" invisible="1"/> |
|||
<field name="max_navigate_line_sequence" invisible="1" /> |
|||
<field name="max_navigate_line_model" invisible="1" /> |
|||
<!-- we can check emptyness of a 2many like this since v10 i think /--> |
|||
<button name="delete_last_line" string="Delete Last Line" type="object" |
|||
attrs="{'invisible': [('navigate_line_ids', '=', [])]}"/> |
|||
<field name="navigate_line_ids" context="{'navigate_line_ids': navigate_line_ids}" nolabel="1" colspan="4"> |
|||
<button |
|||
name="delete_last_line" |
|||
string="Delete Last Line" |
|||
type="object" |
|||
attrs="{'invisible': [('navigate_line_ids', '=', [])]}" |
|||
/> |
|||
<field |
|||
name="navigate_line_ids" |
|||
context="{'navigate_line_ids': navigate_line_ids}" |
|||
nolabel="1" |
|||
colspan="4" |
|||
> |
|||
<tree editable="bottom" delete="false"> |
|||
<!-- the handle widget takes care of the sequence /--> |
|||
<field name="sequence" widget="handle" invisible="True" /> |
|||
<field |
|||
name="sequence" |
|||
widget="handle" |
|||
invisible="True" |
|||
/> |
|||
<field name="field_id" /> |
|||
<field name="field_model"/> |
|||
<field name="field_model" /> |
|||
</tree> |
|||
</field> |
|||
<field name="navigate_action_id" |
|||
attrs="{'invisible': [('navigate_line_ids', '=', [])]}"/> |
|||
<field |
|||
name="navigate_action_id" |
|||
attrs="{'invisible': [('navigate_line_ids', '=', [])]}" |
|||
/> |
|||
</group> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue