[MERGE] merge with dev addons3 branch

bzr revid: psi@tinyerp.co.in-20100611131956-5x8igz6srlwp2upn
This commit is contained in:
psi (Open ERP) 2010-06-11 18:49:56 +05:30
commit a15b68ac2e
69 changed files with 684 additions and 542 deletions

View File

@ -577,13 +577,16 @@ class account_move_line(osv.osv):
# writeoff; entry generated for the difference between the lines
#
def reconcile_partial(self, cr, uid, ids, type='auto', context={}):
def reconcile_partial(self, cr, uid, ids, type='auto', context=None):
merges = []
unmerge = []
total = 0.0
merges_rec = []
company_list = []
if context is None:
context = {}
for line in self.browse(cr, uid, ids, context=context):
if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
@ -613,13 +616,15 @@ class account_move_line(osv.osv):
self.pool.get('account.move.reconcile').reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context)
return True
def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}):
def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None):
lines = self.browse(cr, uid, ids, context=context)
unrec_lines = filter(lambda x: not x['reconcile_id'], lines)
credit = debit = 0.0
currency = 0.0
account_id = False
partner_id = False
if context is None:
context = {}
company_list = []
for line in self.browse(cr, uid, ids, context=context):

View File

@ -312,23 +312,23 @@
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
<menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
<record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
<field name="name">Check Register</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
</record> -->
<!-- <menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_bank_and_cash"/>-->
<record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
<field name="name">Checks Register</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
</record> -->
<!-- <menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_bank_and_cash"/>-->
<!-- <record id="ir_open_account_journal_analytic" model="ir.values">-->
<!-- <field eval="'tree_but_open'" name="key2"/>-->
<!-- <field eval="'account.analytic.journal'" name="model"/>-->

View File

@ -1,4 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_product_product_account_user","product.product.account.user","product.model_product_product","group_account_user",1,0,0,0
"access_account_payment_term","account.payment.term","model_account_payment_term","account.group_account_user",1,0,0,0
"access_account_payment_term_line","account.payment.term.line","model_account_payment_term_line","account.group_account_user",1,0,0,0
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_product_product_account_user product.product.account.user product.model_product_product group_account_user 1 0 0 0
3 access_account_payment_term account.payment.term model_account_payment_term account.group_account_user 1 0 0 0
4 access_account_payment_term_line account.payment.term.line model_account_payment_term_line account.group_account_user 1 0 0 0
5 access_account_account_type account.account.type model_account_account_type account.group_account_user 1 0 0 0

View File

@ -56,11 +56,11 @@ class account_move_line_reconcile(osv.osv_memory):
if 'trans_nbr' in fields:
res.update({'trans_nbr':data['trans_nbr']})
if 'credit' in fields:
res.update({'trans_nbr':data['credit']})
res.update({'credit':data['credit']})
if 'debit' in fields:
res.update({'trans_nbr':data['debit']})
res.update({'debit':data['debit']})
if 'writeoff' in fields:
res.update({'trans_nbr':data['writeoff']})
res.update({'writeoff':data['writeoff']})
return res
def partial_check(self, cr, uid, ids, context=None):

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -23,11 +23,10 @@
# Init Sales
#----------------------------------------------------------
import payment
import account_payment
import wizard
import account_move_line
import account_invoice
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,11 +41,11 @@
'wizard/account_payment_pay_view.xml',
'wizard/account_payment_populate_statement_view.xml',
'wizard/account_payment_create_order_view.xml',
'payment_view.xml',
'payment_workflow.xml',
'payment_sequence.xml',
'account_payment_view.xml',
'account_payment_workflow.xml',
'account_payment_sequence.xml',
'account_invoice_view.xml',
'payment_report.xml',
'account_payment_report.xml',
],
'demo_xml': [],
'test': ['test/account_payment.yml'],

View File

@ -18,29 +18,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields
from osv import osv
import time
import netsvc
import pooler
from osv import osv, fields
import netsvc
class payment_type(osv.osv):
_name= 'payment.type'
_description= 'Payment Type'
_columns= {
'name': fields.char('Name', size=64, required=True,help='Payment Type'),
'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'),
'name': fields.char('Name', size=64, required=True, help='Payment Type'),
'code': fields.char('Code', size=64, required=True, help='Specifies the Code for Payment Type'),
'suitable_bank_types': fields.many2many('res.partner.bank.type',
'bank_type_payment_type_rel',
'pay_type_id','bank_type_id',
'Suitable bank types')
}
}
payment_type()
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment Mode'
@ -66,16 +62,14 @@ class payment_mode(osv.osv):
where pm.id = %s """, [payment_code])
return [x[0] for x in cr.fetchall()]
payment_mode()
class payment_order(osv.osv):
_name = 'payment.order'
_description = 'Payment Order'
_rec_name = 'reference'
def get_wizard(self,type):
def get_wizard(self, type):
logger = netsvc.Logger()
logger.notifyChannel("warning", netsvc.LOG_WARNING,
"No wizard found for the payment type '%s'." % type)
@ -146,7 +140,6 @@ class payment_order(osv.osv):
payment_order()
class payment_line(osv.osv):
_name = 'payment.line'
_description = 'Payment Line'

View File

@ -110,8 +110,7 @@ class payment_order_create(osv.osv_memory):
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': ('Entrie Lines'),
return {'name': ('Entrie Lines'),
'context': context,
'view_type': 'form',
'view_mode': 'form',

View File

@ -18,16 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
class account_payment_make_payment(osv.osv_memory):
_name = 'account.payment.make.payment'
_description = 'Account make payment'
_columns = {
}
def launch_wizard(self, cr, uid, ids, context):
def launch_wizard(self, cr, uid, ids, context=None):
"""
Search for a wizard to launch according to the type.
If type is manual. just confirm the order.
@ -35,8 +32,8 @@ class account_payment_make_payment(osv.osv_memory):
obj_payment_order = self.pool.get('payment.order')
obj_model = self.pool.get('ir.model.data')
obj_act = self.pool.get('ir.actions.act_window')
order= obj_payment_order.browse(cr,uid,context['active_id'],context)
t= order.mode and order.mode.type.code or 'manual'
order= obj_payment_order.browse(cr, uid, context['active_id'], context)
t = order.mode and order.mode.type.code or 'manual'
if t == 'manual' :
obj_payment_order.set_done(cr,uid,context['active_id'],context)
return {}
@ -49,12 +46,10 @@ class account_payment_make_payment(osv.osv_memory):
module, wizard= gw
result = mod_obj._get_id(cr, uid, module, wizard)
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
return act_obj.read(cr, uid, [id])[0]
#result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
return result
account_payment_make_payment()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,7 +8,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Make Payment">
<group height="80" width="320">
<group height="100" width="320">
<separator string="Are you sure you want to make payment?"/>
<newline/>
<group colspan="2" col="4">

View File

