Commit b2bc4b12 authored by jssuzanne's avatar jssuzanne
Browse files

merge outgoing function with view

parent c39517cd33ff
#!/usr/bin/env python # -*- coding: utf-8 -*-
#============================================================================== #flake8: noqa
# =
# anybus module for OpenERP, Use the lib anybus and broker rabbitmq to send and receive data
# Copyright (C) 2012 Anybox (<http://http://anybox.fr>)
# Jean-Sebastien SUZANNE <jssuzanne@anybox.fr>
# =
# This file is a part of anybus
# =
# anybus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 or later
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# =
# anybus 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 Affero General Public License v3 or later for more details.
# =
# You should have received a copy of the GNU Affero General Public License
# v3 or later along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# =
#==============================================================================
import treatment_function import process
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python # -*- coding: utf-8 -*-
#==============================================================================
# =
# anybus module for OpenERP, Use the lib anybus and broker rabbitmq to send and receive data
# Copyright (C) 2012 Anybox (<http://http://anybox.fr>)
# Jean-Sebastien SUZANNE <jssuzanne@anybox.fr>
# =
# This file is a part of anybus
# =
# anybus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 or later
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# =
# anybus 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 Affero General Public License v3 or later for more details.
# =
# You should have received a copy of the GNU Affero General Public License
# v3 or later along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# =
#==============================================================================
{ {
'name': 'Publisher function', 'name': 'Publisher function',
'version': '0.2', 'version': '0.3',
'category': 'Anybus/Addons/Outgoing treatment', 'category': 'Anybus/Addons/Outgoing process',
'description': """ 'description': """
Fonction treatment for the publisher Fonction process for the publisher
""", """,
'author': 'Jean-Sebastien SUZANNE', 'author': 'Jean-Sebastien SUZANNE',
'website': 'http://anybox.fr', 'website': 'http://anybox.fr',
'images': [], 'images': [],
'depends': [ 'depends': [
'base', 'base',
'anybus_publisher_core', 'anybus',
], 'anybus_publisher',
'init_xml': [
], ],
'update_xml': [ 'update_xml': [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'view/process.xml',
], ],
'demo_xml': [ 'demo_xml': [
'demo/demo.xml', 'demo/demo.xml',
...@@ -49,5 +26,4 @@ Fonction treatment for the publisher ...@@ -49,5 +26,4 @@ Fonction treatment for the publisher
'auto_install': False, 'auto_install': False,
'license': 'AGPL-3', 'license': 'AGPL-3',
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="anybus_publisher_treatment_function" model="anybus.publisher.treatment.function"> <record id="anybus_publisher_process_function"
model="anybus.publisher.process.function">
<field name="name">Function 1</field> <field name="name">Function 1</field>
<field name="model_id" ref="base.model_res_partner"/> <field name="model_id" ref="base.model_res_partner"/>
<field name="function">result = { <field name="function">result = {
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
from osv import osv, fields from osv import osv, fields
class AnybusPublisherTreatmentFonction(osv.Model): class AnybusPublisherprocessFonction(osv.Model):
_name = 'anybus.publisher.treatment.function' _name = 'anybus.publisher.process.function'
_description = 'Treatment fonction for publisher' _description = 'process fonction for publisher'
_inherits = {'anybus.publisher.treatment': 'treatment_id'} _inherits = {'anybus.publisher.process': 'process_id'}
_inherit = 'abstract.anybus.treatment' _inherit = 'abstract.anybus.process'
_columns = { _columns = {
'treatment_id': fields.many2one('anybus.publisher.treatment', 'process_id': fields.many2one('anybus.publisher.process', 'process',
'treatment', required=True, ondelete="cascade"), required=True, ondelete="cascade"),
'function': fields.text('Function'), 'function': fields.text('Function'),
} }
...@@ -20,7 +20,7 @@ class AnybusPublisherTreatmentFonction(osv.Model): ...@@ -20,7 +20,7 @@ class AnybusPublisherTreatmentFonction(osv.Model):
# cr => current cursor # cr => current cursor
# uid => current user # uid => current user
# obj => regisry to the model # obj => regisry to the model
# model_ids => id of the treatment # model_ids => id of the process
# models => browse on the model with model_id # models => browse on the model with model_id
# context => the context # context => the context
# in result you return # in result you return
...@@ -30,8 +30,9 @@ class AnybusPublisherTreatmentFonction(osv.Model): ...@@ -30,8 +30,9 @@ class AnybusPublisherTreatmentFonction(osv.Model):
} }
def _process_treatment(self, cr, uid, id, model, model_ids, context=None): def _process_process(self, cr, uid, id, model, model_ids, context=None):
function = self.read(cr, uid, id, ['function'], context=context).get('function', 'pass') function = self.read(
cr, uid, id, ['function'], context=context).get('function', 'pass')
obj = self.pool.get(model) obj = self.pool.get(model)
globals_dict = {} globals_dict = {}
method_local = { method_local = {
...@@ -43,7 +44,7 @@ class AnybusPublisherTreatmentFonction(osv.Model): ...@@ -43,7 +44,7 @@ class AnybusPublisherTreatmentFonction(osv.Model):
'model_ids': model_ids, 'model_ids': model_ids,
'context': context, 'context': context,
'result': { 'result': {
'properties' : {}, 'properties': {},
'message': None, 'message': None,
} }
} }
......
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"acc_anybus_publisher_treatment_function","Publisher function treatment","model_anybus_publisher_treatment_function","",1,1,1,1 "acc_anybus_publisher_process_function","Publisher function process","model_anybus_publisher_process_function","",1,1,1,1
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<openerp> <openerp>
<data> <data>
#============================================================================== <record id="view_process_function_tree" model="ir.ui.view">
# = <field name="name">anybus.publisher.process.function.tree</field>
# anybus module for OpenERP, Use the lib anybus and broker rabbitmq to send <field name="model">anybus.publisher.process.function</field>
# and receive data
# Copyright (C) 2012 Anybox (http://http://anybox.fr)
# Jean-Sebastien SUZANNE (jssuzanne@anybox.fr)
# =
# This file is a part of anybus
# =
# anybus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 or later
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# =
# anybus 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 Affero General Public License v3 or later for more details.
# =
# You should have received a copy of the GNU Affero General Public License
# v3 or later along with this program.
# If not, see http://www.gnu.org/licenses/.
# =
#==============================================================================
<record id="view_treatment_function_tree" model="ir.ui.view">
<field name="name">anybus.publisher.treatment.function.tree</field>
<field name="model">anybus.publisher.treatment.function</field>
<field name="priority" eval="8"/> <field name="priority" eval="8"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Publisher treatment functions" fonts="bold:isdefault==True"> <tree string="Publisher process functions"
fonts="bold:isdefault==True">
<field name="name"/> <field name="name"/>
<field name="model_id"/> <field name="model_id"/>
<field name="isdefault"/> <field name="isdefault"/>
</tree> </tree>
</field> </field>
</record> </record>
<record id="view_treatment_function_form" model="ir.ui.view"> <record id="view_process_function_form" model="ir.ui.view">
<field name="name">anybus.publisher.treatment.function.form</field> <field name="name">anybus.publisher.process.function.form</field>
<field name="model">anybus.publisher.treatment.function</field> <field name="model">anybus.publisher.process.function</field>
<field name="priority" eval="8"/> <field name="priority" eval="8"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Publisher treatment functions" version="7.0"> <form string="Publisher process functions" version="7.0">
<sheet> <sheet>
<group colspan="4"> <group colspan="4">
<field name="name"/> <field name="name"/>
...@@ -54,49 +30,53 @@ ...@@ -54,49 +30,53 @@
</form> </form>
</field> </field>
</record> </record>
<record id="view_treatment_function_search" model="ir.ui.view"> <record id="view_process_function_search" model="ir.ui.view">
<field name="name">anybus.publisher.treatment.function.search</field> <field name="name">anybus.publisher.process.function.search</field>
<field name="model">anybus.publisher.treatment.function</field> <field name="model">anybus.publisher.process.function</field>
<field name="priority" eval="8"/> <field name="priority" eval="8"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Publisher treatment functions"> <search string="Publisher process functions">
<field name="name"/> <field name="name"/>
<field name="model_id"/> <field name="model_id"/>
</search> </search>
</field> </field>
</record> </record>
<record model="ir.actions.act_window" id="act_open_treatment_function_view"> <record model="ir.actions.act_window"
<field name="name">Publisher treatment functions</field> id="act_open_process_function_view">
<field name="name">Publisher process functions</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">anybus.publisher.treatment.function</field> <field name="res_model">anybus.publisher.process.function</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_treatment_function_search"/> <field name="search_view_id" ref="view_process_function_search"/>
<field name="domain">[]</field> <field name="domain">[]</field>
<field name="context">{}</field> <field name="context">{}</field>
</record> </record>
<record model="ir.actions.act_window.view" id="act_open_treatment_function_view_form"> <record model="ir.actions.act_window.view"
<field name="act_window_id" ref="act_open_treatment_function_view"/> id="act_open_process_function_view_form">
<field name="act_window_id" ref="act_open_process_function_view"/>
<field name="sequence" eval="20"/> <field name="sequence" eval="20"/>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="view_id" ref="view_treatment_function_form"/> <field name="view_id" ref="view_process_function_form"/>
</record> </record>
<record model="ir.actions.act_window.view" id="act_open_treatment_function_view_tree"> <record model="ir.actions.act_window.view"
<field name="act_window_id" ref="act_open_treatment_function_view"/> id="act_open_process_function_view_tree">
<field name="act_window_id" ref="act_open_process_function_view"/>
<field name="sequence" eval="10"/> <field name="sequence" eval="10"/>
<field name="view_mode">tree</field> <field name="view_mode">tree</field>
<field name="view_id" ref="view_treatment_function_tree"/> <field name="view_id" ref="view_process_function_tree"/>
</record> </record>
<menuitem id="menu_treatment_function" <menuitem id="menu_process_function"
parent="anybus_publisher_core.menu_anybus_publisher_treatment_root" parent="anybus_publisher.menu_anybus_publisher_process_root"
sequence="20" sequence="20"
action="act_open_treatment_function_view"/> action="act_open_process_function_view"/>
<record model="ir.values" id="wizard_anybus_treatment_test"> <record model="ir.values" id="wizard_anybus_process_test">
<field name="name">Test Function</field> <field name="name">Test Function</field>
<field name="key">action</field> <field name="key">action</field>
<field name="key2">client_action_relate</field> <field name="key2">client_action_relate</field>
<field name="model">anybus.publisher.treatment.function</field> <field name="model">anybus.publisher.process.function</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('view_7_0_anybus_publisher.action_anybus_treatment_test_view'))" /> <field name="value"
eval="'ir.actions.act_window,' + str(ref('anybus_publisher.action_anybus_process_test_view'))" />
</record> </record>
</data> </data>
</openerp> </openerp>
#!/usr/bin/env python
#==============================================================================
# =
# anybus module for OpenERP, Use the lib anybus and broker rabbitmq to send and receive data
# Copyright (C) 2012 Anybox (<http://http://anybox.fr>)
# Jean-Sebastien SUZANNE <jssuzanne@anybox.fr>
# =
# This file is a part of anybus
# =
# anybus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 or later
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# =
# anybus 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 Affero General Public License v3 or later for more details.
# =
# You should have received a copy of the GNU Affero General Public License
# v3 or later along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# =
#==============================================================================
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python
#==============================================================================
# =
# anybus module for OpenERP, Use the lib anybus and broker rabbitmq to send and receive data
# Copyright (C) 2012 Anybox (<http://http://anybox.fr>)
# Jean-Sebastien SUZANNE <jssuzanne@anybox.fr>
# =
# This file is a part of anybus
# =
# anybus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 or later
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# =
# anybus 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 Affero General Public License v3 or later for more details.
# =
# You should have received a copy of the GNU Affero General Public License
# v3 or later along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# =
#==============================================================================
{
'name': 'View 7.0 for publisher function',
'version': '0.2',
'category': 'Anybus/Views/7.0',
'description': """
View 7.0 for publisher function
""",
'author': 'Jean-Sebastien SUZANNE',
'website': 'http://anybox.fr',
'images': [],
'depends': [
'base',
'anybus_outgoing_function',
'view_7_0_anybus_publisher',
],
'init_xml': [
],
'update_xml': [
'view/treatment_function.xml',
],
'demo_xml': [
],
'installable': True,
'application': False,
'auto_install': False,
'license': 'AGPL-3',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account
#
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment