@@ -1608,8 +1608,8 @@ class account_model_line(osv.osv):
|
||||
}
|
||||
_order = 'sequence'
|
||||
_sql_constraints = [
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model !'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model !'),
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
|
||||
]
|
||||
account_model_line()
|
||||
|
||||
|
||||
+11
-11
@@ -29,17 +29,17 @@ from mx.DateTime import RelativeDateTime
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
||||
class fiscalyear_seq(osv.osv):
|
||||
_name = "fiscalyear.seq"
|
||||
_description = "Maintains Invoice sequences with Fiscal Year"
|
||||
_rec_name = 'fiscalyear_id'
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year',required=True),
|
||||
'sequence_id':fields.many2one('ir.sequence', 'Sequence',required=True),
|
||||
}
|
||||
|
||||
fiscalyear_seq()
|
||||
#class fiscalyear_seq(osv.osv):
|
||||
# _name = "fiscalyear.seq"
|
||||
# _description = "Maintains Invoice sequences with Fiscal Year"
|
||||
# _rec_name = 'fiscalyear_id'
|
||||
# _columns = {
|
||||
# 'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
# 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year',required=True),
|
||||
# 'sequence_id':fields.many2one('ir.sequence', 'Sequence',required=True),
|
||||
# }
|
||||
#
|
||||
#fiscalyear_seq()
|
||||
|
||||
class account_invoice(osv.osv):
|
||||
def _amount_all(self, cr, uid, ids, name, args, context=None):
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
|
||||
"access_fiscalyear_seq","fiscalyear.seq","model_fiscalyear_seq","account.group_account_invoice",1,1,1,1
|
||||
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
|
||||
|
||||
|
@@ -33,10 +33,10 @@
|
||||
<field name="project"/> <field name="knowledge"/>
|
||||
<field name="stock"/> <field name="mrp"/>
|
||||
<field name="account"/>
|
||||
<field name="charts" attrs="{readonly:[('account','=',False)]}"/>
|
||||
<field name="charts" attrs="{'readonly':[('account','=',False)]}"/>
|
||||
<field name="purchase"/> <field name="hr"/>
|
||||
<field name="pos"/> <field name="marketing"/>
|
||||
<field name="tools"/> <field name="report_design"/>
|
||||
<field name="point_of_sale"/> <field name="marketing"/>
|
||||
<field name="misc_tools"/> <field name="report_designer"/>
|
||||
<separator string="Generic Modules" colspan="4"/>
|
||||
<field name="profile_association"/>
|
||||
<field name="profile_training"/>
|
||||
|
||||
@@ -127,6 +127,16 @@ class CalDAV(object):
|
||||
if not model:
|
||||
continue
|
||||
uidval = common.openobjectid2uid(cr, data[map_field], model)
|
||||
cr.execute('select id from %s where recurrent_uid=%s'
|
||||
% (model.replace('.', '_'), data[map_field]))
|
||||
r_ids = map(lambda x: x[0], cr.fetchall())
|
||||
if r_ids:
|
||||
rdata = self.pool.get(model).read(cr, uid, r_ids)
|
||||
rcal = self.export_ical(cr, uid, rdata, context=context)
|
||||
for revents in rcal.contents['vevent']:
|
||||
ical.contents['vevent'].append(revents)
|
||||
if data.get('recurrent_uid', None):
|
||||
uidval = common.openobjectid2uid(cr, data['recurrent_uid'], model)
|
||||
vevent.add('uid').value = uidval
|
||||
elif field == 'attendee' and data[map_field]:
|
||||
attendee_obj = self.pool.get('basic.calendar.attendee')
|
||||
@@ -236,7 +246,7 @@ class Event(CalDAV, osv.osv_memory):
|
||||
'duration': None, # Use: O-1, Type: DURATION, Specifies a positive duration of time.
|
||||
'dtend': None, # Use: O-1, Type: DATE-TIME, Specifies the date and time that a calendar component ends.
|
||||
}
|
||||
def export_ical(self, cr, uid, datas, context={}):
|
||||
def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
|
||||
return super(Event, self).export_ical(cr, uid, datas, 'vevent', context=context)
|
||||
|
||||
Event()
|
||||
@@ -279,7 +289,7 @@ class ToDo(CalDAV, osv.osv_memory):
|
||||
'rrule': None,
|
||||
}
|
||||
|
||||
def export_ical(self, cr, uid, datas, context={}):
|
||||
def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
|
||||
return super(ToDo, self).export_ical(cr, uid, datas, 'vtodo', context=context)
|
||||
|
||||
ToDo()
|
||||
|
||||
@@ -56,7 +56,7 @@ class crm_claim(osv.osv):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
}
|
||||
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
|
||||
if not categ:
|
||||
|
||||
@@ -65,7 +65,7 @@ class crm_fundraising(osv.osv):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
}
|
||||
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
|
||||
if not categ:
|
||||
|
||||
+24
-12
@@ -26,8 +26,6 @@ from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import base64
|
||||
import re
|
||||
import time
|
||||
import tools
|
||||
|
||||
|
||||
class crm_meeting(osv.osv):
|
||||
@@ -53,8 +51,7 @@ class crm_meeting(osv.osv):
|
||||
'transp': {'field': 'transparent', 'type': 'text'},
|
||||
'uid': {'field': 'id', 'type': 'text'},
|
||||
'url': {'field': 'caldav_url', 'type': 'text'},
|
||||
'recurid': None,
|
||||
# 'attach': {'field': 'attachment_ids', 'sub-field': 'datas', 'type': 'list'},
|
||||
'recurrence-id': {'field': 'recurrent_id', 'type': 'datetime'},
|
||||
'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'},
|
||||
'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'},
|
||||
'comment': None,
|
||||
@@ -89,13 +86,13 @@ class crm_meeting(osv.osv):
|
||||
where id=%s"% (end.strftime("%Y-%m-%d %H:%M:%S"), id))
|
||||
return True
|
||||
|
||||
def onchange_rrule_type(self, cr, uid, ids, type, *args, **argv):
|
||||
if type == 'none':
|
||||
def onchange_rrule_type(self, cr, uid, ids, rtype, *args, **argv):
|
||||
if rtype == 'none' or not rtype:
|
||||
return {'value': {'rrule': ''}}
|
||||
if type == 'custom':
|
||||
if rtype == 'custom':
|
||||
return {}
|
||||
rrule = self.pool.get('calendar.custom.rrule')
|
||||
rrulestr = rrule.compute_rule_string(cr, uid, {'freq': type.upper(), \
|
||||
rrulestr = rrule.compute_rule_string(cr, uid, {'freq': rtype.upper(), \
|
||||
'interval': 1})
|
||||
return {'value': {'rrule': rrulestr}}
|
||||
|
||||
@@ -119,7 +116,6 @@ account for mail gateway.'),
|
||||
help='Category related to the section.Subdivide the CRM cases \
|
||||
independently or section-wise.'),
|
||||
'description': fields.text('Your action'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
|
||||
('confidential', 'Confidential')], 'Mark as'),
|
||||
'location': fields.char('Location', size=264, help="Location of Meeting"),
|
||||
@@ -138,6 +134,8 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'crm_attendee_rel', 'case_id', 'attendee_id', 'Attendees'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
'caldav_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
|
||||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -162,7 +160,7 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
crm_data = self.read(cr, uid, ids)
|
||||
event_obj = self.pool.get('basic.calendar.event')
|
||||
event_obj.__attribute__.update(self.__attribute__)
|
||||
ical = event_obj.export_ical(cr, uid, crm_data, {'model': self._name})
|
||||
ical = event_obj.export_ical(cr, uid, crm_data, context={'model': self._name})
|
||||
cal_val = ical.serialize()
|
||||
cal_val = cal_val.replace('"', '').strip()
|
||||
return cal_val
|
||||
@@ -267,6 +265,18 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
return ids and ids[0] or False
|
||||
return ids
|
||||
|
||||
def modify_this(self, cr, uid, ids, defaults, context=None, *args):
|
||||
datas = self.read(cr, uid, ids[0], context=context)
|
||||
date = datas.get('date')
|
||||
defaults.update({
|
||||
'recurrent_uid': common.caldav_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date'),
|
||||
'rrule_type': 'none',
|
||||
'rrule': ''
|
||||
})
|
||||
new_id = self.copy(cr, uid, ids[0], default=defaults, context=context)
|
||||
return new_id
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
context=None, count=False):
|
||||
args_without_date = []
|
||||
@@ -356,11 +366,13 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
else:
|
||||
ids = map(lambda x: common.caldav_id2real_id(x), ids)
|
||||
res = super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids))
|
||||
self.do_alarm_unlink(cr, uid, ids)
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
alarm_obj.do_alarm_unlink(cr, uid, ids, self._name)
|
||||
else:
|
||||
ids = map(lambda x: common.caldav_id2real_id(x), ids)
|
||||
res = super(crm_meeting, self).unlink(cr, uid, ids)
|
||||
self.do_alarm_unlink(cr, uid, ids)
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
alarm_obj.do_alarm_unlink(cr, uid, ids, self._name)
|
||||
return res
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<field name="date_deadline" string="End Date" required="1" />
|
||||
<field name="location" />
|
||||
<field name="categ_id" widget="selection" />
|
||||
<group colspan="2" col="3">
|
||||
<group colspan="2" col="3" attrs="{'readonly':[('recurrent_uid','!=',False)]}">
|
||||
<field name="rrule_type" string="Recurrency"
|
||||
on_change="onchange_rrule_type(rrule_type)"
|
||||
colspan="1" />
|
||||
@@ -46,8 +46,7 @@
|
||||
context="{'model' : 'crm.meeting'}" colspan="2"/>
|
||||
<field name="attendee_ids" colspan="4"
|
||||
nolabel="1" widget="one2many" mode="tree,form">
|
||||
<tree string="Atendee details"
|
||||
editable="top">
|
||||
<tree string="Atendee details" editable="top">
|
||||
<field name="email" />
|
||||
<field name="role" select="1" />
|
||||
<field name="state" />
|
||||
@@ -63,7 +62,7 @@
|
||||
<field name="state" />
|
||||
</page>
|
||||
<page string="Other">
|
||||
<field name="user_id" select="1" />
|
||||
<field name="user_id"/>
|
||||
<field name="partner_address_id" select="1" />
|
||||
<newline />
|
||||
</page>
|
||||
@@ -76,9 +75,17 @@
|
||||
<field name="show_as"/>
|
||||
<field name="class"/>
|
||||
<field name="user_id"/>
|
||||
<field name="rrule" invisible="1"/>
|
||||
<field name="recurrent_id" invisible="1" />
|
||||
<field name="recurrent_uid" invisible="1" />
|
||||
<field name="rrule" invisible="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="3" colspan="4" attrs="{'invisible':[('rrule_type','in', ('none', False))]}">
|
||||
<label string="" />
|
||||
<button string="Modify this Occurrence"
|
||||
name="%(crm.wizard_meeting_edit_this)d" icon="gtk-save"
|
||||
type="action" context="{'model' : 'crm.meeting'}" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -9,9 +9,12 @@
|
||||
name="caldav.crm.subscribe" id="wizard_crm_cal_subscribe" multi="True"
|
||||
/>
|
||||
|
||||
<wizard string="Export ICS File" model="crm.meeting" name="caldav.crm.export"
|
||||
id="wizard_crm_cal_export" multi="True"
|
||||
/>
|
||||
<wizard string="Export ICS File" model="crm.meeting"
|
||||
name="caldav.crm.export" id="wizard_crm_cal_export" multi="True" />
|
||||
|
||||
<wizard string="Edit this meeting" model="crm.meeting"
|
||||
name="crm.meeting.edit.this" id="wizard_meeting_edit_this"
|
||||
menu="False" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -57,9 +57,8 @@ class crm_phonecall(osv.osv):
|
||||
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
|
||||
if not categ:
|
||||
return {'value':{}}
|
||||
cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability
|
||||
return {'value':{'probability':cat}}
|
||||
|
||||
cat = self.pool.get('crm.phonecall.categ').browse(cr, uid, categ, context).probability
|
||||
return {'value':{'probability':cat}}
|
||||
|
||||
crm_phonecall()
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import crm_opportunity_wizard
|
||||
import crm_lead_wizard
|
||||
import crm_phonecall_wizard
|
||||
import crm_meeting_edit_wizard
|
||||
|
||||
|
||||
import wizard_crm_send_email
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
class meeting_edit_this(wizard.interface):
|
||||
case_form = """<?xml version="1.0"?>
|
||||
<form string="Edit Meeting">
|
||||
<separator string="" colspan="4" />
|
||||
<newline />
|
||||
<field name='name' colspan="4" />
|
||||
<newline />
|
||||
<field name='location' colspan="4" />
|
||||
<newline />
|
||||
<field name='categ_id'/>
|
||||
<newline />
|
||||
<field name='date' />
|
||||
<field name='date_deadline' />
|
||||
<newline />
|
||||
<field name='alarm_id'/>
|
||||
</form>"""
|
||||
|
||||
case_fields = {
|
||||
'name': {'string': 'Title', 'type': 'char', 'size': 64},
|
||||
'date': {'string': 'Start Date', 'type': 'datetime'},
|
||||
'date_deadline': {'string': 'End Date', 'type': 'datetime'},
|
||||
'location': {'string': 'Location', 'type': 'char', 'size': 124},
|
||||
'categ_id': {'string': 'Category', 'type': 'many2one', 'relation': 'crm.meeting.categ'},
|
||||
'alarm_id': {'string': 'Reminder', 'type': 'many2one', 'relation': 'res.alarm'},
|
||||
}
|
||||
|
||||
def _default_values(self, cr, uid, data, context):
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
|
||||
case = case_obj.read(cr, uid, data['id'], ['name', 'location', 'date',\
|
||||
'date_deadline', 'categ_id', 'alarm_id'])
|
||||
return case
|
||||
|
||||
def _modify_this(self, cr, uid, datas, *args):
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
|
||||
new_id = case_obj.modify_this(cr, uid, [datas['id']], datas['form'])
|
||||
value = {
|
||||
'name': 'New event',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'crm.meeting',
|
||||
'res_id': new_id,
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
return value
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_default_values],
|
||||
'result': {'type': 'form', 'arch': case_form, 'fields': case_fields,
|
||||
'state': [('end', 'Cancel', 'gtk-cancel'), ('edit', '_Save', 'gtk-save')]}
|
||||
},
|
||||
'edit': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _modify_this, 'state': 'end'}
|
||||
}
|
||||
}
|
||||
|
||||
meeting_edit_this('crm.meeting.edit.this')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -508,11 +508,10 @@ class message(osv.osv):
|
||||
message()
|
||||
|
||||
def _project_get(self, cr, uid, context={}):
|
||||
obj = self.pool.get('project.project')
|
||||
ids = obj.search(cr, uid, [])
|
||||
res = obj.read(cr, uid, ids, ['id','name'], context)
|
||||
res = [(str(r['id']),r['name']) for r in res]
|
||||
return res
|
||||
cr.execute("""SELECT to_char(id, '99999'),name FROM project_project where manager=%s OR
|
||||
id IN (SELECT project_id from project_user_rel where uid=%s)""" % (uid, uid))
|
||||
projects = cr.fetchall()
|
||||
return projects
|
||||
|
||||
class users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="project_task_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('project_id','=',False),('project_id','=',user.context_project_id)]</field>
|
||||
<field name="domain_force">['|',('project_id','=',False),('project_id','in',[user.context_project_id])]</field>
|
||||
<field name="rule_group" ref="project_task_rule_group"/>
|
||||
</record>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="project_task_work_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('task_id.project_id','=',False),('task_id.project_id','=',user.context_project_id)]</field>
|
||||
<field name="domain_force">['|',('task_id.project_id','=',False),('task_id.project_id','in',[user.context_project_id])]</field>
|
||||
<field name="rule_group" ref="project_task_work_rule_group"/>
|
||||
</record>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="project_project_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('id','=',False),('id','=',user.context_project_id)]</field>
|
||||
<field name="domain_force">['|',('id','=',False),('id','in',[user.context_project_id])]</field>
|
||||
<field name="rule_group" ref="project_project_rule_group"/>
|
||||
</record>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="project_message_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('project_id','=',False),('project_id','=',user.context_project_id)]</field>
|
||||
<field name="domain_force">['|',('project_id','=',False),('project_id','in',[user.context_project_id])]</field>
|
||||
<field name="rule_group" ref="project_message_rule_group"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ class messages(osv.osv):
|
||||
logger = netsvc.Logger()
|
||||
|
||||
_columns = {
|
||||
'from_id':fields.many2one('res.users', 'From', ondelete="CASCADE"),
|
||||
'to_id':fields.many2one('res.users', 'To', ondelete="CASCADE"),
|
||||
'project_id':fields.many2one('project.project', 'Project',
|
||||
required=True, ondelete="CASCADE"),
|
||||
|
||||
Reference in New Issue
Block a user