Jigar Amin - OpenERP has proposed merging lp:~openerp-dev/openobject-addons/trunk-automated_rules-crm_automated_rules-jam into lp:~openerp-dev/openobject-addons/trunk-automated_rules.
Requested reviews: Bhumika (OpenERP) (sbh-openerp) For more details, see: https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-automated_rules-crm_automated_rules-jam/+merge/52655 Hello, Changes with the Merge Proposal : + Backlog 3 : crm_automated_rules [JAM] - add two tabs + crm conditions + crm action This Tab should contains filter condition field on state. stage, stage, partner, partner category , regular expression, condition on time triggers and Target Field after condition filters Kindly Review this Thank You -- https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-automated_rules-crm_automated_rules-jam/+merge/52655 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-automated_rules.
=== added directory 'crm_action_rule' === added file 'crm_action_rule/__init__.py' --- crm_action_rule/__init__.py 1970-01-01 00:00:00 +0000 +++ crm_action_rule/__init__.py 2011-03-09 10:38:59 +0000 @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import crm_action_rule === added file 'crm_action_rule/__openerp__.py' --- crm_action_rule/__openerp__.py 1970-01-01 00:00:00 +0000 +++ crm_action_rule/__openerp__.py 2011-03-09 10:38:59 +0000 @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + + +{ + 'name' : 'CRM Action Rules', + 'version' : '1.0', + 'category' : 'Others', + 'description' : """ +This module allows to implement action rules using crm specific condidtions. +""", + 'author' : 'OpenERP SA', + 'website' : 'http://www.openerp.com', + 'depends' : ['base_action_rule', 'crm'], + 'init_xml' : [], + 'update_xml' : [ 'crm_action_rule_view.xml' ], + 'demo_xml' : [], + 'test' : [], + 'installable' : True, + 'active' : False, + 'certificate' : '', +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'crm_action_rule/crm_action_rule.py' --- crm_action_rule/crm_action_rule.py 1970-01-01 00:00:00 +0000 +++ crm_action_rule/crm_action_rule.py 2011-03-09 10:38:59 +0000 @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from osv import fields +from osv import osv +from crm import crm + +TIME_RANGE_SELECTION = [('minutes', 'Minutes'), ('hours', 'Hours'),('days', 'Days'), ('weeks', 'Weeks')] + +class base_action_rule(osv.osv): + + _inherit = 'base.action.rule' + + def _crm_state_get(self, cr, uid, context=None): + """Gets available states for crm""" + return crm.AVAILABLE_STATES + + _columns = { + 'crm_trg_section_id' : fields.many2one('crm.case.section', 'Sale Team'), + 'crm_trg_categ_id' : fields.many2one('crm.case.categ', 'Category'), + 'crm_trg_partner_id' : fields.many2one('res.partner', 'Partner'), + 'crm_trg_partner_catg_id' : fields.many2one('res.partner.category', 'Partner Category'), + 'crm_trg_state' : fields.selection(_crm_state_get, 'State', size=16), + 'crm_trg_btn_pressed': fields.selection(_crm_state_get, 'Button Pressed', size=16), + 'crm_trg_regex' : fields.char('Regular Expression on Case History', size=256), + 'crm_trg_responsible_id' : fields.many2one('res.users', 'Responsible'), + 'crm_trg_field_id' : fields.many2one('ir.model.fields', 'Trigger Date'), + 'crm_trg_date_range' : fields.integer('Delay after trigger date'), + 'crm_trg_date_range_type' : fields.selection(TIME_RANGE_SELECTION, 'Delay type'), + 'crm_to_responsible_id' : fields.many2one('res.users', 'Set Responsible To'), + 'crm_to_categ_id' : fields.many2one('crm.case.categ', 'Set Category To'), + 'crm_to_section_id' : fields.many2one('crm.case.section', 'Set Team To'), + 'crm_to_state' : fields.selection(_crm_state_get, 'Set State To', size=16), + } + +base_action_rule() === added file 'crm_action_rule/crm_action_rule_view.xml' --- crm_action_rule/crm_action_rule_view.xml 1970-01-01 00:00:00 +0000 +++ crm_action_rule/crm_action_rule_view.xml 2011-03-09 10:38:59 +0000 @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + <record id="view_crm_action_rule_from" model="ir.ui.view"> + <field name="name">base.action.rule.form.inherit</field> + <field name="model">base.action.rule</field> + <field name="inherit_id" ref="base_action_rule.view_base_action_rule_form"/> + <field name="type">form</field> + <field name="arch" type="xml"> + <xpath expr="/form/notebook/page[@string='Generic Rule']" position="after"> + <page string="CRM Condition"> + <group colspan="2" col="2"> + <separator string="Condition Case Fields" colspan="2" /> + <field name="crm_trg_section_id" widget="selection" /> + <field name="crm_trg_categ_id" widget="selection" /> + </group> + <group colspan="2" col="2"> + <separator string="Condition On Partner" colspan="2" /> + <field name="crm_trg_partner_id" /> + <field name="crm_trg_partner_catg_id" widget="selection" /> + </group> + <group colspan="2" col="2"> + <separator string="Condition on State" colspan="2" /> + <field name="crm_trg_state"/> + <field name="crm_trg_btn_pressed"/> + </group> + <group colspan="2" col="2"> + <separator colspan="4" string="Condition on Communication History"/> + <field name="crm_trg_regex"/> + </group> + <group col="2" colspan="2"> + <separator colspan="2" string="Conditions on Timing"/> + <field name="crm_trg_field_id" domain="[('model_id','=',model_id),('ttype','=','datetime')]"/> + <group col="3" colspan="2" attrs="{'invisible': [('crm_trg_field_id', '=', False)]}"> + <field name="crm_trg_date_range" string="Delay After Trigger Date"/> + <field name="crm_trg_date_range_type" nolabel="1"/> + </group> + </group> + <group colspan="2" col="2"> + <separator colspan="4" string="Condition Responsible"/> + <field name="crm_trg_responsible_id"/> + </group> + </page> + <page string="CRM Action"> + <separator string="Fields to Change" colspan="4" /> + <group colspan="2" col="2"> + <field name="crm_to_responsible_id" widget="selection" /> + <field name="crm_to_categ_id" widget="selection" /> + </group> + <group colspan="2" col="2"> + <field name="crm_to_section_id"/> + <field name="crm_to_state"/> + </group> + </page> + </xpath> + </field> + </record> + </data> +</openerp>
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-web Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-dev-web More help : https://help.launchpad.net/ListHelp

