Commit b2bc4b12 authored by jssuzanne's avatar jssuzanne
Browse files

merge outgoing function with view

parent c39517cd33ff
#!/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/>.
# =
#==============================================================================
# -*- coding: utf-8 -*-
#flake8: noqa
import treatment_function
import process
# 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/>.
# =
#==============================================================================
# -*- coding: utf-8 -*-
{
'name': 'Publisher function',
'version': '0.2',
'category': 'Anybus/Addons/Outgoing treatment',
'version': '0.3',
'category': 'Anybus/Addons/Outgoing process',
'description': """
Fonction treatment for the publisher
Fonction process for the publisher
""",
'author': 'Jean-Sebastien SUZANNE',
'website': 'http://anybox.fr',
'images': [],
'depends': [
'base',
'anybus_publisher_core',
],
'init_xml': [
'anybus',
'anybus_publisher',
],
'update_xml': [
'security/ir.model.access.csv',
'view/process.xml',
],
'demo_xml': [
'demo/demo.xml',
......@@ -49,5 +26,4 @@ Fonction treatment for the publisher
'auto_install': False,
'license': 'AGPL-3',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<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="model_id" ref="base.model_res_partner"/>
<field name="function">result = {
......
......@@ -3,15 +3,15 @@
from osv import osv, fields
class AnybusPublisherTreatmentFonction(osv.Model):
_name = 'anybus.publisher.treatment.function'
_description = 'Treatment fonction for publisher'
_inherits = {'anybus.publisher.treatment': 'treatment_id'}
_inherit = 'abstract.anybus.treatment'
class AnybusPublisherprocessFonction(osv.Model):
_name = 'anybus.publisher.process.function'
_description = 'process fonction for publisher'
_inherits = {'anybus.publisher.process': 'process_id'}
_inherit = 'abstract.anybus.process'
_columns = {
'treatment_id': fields.many2one('anybus.publisher.treatment',
'treatment', required=True, ondelete="cascade"),
'process_id': fields.many2one('anybus.publisher.process', 'process',
required=True, ondelete="cascade"),
'function': fields.text('Function'),
}
......@@ -20,7 +20,7 @@ class AnybusPublisherTreatmentFonction(osv.Model):
# cr => current cursor
# uid => current user
# 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
# context => the context
# in result you return
......@@ -30,8 +30,9 @@ class AnybusPublisherTreatmentFonction(osv.Model):
}
def _process_treatment(self, cr, uid, id, model, model_ids, context=None):
function = self.read(cr, uid, id, ['function'], context=context).get('function', 'pass')
def _process_process(self, cr, uid, id, model, model_ids, context=None):
function = self.read(
cr, uid, id, ['function'], context=context).get('function', 'pass')
obj = self.pool.get(model)
globals_dict = {}
method_local = {
......@@ -43,7 +44,7 @@ class AnybusPublisherTreatmentFonction(osv.Model):
'model_ids': model_ids,
'context': context,
'result': {
'properties' : {},
'properties': {},
'message': None,
}
}
......
"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"?>
<openerp>
<data>
#==============================================================================
# =
# 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/.
# =
#==============================================================================
<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>
<record id="view_process_function_tree" model="ir.ui.view">
<field name="name">anybus.publisher.process.function.tree</field>
<field name="model">anybus.publisher.process.function</field>
<field name="priority" eval="8"/>
<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="model_id"/>
<field name="isdefault"/>
</tree>
</field>
</record>
<record id="view_treatment_function_form" model="ir.ui.view">
<field name="name">anybus.publisher.treatment.function.form</field>
<field name="model">anybus.publisher.treatment.function</field>
<record id="view_process_function_form" model="ir.ui.view">
<field name="name">anybus.publisher.process.function.form</field>
<field name="model">anybus.publisher.process.function</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Publisher treatment functions" version="7.0">
<form string="Publisher process functions" version="7.0">
<sheet>
<group colspan="4">
<field name="name"/>
......@@ -54,49 +30,53 @@
</form>
</field>
</record>
<record id="view_treatment_function_search" model="ir.ui.view">
<field name="name">anybus.publisher.treatment.function.search</field>
<field name="model">anybus.publisher.treatment.function</field>
<record id="view_process_function_search" model="ir.ui.view">
<field name="name">anybus.publisher.process.function.search</field>
<field name="model">anybus.publisher.process.function</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<search string="Publisher treatment functions">
<search string="Publisher process functions">
<field name="name"/>
<field name="model_id"/>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="act_open_treatment_function_view">
<field name="name">Publisher treatment functions</field>
<record model="ir.actions.act_window"
id="act_open_process_function_view">
<field name="name">Publisher process functions</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_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="context">{}</field>
</record>
<record model="ir.actions.act_window.view" id="act_open_treatment_function_view_form">
<field name="act_window_id" ref="act_open_treatment_function_view"/>
<record model="ir.actions.act_window.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="view_mode">form</field>
<field name="view_id" ref="view_treatment_function_form"/>
<field name="view_id" ref="view_process_function_form"/>
</record>
<record model="ir.actions.act_window.view" id="act_open_treatment_function_view_tree">
<field name="act_window_id" ref="act_open_treatment_function_view"/>
<record model="ir.actions.act_window.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="view_mode">tree</field>
<field name="view_id" ref="view_treatment_function_tree"/>
<field name="view_id" ref="view_process_function_tree"/>
</record>
<menuitem id="menu_treatment_function"
parent="anybus_publisher_core.menu_anybus_publisher_treatment_root"
<menuitem id="menu_process_function"
parent="anybus_publisher.menu_anybus_publisher_process_root"
sequence="20"
action="act_open_treatment_function_view"/>
<record model="ir.values" id="wizard_anybus_treatment_test">
action="act_open_process_function_view"/>
<record model="ir.values" id="wizard_anybus_process_test">
<field name="name">Test Function</field>
<field name="key">action</field>
<field name="key2">client_action_relate</field>
<field name="model">anybus.publisher.treatment.function</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('view_7_0_anybus_publisher.action_anybus_treatment_test_view'))" />
<field name="model">anybus.publisher.process.function</field>
<field name="value"
eval="'ir.actions.act_window,' + str(ref('anybus_publisher.action_anybus_process_test_view'))" />
</record>
</data>
</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