@ -1,2 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_base_action_rule","base.action.rule","model_base_action_rule",,1,1,1,1
"access_base_action_rule","base.action.rule","model_base_action_rule",,1,0,0,0
"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_base_action_rule base.action.rule model_base_action_rule 1 1 0 1 0 1 0
3 access_base_action_rule_config base.action.rule config model_base_action_rule base.group_system 1 0 0 0

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<!-- Attendee form view-->
<!-- Attendee form view-->
<record id="base_calendar_attendee_form_view" model="ir.ui.view">
<field name="name">calendar.attendee.form</field>
@ -10,12 +10,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Invitation details">
<group col="6" colspan="4">
<field name="email" string="Invitation To"/>
<field name="cutype" string="Invitation type" />
<group col="6" colspan="4">
<field name="email" string="Invitation To"/>
<field name="cutype" string="Invitation type" />
<field name="rsvp" />
<field name="role" string="Role" />
<field name="sent_by_uid" string="Invitation From" />
<field name="sent_by_uid" string="Invitation From" />
</group>
<notebook colspan="4">
<page string="Invitation">
@ -68,7 +68,7 @@
</field>
</record>
<!-- Attendee tree view-->
<!-- Attendee tree view-->
<record id="base_calendar_attendee_tree_view" model="ir.ui.view">
<field name="name">calendar.attendee.tree</field>
@ -87,7 +87,7 @@
</field>
</record>
<!-- Attendee search view-->
<!-- Attendee search view-->
<record id="base_calendar_attendee_search_view" model="ir.ui.view">
<field name="name">calendar.attendee.search</field>
@ -108,47 +108,47 @@
<field name="cutype" string="Invitation type" select="1"/>
<field name="event_date" select="1"/>
<newline/>
<group expand="0" string="Group By...">
<filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type"
domain="[]" context="{'group_by':'cutype'}" />
<filter string="Role" icon="terp-gtk-select-all"
domain="[]" context="{'group_by':'role'}" />
<filter string="Required Reply" icon="terp-mail-replied"
domain="[]" context="{'group_by':'rsvp'}" />
<separator orientation="vertical" />
<filter string="User" icon="terp-personal" domain="[]"
context="{'group_by':'user_id'}" />
<filter string="Contact" icon="terp-gtk-jump-to-ltr" domain="[]"
context="{'group_by':'partner_address_id'}" />
<filter string="State" icon="terp-stock_effects-object-colorize" help="Invitation Type"
<group expand="0" string="Group By...">
<filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type"
domain="[]" context="{'group_by':'cutype'}" />
<filter string="Role" icon="terp-gtk-select-all"
domain="[]" context="{'group_by':'role'}" />
<filter string="Required Reply" icon="terp-mail-replied"
domain="[]" context="{'group_by':'rsvp'}" />
<separator orientation="vertical" />
<filter string="User" icon="terp-personal" domain="[]"
context="{'group_by':'user_id'}" />
<filter string="Contact" icon="terp-gtk-jump-to-ltr" domain="[]"
context="{'group_by':'partner_address_id'}" />
<filter string="State" icon="terp-stock_effects-object-colorize" help="Invitation Type"
domain="[]" context="{'group_by':' state'}" />
</group>
</group>
</search>
</field>
</record>
<record id="action_view_attendee_form" model="ir.actions.act_window">
<field name="name">Event Invitations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.attendee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
<field name="context">{'default_sent_by_uid': uid}</field>
</record>
<record id="action_view_attendee_form" model="ir.actions.act_window">
<field name="name">Event Invitations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.attendee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
<field name="context">{'default_sent_by_uid': uid}</field>
</record>
<!-- Calenadar's menu -->
<!-- Calenadar's menu -->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_address_book" sequence="15" />
parent="base.menu_base_config" sequence="15" />
<!-- Invitation menu -->
<!-- Invitation menu -->
<menuitem id="menu_attendee_invitations"
<menuitem id="menu_attendee_invitations"
name="Event Invitations" parent="base.menu_calendar_configuration"
sequence="10" action="action_view_attendee_form" />
<!-- ALARM FORM VIEW-->
<!-- ALARM FORM VIEW-->
<record id="res_alarm_form_view" model="ir.ui.view">
<record id="res_alarm_form_view" model="ir.ui.view">
<field name="name">res.alarm.form</field>
<field name="model">res.alarm</field>
<field name="type">form</field>
@ -165,7 +165,7 @@
</field>
</record>
<!-- ALARM TREE VIEW-->
<!-- ALARM TREE VIEW-->
<record id="res_alarm_tree_view" model="ir.ui.view">
<field name="name">res.alarm.tree</field>
@ -189,198 +189,199 @@
<field name="view_mode">tree,form</field>
</record>
<!-- Menu for Alarms-->
<!-- Menu for Alarms-->
<menuitem id="menu_crm_meeting_avail_alarm"
groups="base.group_extended"
action="base_calendar.action_res_alarm_view"
parent="base.menu_calendar_configuration" />
<!-- Event Form View-->
<record model="ir.ui.view" id="event_form_view">
<field name="name">Event Form</field>
<field name="model">calendar.event</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Events">
<group col="6" colspan="4">
<field name="name" select="1" string="Summary"
colspan="4" />
<field name="allday" colspan="2" on_change="onchange_allday(allday)" />
<newline/>
<field name="date" string="Start Date" required="1" select="1"
on_change="onchange_dates(date,duration,False,allday)" />
<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False,allday)" attrs="{'invisible': [('allday', '=', True)]}"/>
<field name="date_deadline" string="End Date" required="1"
on_change="onchange_dates(date,False,date_deadline)" />
<field name="location" />
<field name="alarm_id" string="Reminder"
widget="selection" />
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Meeting"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_event" icon="gtk-edit"
type="object" />
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Select data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
</group>
</group>
</group>
<notebook colspan="4">
<page string="Event">
<group col="6" colspan="4">
<separator colspan="6" string="Visibility"/>
<field name="user_id" string="Responsible User" />
<field name="show_as" string="Show time as"/>
<field name="class" string="Privacy"/>
<field name="recurrent_id" invisible="1" />
<field name="recurrent_uid" invisible="1" />
</group>
<separator string="Description" colspan="4" />
<field name="description" nolabel="1" colspan="4" />
<separator colspan="4"/>
</page>
<page string="Invitation Detail">
<button string="Invite People"
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
context="{'model' : 'calendar.event', 'attendee_field':'attendee_ids'}" colspan="2"/>
<field name="attendee_ids" colspan="4"
nolabel="1" widget="one2many" mode="tree,form">
<tree string="Invitation details" editable="top">
<field name="email" />
<field name="role" width="200" select="1" />
<field name="state" />
</tree>
<form string="Invitation details">
<notebook colspan="4">
<page string="Details">
<field name="email" />
<field name="rsvp" select="1" />
<field name="cutype" select="1" />
<field name="role" select="1" />
<separator colspan="4" string="" />
<group col="6" colspan="4">
<field name="state" select="2" />
<button name="do_tentative"
states="needs-action,declined,accepted"
string="Uncertain"
type="object"
icon="terp-crm" />
<button name="do_accept"
string="Accept"
states="needs-action,tentative,declined"
type="object"
icon="gtk-apply" />
<button name="do_decline"
string="Decline"
states="needs-action,tentative,accepted"
type="object"
icon="gtk-cancel" />
<button
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
string="Delegate"
type="action"
icon="gtk-sort-descending"
states="needs-action,tentative,declined,accepted"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
</group>
</page>
</notebook>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="event_form_view">
<field name="name">Event Form</field>
<field name="model">calendar.event</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Events">
<group col="6" colspan="4">
<field name="name" select="1" string="Summary"
colspan="4" />
<field name="allday" colspan="2" on_change="onchange_allday(allday)" />
<newline/>
<field name="date" string="Start Date" required="1" select="1"
on_change="onchange_dates(date,duration,False,allday)" />
<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False,allday)" attrs="{'invisible': [('allday', '=', True)]}"/>
<field name="date_deadline" string="End Date" required="1"
on_change="onchange_dates(date,False,date_deadline)" />
<field name="location" />
<field name="alarm_id" string="Reminder"
widget="selection" />
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Meeting"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_event" icon="gtk-edit"
type="object" />
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Select data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
</group>
</group>
</group>
<notebook colspan="4">
<page string="Event">
<group col="6" colspan="4">
<separator colspan="6" string="Visibility"/>
<field name="user_id" string="Responsible User" />
<field name="show_as" string="Show time as"/>
<field name="class" string="Privacy"/>
<field name="recurrent_id" invisible="1" />
<field name="recurrent_uid" invisible="1" />
</group>
<separator string="Description" colspan="4" />
<field name="description" nolabel="1" colspan="4" />
<separator colspan="4"/>
</page>
<page string="Invitation Detail">
<button string="Invite People"
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
context="{'model' : 'calendar.event', 'attendee_field':'attendee_ids'}" colspan="2"/>
<field name="attendee_ids" colspan="4"
nolabel="1" widget="one2many" mode="tree,form">
<tree string="Invitation details" editable="top">
<field name="email" />
<field name="role" width="200" select="1" />
<field name="state" />
</tree>
<form string="Invitation details">
<notebook colspan="4">
<page string="Details">
<field name="email" />
<field name="rsvp" select="1" />
<field name="cutype" select="1" />
<field name="role" select="1" />
<separator colspan="4" string="" />
<group col="6" colspan="4">
<field name="state" select="2" />
<button name="do_tentative"
states="needs-action,declined,accepted"
string="Uncertain"
type="object"
icon="terp-crm" />
<button name="do_accept"
string="Accept"
states="needs-action,tentative,declined"
type="object"
icon="gtk-apply" />
<button name="do_decline"
string="Decline"
states="needs-action,tentative,accepted"
type="object"
icon="gtk-cancel" />
<button
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
string="Delegate"
type="action"
icon="gtk-sort-descending"
states="needs-action,tentative,declined,accepted"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
</group>
</page>
</notebook>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
<!-- Event Tree View -->
<!-- Event Tree View -->
<record model="ir.ui.view" id="event_tree_view">
<field name="name">Event Tree</field>
<field name="model">calendar.event</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Events">
<field name="name" string="Subject" />
<field name="date" string="Meeting Date" />
<field name="location" />
<field name="show_as" />
<field name="class" string="Privacy" />
<field name="user_id" invisible="1"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="event_tree_view">
<field name="name">Event Tree</field>
<field name="model">calendar.event</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Events">
<field name="name" string="Subject" />
<field name="date" string="Meeting Date" />
<field name="location" />
<field name="show_as" />
<field name="class" string="Privacy" />
<field name="user_id" invisible="1"/>
</tree>
</field>
</record>
<!-- Event Calendar View -->
<!-- Event Calendar View -->
<record model="ir.ui.view" id="event_calendar_view">
<field name="name">Events Calendar</field>
<field name="model">calendar.event</field>
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Events" date_start="date" color="show_as" date_delay="duration">
<field name="name"/>
<field name="class"/>
<field name="show_as"/>
</calendar>
</field>
</record>
<record model="ir.ui.view" id="event_calendar_view">
<field name="name">Events Calendar</field>
<field name="model">calendar.event</field>
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Events" date_start="date" color="show_as" date_delay="duration">
<field name="name"/>
<field name="class"/>
<field name="show_as"/>
</calendar>
</field>
</record>
<!-- Event Search View-->
<!-- Event Search View-->
<record id="view_calendar_event_filter" model="ir.ui.view">
<field name="name">Calendar Events Search</field>
<field name="model">calendar.event</field>
<field name="type">search</field>
<field name="arch" type="xml">
<record id="view_calendar_event_filter" model="ir.ui.view">
<field name="name">Calendar Events Search</field>
<field name="model">calendar.event</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Events">
<group col="12" colspan="4">
<filter icon="terp-go-today" string="My Events"
@ -396,36 +397,36 @@
<field name="class" select="1"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Date" icon="terp-go-month"
domain="[]" context="{'group_by':'date'}" />
<filter string="Availability" icon="terp-camera_test"
domain="[]" context="{'group_by':'show_as'}" />
<filter string="Privacy" icon="terp-locked"
domain="[]" context="{'group_by':'class'}" />
<separator orientation="vertical" />
<filter string="Responsible" icon="terp-personal" domain="[]"
context="{'group_by':'user_id'}" />
</group>
<group expand="0" string="Group By...">
<filter string="Date" icon="terp-go-month"
domain="[]" context="{'group_by':'date'}" />
<filter string="Availability" icon="terp-camera_test"
domain="[]" context="{'group_by':'show_as'}" />
<filter string="Privacy" icon="terp-locked"
domain="[]" context="{'group_by':'class'}" />
<separator orientation="vertical" />
<filter string="Responsible" icon="terp-personal" domain="[]"
context="{'group_by':'user_id'}" />
</group>
</search>
</field>
</record>
</record>
<!-- Event action -->
<!-- Event action -->
<record id="action_view_event" model="ir.actions.act_window">
<field name="name">Events</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="search_view_id" ref="view_calendar_event_filter"/>
</record>
<record id="action_view_event" model="ir.actions.act_window">
<field name="name">Events</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="search_view_id" ref="view_calendar_event_filter"/>
</record>
<!-- Event menu -->
<!-- Event menu -->
<menuitem id="menu_events"
<menuitem id="menu_events"
name="Events" parent="base.menu_calendar_configuration"
sequence="5" action="action_view_event" />

16
addons/base_calendar/security/ir.model.access.csv Executable file → Normal file
View File

