Browse Source
Merge pull request #32 from avanzosc/8.0-mass_editing
Merge pull request #32 from avanzosc/8.0-mass_editing
[ADD] Migrated <mass_editing> for Odoopull/18/head
Pedro M. Baeza
11 years ago
15 changed files with 216 additions and 149 deletions
-
71__unported__/mass_editing/mass_editing_view.xml
-
0mass_editing/ChangeLog.txt
-
8mass_editing/__init__.py
-
25mass_editing/__openerp__.py
-
2mass_editing/i18n/es.po
-
0mass_editing/i18n/fr.po
-
0mass_editing/i18n/fr_CA.po
-
0mass_editing/i18n/mass_editing.pot
-
10mass_editing/models/__init__.py
-
42mass_editing/models/ir_model_fields.py
-
60mass_editing/models/mass_object.py
-
0mass_editing/security/ir.model.access.csv
-
98mass_editing/views/mass_editing_view.xml
-
23mass_editing/wizard/__init__.py
-
26mass_editing/wizard/mass_editing_wizard.py
@ -1,71 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<data> |
|||
|
|||
<record model="ir.ui.view" id="view_mass_object_form"> |
|||
<field name="name">mass.object.form</field> |
|||
<field name="model">mass.object</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Object"> |
|||
<field name="name"/> |
|||
<field name="model_id" on_change="onchange_model(model_id)"/> |
|||
<field name="model_ids" invisible="1"/> |
|||
<notebook colspan="4"> |
|||
<page string="Fields"> |
|||
<field name="field_ids" colspan="4" nolabel="1" |
|||
domain="[('ttype', 'not in', ['reference', 'function']), ('model_id', 'in', model_ids[0][2])]"/> |
|||
</page> |
|||
<page string="Advanced"> |
|||
<group colspan="2" col="2"> |
|||
<button name="create_action" string="Add sidebar button" type="object" icon="gtk-execute" |
|||
colspan="2" attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" |
|||
help="Display a button in the sidebar of related documents to open a composition wizard"/> |
|||
<field name="ref_ir_act_window" attrs="{'invisible':[('ref_ir_act_window','=',False)]}"/> |
|||
<field name="ref_ir_value" attrs="{'invisible':[('ref_ir_act_window','=',False)]}"/> |
|||
<button name="unlink_action" string="Remove sidebar button" type="object" icon="gtk-delete" |
|||
attrs="{'invisible':[('ref_ir_act_window','=',False)]}" colspan="2" /> |
|||
</group> |
|||
</page> |
|||
</notebook> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_mass_object_tree"> |
|||
<field name="name">mass.object.tree</field> |
|||
<field name="model">mass.object</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Object"> |
|||
<field name="name"/> |
|||
<field name="model_id"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.actions.act_window" id="action_mass_object_form"> |
|||
<field name="name">Mass Editing</field> |
|||
<field name="res_model">mass.object</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_id" ref="view_mass_object_tree" /> |
|||
</record> |
|||
|
|||
<record id="action_mass_object_form_view1" model="ir.actions.act_window.view"> |
|||
<field eval="10" name="sequence"/> |
|||
<field name="view_mode">tree</field> |
|||
<field name="view_id" ref="view_mass_object_tree"/> |
|||
<field name="act_window_id" ref="action_mass_object_form"/> |
|||
</record> |
|||
<record id="action_mass_object_form_view2" model="ir.actions.act_window.view"> |
|||
<field eval="20" name="sequence"/> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="view_mass_object_form"/> |
|||
<field name="act_window_id" ref="action_mass_object_form"/> |
|||
</record> |
|||
|
|||
<menuitem id="menu_mass_editing" name="Mass Editing" parent="base.menu_config" sequence="6"/> |
|||
|
|||
<menuitem id="menu_mass_object_view" action="action_mass_object_form" parent="menu_mass_editing"/> |
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# This module uses OpenERP, Open Source Management Solution Framework. |
|||
# Copyright (C): |
|||
# 2012-Today Serpent Consulting Services (<http://www.serpentcs.com>) |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation, either version 3 of the License, or |
|||
# (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
# |
|||
############################################################################## |
|||
|
|||
from openerp.osv import orm |
|||
|
|||
|
|||
class IrModelFields(orm.Model): |
|||
_inherit = 'ir.model.fields' |
|||
|
|||
def search( |
|||
self, cr, uid, args, offset=0, limit=0, order=None, context=None, |
|||
count=False): |
|||
model_domain = [] |
|||
for domain in args: |
|||
if domain[0] == 'model_id' and domain[2]\ |
|||
and type(domain[2]) != list: |
|||
model_domain += [( |
|||
'model_id', 'in', map(int, domain[2][1:-1].split(',')))] |
|||
else: |
|||
model_domain.append(domain) |
|||
return super(IrModelFields, self).search( |
|||
cr, uid, model_domain, offset=offset, limit=limit, order=order, |
|||
context=context, count=count) |
@ -0,0 +1,98 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<data> |
|||
|
|||
<record model="ir.ui.view" id="view_mass_object_form"> |
|||
<field name="name">mass.object.form</field> |
|||
<field name="model">mass.object</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Object"> |
|||
<sheet> |
|||
<div class="oe_title"> |
|||
<label for="name" class="oe_edit_only" /> |
|||
<h1> |
|||
<field name="name" required="1" /> |
|||
</h1> |
|||
<group> |
|||
<field name="model_id" required="1" |
|||
on_change="onchange_model_id(model_id)" /> |
|||
<field name="model_ids" invisible="1" /> |
|||
</group> |
|||
</div> |
|||
<div class="oe_right oe_button_box" name="buttons"> |
|||
<field name="ref_ir_act_window" |
|||
invisible="1" /> |
|||
<button class="oe_inline oe_stat_button" |
|||
name="create_action" type="object" |
|||
attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" |
|||
icon="fa-plus" |
|||
help="Display a button in the sidebar of related documents to open a composition wizard"> |
|||
<div>Add<br />Sidebar Button</div> |
|||
</button> |
|||
<button name="unlink_action" type="object" |
|||
class="oe_stat_button" icon="fa-minus" |
|||
attrs="{'invisible':[('ref_ir_act_window','=',False)]}" |
|||
help="Remove the contextual action to use this template on related documents" |
|||
widget="statinfo"> |
|||
<div>Remove<br />Sidebar Button</div> |
|||
</button> |
|||
</div> |
|||
|
|||
<notebook colspan="4"> |
|||
<page string="Fields"> |
|||
<field name="field_ids" colspan="4" |
|||
nolabel="1" |
|||
domain="[('ttype', 'not in', ['reference', 'function']), ('model_id', 'in', model_ids[0][2])]" /> |
|||
</page> |
|||
<page string="Advanced" attrs="{'invisible':[('ref_ir_act_window','=',False)]}"> |
|||
<group colspan="2" col="2"> |
|||
<field name="ref_ir_act_window" /> |
|||
<field name="ref_ir_value" /> |
|||
</group> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_mass_object_tree"> |
|||
<field name="name">mass.object.tree</field> |
|||
<field name="model">mass.object</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Object"> |
|||
<field name="name" /> |
|||
<field name="model_id" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.actions.act_window" id="action_mass_object_form"> |
|||
<field name="name">Mass Editing</field> |
|||
<field name="res_model">mass.object</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_id" ref="view_mass_object_tree" /> |
|||
</record> |
|||
|
|||
<record id="action_mass_object_form_view1" model="ir.actions.act_window.view"> |
|||
<field eval="10" name="sequence" /> |
|||
<field name="view_mode">tree</field> |
|||
<field name="view_id" ref="view_mass_object_tree" /> |
|||
<field name="act_window_id" ref="action_mass_object_form" /> |
|||
</record> |
|||
<record id="action_mass_object_form_view2" model="ir.actions.act_window.view"> |
|||
<field eval="20" name="sequence" /> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="view_mass_object_form" /> |
|||
<field name="act_window_id" ref="action_mass_object_form" /> |
|||
</record> |
|||
|
|||
<menuitem id="menu_mass_editing" name="Mass Editing" |
|||
parent="base.menu_administration" sequence="6" /> |
|||
|
|||
<menuitem id="menu_mass_object_view" action="action_mass_object_form" |
|||
parent="menu_mass_editing" /> |
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# This module uses OpenERP, Open Source Management Solution Framework. |
|||
# Copyright (C): |
|||
# 2012-Today Serpent Consulting Services (<http://www.serpentcs. |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation, either version 3 of the License, or |
|||
# (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
# |
|||
############################################################################## |
|||
|
|||
from . import mass_editing_wizard |
Write
Preview
Loading…
Cancel
Save
Reference in new issue