@ -1,9 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_calendar_attendee","calendar.attendee","model_calendar_attendee",,1,1,1,1
"access_calendar_alarm","calendar.alarm","model_calendar_alarm",,1,1,1,1
"access_res_alarm","res.alarm","model_res_alarm",,1,1,1,1
"access_calendar_event_all","calendar.event","model_calendar_event",,1,1,1,1
"access_calendar_todo","calendar.todo","model_calendar_todo",,1,1,1,1
"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",,1,1,1,1
"access_calendar_event_edit_all","calendar_event_edit_all","model_calendar_event_edit_all",,1,1,1,1
"access_base_calendar_set_exrule","base.calendar.set.exrule","model_base_calendar_set_exrule",,1,1,1,1
"access_calendar_attendee","calendar.attendee","model_calendar_attendee",base.group_user,1,1,1,1
"access_calendar_alarm","calendar.alarm","model_calendar_alarm",base.group_user,1,1,1,1
"access_res_alarm","res.alarm","model_res_alarm",base.group_user,1,1,1,1
"access_calendar_event_all","calendar.event","model_calendar_event",base.group_user,1,1,1,1
"access_calendar_todo","calendar.todo","model_calendar_todo",base.group_user,1,1,1,1
"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",base.group_user,1,1,1,1
"access_calendar_event_edit_all","calendar_event_edit_all","model_calendar_event_edit_all",base.group_user,1,1,1,1
"access_base_calendar_set_exrule","base.calendar.set.exrule","model_base_calendar_set_exrule",base.group_user,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_calendar_attendee calendar.attendee model_calendar_attendee base.group_user 1 1 1 1
3 access_calendar_alarm calendar.alarm model_calendar_alarm base.group_user 1 1 1 1
4 access_res_alarm res.alarm model_res_alarm base.group_user 1 1 1 1
5 access_calendar_event_all calendar.event model_calendar_event base.group_user 1 1 1 1
6 access_calendar_todo calendar.todo model_calendar_todo base.group_user 1 1 1 1
7 access_base_calendar_invite_attendee base_calendar.invite.attendee model_base_calendar_invite_attendee base.group_user 1 1 1 1
8 access_calendar_event_edit_all calendar_event_edit_all model_calendar_event_edit_all base.group_user 1 1 1 1
9 access_base_calendar_set_exrule base.calendar.set.exrule model_base_calendar_set_exrule base.group_user 1 1 1 1

View File

@ -18,10 +18,10 @@
If you don't think you need any of these right now, you can easily install them later on.</attribute>
</xpath>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
<attribute name='rowspan'>15</attribute>
</xpath>
<separator string="title" position="attributes">
<attribute name='string'></attribute>
<attribute name='rowspan'>15</attribute>
</xpath>
<separator string="title" position="attributes">
<attribute name="string">Install Generic Modules</attribute>
</separator>
<group colspan="8">
@ -29,7 +29,7 @@ If you don't think you need any of these right now, you can easily install them
<field name="project" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="knowledge" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)" groups="base.group_extended"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)" groups="base.group_extended"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<separator string="Install Specific Business Modules" colspan="4"/>
@ -60,11 +60,11 @@ If you don't think you need any of these right now, you can easily install them
<field name="name">base_setup_installer_action_replace</field>
<field name="type">tree</field>
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
<field name="arch" type="xml">
<xpath expr="//button[@string='Launch']" position="replace">
<button name="%(action_base_setup_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
</xpath>
</field>
</record>
<field name="arch" type="xml">
<xpath expr="//button[@string='Launch']" position="replace">
<button name="%(action_base_setup_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -66,7 +66,7 @@
states="open,pending" type="object"
icon="gtk-go-forward" />
</group>
<field name="type" readonly="1"/>
<field name="type" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Lead">

View File

@ -52,8 +52,9 @@ class crm_opportunity(osv.osv):
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'phone': fields.char("Phone", size=64),
'date_deadline': fields.date('Expected Closing'),
'date_action': fields.date('Next Action'),
}
'date_action': fields.date('Next Action Date'),
'title_action': fields.char('Next Action', size=64),
}
def case_close(self, cr, uid, ids, *args):
"""Overrides close for crm_case for setting probability and close date
@param self: The object pointer

View File

@ -81,6 +81,7 @@
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
<newline/>
<field name="date_action"/>
<field name="title_action"/>
<field name="priority" string="Priority"/>
<field name="type" readonly="1"/>
</group>

View File

@ -2,22 +2,22 @@
<openerp>
<data>
<menuitem id="base.menu_crm_config_sales" name="Sales"
parent="base.menu_base_config" sequence="1" groups="base.group_extended"/>
parent="base.menu_base_config" sequence="1"/>
<menuitem id="menu_crm_config_lead" name="Lead"
parent="base.menu_crm_config_sales" sequence="0" groups="base.group_extended"/>
<menuitem id="menu_crm_config_opportunity" name="Opportunity"
parent="base.menu_crm_config_sales" sequence="1" groups="base.group_extended"/>
parent="base.menu_crm_config_sales" sequence="1"/>
<menuitem id="menu_crm_config_meeting" name="Meeting"
parent="base.menu_base_config" sequence="4" groups="base.group_extended"/>
parent="base.menu_base_config" sequence="4"/>
<menuitem id="menu_crm_config_phonecall" name="Phone Call"
parent="base.menu_base_config" sequence="5" groups="base.group_extended"/>
<menuitem id="base.next_id_64" name="Reporting"
parent="base.menu_base_partner" sequence="8" />
parent="base.menu_base_partner" sequence="8" />
<!-- Case Sections Form View -->
@ -57,7 +57,7 @@
</field>
</record>
<!-- Case Sections Tree View -->
<!-- Case Sections Tree View -->
<record id="crm_case_section_view_tree" model="ir.ui.view">
<field name="name">crm.case.section.tree</field>
@ -73,7 +73,7 @@
</field>
</record>
<!-- Case Sections Action -->
<!-- Case Sections Action -->
<record id="crm_case_section_act" model="ir.actions.act_window">
<field name="name">Sales Team</field>
@ -82,7 +82,7 @@
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<!-- CRM Stage Tree View -->
<!-- CRM Stage Tree View -->
<record model="ir.ui.view" id="crm_case_stage_tree">
<field name="name">crm.case.stage.tree</field>
@ -99,7 +99,7 @@
</field>
</record>
<!-- CRM Stage Form View -->
<!-- CRM Stage Form View -->
<record model="ir.ui.view" id="crm_case_stage_form">
<field name="name">crm.case.stage.form</field>
@ -120,7 +120,7 @@
</field>
</record>
<!-- CRM Stage Action -->
<!-- CRM Stage Action -->
<record id="crm_case_stage_act" model="ir.actions.act_window">
<field name="name">Stages</field>
@ -144,7 +144,7 @@
</field>
</record>
<!-- Case Categories Tree View -->
<!-- Case Categories Tree View -->
<record id="crm_case_categ_tree-view" model="ir.ui.view">
<field name="name">crm.case.categ.tree</field>
@ -158,7 +158,7 @@
</field>
</record>
<!-- Case Categories Action -->
<!-- Case Categories Action -->
<record id="crm_case_categ-act" model="ir.actions.act_window">
<field name="name">Categories</field>
@ -173,7 +173,7 @@
<!-- Resource Type of case Tree View -->
<!-- Resource Type of case Tree View -->
<record model="ir.ui.view" id="crm_case_resource_type_tree">
<field name="name">crm.case.resource.type.tree</field>
@ -188,7 +188,7 @@
</field>
</record>
<!-- Resource Type of case Form View -->
<!-- Resource Type of case Form View -->
<record model="ir.ui.view" id="crm_case_resource_type_form">
<field name="name">crm.case.resource.type.form</field>
@ -203,7 +203,7 @@
</field>
</record>
<!-- Resource Type of case Action -->
<!-- Resource Type of case Action -->
<record id="crm_case_resource_type_act" model="ir.actions.act_window">
<field name="name">Resource Type</field>
@ -220,7 +220,7 @@
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<!-- Cases Tree View -->
<!-- Cases Tree View -->
<record id="crm_case_log_tree-view" model="ir.ui.view">
<field name="name">crm.case.log.tree</field>
@ -240,7 +240,7 @@
</field>
</record>
<!-- Segmentation line Tree View -->
<!-- Segmentation line Tree View -->
<record id="crm_segmentation_line_tree-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.tree</field>
@ -257,7 +257,7 @@
</field>
</record>
<!-- Segmentation line Form View -->
<!-- Segmentation line Form View -->
<record id="crm_segmentation_line-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.form</field>
@ -277,7 +277,7 @@
</field>
</record>
<!-- CRM Segmentation Form View -->
<!-- CRM Segmentation Form View -->
<record id="crm_segmentation-view" model="ir.ui.view">
<field name="name">crm.segmentation.form</field>
@ -322,7 +322,7 @@
</field>
</record>
<!-- CRM Segmentation Tree View -->
<!-- CRM Segmentation Tree View -->
<record id="crm_segmentation_tree-view" model="ir.ui.view">
<field name="name">crm.segmentation.tree</field>
@ -383,7 +383,7 @@
</field>
</record>
<!-- Inherit View From Partner -->
<!-- Inherit View From Partner -->
<record id="view_partners_form_crm1" model="ir.ui.view">
<field name="name">view.res.partner.form.crm.inherited1</field>

View File

@ -232,11 +232,9 @@
</record>
<menuitem name="Leads Analysis" id="menu_report_crm_leads_tree"
groups="base.group_extended"
parent="base.next_id_64" action="action_report_crm_lead" />
<menuitem name="Opportunities Analysis" id="menu_report_crm_opportunities_tree"
groups="base.group_extended"
<menuitem name="Opportunities Analysis" id="menu_report_crm_opportunities_tree"
parent="base.next_id_64" action="action_report_crm_opportunity" />
</data>

View File

@ -189,7 +189,6 @@
<menuitem name="Phone Calls"
action="action_report_crm_phonecall"
groups="base.group_extended"
id="menu_report_crm_phonecalls_tree" parent="base.next_id_64" />
</data>

View File

@ -4,62 +4,62 @@
<!-- Partners inherited form -->
<record id="view_crm_partner_info_form" model="ir.ui.view">
<field name="name">res.partner.crm.info.inherit</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook[last()]" position="after">
<notebook colspan="4">
<page string="CRM">
<field name="meeting_ids" colspan="4" nolabel="1" />
<field name="phonecall_ids" colspan="4" nolabel="1" />
<field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="create_date"/>
<field name="partner_name"/>
<field name="name"/>
<field name="email_from"/>
<field name="phone"/>
<field name="categ_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="stage_id"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
icon="gtk-go-forward" />
<field name="section_id"
invisible="context.get('invisible_section', True)" />
<field name="user_id" />
<field name="state" />
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Close"
states="open,draft,pending" type="object"
icon="gtk-close" />
<button string="Convert to Opportunity"
name="convert_opportunity"
states="draft,open,pending" icon="gtk-index"
type="object" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
icon="gtk-go-up" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
</page>
</notebook>
</xpath>
</field>
</record>
<!-- <record id="view_crm_partner_info_form" model="ir.ui.view">-->
<!-- <field name="name">res.partner.crm.info.inherit</field>-->
<!-- <field name="model">res.partner</field>-->
<!-- <field name="type">form</field>-->
<!-- <field name="inherit_id" ref="base.view_partner_form"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//notebook[last()]" position="after">-->
<!-- <notebook colspan="4">-->
<!-- <page string="CRM">-->
<!-- <field name="meeting_ids" colspan="4" nolabel="1" />-->
<!-- <field name="phonecall_ids" colspan="4" nolabel="1" />-->
<!-- <field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">-->
<!-- <tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">-->
<!-- <field name="create_date"/>-->
<!-- <field name="partner_name"/>-->
<!-- <field name="name"/>-->
<!-- <field name="email_from"/>-->
<!-- <field name="phone"/>-->
<!-- -->
<!-- <field name="categ_id" invisible="1"/>-->
<!-- <field name="type_id" invisible="1"/>-->
<!-- <field name="referred" invisible="1"/>-->
<!-- -->
<!-- <field name="stage_id"/>-->
<!-- <button name="stage_previous" string="Previous"-->
<!-- states="open,pending" type="object" icon="gtk-go-back" />-->
<!-- <button name="stage_next" string="Next"-->
<!-- states="open,pending" type="object"-->
<!-- icon="gtk-go-forward" />-->
<!-- <field name="section_id"-->
<!-- invisible="context.get('invisible_section', True)" />-->
<!-- <field name="user_id" />-->
<!-- <field name="state" />-->
<!-- <button name="case_open" string="Open"-->
<!-- states="draft,pending" type="object"-->
<!-- icon="gtk-go-forward" />-->
<!-- <button name="case_close" string="Close"-->
<!-- states="open,draft,pending" type="object"-->
<!-- icon="gtk-close" />-->
<!-- <button string="Convert to Opportunity"-->
<!-- name="convert_opportunity"-->
<!-- states="draft,open,pending" icon="gtk-index"-->
<!-- type="object" />-->
<!-- <button name="case_escalate" string="Escalate"-->
<!-- states="open,draft,pending" type="object"-->
<!-- icon="gtk-go-up" />-->
<!-- <button name="case_cancel" string="Cancel"-->
<!-- states="draft,open,pending" type="object"-->
<!-- icon="gtk-cancel" />-->
<!-- </tree>-->
<!-- </field>-->
<!-- </page>-->
<!-- </notebook>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
</data>
</openerp>

View File

@ -1,19 +1,23 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_crm_segmentation_user","crm.segmentation user","model_crm_segmentation","crm.group_crm_user",1,0,0,0
"access_crm_segmentation_line_user","crm.segmentation.line user","model_crm_segmentation_line","crm.group_crm_user",1,0,0,0
"access_crm_segmentation","crm.segmentation","model_crm_segmentation","crm.group_crm_manager",1,1,1,1
"access_crm_segmentation_line","crm.segmentation.line","model_crm_segmentation_line","crm.group_crm_manager",1,1,1,1
"access_crm_case_section","crm.case.section","model_crm_case_section","crm.group_crm_user",1,0,0,0
"access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0
"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_manager",1,1,1,1
"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_manager",1,1,1,1
"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_manager",1,1,1,1
"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_user",1,1,1,1
"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_user",1,1,1,1
"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_user",1,1,1,1
"access_crm_case_section_user","crm.case.section.user","model_crm_case_section","crm.group_crm_user",1,0,0,0
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
"access_crm_case_categ_user","crm.case.categ.user","model_crm_case_categ","crm.group_crm_user",1,0,0,0
"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
"access_crm_case_resource_type_user","crm_case_resource_type user","model_crm_case_resource_type","crm.group_crm_user",1,0,0,0
"access_crm_case_resource_type_manager","crm_case_resource_type manager","model_crm_case_resource_type","crm.group_crm_manager",1,1,1,1
"access_crm_lead_report_user","crm.lead.report","model_crm_lead_report","crm.group_crm_user",1,0,0,0
"access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0
"access_crm_lead_report_manager","crm.lead.report","model_crm_lead_report","crm.group_crm_manager",1,0,0,0
"access_crm_phonecall_report_manager","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_manager",1,0,0,0
"access_crm_lead2partner","crm.lead2partner","model_crm_lead2partner","crm.group_crm_user",1,1,1,1
"access_crm_lead2opportunity","crm.lead2opportunity","model_crm_lead2opportunity","crm.group_crm_user",1,1,1,1
"access_crm_opportunity2phonecall","crm.opportunity2phonecall","model_crm_opportunity2phonecall","crm.group_crm_user",1,1,1,1
@ -24,6 +28,11 @@
"access_crm_send_mail_attachment","crm.send.mail.attachment","model_crm_send_mail_attachment","crm.group_crm_user",1,1,1,1
"access_crm_partner2opportunity","crm.partner2opportunity","model_crm_partner2opportunity","crm.group_crm_user",1,1,1,1
"access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1
"access_crm_installer","crm.installer.rule","model_crm_installer","crm.group_crm_user",1,1,1,1
"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",2,2,2,2
"access_crm_installer","crm.installer.rule","model_crm_installer","base.group_system",1,1,1,1
"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",1,1,1,1
"access_mailgate_thread","mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1
"access_res_partner","res.partner.crm.user","base.model_res_partner","crm.group_crm_user",1,0,0,0
"access_res_partner_address","res.partner.address.crm.user","base.model_res_partner_address","crm.group_crm_user",1,0,0,0
"access_res_partner_category","res.partner.category.crm.user","base.model_res_partner_category","crm.group_crm_user",1,0,0,0
"mail_gateway_mailgate_message","mail_gateway.mailgate.message","model_mailgate_message","crm.group_crm_user",1,1,1,1
"mail_gateway_mailgate_thread","mail_gateway.mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_crm_segmentation_user crm.segmentation user model_crm_segmentation crm.group_crm_user 1 0 0 0
3 access_crm_segmentation_line_user crm.segmentation.line user model_crm_segmentation_line crm.group_crm_user 1 0 0 0
4 access_crm_segmentation crm.segmentation model_crm_segmentation crm.group_crm_manager 1 1 1 1
5 access_crm_segmentation_line crm.segmentation.line model_crm_segmentation_line crm.group_crm_manager 1 1 1 1
6 access_crm_case_section crm.case.section model_crm_case_section crm.group_crm_user 1 0 0 0
7 access_crm_case_categ crm.case.categ model_crm_case_categ crm.group_crm_user 1 0 0 0
8 access_crm_meeting crm.meeting model_crm_meeting crm.group_crm_manager crm.group_crm_user 1 1 1 1
9 access_crm_lead crm.lead model_crm_lead crm.group_crm_manager crm.group_crm_user 1 1 1 1
10 access_crm_phonecall crm.phonecall model_crm_phonecall crm.group_crm_manager crm.group_crm_user 1 1 1 1
11 access_crm_case_section_user crm.case.section.user model_crm_case_section crm.group_crm_user 1 0 0 0
12 access_crm_case_section_manager crm.case.section.manager model_crm_case_section crm.group_crm_manager 1 1 1 1
13 access_crm_case_categ_user crm.case.categ.user model_crm_case_categ crm.group_crm_user 1 0 0 0
14 access_crm_case_categ_manager crm.case.categ.manager model_crm_case_categ crm.group_crm_manager 1 1 1 1
15 access_crm_case_stage crm.case.stage model_crm_case_stage crm.group_crm_user 1 0 0 0
16 access_crm_case_stage_manager crm.case.stage model_crm_case_stage crm.group_crm_manager 1 1 1 1
17 access_crm_case_resource_type_user crm_case_resource_type user model_crm_case_resource_type crm.group_crm_user 1 0 0 0
18 access_crm_case_resource_type_manager crm_case_resource_type manager model_crm_case_resource_type crm.group_crm_manager 1 1 1 1
19 access_crm_lead_report_user access_crm_lead_report_manager crm.lead.report model_crm_lead_report crm.group_crm_user crm.group_crm_manager 1 0 0 0
20 access_crm_phonecall_report_user access_crm_phonecall_report_manager crm.phonecall.report model_crm_phonecall_report crm.group_crm_user crm.group_crm_manager 1 0 0 0
21 access_crm_lead2partner crm.lead2partner model_crm_lead2partner crm.group_crm_user 1 1 1 1
22 access_crm_lead2opportunity crm.lead2opportunity model_crm_lead2opportunity crm.group_crm_user 1 1 1 1
23 access_crm_opportunity2phonecall crm.opportunity2phonecall model_crm_opportunity2phonecall crm.group_crm_user 1 1 1 1
28 access_crm_send_mail_attachment crm.send.mail.attachment model_crm_send_mail_attachment crm.group_crm_user 1 1 1 1
29 access_crm_partner2opportunity crm.partner2opportunity model_crm_partner2opportunity crm.group_crm_user 1 1 1 1
30 access_crm_lead2opportunity_partner crm.lead2opportunity.partner model_crm_lead2opportunity_partner crm.group_crm_user 1 1 1 1
31 access_crm_installer crm.installer.rule model_crm_installer crm.group_crm_user base.group_system 1 1 1 1
32 access_crm_lead_forward_to_partner crm.lead.forward.to.partner model_crm_lead_forward_to_partner crm.group_crm_user 2 1 2 1 2 1 2 1
33 access_mailgate_thread mailgate.thread model_mailgate_thread crm.group_crm_user 1 1 1 1
34 access_res_partner res.partner.crm.user base.model_res_partner crm.group_crm_user 1 0 0 0
35 access_res_partner_address res.partner.address.crm.user base.model_res_partner_address crm.group_crm_user 1 0 0 0
36 access_res_partner_category res.partner.category.crm.user base.model_res_partner_category crm.group_crm_user 1 0 0 0
37 mail_gateway_mailgate_message mail_gateway.mailgate.message model_mailgate_message crm.group_crm_user 1 1 1 1
38 mail_gateway_mailgate_thread mail_gateway.mailgate.thread model_mailgate_thread crm.group_crm_user 1 1 1 1

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
@ -50,11 +50,11 @@ class open_questionnaire(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel'), ('open', 'Open Questionnaire')]}
'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel','gtk-cancel'), ('open', 'Open Questionnaire','terp-camera_test')]}
},
'open': {
'actions': [build_form],
'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel'), ('compute', 'Save Data')]}
'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel','gtk-cancel'), ('compute', 'Save Data','terp-stock_format-scientific')]}
},
'compute': {
'actions': [],

View File

@ -3,7 +3,7 @@
<!--<menuitem name="Document Management" icon="terp-stock" id="menu_document"/>
<menuitem name="Document Configuration" id="menu_document_configuration" parent="menu_document"/>-->
<menuitem name="Knowledge Management" icon="terp-stock" id="base.menu_document" sequence="4"/>
<menuitem name="Knowledge Management" icon="terp-stock" id="base.menu_document" sequence="4" groups="base.group_user"/>
<menuitem name="Configuration" id="base.menu_document_configuration" parent="base.menu_document" sequence="50"/>
<menuitem name="Document Management" id="menu_document_management_configuration" parent="base.menu_document_configuration" sequence="1"/>
@ -13,15 +13,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Storage Media">
<group colspan="4" col="4">
<field name="name" select="1" colspan="4"/>
<field name="user_id"/>
<field name="type"/>
<field name="online"/>
<field name="readonly"/>
<group colspan="4" col="4">
<field name="name" select="1" colspan="4"/>
<field name="user_id"/>
<field name="type"/>
<field name="online"/>
<field name="readonly"/>
</group>
<group colspan="2" attrs="{'invisible':[('type','!=','realstore')]}">
<field name="path"/>
<field name="path"/>
</group>
</form>
</field>
@ -71,13 +71,13 @@
<newline/>
<field name="domain" attrs="{'required': [('type','=','ressource')], 'readonly': [('type','=','static')]}"/>
<field name="ressource_tree"/>
<field name="resource_field" domain="[('model_id','=',ressource_type_id), ('ttype', 'in', ('char', 'selection', 'date', 'datetime'))]"/>
<field name="resource_field" domain="[('model_id','=',ressource_type_id), ('ttype', 'in', ('char', 'selection', 'date', 'datetime'))]"/>
<field name="ressource_id" select="2" readonly="1"/>
<field name="ressource_parent_type_id"/>
</page>
<page string="Generated Files">
<label colspan="4" string="For each entry here, virtual files will appear in this folder." />
<field name="content_ids" nolabel="1" colspan="4" attrs="{'readonly': [('ressource_type_id','=',False)]}">
<field name="content_ids" nolabel="1" colspan="4" attrs="{'readonly': [('ressource_type_id','=',False)]}">
<form string="Contents">
<field name="name"/>
<field name="sequence"/>

0
addons/email_template/__init__.py Executable file → Normal file
View File

1
addons/email_template/__openerp__.py Executable file → Normal file
View File

@ -16,6 +16,7 @@
'email_template_view.xml',
'email_template_mailbox_view.xml',
'wizard/email_template_send_wizard_view.xml',
'security/ir.model.access.csv'
],
"installable": True,
"active": False,

30
addons/email_template/email_template.py Executable file → Normal file
View File

@ -17,10 +17,10 @@ try:
TEMPLATE_ENGINES.append(('mako', 'Mako Templates'))
except:
LOGGER.notifyChannel(
_("Email Template"),
netsvc.LOG_ERROR,
_("Mako templates not installed")
)
_("Email Template"),
netsvc.LOG_WARNING,
_("Mako templates not installed")
)
try:
from django.template import Context, Template as DjangoTemplate
#Workaround for bug:
@ -31,10 +31,10 @@ try:
TEMPLATE_ENGINES.append(('django', 'Django Template'))
except:
LOGGER.notifyChannel(
_("Email Template"),
netsvc.LOG_ERROR,
_("Django templates not installed")
)
_("Email Template"),
netsvc.LOG_WARNING,
_("Django templates not installed")
)
import email_template_engines
import tools
@ -468,7 +468,7 @@ class email_template(osv.osv):
context)
return True
def generate_mailbox_item_from_template(self,
def _generate_mailbox_item_from_template(self,
cursor,
user,
template,
@ -559,6 +559,8 @@ class email_template(osv.osv):
'folder':'drafts',
'mail_type':'multipart/alternative'
}
if not mailbox_values['account_id']:
raise Exception("Unable to send the mail. No account linked to the template.")
#Use signatures if allowed
if template.use_sign:
sign = self.pool.get('res.users').read(cursor,
@ -570,13 +572,17 @@ class email_template(osv.osv):
mailbox_values['body_text'] += sign
if mailbox_values['body_html']:
mailbox_values['body_html'] += sign
print 'Creating', mailbox_values
mailbox_id = self.pool.get('email_template.mailbox').create(
cursor,
user,
mailbox_values,
context)
print 'Sending', mailbox_id
self.pool.get('email_template.mailbox').send_this_mail(cursor, user, [mailbox_id], context)
return mailbox_id
def generate_mail(self,
cursor,
user,
@ -588,6 +594,7 @@ class email_template(osv.osv):
template = self.browse(cursor, user, template_id, context=context)
if not template:
raise Exception("The requested template could not be loaded")
print 'loaded', record_ids
for record_id in record_ids:
mailbox_id = self._generate_mailbox_item_from_template(
cursor,
@ -595,6 +602,7 @@ class email_template(osv.osv):
template,
record_id,
context)
print 'loaded'
mail = self.pool.get('email_template.mailbox').browse(
cursor,
user,
@ -616,7 +624,7 @@ class email_template(osv.osv):
mailbox_id,
{'folder':'outbox'},
context=context
)
)
return True
email_template()

0
addons/email_template/email_template_account.py Executable file → Normal file
View File

0
addons/email_template/email_template_account_view.xml Executable file → Normal file
View File

0
addons/email_template/email_template_engines.py Executable file → Normal file
View File

4
addons/email_template/email_template_mailbox.py Executable file → Normal file
View File

@ -41,9 +41,7 @@ class email_template_mailbox(osv.osv):
return True
def send_this_mail(self, cr, uid, ids=None, context=None):
if ids is None:
ids = []
for id in ids:
for id in (ids or []):
try:
account_obj = self.pool.get('email_template.account')
values = self.read(cr, uid, id, [], context)

0
addons/email_template/email_template_mailbox_view.xml Executable file → Normal file
View File

View File

0
addons/email_template/email_template_view.xml Executable file → Normal file
View File

0
addons/email_template/email_template_workflow.xml Executable file → Normal file
View File

0
addons/email_template/html2text.py Executable file → Normal file
View File

View File

@ -2,6 +2,10 @@
<openerp>
<data noupdate="0">
<record id="res_groups_email_template_admin" model="res.groups">
<field name="name">Email Template / Admin</field>
</record>
<record id="res_groups_email_template_manager" model="res.groups">
<field name="name">Email Template / Settings_Manager</field>
</record>

View File

@ -0,0 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_email_template_engines","email_template.engines","model_email_template_engines","email_template.res_groups_email_template_admin",1,1,1,1
"access_email_template_account","email_template.account","model_email_template_account","email_template.res_groups_email_template_admin",1,1,1,1
"access_email_template","email.template","model_email_template","email_template.res_groups_email_template_admin",1,1,1,1
"access_email_template_preview","email_template.preview","model_email_template_preview","email_template.res_groups_email_template_admin",1,1,1,1
"access_email_template_mailbox","email_template.mailbox","model_email_template_mailbox","email_template.res_groups_email_template_admin",1,1,1,1
"access_email_template_send_wizard","email_template.send.wizard","model_email_template_send_wizard","email_template.res_groups_email_template_admin",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_email_template_engines email_template.engines model_email_template_engines email_template.res_groups_email_template_admin 1 1 1 1
3 access_email_template_account email_template.account model_email_template_account email_template.res_groups_email_template_admin 1 1 1 1
4 access_email_template email.template model_email_template email_template.res_groups_email_template_admin 1 1 1 1
5 access_email_template_preview email_template.preview model_email_template_preview email_template.res_groups_email_template_admin 1 1 1 1
6 access_email_template_mailbox email_template.mailbox model_email_template_mailbox email_template.res_groups_email_template_admin 1 1 1 1
7 access_email_template_send_wizard email_template.send.wizard model_email_template_send_wizard email_template.res_groups_email_template_admin 1 1 1 1

View File

@ -10,6 +10,7 @@
id="menu_hr_configuration"
name="Configuration"
parent="hr.menu_hr_root"
groups="group_hr_manager"
sequence="50" />
<menuitem
id="menu_view_employee_category_configuration_form"

View File

@ -1,3 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_user",1,1,1,1
"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr.group_hr_user",1,1,1,1
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_attendance",1,0,0,0
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_manager",1,1,1,1
"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr.group_hr_attendance",1,1,1,1
"access_hr_sign_in_out","hr attendance sign in out","model_hr_sign_in_out","hr.group_hr_attendance",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_action_reason_employee hr action reason employee model_hr_action_reason hr.group_hr_user hr.group_hr_attendance 1 1 0 1 0 1 0
3 access_hr_attendance_employee access_hr_action_reason_employee hr attendance employee hr action reason employee model_hr_attendance model_hr_action_reason hr.group_hr_user hr.group_hr_manager 1 1 1 1
4 access_hr_attendance_employee hr attendance employee model_hr_attendance hr.group_hr_attendance 1 1 1 1
5 access_hr_sign_in_out hr attendance sign in out model_hr_sign_in_out hr.group_hr_attendance 1 1 1 1

View File

@ -1,12 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_user",1,1,1,1
"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_manager","hr_evaluation.plan","model_hr_evaluation_plan","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_phase","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report",,1,0,0,0
"access_hr_evaluation_reminder_manager","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_reminder","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report","hr.group_hr_manager",1,0,0,0
"access_hr_evaluation_reminder","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_evaluation_evaluation hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_user 1 0 1 0 1 0 1
access_hr_evaluation_evaluation_manager hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_manager 1 1 1 1
3 access_hr_evaluation_plan hr_evaluation.plan model_hr_evaluation_evaluation hr.group_hr_user 1 0 0 0
4 access_hr_evaluation_plan_manager hr_evaluation.plan model_hr_evaluation_plan hr.group_hr_manager 1 1 1 1
5 access_hr_evaluation_plan_phase hr_evaluation.plan.phase model_hr_evaluation_plan_phase hr.group_hr_user 1 0 0 0
6 access_hr_evaluation_plan_phase_manager hr_evaluation.plan.phase model_hr_evaluation_plan_phase hr.group_hr_manager 1 1 1 1
7 access_hr_evaluation_interview hr.evaluation.interview model_hr_evaluation_interview hr.group_hr_user 1 0 1 0 1 0 1
8 access_hr_evaluation_interview_manager access_hr_evaluation_report hr.evaluation.interview hr.evaluation.report model_hr_evaluation_interview model_hr_evaluation_report hr.group_hr_manager 1 1 0 1 0 1 0
9 access_hr_evaluation_report access_hr_evaluation_reminder hr.evaluation.report hr.evaluation.reminder model_hr_evaluation_report model_hr_evaluation_reminder hr.group_hr_user 1 0 1 0 1 0 1
access_hr_evaluation_reminder_manager hr.evaluation.reminder model_hr_evaluation_reminder hr.group_hr_manager 1 1 1 1
access_hr_evaluation_reminder hr.evaluation.reminder model_hr_evaluation_reminder hr.group_hr_user 1 0 0 0

View File

@ -9,3 +9,4 @@
"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_manager",1,1,1,1
"access_hr_holidays_report_user","hr.holidays.report","model_hr_holidays_report","hr.group_hr_user",1,0,0,0
"access_available_holidays_report_user","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_user",1,0,0,0
"access_hr_holidays_summary_dept","hr.holidays.summary.dept","model_hr_holidays_summary_dept","hr.group_hr_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
9 access_available_holidays_report hr.available.holidays.report model_available_holidays_report hr.group_hr_manager 1 1 1 1
10 access_hr_holidays_report_user hr.holidays.report model_hr_holidays_report hr.group_hr_user 1 0 0 0
11 access_available_holidays_report_user hr.available.holidays.report model_available_holidays_report hr.group_hr_user 1 0 0 0
12 access_hr_holidays_summary_dept hr.holidays.summary.dept model_hr_holidays_summary_dept hr.group_hr_manager 1 1 1 1

View File

@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_manager",1,1,1,1
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report",,1,0,0,0
"access_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_user",1,1,1,1
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","hr.group_hr_manager",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_applicant hr.applicant model_hr_applicant hr.group_hr_manager hr.group_hr_user 1 1 1 1
3 access_hr_recruitment_report hr.recruitment.report model_hr_recruitment_report hr.group_hr_manager 1 0 0 0

View File

@ -1,4 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","hr.group_hr_user",1,1,1,1
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","hr.group_hr_user",1,1,1,0
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","hr.group_hr_user",1,0,0,0
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","hr.group_hr_user",1,0,0,0
"access_hr_sign_in_project","hr.sign.in.project attendance","model_hr_sign_in_project","hr_attendance.group_hr_tendance",1,0,0,0
"access_hr_analytal_timesheet_employee","hr.analytical.timesheet.employee","model_hr_analytical_timesheet_employee","hr.group_hr_manager",1,1,1,1
"access_hr_analytal_timesheet_user","hr.analytical.timesheet.user","model_hr_analytical_timesheet_user","hr.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_analytic_timesheet hr.analytic.timesheet model_hr_analytic_timesheet hr.group_hr_user 1 1 1 1
3 access_hr_account_analytic_line account.account.analytic.line account.model_account_analytic_line hr.group_hr_user 1 1 1 0
4 access_account_analytic_journal account.account.analytic.journal account.model_account_analytic_journal hr.group_hr_user 1 0 0 0
5 access_hr_sign_in_project hr.sign.in.project attendance model_hr_sign_in_project hr_attendance.group_hr_tendance 1 0 0 0
6 access_hr_analytal_timesheet_employee hr.analytical.timesheet.employee model_hr_analytical_timesheet_employee hr.group_hr_manager 1 1 1 1
7 access_hr_analytal_timesheet_user hr.analytical.timesheet.user model_hr_analytical_timesheet_user hr.group_hr_user 1 1 1 1

View File

@ -3,9 +3,10 @@
"access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
"access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0
"access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0
"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_user",1,0,0,0
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_user",1,0,0,0
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_user",1,0,0,0
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_user",1,0,0,0
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_user",1,0,0,0
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_user",1,0,0,0
"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","hr.group_hr_manager",1,0,0,0
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","hr.group_hr_manager",1,0,0,0
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","hr.group_hr_manager",1,0,0,0
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","hr.group_hr_manager",1,0,0,0
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","hr.group_hr_manager",1,0,0,0
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","hr.group_hr_manager",1,0,0,0
"access_hr_timesheet_analytic_profit","hr_timesheet_analytic_profit","model_hr_timesheet_analytic_profit","hr.group_account_invoice",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_hr_timesheet_invoice_factor_acc_inv hr_timesheet_invoice.factor.account.invoice model_hr_timesheet_invoice_factor account.group_account_invoice 1 1 1 1
4 access_report_analytic_account_close report.analytic.account.close model_report_analytic_account_close account.group_account_manager 1 0 0 0
5 access_report_account_analytic_line_to_invoice report.account.analytic.line.to.invoice model_report_account_analytic_line_to_invoice account.group_account_manager 1 0 0 0
6 access_report_timesheet_user report_timesheet.user model_report_timesheet_user base.group_user hr.group_hr_manager 1 0 0 0
7 access_report_timesheet_account report_timesheet.account model_report_timesheet_account base.group_user hr.group_hr_manager 1 0 0 0
8 access_report_timesheet_account_date report_timesheet.account.date model_report_timesheet_account_date base.group_user hr.group_hr_manager 1 0 0 0
9 access_report_timesheet_invoice report_timesheet.invoice model_report_timesheet_invoice base.group_user hr.group_hr_manager 1 0 0 0
10 access_report_random_timesheet report_random_timesheet model_report_random_timesheet base.group_user hr.group_hr_manager 1 0 0 0
11 access_report_random_timesheet_lines random_timesheet_lines model_random_timesheet_lines base.group_user hr.group_hr_manager 1 0 0 0
12 access_hr_timesheet_analytic_profit hr_timesheet_analytic_profit model_hr_timesheet_analytic_profit hr.group_account_invoice 1 1 1 1

View File

@ -28,6 +28,11 @@ class l10n_be_vat_declaration(osv.osv_memory):
_name = "l1on_be.vat.declaration"
_description = "Vat Declaration"
def _get_xml_data(self, cr, uid, context=None):
if context.get('file_save', False):
return base64.encodestring(context['file_save'])
return ''
_columns = {
'name': fields.char('File Name', size=32),
'period_id': fields.many2one('account.period','Period', required=True),
@ -39,7 +44,9 @@ class l10n_be_vat_declaration(osv.osv_memory):
}
_defaults = {
'msg': 'Save the File with '".xml"' extension.',
}
'file_save': _get_xml_data,
'name': 'vat_declaration.xml',
}
def create_xml(self, cr, uid, ids, context=None):
obj_fyear = self.pool.get('account.fiscalyear')
@ -48,6 +55,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
obj_user = self.pool.get('res.users')
obj_comp = self.pool.get('res.company')
obj_data = self.pool.get('ir.model.data')
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
@ -99,9 +107,21 @@ class l10n_be_vat_declaration(osv.osv_memory):
data_of_file +='\n\t\t\t\t<D'+str(int(item['code'])) +'>' + str(abs(int(item['sum_period']*100))) + '</D'+str(int(item['code'])) +'>'
data_of_file +='\n\t\t\t</DATA_ELEM>\n\t\t</DATA>\n\t</VATRECORD>\n</VATSENDING>'
data['file_save'] = base64.encodestring(data_of_file)
self.write(cr, uid, ids, {'file_save': data['file_save'], 'name': 'vat_declare.xml'}, context=context)
return True
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_vat_save')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context['file_save'] = data_of_file
return {
'name': _('Save XML For Vat declaration'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'l1on_be.vat.declaration',
'views': [(resource_id,'form')],
'view_id': 'view_vat_save',
'type': 'ir.actions.act_window',
'target': 'new',
}
l10n_be_vat_declaration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,31 +13,46 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Periodical VAT Declaration" >
<group height="400" width="330">
<group height="220" width="330">
<group>
<separator string="Declare Periodical VAT" colspan="2" /><newline/>
<field name="period_id" /><newline/>
<field name="ask_resitution" colspan="2" align="1"/><newline/>
<field name="ask_payment" colspan="2"/><newline/>
<field name="client_nihil" colspan="2" string="Is Last Declaration"/><newline/><label/>
<button icon="gtk-execute" name="create_xml" string="Create XML" type="object" default_focus="1" />
</group>
<newline/>
<group attrs="{'readonly':[('name','=',False)]}">
<separator colspan="2" string="Note: "/><newline/>
<group>
<button icon="gtk-execute" name="create_xml" string="Create XML" type="object" default_focus="1" />
<button special="cancel" string="Close" icon="gtk-cancel"/>
</group>
</group>
</form>
</field>
</record>
<record id="view_vat_save" model="ir.ui.view">
<field name="name">Save XML</field>
<field name="model">l1on_be.vat.declaration</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Save xml">
<group height="200" width="310">
<separator colspan="2" string="Note: "/><newline/>
<label string="Save the File with '.xml' extension." colspan="2" align="0.0"/><newline/>
<field name="name"/><newline/>
<field name="file_save" readonly="True"/>
<newline/>
<label/>
</group>
<newline/>
<button special="cancel" string="Close" icon="gtk-cancel"/>
</group>
<newline/>
<label colspan="1"/>
<button colspan="1" special="cancel" string="Close" icon="gtk-cancel" align="0.0"/>
</group>
</form>
</field>
</field>
</record>
<record id="action_vat_declaration" model="ir.actions.act_window">
<field name="name">Vat Declaraion</field>
<field name="type">ir.actions.act_window</field>

View File

@ -31,6 +31,11 @@ class partner_vat_intra(osv.osv_memory):
_name = "partner.vat.intra"
_description = 'Partner VAT Intra'
def _get_xml_data(self, cr, uid, context=None):
if context.get('file_save', False):
return base64.encodestring(context['file_save'])
return ''
def _get_europe_country(self, cursor, user, context=None):
return self.pool.get('res.country').search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])
@ -56,6 +61,8 @@ class partner_vat_intra(osv.osv_memory):
_defaults = {
'country_ids': _get_europe_country,
'file_save': _get_xml_data,
'name': 'vat_Intra.xml',
}
def create_xml(self, cursor, user, ids, context=None):
@ -65,6 +72,7 @@ class partner_vat_intra(osv.osv_memory):
obj_partner = self.pool.get('res.partner')
obj_partner_add = self.pool.get('res.partner.address')
obj_country = self.pool.get('res.country')
mod_obj = self.pool.get('ir.model.data')
street = zip_city = country = p_list = data_clientinfo = ''
error_message = list_partner = []
seq = amount_sum = 0
@ -132,14 +140,20 @@ class partner_vat_intra(osv.osv_memory):
amount_sum = int(amount_sum)
data_decl = '\n\t<DeclarantList SequenceNum="1" DeclarantNum="'+ dnum + '" ClientNbr="'+ str(seq) +'" AmountSum="'+ str(amount_sum) +'" >'
data_file += str(data_decl) + str(data_comp) + str(data_period) + str(data_clientinfo) + '\n\t</DeclarantList>\n</VatIntra>'
data = {
'msg': 'XML Flie has been Created. Save the File with '".xml"' extension.',
'file_save': base64.encodestring(data_file),
'name': 'vat_Intra.xml',
'country_ids': [[6, 0, obj_country.search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])]],
}
self.write(cursor, user, ids, {'file_save':data['file_save'], 'msg':data['msg'], 'name':data['name'], 'no_vat':p_list, 'country_ids':data['country_ids']}, context=context)
return True
model_data_ids = mod_obj.search(cursor, user,[('model','=','ir.ui.view'),('name','=','view_vat_intra_save')], context=context)
resource_id = mod_obj.read(cursor, user, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context['file_save'] = data_file
return {
'name': _('Save'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'partner.vat.intra',
'views': [(resource_id,'form')],
'view_id': 'view_vat_intra_save',
'type': 'ir.actions.act_window',
'target': 'new',
}
partner_vat_intra()

View File

@ -13,32 +13,48 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Partner VAT intra">
<group width="450">
<separator string="Create an XML file for Vat Intra" colspan="4"/>
<notebook colspan="4">
<page string="General Information">
<newline/>
<field name="period_code" colspan="4"/>
<newline/>
<field name="mand_id" colspan="4"/>
<newline/>
<separator string="Periods" colspan="4"/>
<field name="period_ids" nolabel="1" colspan="4"/>
<newline/><label/>
<group width="450">
<separator string="Create an XML file for Vat Intra" colspan="4"/>
<notebook colspan="4">
<page string="General Information">
<newline/>
<group>
<field name="period_code" colspan="4"/>
<newline/>
<field name="mand_id" colspan="4"/>
<newline/>
</group>
<separator string="Periods" colspan="4"/>
<field name="period_ids" nolabel="1" colspan="4"/>
<newline/><label/>
</page>
<page string="European Countries">
<field name="country_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
<separator colspan="4"/><label/>
<button name="create_xml" string="Create XML" type="object" icon="gtk-execute"/>
<separator colspan="4" string="Note"/>
<field name="msg" colspan="4" nolabel="1"/>
<button special="cancel" string="Close" icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
<record id="view_vat_intra_save" model="ir.ui.view">
<field name="name">Partner VAT intra Save</field>
<field name="model">partner.vat.intra</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Save XML">
<group width="450">
<separator colspan="2" string="Note: "/><newline/>
<label string="Save the File with '.xml' extension." colspan="2" align="0.0"/><newline/>
<field name="name" colspan="4"/>
<newline/>
<field name="file_save" colspan="4"/>
<newline/>
<separator string="Partner With No VAT" colspan="4"/>
<field nolabel="1" name="no_vat" colspan="4"/>
</page>
<page string="European Countries">
<field name="country_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
<separator colspan="4"/><label/>
<button special="cancel" string="Close" icon="gtk-cancel"/>
</group>
@ -46,6 +62,7 @@
</field>
</record>
<record id="action_vat_intra" model="ir.actions.act_window">
<field name="name">Partner Vat Intra</field>
<field name="type">ir.actions.act_window</field>

View File

@ -29,7 +29,10 @@
"description": "Menu for Marketing",
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': ['marketing_view.xml'],
'update_xml': [
'marketing_view.xml',
'security/ir.model.access.csv'
],
'demo_xml': [],
'installable': True,
'active': False,

View File

@ -29,8 +29,9 @@
<attribute name="string">Configure</attribute>
</xpath>
<group colspan="8">
<field name="marketing_campaign" />
<field name="email_template" />
<field name="crm_profiling" />
<field name="marketing_campaign" />
<field name="marketing_campaign_mailchimp" />
</group>
</data>

View File

@ -25,7 +25,8 @@ class marketing_installer(osv.osv_memory):
_name = 'marketing.installer'
_inherit = 'res.config.installer'
_columns = {
# Generic modules
'email_template':fields.boolean('Automated E-Mails',
help="Helps you to design templates of emails and integrate them in your different processes."),
'marketing_campaign':fields.boolean('Marketing Campaigns',
help="Helps you to manage marketing campaigns and automate actions and communication steps."),
'marketing_campaign_mailchimp':fields.boolean('Mailchimp Integration',

View File

@ -0,0 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_marketing_installer","marketing.installer","model_marketing_installer","base.group_system",1,1,1,1
"access_res_config_installer","access_marketing_installer","base.model_res_config_installer","base.group_system",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_marketing_installer marketing.installer model_marketing_installer base.group_system 1 1 1 1
3 access_res_config_installer access_marketing_installer base.model_res_config_installer base.group_system 1 1 1 1

0
addons/marketing_campaign/__init__.py Executable file → Normal file
View File

2
addons/marketing_campaign/__openerp__.py Executable file → Normal file
View File

@ -39,6 +39,8 @@
'marketing_campaign_data.xml',
'marketing_campaign_workflow.xml',
'report/campaign_analysis_view.xml',
"security/marketing_campaign_security.xml",
"security/ir.model.access.csv"
],
'demo_xml': [
'marketing_campaign_demo.xml',

116
addons/marketing_campaign/marketing_campaign.py Executable file → Normal file
View File

@ -101,7 +101,7 @@ class marketing_campaign_segment(osv.osv):
_columns = {
'name': fields.char('Name', size=64,required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
required=True),
required=True, select=1),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
@ -200,7 +200,7 @@ class marketing_campaign_activity(osv.osv):
_columns = {
'name': fields.char('Name', size=128, required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
required = True, ondelete='cascade'),
required = True, ondelete='cascade', select=1),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
@ -242,7 +242,7 @@ class marketing_campaign_activity(osv.osv):
self._actions = {'paper' : self.process_wi_report,
'email' : self.process_wi_email,
'server_action' : self.process_wi_action,
}
}
return super(marketing_campaign_activity, self).__init__(*args)
def search(self, cr, uid, args, offset=0, limit=None, order=None,
@ -259,7 +259,7 @@ class marketing_campaign_activity(osv.osv):
return super(marketing_campaign_activity, self).search(cr, uid, args,
offset, limit, order, context, count)
def process_wi_report(self, cr, uid, activity, workitem):
def process_wi_report(self, cr, uid, activity, workitem, context={}):
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
(report_data, format) = service.create(cr, uid, [], {}, {})
attach_vals = {
@ -274,46 +274,58 @@ class marketing_campaign_activity(osv.osv):
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
return True
def process_wi_email(self, cr, uid, activity, workitem):
template = activity.email_template_id
accounts = template.enforce_from_account
if not template.enforce_from_account:
return {'error_msg' : "There is no account defined for the email"}
if not workitem.partner_id.email:
return {'error_msg' : "There is no email defined for the partner"}
vals = {
'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
'email_to': workitem.partner_id.email,
'subject': template.def_subject,
'body_text': template.def_body_text,
'body_html': template.def_body_html,
'account_id':accounts.id,
'state':'na',
'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
}
# if accounts.use_sign:
# signature = self.pool.get('res.users').read(cr, uid, uid, ['signature'], context)['signature']
# if signature:
# vals['pem_body_text'] = tools.ustr(vals['pem_body_text'] or '') + signature
# vals['pem_body_html'] = tools.ustr(vals['pem_body_html'] or '') + signature
def process_wi_email(self, cr, uid, activity, workitem, context=None):
print 'Sending Email Init', activity.name
return self.pool.get('email.template').generate_mail(cr, uid, activity.email_template_id.id, [workitem.res_id], context=context)
#Create partly the mail and later update attachments
mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
#if not template.enforce_from_account:
# self.pool.get('marketing.campaign.workitem').write(cr, uid, [workitem.id], {
# 'error_msg': 'There is no account defined for the email',
# 'state': 'exception'
# })
# return False
#if not workitem.partner_id.email:
# self.pool.get('marketing.campaign.workitem').write(cr, uid, [workitem.id], {
# 'error_msg': "There is no email defined for the partner",
# 'state': 'exception'
# })
# return False
#vals = {
# 'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
# 'email_to': template.email_to,
# 'email_cc': template.email_cc,
# 'email_bcc': template.email_bcc,
# 'subject': template.def_subject,
# 'body_text': template.def_body_text,
# 'body_html': template.def_body_html,
# 'account_id': accounts.id,
# 'state':'na',
# 'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
#}
# # if accounts.use_sign:
# # signature = self.pool.get('res.users').read(cr, uid, uid, ['signature'], context)['signature']
# # if signature:
# # vals['pem_body_text'] = tools.ustr(vals['pem_body_text'] or '') + signature
# # vals['pem_body_html'] = tools.ustr(vals['pem_body_html'] or '') + signature
##Create partly the mail and later update attachments
#print 'Sending Email', vals
#mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
return True
def process_wi_action(self, cr, uid, activity, workitem):
def process_wi_action(self, cr, uid, activity, workitem, context={}):
context = {}
server_obj = self.pool.get('ir.actions.server')
server_obj.run(cr, uid, [activity.server_action_id.id], context)
server_obj.run(cr, uid, [activity.server_action_id.id], context)
return True
def process(self, cr, uid, act_id, wi_id, context={}):
activity = self.browse(cr, uid, act_id)
print 'Process', activity.name
workitem_obj = self.pool.get('marketing.campaign.workitem')
workitem = workitem_obj.browse(cr, uid, wi_id)
self._actions[activity.type](cr, uid, activity, workitem)
return True
workitem = workitem_obj.browse(cr, uid, wi_id, context=context)
print 'WI', workitem, activity.type
return self._actions[activity.type](cr, uid, activity, workitem, context)
marketing_campaign_activity()
@ -324,7 +336,7 @@ class marketing_campaign_transition(osv.osv):
_columns = {
'activity_from_id': fields.many2one('marketing.campaign.activity',
'Source Activity'),
'Source Activity', select=1),
'activity_to_id': fields.many2one('marketing.campaign.activity',
'Destination Activity'),
'interval_nbr': fields.integer('Interval No.'),
@ -366,12 +378,12 @@ class marketing_campaign_workitem(osv.osv):
'campaign_id': fields.related('segment_id', 'campaign_id',
type='many2one', relation='marketing.campaign', string='Campaign', readonly=True),
'object_id': fields.related('segment_id', 'campaign_id', 'object_id',
type='many2one', relation='ir.model', string='Object'),
'res_id': fields.integer('Resource ID'),
type='many2one', relation='ir.model', string='Object', select=1),
'res_id': fields.integer('Resource ID', select=1),
'res_name': fields.function(_res_name_get, method=True, string='Resource Name', type="char", size=64),
'date': fields.datetime('Execution Date'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'state': fields.selection([('todo', 'ToDo'), ('inprogress', 'In Progress'),
'partner_id': fields.many2one('res.partner', 'Partner', select=1),
'state': fields.selection([('todo', 'To Do'), ('inprogress', 'In Progress'),
('exception', 'Exception'), ('done', 'Done'),
('cancelled', 'Cancelled')], 'State'),
@ -400,8 +412,14 @@ class marketing_campaign_workitem(osv.osv):
self.create(cr, uid, workitem_vals)
return True
def button_draft(self, cr, uid, workitem_ids, context={}):
for wi in self.browse(cr, uid, workitem_ids, context=context):
if wi.state=='exception':
self.write(cr, uid, [wi.id], {'state':'todo'}, context=context)
return True
def button_cancel(self, cr, uid, workitem_ids, context={}):
for wi in self.browse(cr, uid, workitem_ids):
for wi in self.browse(cr, uid, workitem_ids, context=context):
if wi.state in ('todo','exception'):
self.write(cr, uid, [wi.id], {'state':'cancelled'}, context=context)
return True
@ -419,14 +437,18 @@ class marketing_campaign_workitem(osv.osv):
}
expr = eval(str(wi.activity_id.condition), eval_context)
if expr:
try :
try:
result = True
if wi.campaign_id.mode in ('manual','active'):
self.pool.get('marketing.campaign.activity').process(
result = self.pool.get('marketing.campaign.activity').process(
cr, uid, wi.activity_id.id, wi.id, context)
self.write(cr, uid, wi.id, {'state': 'done'})
self.process_chain(cr, uid, wi.id, context)
if result:
self.write(cr, uid, wi.id, {'state': 'done'})
self.process_chain(cr, uid, wi.id, context)
else:
self.write(cr, uid, wi.id, {'state': 'exception'})
except Exception,e:
self.write(cr, uid, wi.id, {'state': 'exception'})
self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
else :
self.write(cr, uid, wi.id, {'state': 'cancelled'})
@ -444,7 +466,7 @@ class marketing_campaign_workitem(osv.osv):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
else:
# manual states are not processed automatically
pass
workitem_ids = []
if workitem_ids:
self.process(cr, uid, workitem_ids, context)

13
addons/marketing_campaign/marketing_campaign_view.xml Executable file → Normal file
View File

@ -182,15 +182,15 @@
</group>
<group colspan="2" col="2">
<separator string="Synchronization" colspan="2"/>
<field name="sync_last_date"/>
<field name="sync_mode" required="True"/>
<field name="sync_last_date"/>
<label string="" colspan="1"/>
<button string="Synchronize" states="running" name="synchroniz" icon="gtk-apply" type="object"/>
</group>
<group colspan="2" col="2">
<separator string="Dates" colspan="2"/>
<field name="date_run" attrs="{'readonly':[('date_run','!=',False),('state','=','running')]}"/>
<field name="date_done"/>
<field name="date_run" readonly="1"/>
<field name="date_done" readonly="1"/>
</group>
<separator string="Status" colspan="4"/>
<group col="10" colspan="4">
@ -397,11 +397,16 @@
<button string="Preview" states="todo" name="preview" icon="gtk-apply" type="object"/>
</group>
</group>
<group colspan="4" col="4" attrs="{'invisible':[('state','!=','exception')]}">
<separator string="Error Message" colspan="4"/>
<field name="error_msg" nolabel="1" colspan="4"/>
</group>
<separator string="Status" colspan="4"/>
<group colspan="4" col="11">
<field name="state" nolabel="1" readonly="True" select="1"/>
<button string="Retry" states="exception" name="button_draft" type="object" icon="gtk-ok"/>
<button string="Process" states="todo" name="process" type="object" icon="gtk-ok"/>
<button string="Cancel" states="todo" name="button_cancel" type="object" icon="gtk-cancel"/>
<button string="Cancel" states="todo,exception" name="button_cancel" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>

View File

@ -0,0 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
"access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
"access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
"access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
"access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
"access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing_campaign.res_groups_marketing_campaign",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_marketing_campaign_admin marketing.campaign model_marketing_campaign marketing_campaign.res_groups_marketing_campaign 1 1 1 1
3 access_marketing_campaign_segment_campaignadmin marketing.campaign.segment model_marketing_campaign_segment marketing_campaign.res_groups_marketing_campaign 1 1 1 1
4 access_marketing_campaign_activity_campaignadmin marketing.campaign.activity model_marketing_campaign_activity marketing_campaign.res_groups_marketing_campaign 1 1 1 1
5 access_marketing_campaign_workitem_campaignadmin marketing.campaign.workitem model_marketing_campaign_workitem marketing_campaign.res_groups_marketing_campaign 1 1 1 1
6 access_marketing_campaign_transition_campaignadmin marketing.campaign.transition model_marketing_campaign_transition marketing_campaign.res_groups_marketing_campaign 1 1 1 1
7 access_marketing_campaign_analysis_campaignadmin campaign.analysis model_campaign_analysis marketing_campaign.res_groups_marketing_campaign 1 0 0 0

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="res_groups_marketing_campaign" model="res.groups">
<field name="name">Marketing / Campaign</field>
</record>
</data>
</openerp>

View File

@ -34,7 +34,7 @@
* Notes for the technician and for the final customer
""",
'author': 'Tiny',
'depends': ['base', 'sale', 'account'],
'depends': ['mrp', 'sale', 'account'],
'update_xml': [
'security/ir.model.access.csv',
'mrp_repair_sequence.xml',

View File

@ -8,7 +8,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" name="%(mrp_procurement.mrp_procurement_action5)d" string="Procurement Exceptions" width="510" />
<action colspan="4" name="%(procurement.procurement_action5)d" string="Procurement Exceptions" width="510" />
</xpath>
</field>
</record>

View File

@ -18,7 +18,6 @@
"access_product_ul_user","product.ul.user","model_product_ul","base.group_user",1,0,0,0
"access_product_category_user","product.category.user","model_product_category","base.group_user",1,0,0,0
"access_product_template_user","product.template.user","model_product_template","base.group_user",1,0,0,0
"access_product_product_user","product.product.user","model_product_product","base.group_user",1,0,0,0
"access_product_packaging_user","product.packaging.user","model_product_packaging","base.group_user",1,0,0,0
"access_product_supplierinfo_user","product.supplierinfo.user","model_product_supplierinfo","base.group_user",1,0,0,0
"access_pricelist_partnerinfo_user","pricelist.partnerinfo.user","model_pricelist_partnerinfo","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
18 access_product_ul_user product.ul.user model_product_ul base.group_user 1 0 0 0
19 access_product_category_user product.category.user model_product_category base.group_user 1 0 0 0
20 access_product_template_user product.template.user model_product_template base.group_user 1 0 0 0
access_product_product_user product.product.user model_product_product base.group_user 1 0 0 0
21 access_product_packaging_user product.packaging.user model_product_packaging base.group_user 1 0 0 0
22 access_product_supplierinfo_user product.supplierinfo.user model_product_supplierinfo base.group_user 1 0 0 0
23 access_pricelist_partnerinfo_user pricelist.partnerinfo.user model_pricelist_partnerinfo base.group_user 1 0 0 0

View File

@ -48,7 +48,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['product', 'stock', 'mrp_procurement', 'process','board'],
'depends': ['product', 'stock', 'procurement', 'process','board'],
'init_xml': [],
'update_xml': [
'wizard/sale_make_invoice_advance.xml',

View File

@ -16,12 +16,11 @@
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
"access_sale_order_line_manager","sale.order.line.manager","model_sale_order_line","group_sale_manager",1,1,1,1
"access_sale_report","sale.report","model_sale_report","group_sale_user",1,1,1,0
"access_sale_report_manager","sale.report","model_sale_report","group_sale_manager",1,1,1,1
"access_sale_report_manager","sale.report","model_sale_report","group_sale_manager",1,0,0,0
"access_sale_order_line_make_invoice","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_user",1,1,1,0
"access_sale_order_line_make_invoice_manager","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_manager",1,1,1,1
"access_sale_advance_payment_inv","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_user",1,1,1,0
"access_sale_advance_payment_inv_manager","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_manager",1,1,1,1
"access_sale_open_invoice","sale.open.invoice","model_sale_open_invoice","group_sale_user",1,1,1,0
"access_sale_open_invoice_manager","sale.open.invoice","model_sale_open_invoice","group_sale_manager",1,1,1,1
"access_product_product_sale_user","product.product.sale.user","model_product_product","group_sale_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
16 access_sale_order_line_stock_worker sale.order.line stock worker model_sale_order_line stock.group_stock_user 1 1 0 0
17 access_sale_order_manager sale.order.manager model_sale_order group_sale_manager 1 1 1 1
18 access_sale_order_line_manager sale.order.line.manager model_sale_order_line group_sale_manager 1 1 1 1
19 access_sale_report access_sale_report_manager sale.report model_sale_report group_sale_user group_sale_manager 1 1 0 1 0 0
access_sale_report_manager sale.report model_sale_report group_sale_manager 1 1 1 1
20 access_sale_order_line_make_invoice sale.order.line.make.invoice model_sale_order_line_make_invoice group_sale_user 1 1 1 0
21 access_sale_order_line_make_invoice_manager sale.order.line.make.invoice model_sale_order_line_make_invoice group_sale_manager 1 1 1 1
22 access_sale_advance_payment_inv sale.advance.payment.inv model_sale_advance_payment_inv group_sale_user 1 1 1 0
23 access_sale_advance_payment_inv_manager sale.advance.payment.inv model_sale_advance_payment_inv group_sale_manager 1 1 1 1
24 access_sale_open_invoice sale.open.invoice model_sale_open_invoice group_sale_user 1 1 1 0
25 access_sale_open_invoice_manager sale.open.invoice model_sale_open_invoice group_sale_manager 1 1 1 1
26 access_product_product_sale_user product.product.sale.user model_product_product group_sale_user 1 0 0 0

View File

@ -23,7 +23,6 @@
<form string="Warehouse board">
<hpaned position="100">
<child1>
<action colspan="4" name="%(procurement.procurement_action5)d" string="Procurement Exceptions" width="510" />
<action colspan="4" name="%(action_reception_picking_move_board)d" string="Products To Receive" />
</child1>