@@ -74,13 +74,13 @@
|
||||
<page string="Accounting" position="inside">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_receivable"/>
|
||||
<field name="property_account_receivable" groups="base.group_extended" />
|
||||
<field name="property_account_position" widget="selection"/>
|
||||
<field name="property_payment_term" widget="selection"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Supplier Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_payable" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Credit" colspan="2"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,34 +15,35 @@
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
"name" : "Basic Calendar Functionality",
|
||||
"version" : "1.0",
|
||||
"depends" : ["base"],
|
||||
"name" : "Basic Calendar Functionality",
|
||||
"version" : "1.0",
|
||||
"depends" : ["base"],
|
||||
'description': """Full featured calendar system that support:
|
||||
- Alerts (create requests)
|
||||
- Recurring events (*)
|
||||
- Invitations to others people""",
|
||||
"author" : "Tiny",
|
||||
'category': 'Generic Modules/Others',
|
||||
'website': 'http://www.openerp.com',
|
||||
- Invitations to others people""",
|
||||
"author" : "Tiny",
|
||||
'category': 'Generic Modules/Others',
|
||||
'website': 'http://www.openerp.com',
|
||||
"init_xml" : [
|
||||
'base_calendar_data.xml'
|
||||
],
|
||||
"demo_xml" : [],
|
||||
],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/calendar_event_edit_all_view.xml',
|
||||
'wizard/base_calendar_invite_attendee_view.xml',
|
||||
'wizard/calendar_event_edit_all_view.xml',
|
||||
'wizard/base_calendar_invite_attendee_view.xml',
|
||||
'wizard/base_calendar_set_exrule_view.xml',
|
||||
'base_calendar_view.xml'
|
||||
],
|
||||
"test" : ['test/base_calendar_test.yml'],
|
||||
"installable" : True,
|
||||
"active" : False,
|
||||
],
|
||||
# "test" : ['test/base_calendar_test.yml'],
|
||||
"installable" : True,
|
||||
"active" : False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -44,7 +44,6 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None, exrule=None):
|
||||
@param startdate: Startdate for computing recurrent dates
|
||||
@return: List of Recurrent dates
|
||||
"""
|
||||
|
||||
def todate(date):
|
||||
val = parser.parse(''.join((re.compile('\d')).findall(date)))
|
||||
return val
|
||||
@@ -313,60 +312,60 @@ class calendar_attendee(osv.osv):
|
||||
'cutype': fields.selection([('individual', 'Individual'), \
|
||||
('group', 'Group'), ('resource', 'Resource'), \
|
||||
('room', 'Room'), ('unknown', '') ], \
|
||||
'Invite Type', help="Specify the type of Invitation"),
|
||||
'member': fields.char('Member', size=124,
|
||||
help="Indicate the groups that the attendee belongs to"),
|
||||
'Invite Type', help="Specify the type of Invitation"),
|
||||
'member': fields.char('Member', size=124,
|
||||
help="Indicate the groups that the attendee belongs to"),
|
||||
'role': fields.selection([('req-participant', 'Participation required'), \
|
||||
('chair', 'Chair Person'), \
|
||||
('opt-participant', 'Optional Participation'), \
|
||||
('non-participant', 'For information Purpose')], 'Role', \
|
||||
help='Participation role for the calendar user'),
|
||||
'state': fields.selection([('tentative', 'Tentative'),
|
||||
('needs-action', 'Needs Action'),
|
||||
('accepted', 'Accepted'),
|
||||
('declined', 'Declined'),
|
||||
help='Participation role for the calendar user'),
|
||||
'state': fields.selection([('tentative', 'Tentative'),
|
||||
('needs-action', 'Needs Action'),
|
||||
('accepted', 'Accepted'),
|
||||
('declined', 'Declined'),
|
||||
('delegated', 'Delegated')], 'State', readonly=True, \
|
||||
help="Status of the attendee's participation"),
|
||||
'rsvp': fields.boolean('Required Reply?',
|
||||
help="Indicats whether the favor of a reply is requested"),
|
||||
help="Status of the attendee's participation"),
|
||||
'rsvp': fields.boolean('Required Reply?',
|
||||
help="Indicats whether the favor of a reply is requested"),
|
||||
'delegated_to': fields.function(_compute_data, method=True, \
|
||||
string='Delegated To', type="char", size=124, store=True, \
|
||||
multi='delegated_to', help="The users that the original \
|
||||
request was delegated to"),
|
||||
request was delegated to"),
|
||||
'delegated_from': fields.function(_compute_data, method=True, string=\
|
||||
'Delegated From', type="char", store=True, size=124, multi='delegated_from'),
|
||||
'Delegated From', type="char", store=True, size=124, multi='delegated_from'),
|
||||
'parent_ids': fields.many2many('calendar.attendee', 'calendar_attendee_parent_rel', \
|
||||
'attendee_id', 'parent_id', 'Delegrated From'),
|
||||
'attendee_id', 'parent_id', 'Delegrated From'),
|
||||
'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel', \
|
||||
'attendee_id', 'child_id', 'Delegrated To'),
|
||||
'attendee_id', 'child_id', 'Delegrated To'),
|
||||
'sent_by': fields.function(_compute_data, method=True, string='Sent By', \
|
||||
type="char", multi='sent_by', store=True, size=124, \
|
||||
help="Specify the user that is acting on behalf of the calendar user"),
|
||||
help="Specify the user that is acting on behalf of the calendar user"),
|
||||
'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', \
|
||||
type="many2one", relation="res.users", multi='sent_by_uid'),
|
||||
type="many2one", relation="res.users", multi='sent_by_uid'),
|
||||
'cn': fields.function(_compute_data, method=True, string='Common name', \
|
||||
type="char", size=124, multi='cn', store=True),
|
||||
type="char", size=124, multi='cn', store=True),
|
||||
'dir': fields.char('URI Reference', size=124, help="Reference to the URI\
|
||||
that points to the directory information corresponding to the attendee."),
|
||||
that points to the directory information corresponding to the attendee."),
|
||||
'language': fields.function(_compute_data, method=True, string='Language', \
|
||||
type="selection", selection=_lang_get, multi='language', \
|
||||
store=True, help="To specify the language for text values in a\
|
||||
property or property parameter."),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact'),
|
||||
property or property parameter."),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact'),
|
||||
'partner_id': fields.related('partner_address_id', 'partner_id', type='many2one', \
|
||||
relation='res.partner', string='Partner', help="Partner related to contact"),
|
||||
'email': fields.char('Email', size=124, help="Email of Invited Person"),
|
||||
relation='res.partner', string='Partner', help="Partner related to contact"),
|
||||
'email': fields.char('Email', size=124, help="Email of Invited Person"),
|
||||
'event_date': fields.function(_compute_data, method=True, string='Event Date', \
|
||||
type="datetime", multi='event_date'),
|
||||
type="datetime", multi='event_date'),
|
||||
'event_end_date': fields.function(_compute_data, method=True, \
|
||||
string='Event End Date', type="datetime", \
|
||||
multi='event_end_date'),
|
||||
'ref': fields.reference('Event Ref', selection=_links_get, size=128),
|
||||
'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"),
|
||||
multi='event_end_date'),
|
||||
'ref': fields.reference('Event Ref', selection=_links_get, size=128),
|
||||
'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *x: 'needs-action',
|
||||
'state': lambda *x: 'needs-action',
|
||||
}
|
||||
|
||||
def get_ics_file(self, cr, uid, event_obj, context=None):
|
||||
@@ -401,7 +400,7 @@ property or property parameter."),
|
||||
event.add('location').value = event_obj.location
|
||||
if event_obj.rrule:
|
||||
event.add('rrule').value = event_obj.rrule
|
||||
|
||||
|
||||
if event_obj.alarm_id:
|
||||
# computes alarm data
|
||||
valarm = event.add('valarm')
|
||||
@@ -422,10 +421,10 @@ property or property parameter."),
|
||||
if interval == 'minutes':
|
||||
delta = timedelta(minutes=duration)
|
||||
trigger.value = delta
|
||||
|
||||
|
||||
# Compute other details
|
||||
valarm.add('DESCRIPTION').value = alarm_data['name'] or 'OpenERP'
|
||||
|
||||
|
||||
for attendee in event_obj.attendee_ids:
|
||||
attendee_add = event.add('attendee')
|
||||
attendee_add.params['CUTYPE'] = [str(attendee.cutype)]
|
||||
@@ -434,7 +433,7 @@ property or property parameter."),
|
||||
attendee_add.value = 'MAILTO:' + attendee.email
|
||||
res = cal.serialize()
|
||||
return res
|
||||
|
||||
|
||||
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}):
|
||||
"""
|
||||
Send mail for calendar attendee.
|
||||
@@ -457,14 +456,14 @@ property or property parameter."),
|
||||
att_infos.append(((att2.user_id and att2.user_id.name) or \
|
||||
(att2.partner_id and att2.partner_id.name) or \
|
||||
att2.email) + ' - Status: ' + att2.state.title())
|
||||
body_vals = {'name': res_obj.name,
|
||||
'start_date': res_obj.date,
|
||||
'end_date': res_obj.date_deadline or False,
|
||||
'description': res_obj.description or '-',
|
||||
'location': res_obj.location or '-',
|
||||
'attendees': '<br>'.join(att_infos),
|
||||
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
||||
'sign': sign,
|
||||
body_vals = {'name': res_obj.name,
|
||||
'start_date': res_obj.date,
|
||||
'end_date': res_obj.date_deadline or False,
|
||||
'description': res_obj.description or '-',
|
||||
'location': res_obj.location or '-',
|
||||
'attendees': '<br>'.join(att_infos),
|
||||
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
||||
'sign': sign,
|
||||
'company': company
|
||||
}
|
||||
body = html_invitation % body_vals
|
||||
@@ -564,30 +563,30 @@ class res_alarm(osv.osv):
|
||||
_name = 'res.alarm'
|
||||
_description = 'Basic Alarm Information'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True),
|
||||
'name':fields.char('Name', size=256, required=True),
|
||||
'trigger_occurs': fields.selection([('before', 'Before'), \
|
||||
('after', 'After')], \
|
||||
'Triggers', required=True),
|
||||
'Triggers', required=True),
|
||||
'trigger_interval': fields.selection([('minutes', 'Minutes'), \
|
||||
('hours', 'Hours'), \
|
||||
('days', 'Days')], 'Interval', \
|
||||
required=True),
|
||||
'trigger_duration': fields.integer('Duration', required=True),
|
||||
required=True),
|
||||
'trigger_duration': fields.integer('Duration', required=True),
|
||||
'trigger_related': fields.selection([('start', 'The event starts'), \
|
||||
('end', 'The event ends')], \
|
||||
'Related to', required=True),
|
||||
'Related to', required=True),
|
||||
'duration': fields.integer('Duration', help="""Duration' and 'Repeat' \
|
||||
are both optional, but if one occurs, so MUST the other"""),
|
||||
'repeat': fields.integer('Repeat'),
|
||||
are both optional, but if one occurs, so MUST the other"""),
|
||||
'repeat': fields.integer('Repeat'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to \
|
||||
true, it will allow you to hide the event alarm information without removing it.")
|
||||
}
|
||||
_defaults = {
|
||||
'trigger_interval': lambda *x: 'minutes',
|
||||
'trigger_duration': lambda *x: 5,
|
||||
'trigger_occurs': lambda *x: 'before',
|
||||
'trigger_related': lambda *x: 'start',
|
||||
'active': lambda *x: 1,
|
||||
'trigger_interval': lambda *x: 'minutes',
|
||||
'trigger_duration': lambda *x: 5,
|
||||
'trigger_occurs': lambda *x: 'before',
|
||||
'trigger_related': lambda *x: 'start',
|
||||
'active': lambda *x: 1,
|
||||
}
|
||||
|
||||
def do_alarm_create(self, cr, uid, ids, model, date, context={}):
|
||||
@@ -615,20 +614,20 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
self.do_alarm_unlink(cr, uid, [data.id], model)
|
||||
if basic_alarm:
|
||||
vals = {
|
||||
'action': 'display',
|
||||
'description': data.description,
|
||||
'name': data.name,
|
||||
'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))],
|
||||
'trigger_related': basic_alarm.trigger_related,
|
||||
'trigger_duration': basic_alarm.trigger_duration,
|
||||
'trigger_occurs': basic_alarm.trigger_occurs,
|
||||
'trigger_interval': basic_alarm.trigger_interval,
|
||||
'duration': basic_alarm.duration,
|
||||
'repeat': basic_alarm.repeat,
|
||||
'state': 'run',
|
||||
'event_date': data[date],
|
||||
'res_id': data.id,
|
||||
'model_id': model_id,
|
||||
'action': 'display',
|
||||
'description': data.description,
|
||||
'name': data.name,
|
||||
'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))],
|
||||
'trigger_related': basic_alarm.trigger_related,
|
||||
'trigger_duration': basic_alarm.trigger_duration,
|
||||
'trigger_occurs': basic_alarm.trigger_occurs,
|
||||
'trigger_interval': basic_alarm.trigger_interval,
|
||||
'duration': basic_alarm.duration,
|
||||
'repeat': basic_alarm.repeat,
|
||||
'state': 'run',
|
||||
'event_date': data[date],
|
||||
'res_id': data.id,
|
||||
'model_id': model_id,
|
||||
'user_id': uid
|
||||
}
|
||||
alarm_id = alarm_obj.create(cr, uid, vals)
|
||||
@@ -702,8 +701,8 @@ class calendar_alarm(osv.osv):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'action': lambda *x: 'email',
|
||||
'state': lambda *x: 'run',
|
||||
'action': lambda *x: 'email',
|
||||
'state': lambda *x: 'run',
|
||||
}
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
"""
|
||||
@@ -754,11 +753,11 @@ class calendar_alarm(osv.osv):
|
||||
for alarm in self.browse(cr, uid, alarm_ids):
|
||||
if alarm.action == 'display':
|
||||
value = {
|
||||
'name': alarm.name,
|
||||
'act_from': alarm.user_id.id,
|
||||
'act_to': alarm.user_id.id,
|
||||
'body': alarm.description,
|
||||
'trigger_date': alarm.trigger_date,
|
||||
'name': alarm.name,
|
||||
'act_from': alarm.user_id.id,
|
||||
'act_to': alarm.user_id.id,
|
||||
'body': alarm.description,
|
||||
'trigger_date': alarm.trigger_date,
|
||||
'ref_doc1': '%s,%s' % (alarm.model_id.model, alarm.res_id)
|
||||
}
|
||||
request_id = request_obj.create(cr, uid, value)
|
||||
@@ -788,9 +787,9 @@ class calendar_alarm(osv.osv):
|
||||
mail_to.append(att.user_id.address_id.email)
|
||||
if mail_to:
|
||||
tools.email_send(
|
||||
tools.config.get('email_from', False),
|
||||
mail_to,
|
||||
sub,
|
||||
tools.config.get('email_from', False),
|
||||
mail_to,
|
||||
sub,
|
||||
body
|
||||
)
|
||||
self.write(cr, uid, [alarm.id], {'state':'done'})
|
||||
@@ -820,12 +819,12 @@ class calendar_event(osv.osv):
|
||||
return {}
|
||||
event = self.browse(cr, uid, ids, context=context)[0]
|
||||
value = {
|
||||
'date': event.date and event.date[:11] + '00:00:00',
|
||||
'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00',
|
||||
'duration': 24
|
||||
'date': event.date and event.date[:11] + '00:00:00',
|
||||
'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00',
|
||||
'duration': 24
|
||||
}
|
||||
return {'value': value}
|
||||
|
||||
|
||||
def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context={}):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@@ -847,8 +846,8 @@ class calendar_event(osv.osv):
|
||||
if allday: # For all day event
|
||||
start = start_date[:11] + '00:00:00'
|
||||
value = {
|
||||
'date': start,
|
||||
'date_deadline': start,
|
||||
'date': start,
|
||||
'date_deadline': start,
|
||||
'duration': 24
|
||||
}
|
||||
return {'value': value}
|
||||
@@ -877,7 +876,7 @@ class calendar_event(osv.osv):
|
||||
cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\
|
||||
mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\
|
||||
day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id))
|
||||
|
||||
|
||||
if not value:
|
||||
cr.execute("UPDATE %s set rrule_type='none' where id=%s" % (self._table, id))
|
||||
return True
|
||||
@@ -906,19 +905,19 @@ class calendar_event(osv.osv):
|
||||
for day in val['byday'].split(','):
|
||||
new_val[day] = True
|
||||
val.pop('byday')
|
||||
|
||||
|
||||
if val.get('until'):
|
||||
until = parser.parse(''.join((re.compile('\d')).findall(val.get('until'))))
|
||||
new_val['end_date'] = until.strftime('%Y-%m-%d')
|
||||
val.pop('until')
|
||||
new_val.pop('until')
|
||||
|
||||
|
||||
if val.get('bymonthday'):
|
||||
new_val['day'] = val.get('bymonthday')
|
||||
val.pop('bymonthday')
|
||||
new_val['select1'] = 'date'
|
||||
new_val.pop('bymonthday')
|
||||
|
||||
|
||||
if val.get('byday'):
|
||||
d = val.get('byday')
|
||||
if '-' in d:
|
||||
@@ -928,12 +927,12 @@ class calendar_event(osv.osv):
|
||||
new_val['byday'] = d[:1]
|
||||
new_val['week_list'] = d[1:3].upper()
|
||||
new_val['select1'] = 'day'
|
||||
|
||||
|
||||
if val.get('bymonth'):
|
||||
new_val['month_list'] = val.get('bymonth')
|
||||
val.pop('bymonth')
|
||||
new_val.pop('bymonth')
|
||||
|
||||
|
||||
for k, v in new_val.items():
|
||||
temp = ", %s='%s'" % (k, v)
|
||||
qry += temp
|
||||
@@ -941,9 +940,9 @@ class calendar_event(osv.osv):
|
||||
whr = " where id=%(id)s"
|
||||
qry = qry + whr
|
||||
val.update({
|
||||
'table': self._table,
|
||||
'rule_type': rrule_type,
|
||||
'id': id,
|
||||
'table': self._table,
|
||||
'rule_type': rrule_type,
|
||||
'id': id,
|
||||
})
|
||||
cr.execute(qry % val)
|
||||
return True
|
||||
@@ -968,7 +967,7 @@ class calendar_event(osv.osv):
|
||||
raise osv.except_osv('Warning!', 'Interval can not be Negative')
|
||||
if datas.get('count', 0) < 0:
|
||||
raise osv.except_osv('Warning!', 'Count can not be Negative')
|
||||
rrule_custom = self.compute_rule_string(cr, uid, datas,\
|
||||
rrule_custom = self.compute_rule_string(cr, uid, datas, \
|
||||
context=context)
|
||||
result[event] = rrule_custom
|
||||
else:
|
||||
@@ -977,40 +976,40 @@ class calendar_event(osv.osv):
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'id': fields.integer('ID'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'name': fields.char('Description', size=64, required=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'date_deadline': fields.datetime('Deadline'),
|
||||
'create_date': fields.datetime('Created', readonly=True),
|
||||
'duration': fields.float('Duration'),
|
||||
'description': fields.text('Your action'),
|
||||
'id': fields.integer('ID'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'name': fields.char('Description', size=64, required=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'date_deadline': fields.datetime('Deadline'),
|
||||
'create_date': fields.datetime('Created', readonly=True),
|
||||
'duration': fields.float('Duration'),
|
||||
'description': fields.text('Your action'),
|
||||
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
|
||||
('confidential', 'Confidential')], 'Mark as'),
|
||||
'location': fields.char('Location', size=264, help="Location of Event"),
|
||||
'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
|
||||
'Show as'),
|
||||
'base_calendar_url': fields.char('Caldav URL', size=264),
|
||||
'Show as'),
|
||||
'base_calendar_url': fields.char('Caldav URL', size=264),
|
||||
'exdate': fields.text('Exception Date/Times', help="This property \
|
||||
defines the list of date/time exceptions for arecurring calendar component."),
|
||||
defines the list of date/time exceptions for arecurring calendar component."),
|
||||
'exrule': fields.char('Exception Rule', size=352, help="defines a \
|
||||
rule or repeating pattern for an exception to a recurrence set"),
|
||||
rule or repeating pattern for an exception to a recurrence set"),
|
||||
'rrule': fields.function(_get_rulestring, type='char', size=124, method=True, \
|
||||
string='Recurrent Rule', store=True, \
|
||||
fnct_inv=_set_rrulestring, help='Defines a\
|
||||
rule or repeating pattern for recurring events\n\
|
||||
e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
||||
FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'),
|
||||
FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'),
|
||||
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
|
||||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
|
||||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24, \
|
||||
string='Timezone', store=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
string='Timezone', store=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'freq': fields.selection([('None', 'No Repeat'), \
|
||||
('secondly', 'Secondly'), \
|
||||
('minutely', 'Minutely'), \
|
||||
@@ -1018,44 +1017,44 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
||||
('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), \
|
||||
('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly')], 'Frequency'),
|
||||
'interval': fields.integer('Interval'),
|
||||
'count': fields.integer('Count'),
|
||||
'mo': fields.boolean('Mon'),
|
||||
'tu': fields.boolean('Tue'),
|
||||
'we': fields.boolean('Wed'),
|
||||
'th': fields.boolean('Thu'),
|
||||
'fr': fields.boolean('Fri'),
|
||||
'sa': fields.boolean('Sat'),
|
||||
'su': fields.boolean('Sun'),
|
||||
('yearly', 'Yearly')], 'Frequency'),
|
||||
'interval': fields.integer('Interval'),
|
||||
'count': fields.integer('Count'),
|
||||
'mo': fields.boolean('Mon'),
|
||||
'tu': fields.boolean('Tue'),
|
||||
'we': fields.boolean('Wed'),
|
||||
'th': fields.boolean('Thu'),
|
||||
'fr': fields.boolean('Fri'),
|
||||
'sa': fields.boolean('Sat'),
|
||||
'su': fields.boolean('Sun'),
|
||||
'select1': fields.selection([('date', 'Date of month'), \
|
||||
('day', 'Day of month')], 'Option'),
|
||||
'day': fields.integer('Date of month'),
|
||||
('day', 'Day of month')], 'Option'),
|
||||
'day': fields.integer('Date of month'),
|
||||
'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \
|
||||
('WE', 'Wednesday'), ('TH', 'Thursday'), \
|
||||
('FR', 'Friday'), ('SA', 'Saturday'), \
|
||||
('SU', 'Sunday')], 'Weekday'),
|
||||
('SU', 'Sunday')], 'Weekday'),
|
||||
'byday': fields.selection([('1', 'First'), ('2', 'Second'), \
|
||||
('3', 'Third'), ('4', 'Fourth'), \
|
||||
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
|
||||
'month_list': fields.selection(months.items(), 'Month'),
|
||||
'end_date': fields.date('Repeat Until'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
|
||||
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
|
||||
'month_list': fields.selection(months.items(), 'Month'),
|
||||
'end_date': fields.date('Repeat Until'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', \
|
||||
'event_id', 'attendee_id', 'Attendees'),
|
||||
'allday': fields.boolean('All Day'),
|
||||
'allday': fields.boolean('All Day'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to \
|
||||
true, it will allow you to hide the event alarm information without removing it.")
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'class': lambda *a: 'public',
|
||||
'show_as': lambda *a: 'busy',
|
||||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
'active': lambda *x: 1,
|
||||
'class': lambda *a: 'public',
|
||||
'show_as': lambda *a: 'busy',
|
||||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
'active': lambda *x: 1,
|
||||
}
|
||||
|
||||
|
||||
def open_event(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Open Event From for Editing
|
||||
@@ -1067,11 +1066,11 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
value = {}
|
||||
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'base_calendar', 'event_form_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view')
|
||||
id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view')
|
||||
@@ -1083,17 +1082,17 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
id4 = data_obj.browse(cr, uid, id4, context=context).res_id
|
||||
for id in ids:
|
||||
value = {
|
||||
'name': _('Event'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'calendar.event',
|
||||
'view_id': False,
|
||||
'name': _('Event'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'calendar.event',
|
||||
'view_id': False,
|
||||
'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': base_calendar_id2real_id(id),
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': base_calendar_id2real_id(id),
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
|
||||
return value
|
||||
|
||||
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args):
|
||||
@@ -1111,9 +1110,9 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
event_id = base_calendar_id2real_id(event_id)
|
||||
datas = self.read(cr, uid, event_id, context=context)
|
||||
defaults.update({
|
||||
'recurrent_uid': base_calendar_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date') or real_date,
|
||||
'rrule_type': 'none',
|
||||
'recurrent_uid': base_calendar_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date') or real_date,
|
||||
'rrule_type': 'none',
|
||||
'rrule': ''
|
||||
})
|
||||
exdate = datas['exdate'] and datas['exdate'].split(',') or []
|
||||
@@ -1131,7 +1130,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
@param event_ids: List of crm meeting’s IDs.
|
||||
@return: True
|
||||
"""
|
||||
|
||||
|
||||
for event_id in event_ids:
|
||||
event_id = base_calendar_id2real_id(event_id)
|
||||
|
||||
@@ -1146,7 +1145,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
qry += ", location = '%(location)s'"
|
||||
qry += "WHERE id = %s" % (event_id)
|
||||
cr.execute(qry %(defaults))
|
||||
|
||||
|
||||
return True
|
||||
|
||||
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100):
|
||||
@@ -1167,7 +1166,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
result = []
|
||||
if ids and (base_start_date or base_until_date):
|
||||
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \
|
||||
m.exdate from " + self._table + \
|
||||
m.exdate, m.exrule from " + self._table + \
|
||||
" m where m.id in ("\
|
||||
+ ','.join(map(lambda x: str(x), ids))+")")
|
||||
|
||||
@@ -1214,7 +1213,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
new_rule = '%s=%s' % (name, value)
|
||||
new_rrule_str.append(new_rule)
|
||||
new_rrule_str = ';'.join(new_rrule_str)
|
||||
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date)
|
||||
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date, data['exrule'])
|
||||
for rdate in rdates:
|
||||
r_date = datetime.strptime(rdate, "%Y-%m-%d %H:%M:%S")
|
||||
if start_date and r_date < start_date:
|
||||
@@ -1229,7 +1228,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
if isinstance(select, (str, int, long)):
|
||||
return ids and ids[0] or False
|
||||
return ids
|
||||
|
||||
|
||||
def compute_rule_string(self, cr, uid, datas, context=None, *args):
|
||||
"""
|
||||
Compute rule string.
|
||||
@@ -1248,9 +1247,9 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
freq = datas.get('freq')
|
||||
if freq == 'None':
|
||||
return ''
|
||||
|
||||
|
||||
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
|
||||
|
||||
|
||||
if freq == 'weekly':
|
||||
|
||||
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
|
||||
@@ -1286,7 +1285,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
return rrule_string
|
||||
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
context=None, count=False):
|
||||
"""
|
||||
Overrides orm search method.
|
||||
@@ -1317,6 +1316,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
|
||||
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
|
||||
"""
|
||||
Writes values in one or several fields.
|
||||
@@ -1348,7 +1348,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
||||
event_id = base_calendar_id2real_id(event_id)
|
||||
if not event_id in new_ids:
|
||||
new_ids.append(event_id)
|
||||
|
||||
|
||||
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
|
||||
if vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'):
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
@@ -1478,7 +1478,7 @@ class calendar_todo(osv.osv):
|
||||
_description = "Calendar Task"
|
||||
|
||||
def _get_date(self, cr, uid, ids, name, arg, context):
|
||||
"""
|
||||
"""
|
||||
Get Date
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -1494,7 +1494,7 @@ class calendar_todo(osv.osv):
|
||||
return res
|
||||
|
||||
def _set_date(self, cr, uid, id, name, value, arg, context):
|
||||
"""
|
||||
"""
|
||||
Set Date
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -1512,8 +1512,8 @@ class calendar_todo(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \
|
||||
string='Duration', store=True, type='datetime'),
|
||||
'duration': fields.integer('Duration'),
|
||||
string='Duration', store=True, type='datetime'),
|
||||
'duration': fields.integer('Duration'),
|
||||
}
|
||||
|
||||
__attribute__ = {}
|
||||
@@ -1526,7 +1526,7 @@ class ir_attachment(osv.osv):
|
||||
_inherit = 'ir.attachment'
|
||||
|
||||
def search_count(self, cr, user, args, context=None):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param user: the current user’s ID for security checks,
|
||||
@@ -1539,9 +1539,9 @@ class ir_attachment(osv.osv):
|
||||
args1.append(map(lambda x:str(x).split('-')[0], arg))
|
||||
return super(ir_attachment, self).search_count(cr, user, args1, context)
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@@ -1555,8 +1555,8 @@ class ir_attachment(osv.osv):
|
||||
for i, arg in enumerate(new_args):
|
||||
if arg[0] == 'res_id':
|
||||
new_args[i] = (arg[0], arg[1], base_calendar_id2real_id(arg[2]))
|
||||
return super(ir_attachment, self).search(cr, uid, new_args, offset=offset,
|
||||
limit=limit, order=order,
|
||||
return super(ir_attachment, self).search(cr, uid, new_args, offset=offset,
|
||||
limit=limit, order=order,
|
||||
context=context, count=False)
|
||||
ir_attachment()
|
||||
|
||||
@@ -1565,12 +1565,12 @@ class ir_values(osv.osv):
|
||||
|
||||
def set(self, cr, uid, key, key2, name, models, value, replace=True, \
|
||||
isobject=False, meta=False, preserve_user=False, company=False):
|
||||
"""
|
||||
"""
|
||||
Set IR Values
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param model: Get The Model
|
||||
@param model: Get The Model
|
||||
"""
|
||||
|
||||
new_model = []
|
||||
@@ -1584,12 +1584,12 @@ class ir_values(osv.osv):
|
||||
|
||||
def get(self, cr, uid, key, key2, models, meta=False, context={}, \
|
||||
res_id_req=False, without_user=True, key2_req=True):
|
||||
"""
|
||||
"""
|
||||
Get IR Values
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param model: Get The Model
|
||||
@param model: Get The Model
|
||||
"""
|
||||
|
||||
new_model = []
|
||||
@@ -1607,15 +1607,15 @@ class ir_model(osv.osv):
|
||||
|
||||
_inherit = 'ir.model'
|
||||
|
||||
def read(self, cr, uid, ids, fields=None, context={},
|
||||
def read(self, cr, uid, ids, fields=None, context={},
|
||||
load='_classic_read'):
|
||||
"""
|
||||
"""
|
||||
Read IR Model
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of IR Model’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
data = super(ir_model, self).read(cr, uid, ids, fields=fields, \
|
||||
@@ -1630,12 +1630,12 @@ ir_model()
|
||||
class virtual_report_spool(web_services.report_spool):
|
||||
|
||||
def exp_report(self, db, uid, object, ids, datas=None, context=None):
|
||||
"""
|
||||
"""
|
||||
Export Report
|
||||
@param self: The object pointer
|
||||
@param db: get the current database,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
if object == 'printscreen.list':
|
||||
@@ -1654,20 +1654,20 @@ class res_users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
|
||||
def _get_user_avail(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
"""
|
||||
Get USer Availability
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of res user’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
res = {}
|
||||
attendee_obj = self.pool.get('calendar.attendee')
|
||||
attendee_ids = attendee_obj.search(cr, uid, [
|
||||
('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime),
|
||||
('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime),
|
||||
('state', '=', 'accepted'), ('user_id', 'in', ids)
|
||||
])
|
||||
|
||||
@@ -1685,13 +1685,13 @@ class res_users(osv.osv):
|
||||
return res
|
||||
|
||||
def _get_user_avail_fun(self, cr, uid, ids, name, args, context=None):
|
||||
"""
|
||||
"""
|
||||
Get USer Availability Function
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of res user’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
return self._get_user_avail(cr, uid, ids, context=context)
|
||||
@@ -1699,7 +1699,7 @@ class res_users(osv.osv):
|
||||
_columns = {
|
||||
'availability': fields.function(_get_user_avail_fun, type='selection', \
|
||||
selection=[('free', 'Free'), ('busy', 'Busy')], \
|
||||
string='Free/Busy', method=True),
|
||||
string='Free/Busy', method=True),
|
||||
}
|
||||
res_users()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,12 +15,13 @@
|
||||
# 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 calendar_event_edit_all
|
||||
import base_calendar_invite_attendee
|
||||
import base_calendar_set_exrule
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -13,37 +13,38 @@
|
||||
<field name="type" />
|
||||
<field name="send_mail" />
|
||||
<newline />
|
||||
<group col="1" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'external')]}">
|
||||
<field name="email" colspan="4"
|
||||
attrs="{'required': [('type', '=', 'external')]}" />
|
||||
</group>
|
||||
<group col="1" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'internal')]}">
|
||||
<separator string="Users" colspan="4" />
|
||||
<field name="user_ids" select="1" colspan="4"
|
||||
nolabel="1" />
|
||||
<newline />
|
||||
</group>
|
||||
<group col="2" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'partner')]}">
|
||||
<field name="partner_id" colspan="2"
|
||||
on_change="onchange_partner_id(partner_id)"
|
||||
attrs="{'required': [('type', '=', 'partner')]}" />
|
||||
<newline />
|
||||
<separator string="Partner Contacts"
|
||||
colspan="4" />
|
||||
colspan="6" />
|
||||
<field name="contact_ids" select="1" colspan="4"
|
||||
nolabel="1" domain="[('partner_id', '=', partner_id)]"
|
||||
attrs="{'readonly': [('type', '!=', 'partner')]}" />
|
||||
</group>
|
||||
<newline />
|
||||
<separator string="" colspan="6" />
|
||||
<label string="" colspan="2" />
|
||||
<group col="4" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="do_invite" string="Invite"
|
||||
type="object" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from base_calendar import base_calendar
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
import mx.DateTime
|
||||
import re
|
||||
|
||||
|
||||
months = {
|
||||
1: "January", 2: "February", 3: "March", 4: "April", \
|
||||
5: "May", 6: "June", 7: "July", 8: "August", 9: "September", \
|
||||
10: "October", 11: "November", 12: "December"
|
||||
}
|
||||
|
||||
class base_calendar_set_exrule(osv.osv_memory):
|
||||
"""
|
||||
Set Exrule.
|
||||
"""
|
||||
|
||||
_name = "base.calendar.set.exrule"
|
||||
_description = "Set Exrule"
|
||||
|
||||
_columns = {
|
||||
'freq': fields.selection([('None', 'No Repeat'), \
|
||||
('secondly', 'Secondly'), \
|
||||
('minutely', 'Minutely'), \
|
||||
('hourly', 'Hourly'), \
|
||||
('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), \
|
||||
('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly')], 'Frequency',required=True),
|
||||
'interval': fields.integer('Interval'),
|
||||
'count': fields.integer('Count'),
|
||||
'mo': fields.boolean('Mon'),
|
||||
'tu': fields.boolean('Tue'),
|
||||
'we': fields.boolean('Wed'),
|
||||
'th': fields.boolean('Thu'),
|
||||
'fr': fields.boolean('Fri'),
|
||||
'sa': fields.boolean('Sat'),
|
||||
'su': fields.boolean('Sun'),
|
||||
'select1': fields.selection([('date', 'Date of month'), \
|
||||
('day', 'Day of month')], 'Option'),
|
||||
'day': fields.integer('Date of month'),
|
||||
'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \
|
||||
('WE', 'Wednesday'), ('TH', 'Thursday'), \
|
||||
('FR', 'Friday'), ('SA', 'Saturday'), \
|
||||
('SU', 'Sunday')], 'Weekday'),
|
||||
'byday': fields.selection([('1', 'First'), ('2', 'Second'), \
|
||||
('3', 'Third'), ('4', 'Fourth'), \
|
||||
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
|
||||
'month_list': fields.selection(months.items(),'Month'),
|
||||
'end_date': fields.date('Repeat Until'),
|
||||
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
This function checks for precondition before wizard executes
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param fields: List of fields for default value
|
||||
@param context: A standard dictionary for contextual values
|
||||
|
||||
"""
|
||||
crm_obj = self.pool.get('crm.meeting')
|
||||
for meeting in crm_obj.browse(cr, uid, context.get('active_ids', [])):
|
||||
if not meeting.rrule:
|
||||
raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency after Apply Exception Rule"))
|
||||
return False
|
||||
|
||||
def compute_exrule_string(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Compute rule string.
|
||||
@param self: the object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param datas: dictionary of freq and interval value.
|
||||
@return: string value which compute FREQILY;INTERVAL
|
||||
"""
|
||||
|
||||
weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
|
||||
weekstring = ''
|
||||
monthstring = ''
|
||||
yearstring = ''
|
||||
|
||||
for datas in self.read(cr, uid, ids, context=context):
|
||||
freq = datas.get('freq')
|
||||
if freq == 'None':
|
||||
return ''
|
||||
|
||||
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
|
||||
|
||||
if freq == 'weekly':
|
||||
|
||||
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
|
||||
if byday:
|
||||
weekstring = ';BYDAY=' + ','.join(byday)
|
||||
|
||||
elif freq == 'monthly':
|
||||
if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
|
||||
raise osv.except_osv(_('Error!'), ("Please select proper Day of month"))
|
||||
if datas.get('select1')=='day':
|
||||
monthstring = ';BYDAY=' + datas.get('byday') + datas.get('week_list')
|
||||
elif datas.get('select1')=='date':
|
||||
monthstring = ';BYMONTHDAY=' + str(datas.get('day'))
|
||||
|
||||
elif freq == 'yearly':
|
||||
if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
|
||||
raise osv.except_osv(_('Error!'), ("Please select proper Day of month"))
|
||||
bymonth = ';BYMONTH=' + str(datas.get('month_list'))
|
||||
if datas.get('select1')=='day':
|
||||
bystring = ';BYDAY=' + datas.get('byday') + datas.get('week_list')
|
||||
elif datas.get('select1')=='date':
|
||||
bystring = ';BYMONTHDAY=' + str(datas.get('day'))
|
||||
yearstring = bymonth + bystring
|
||||
|
||||
if datas.get('end_date'):
|
||||
datas['end_date'] = ''.join((re.compile('\d')).findall(datas.get('end_date'))) + '235959Z'
|
||||
enddate = (datas.get('count') and (';COUNT=' + str(datas.get('count'))) or '') +\
|
||||
((datas.get('end_date') and (';UNTIL=' + datas.get('end_date'))) or '')
|
||||
|
||||
exrule_string = 'FREQ=' + freq.upper() + weekstring + interval_srting \
|
||||
+ enddate + monthstring + yearstring
|
||||
ex_id = base_calendar.base_calendar_id2real_id(context['active_id'])
|
||||
model = context.get('model', False)
|
||||
model_obj = self.pool.get(model)
|
||||
exrule_value = model_obj.write(cr, uid,ex_id,{
|
||||
'exrule': exrule_string,
|
||||
})
|
||||
return {}
|
||||
|
||||
_defaults = {
|
||||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
}
|
||||
|
||||
base_calendar_set_exrule()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_base_calendar_set_exrule" model="ir.ui.view">
|
||||
<field name="name">base.calendar.set.exrule.form</field>
|
||||
<field name="model">base.calendar.set.exrule</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Set Exrule">
|
||||
<separator string="Select data for ExRule" colspan="8"/>
|
||||
<group col="8" colspan="6">
|
||||
<field name="freq" />
|
||||
<field name="interval" />
|
||||
<field name="count" />
|
||||
<field name="end_date" />
|
||||
</group>
|
||||
<group col="8" colspan="8" 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="8" colspan="6"
|
||||
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 colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="ok" name="compute_exrule_string" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_base_calendar_set_exrule" model="ir.actions.act_window">
|
||||
<field name="name">Set Exrule</field>
|
||||
<field name="res_model">base.calendar.set.exrule</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -136,8 +136,8 @@
|
||||
<form string="Address">
|
||||
<group string="Postal Address" colspan="2" col="2">
|
||||
<field name="type" />
|
||||
<field name="street"/>
|
||||
<field name="street2"/>
|
||||
<field name="street" widget="selection"/>
|
||||
<field name="street2" widget="selection"/>
|
||||
<field name="zip"/>
|
||||
<field name="city"/>
|
||||
<field name="country_id" completion="1"/>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
<record model="ir.ui.view" id="view_calendar_collection_tree">
|
||||
<field name="name">Calendar Collections : Tree</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendar Collections" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
@@ -53,8 +53,8 @@
|
||||
<field name="view_id" ref="view_calendar_collection_form"/>
|
||||
<field name="act_window_id" ref="action_calendar_collection_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
|
||||
<menuitem
|
||||
id="menu_calendar"
|
||||
name="Calendar"
|
||||
parent="base.menu_document_configuration"/>
|
||||
@@ -73,7 +73,7 @@
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="collection_id" required="1"/>
|
||||
<field name="collection_id" required="1"/>
|
||||
<field name="line_ids" mode="form,tree" colspan="4" nolabel="1">
|
||||
<form string="Calendar Lines">
|
||||
<field name="name" required="1" select="1" />
|
||||
@@ -110,11 +110,11 @@
|
||||
<record model="ir.ui.view" id="view_caldav_tree">
|
||||
<field name="name">Calendar : Tree</field>
|
||||
<field name="model">basic.calendar</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendars" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
@@ -127,8 +127,8 @@
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">basic.calendar</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="action_caldav_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
@@ -147,5 +147,6 @@
|
||||
action="action_caldav_form"
|
||||
id="menu_caldav_directories"
|
||||
parent="menu_calendar"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+62
-62
@@ -21,9 +21,9 @@
|
||||
|
||||
|
||||
{
|
||||
'name': 'Customer & Supplier Relationship Management',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'name': 'Customer & Supplier Relationship Management',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'description': """The generic Open ERP Customer Relationship Management
|
||||
system enables a group of people to intelligently and efficiently manage
|
||||
leads, opportunities, meeting, phonecall etc.
|
||||
@@ -41,78 +41,78 @@ appropriate staff, and making sure all future correspondence gets to the right
|
||||
place.
|
||||
|
||||
The CRM module has a email gateway for the synchronisation interface
|
||||
between mails and Open ERP.""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
between mails and Open ERP.""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': [
|
||||
'base',
|
||||
'base_action_rule',
|
||||
'process',
|
||||
'mail_gateway',
|
||||
'base_calendar',
|
||||
'resource',
|
||||
],
|
||||
'base',
|
||||
'base_action_rule',
|
||||
'process',
|
||||
'mail_gateway',
|
||||
'base_calendar',
|
||||
'resource',
|
||||
],
|
||||
'init_xml': [
|
||||
'crm_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_lead_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_opportunity_data.xml',
|
||||
'crm_phonecall_data.xml',
|
||||
],
|
||||
'crm_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_lead_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_opportunity_data.xml',
|
||||
'crm_phonecall_data.xml',
|
||||
],
|
||||
|
||||
'update_xml': [
|
||||
'wizard/crm_lead_to_partner_view.xml',
|
||||
'wizard/crm_lead_to_opportunity_view.xml',
|
||||
'wizard/crm_lead_to_partner_view.xml',
|
||||
'wizard/crm_lead_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_phonecall_to_phonecall_view.xml',
|
||||
'wizard/crm_phonecall_to_partner_view.xml',
|
||||
'wizard/crm_phonecall_to_opportunity_view.xml',
|
||||
'wizard/crm_phonecall_to_phonecall_view.xml',
|
||||
'wizard/crm_phonecall_to_partner_view.xml',
|
||||
'wizard/crm_phonecall_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_opportunity_to_phonecall_view.xml',
|
||||
'wizard/crm_partner_to_opportunity_view.xml',
|
||||
'wizard/crm_opportunity_to_phonecall_view.xml',
|
||||
'wizard/crm_partner_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_forward_to_partner_view.xml',
|
||||
'wizard/crm_send_email_view.xml',
|
||||
'crm_view.xml',
|
||||
'wizard/crm_forward_to_partner_view.xml',
|
||||
'wizard/crm_send_email_view.xml',
|
||||
'crm_view.xml',
|
||||
|
||||
'crm_action_rule_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
'crm_lead_menu.xml',
|
||||
|
||||
'crm_meeting_view.xml',
|
||||
'crm_meeting_menu.xml',
|
||||
|
||||
'crm_phonecall_view.xml',
|
||||
'crm_phonecall_menu.xml',
|
||||
|
||||
'crm_opportunity_view.xml',
|
||||
'crm_opportunity_menu.xml',
|
||||
|
||||
'security/crm_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'crm_action_rule_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
'crm_lead_menu.xml',
|
||||
|
||||
'report/crm_lead_report_view.xml',
|
||||
'report/crm_phonecall_report_view.xml',
|
||||
'crm_meeting_view.xml',
|
||||
'crm_meeting_menu.xml',
|
||||
|
||||
'process/crm_configuration_process.xml',
|
||||
'crm_phonecall_view.xml',
|
||||
'crm_phonecall_menu.xml',
|
||||
|
||||
'crm_opportunity_view.xml',
|
||||
'crm_opportunity_menu.xml',
|
||||
|
||||
'security/crm_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
'report/crm_lead_report_view.xml',
|
||||
'report/crm_phonecall_report_view.xml',
|
||||
|
||||
'process/crm_configuration_process.xml',
|
||||
'crm_installer_view.xml'
|
||||
],
|
||||
],
|
||||
'demo_xml': [
|
||||
'crm_demo.xml',
|
||||
'crm_lead_demo.xml',
|
||||
'crm_meeting_demo.xml',
|
||||
'crm_opportunity_demo.xml',
|
||||
'crm_demo.xml',
|
||||
'crm_lead_demo.xml',
|
||||
'crm_meeting_demo.xml',
|
||||
'crm_opportunity_demo.xml',
|
||||
'crm_phonecall_demo.xml'
|
||||
],
|
||||
],
|
||||
'test': [
|
||||
'test/test_crm_lead.yml',
|
||||
'test/test_crm_meeting.yml',
|
||||
'test/test_crm_opportunity.yml',
|
||||
'test/test_crm_phonecall.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0079056041421',
|
||||
'test/test_crm_lead.yml',
|
||||
'test/test_crm_meeting.yml',
|
||||
'test/test_crm_opportunity.yml',
|
||||
'test/test_crm_phonecall.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0079056041421',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
+18
-18
@@ -74,7 +74,7 @@ class crm_lead(osv.osv, crm_case):
|
||||
|
||||
duration = float(ans.days)
|
||||
if lead.section_id and lead.section_id.resource_calendar_id:
|
||||
duration = float(ans.days) * 24
|
||||
duration = float(ans.days) * 24
|
||||
new_dates = cal_obj.interval_get(cr,
|
||||
uid,
|
||||
lead.section_id.resource_calendar_id and lead.section_id.resource_calendar_id.id or False,
|
||||
@@ -95,18 +95,18 @@ class crm_lead(osv.osv, crm_case):
|
||||
|
||||
_columns = {
|
||||
# From crm.case
|
||||
'email_from': fields.char('Email', size=128, help="These people will receive email."),
|
||||
'email_from': fields.char('Email', size=128, help="These people will receive email."),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
|
||||
select=True, help='Sales team to which Case belongs to.\
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
'create_date': fields.datetime('Creation Date' , readonly=True),
|
||||
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
|
||||
people will receive a copy of the future communication between partner \
|
||||
and users by email"),
|
||||
'description': fields.text('Description'),
|
||||
'write_date': fields.datetime('Update Date' , readonly=True),
|
||||
'description': fields.text('Description'),
|
||||
'write_date': fields.datetime('Update Date' , readonly=True),
|
||||
|
||||
# Lead fields
|
||||
# Lead fields
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Lead Source', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
@@ -117,34 +117,34 @@ and users by email"),
|
||||
'type':fields.selection([
|
||||
('lead','Lead'),
|
||||
('opportunity','Opportunity'),
|
||||
|
||||
],'Type', help="Type is used to separate Leads and Opportunities"),
|
||||
|
||||
],'Type', help="Type is used to separate Leads and Opportunities"),
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'stage_id': fields.many2one('crm.case.stage', 'Stage', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'user_id': fields.many2one('res.users', 'Salesman'),
|
||||
'user_id': fields.many2one('res.users', 'Salesman',help='By Default Salesman is Administrator when create New User'),
|
||||
'referred': fields.char('Referred By', size=64),
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'day_open': fields.function(_compute_day, string='Days to Open', \
|
||||
method=True, multi='day_open', type="float", store=True),
|
||||
'day_close': fields.function(_compute_day, string='Days to Close', \
|
||||
method=True, multi='day_close', type="float", store=True),
|
||||
'function_name': fields.char('Function', size=64),
|
||||
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
|
||||
'function_name': fields.char('Function', size=64),
|
||||
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
|
||||
help='The state is set to \'Draft\', when a case is created.\
|
||||
\nIf the case is in progress the state is set to \'Open\'.\
|
||||
\nWhen the case is over, the state is set to \'Done\'.\
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
'user_id': crm_case._get_default_user,
|
||||
'email_from': crm_case._get_default_email,
|
||||
'state': lambda *a: 'draft',
|
||||
'section_id': crm_case._get_section,
|
||||
'active': lambda *a: 1,
|
||||
'user_id': crm_case._get_default_user,
|
||||
'email_from': crm_case._get_default_email,
|
||||
'state': lambda *a: 'draft',
|
||||
'section_id': crm_case._get_section,
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
}
|
||||
@@ -160,7 +160,7 @@ and users by email"),
|
||||
res = super(crm_lead, self).case_open(cr, uid, ids, *args)
|
||||
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
return res
|
||||
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
"""Overrides close for crm_case for setting close date
|
||||
@param self: The object pointer
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
name="convert_opportunity"
|
||||
string="Convert"
|
||||
help="Convert to Opportunity"
|
||||
icon="gtk-index"
|
||||
icon="gtk-index"
|
||||
type="object"/>
|
||||
<newline />
|
||||
<field name="section_id" colspan="1"
|
||||
@@ -175,7 +175,7 @@
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
</field>
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
|
||||
@@ -157,4 +157,19 @@ class calendar_attendee(osv.osv):
|
||||
|
||||
calendar_attendee()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -110,7 +110,8 @@
|
||||
|
||||
<menuitem id="menu_attendee_invitations"
|
||||
name="Meeting Invitations" parent="crm.menu_meeting_sale"
|
||||
sequence="10" action="action_view_attendee_form" />
|
||||
sequence="10" action="action_view_attendee_form"
|
||||
groups="base.group_extended" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
|
||||
name="open_meeting" icon="gtk-edit"
|
||||
type="object" />
|
||||
<button string="ExRule"
|
||||
name="%(base_calendar.action_base_calendar_set_exrule)d" icon="gtk-zoom-out" type="action"
|
||||
context="{'model' : 'crm.meeting'}"
|
||||
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
|
||||
@@ -213,7 +217,6 @@
|
||||
<field name="partner_id" string="Partner" />
|
||||
<field name="date" string="Meeting Date" />
|
||||
<field name="duration" />
|
||||
<field name="user_id" />
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -2,16 +2,6 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_meeting_new"
|
||||
name="Meetings"
|
||||
res_model="crm.meeting"
|
||||
src_model="crm.lead"
|
||||
view_mode="tree,form,calendar,"
|
||||
context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
|
||||
domain="[('user_id','=',uid), ('opportunity_id', '=', active_id)]"
|
||||
view_type="form"/>
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_phonecall_new"
|
||||
name="Phone calls"
|
||||
@@ -22,6 +12,16 @@
|
||||
domain="[('user_id','=',uid),('opportunity_id', '=', active_id)]"
|
||||
view_type="form"/>
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_meeting_new"
|
||||
name="Meetings"
|
||||
res_model="crm.meeting"
|
||||
src_model="crm.lead"
|
||||
view_mode="tree,form,calendar,"
|
||||
context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
|
||||
domain="[('user_id','=',uid), ('opportunity_id', '=', active_id)]"
|
||||
view_type="form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_oppor11">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="categ_id" invisible="1" groups="base.group_extended"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
@@ -295,7 +295,7 @@
|
||||
help="My Opportunities" default="1"
|
||||
/>
|
||||
<filter icon="terp-partner"
|
||||
domain="[('user_id','=', False)]"
|
||||
domain="[('user_id','=', uid)]"
|
||||
help="Unassigned Opportunities" />
|
||||
</field>
|
||||
<field name="section_id"
|
||||
@@ -315,8 +315,6 @@
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Partner" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<filter string="Salesman" icon="terp-crm"
|
||||
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}" />
|
||||
<separator orientation="vertical" />
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
view_mode="calendar,tree,form"
|
||||
context="{'default_partner_id': active_id, 'default_duration': 1.0}"
|
||||
domain="[('partner_id', '=', active_id)]"
|
||||
groups="base.group_extended"
|
||||
/>
|
||||
|
||||
<!-- PHONE CALLS (menu) -->
|
||||
|
||||
@@ -119,7 +119,6 @@
|
||||
|
||||
<menuitem id="menu_crm_case_stage" name="Stages" parent="base.menu_crm_configuration" groups="base.group_extended"/>
|
||||
|
||||
|
||||
<!-- Case Categories Form View -->
|
||||
|
||||
<record id="crm_case_categ-view" model="ir.ui.view">
|
||||
@@ -425,7 +424,7 @@
|
||||
|
||||
<!-- Case Search View -->
|
||||
|
||||
|
||||
|
||||
<record id="view_crm_case_filter" model="ir.ui.view">
|
||||
<field name="name">crm.case.select</field>
|
||||
<field name="model">mailgate.thread</field>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</record>
|
||||
|
||||
<!-- Leads by user and section Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_lead_filter" model="ir.ui.view">
|
||||
<field name="name">crm.lead.report.select</field>
|
||||
<field name="model">crm.lead.report</field>
|
||||
@@ -119,7 +119,7 @@
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
@@ -144,14 +144,14 @@
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
@@ -180,9 +180,9 @@
|
||||
<tree string="Opportunities">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="section_id" invisible="1"/>
|
||||
<field name="section_id" invisible="1" groups="base.group_extended"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_extended"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
|
||||
@@ -220,7 +220,7 @@
|
||||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_lead"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="res_model">crm.lead.report</field>
|
||||
@@ -244,7 +244,7 @@
|
||||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Leads" id="menu_report_crm_leads_tree"
|
||||
groups="base.group_extended"
|
||||
parent="base.next_id_64" action="action_report_crm_lead" />
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
key2="client_action_multi" name="Create Opportunity"
|
||||
res_model="crm.partner2opportunity" src_model="res.partner"
|
||||
view_id="view_crm_lead2partner_create"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
view_mode="form" target="new" view_type="form"
|
||||
groups="base.group_extended"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<record model="ir.ui.view" id="view_document_directory_tree">
|
||||
<field name="name">document.directory</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Directories" toolbar="1">
|
||||
<field name="name"/>
|
||||
|
||||
@@ -43,7 +43,7 @@ class hr_analytic_timesheet(osv.osv):
|
||||
_inherits = {'account.analytic.line': 'line_id'}
|
||||
_order = "id desc"
|
||||
_columns = {
|
||||
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
|
||||
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
|
||||
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id',relation='account.analytic.account',store=True),
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ class hr_analytic_timesheet(osv.osv):
|
||||
|
||||
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}):
|
||||
res = {}
|
||||
# if prod_id and unit_amount:
|
||||
if prod_id:
|
||||
if prod_id and unit_amount:
|
||||
# find company
|
||||
company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context)
|
||||
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount,company_id,unit, context)
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
"data/olap_security.xml",
|
||||
'security/ir.model.access.csv'
|
||||
],
|
||||
"demo_xml" : ["data/olap_demo.xml",
|
||||
"test/olap_test00.yml"],
|
||||
"demo_xml" : ["data/olap_demo.xml"],
|
||||
"test" : ['test/olap_test00.yml'],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data>
|
||||
|
||||
<!-- Wizard view for the load data -->
|
||||
|
||||
|
||||
<record id="bi_load_db_form" model="ir.ui.view">
|
||||
<field name="name">bi.load.db.form</field>
|
||||
<field name="model">bi.load.db.wizard</field>
|
||||
@@ -22,7 +22,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="act_bi_load_db_wizard" model="ir.actions.act_window">
|
||||
<field name="name">Load database Structure</field>
|
||||
<field name="res_model">bi.load.db.wizard</field>
|
||||
@@ -33,10 +33,10 @@
|
||||
<field name="auto_refresh" eval="1"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Wizard For Olap Warehouse -->
|
||||
|
||||
|
||||
<record id="view_warehouse_bi" model="ir.ui.view">
|
||||
<field name="name">Olap Warehouse</field>
|
||||
<field name="model">olap.warehouse.wizard</field>
|
||||
@@ -51,7 +51,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_olap_warehouse" model="ir.actions.act_window">
|
||||
<field name="name">Olap Warehouse</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -60,7 +60,7 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Warehouse"
|
||||
action="action_olap_warehouse"
|
||||
@@ -68,9 +68,9 @@
|
||||
sequence="51"
|
||||
parent="base.next_id_50"
|
||||
/>
|
||||
|
||||
|
||||
<!-- Wizard View for the parameters wizard -->
|
||||
|
||||
|
||||
<record id="view_config_bi" model="ir.ui.view">
|
||||
<field name="name">Parameters Configuration</field>
|
||||
<field name="model">olap.parameters.config.wizard</field>
|
||||
@@ -90,7 +90,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_config_bi_parameters" model="ir.actions.act_window">
|
||||
<field name="name">Parameters Configuration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -99,7 +99,7 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Server Parameters"
|
||||
action="action_config_bi_parameters"
|
||||
@@ -107,16 +107,16 @@
|
||||
sequence="50"
|
||||
parent="base.next_id_50"
|
||||
/>
|
||||
|
||||
|
||||
<record model="ir.actions.todo" id="config_auto_directory">
|
||||
<field name="name">Server Parameters Configuration</field>
|
||||
<field name="note">This wizard will configure the URL of the web client</field>
|
||||
<field name="action_id" ref="action_config_bi_parameters"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Wizard view for the Auto Configuring the data -->
|
||||
|
||||
|
||||
<record id="bi_auto_configure_form" model="ir.ui.view">
|
||||
<field name="name">bi.auto.configure.form</field>
|
||||
<field name="model">bi.auto.configure.wizard</field>
|
||||
@@ -131,7 +131,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="act_bi_auto_configure" model="ir.actions.act_window">
|
||||
<field name="name">Auto Configuration</field>
|
||||
<field name="res_model">bi.auto.configure.wizard</field>
|
||||
@@ -142,13 +142,13 @@
|
||||
<field name="auto_refresh" eval="1"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Schema
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_schema_tree">
|
||||
<field name="name">olap.schema.tree</field>
|
||||
<field name="model">olap.schema</field>
|
||||
@@ -160,7 +160,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_schema_form">
|
||||
<field name="name">olap.schema.form</field>
|
||||
<field name="model">olap.schema</field>
|
||||
@@ -195,19 +195,19 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_schema_form">
|
||||
<field name="name">Olap Schemas</field>
|
||||
<field name="res_model">olap.schema</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Schema"
|
||||
action="action_olap_schema_form"
|
||||
id="menu_action_olap_schema_form"
|
||||
parent="menu_bi_conf_cubes"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Cubes Table
|
||||
# ------------------------------------------------------------------
|
||||
@@ -245,23 +245,23 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_cube_table_form">
|
||||
<field name="name">Olap Cube Tables</field>
|
||||
<field name="res_model">olap.cube.table</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Cubes Table"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_cube_table_form"
|
||||
id="menu_action_olap_cube_table_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Cubes
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_cube_tree">
|
||||
<field name="name">olap.cube.tree</field>
|
||||
<field name="model">olap.cube</field>
|
||||
@@ -273,7 +273,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_cube_form">
|
||||
<field name="name">olap.cube.form</field>
|
||||
<field name="model">olap.cube</field>
|
||||
@@ -287,24 +287,24 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_cube_form">
|
||||
<field name="name">Olap Cubes</field>
|
||||
<field name="res_model">olap.cube</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Cubes"
|
||||
parent ="menu_bi_conf_cubes"
|
||||
action="action_olap_cube_form"
|
||||
id="menu_action_olap_cube_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Dimensions
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_dimension_tree">
|
||||
<field name="name">olap.dimension.tree</field>
|
||||
<field name="model">olap.dimension</field>
|
||||
@@ -316,7 +316,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_dimension_form">
|
||||
<field name="name">olap.dimension.form</field>
|
||||
<field name="model">olap.dimension</field>
|
||||
@@ -328,23 +328,23 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_dimension_form">
|
||||
<field name="name">Olap Dimensions</field>
|
||||
<field name="res_model">olap.dimension</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Dimension"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_dimension_form"
|
||||
id="menu_action_olap_dimension_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Hierarchies
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_hierarchy_tree">
|
||||
<field name="name">olap.hierarchy.tree</field>
|
||||
<field name="model">olap.hierarchy</field>
|
||||
@@ -356,7 +356,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_hierarchy_form">
|
||||
<field name="name">olap.hierarchy.form</field>
|
||||
<field name="model">olap.hierarchy</field>
|
||||
@@ -365,33 +365,29 @@
|
||||
<form string="Olap hierarchy">
|
||||
<field name="name" select="1" colspan="2"/>
|
||||
<field name="sequence" colspan="2"/>
|
||||
<field name="dimension_id" select="1" attrs="{'readonly':[('dimension_id','!=','')]}" colspan="4"/>
|
||||
<!-- <field name="field_name" select="2"/>-->
|
||||
|
||||
<field name="table_id" select="2" colspan="4" context="{'d_id':dimension_id}"/>
|
||||
<!-- <separator string="Levels" colspan="4"/>
|
||||
<field name="level_ids" colspan="4" nolabel="1"/>-->
|
||||
<field name="dimension_id" select="1" attrs="{'readonly':[('dimension_id','!=','')]}" colspan="2"/>
|
||||
<field name="table_id" select="2" colspan="2" context="{'d_id':dimension_id}"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_hierarchy_form">
|
||||
<field name="name">Olap Hierarchies</field>
|
||||
<field name="res_model">olap.hierarchy</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Hierarchy"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_hierarchy_form"
|
||||
id="menu_action_olap_hierarchy_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Levels
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_level_tree">
|
||||
<field name="name">olap.level.tree</field>
|
||||
<field name="model">olap.level</field>
|
||||
@@ -408,7 +404,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_level_form">
|
||||
<field name="name">olap.level.form</field>
|
||||
<field name="model">olap.level</field>
|
||||
@@ -427,24 +423,24 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_level_form">
|
||||
<field name="name">Olap Level</field>
|
||||
<field name="res_model">olap.level</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Level"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_level_form"
|
||||
id="menu_action_olap_level_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Measure
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_measure_tree">
|
||||
<field name="name">olap.measure.tree</field>
|
||||
<field name="model">olap.measure</field>
|
||||
@@ -456,7 +452,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_measure_form">
|
||||
<field name="name">olap.measure.form</field>
|
||||
<field name="model">olap.measure</field>
|
||||
@@ -471,7 +467,7 @@
|
||||
<group colspan="4" attrs="{'invisible':[('measure_type','!=','fact_column')]}">
|
||||
<newline/>
|
||||
<field name="value_column" select="1" attrs="{'required':[('measure_type','=','fact_column')]}" on_change="onchange_measure_name(value_column)" context="{'filter_cols_cube':cube_id}"/>
|
||||
<field name="agregator" select="2" />
|
||||
<field name="agregator" select="2"/>
|
||||
<field name="formatstring" select="2"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('measure_type','!=','sql_expr')]}">
|
||||
@@ -484,19 +480,19 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_measure_form">
|
||||
<field name="name">Olap Measures</field>
|
||||
<field name="res_model">olap.measure</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Measures"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_measure_form"
|
||||
id="menu_action_olap_measure_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Saved Query
|
||||
# ------------------------------------------------------------------
|
||||
@@ -515,7 +511,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_saved_query_form_mdx">
|
||||
<field name="name">olap.saved.query.mdx</field>
|
||||
<field name="model">olap.saved.query</field>
|
||||
@@ -531,7 +527,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_saved_query_form">
|
||||
<field name="name">olap.saved.query.form</field>
|
||||
<field name="model">olap.saved.query</field>
|
||||
@@ -553,22 +549,22 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_saved_query_form">
|
||||
<field name="name">Olap Saved Query</field>
|
||||
<field name="res_model">olap.saved.query</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,mdx</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Saved Query"
|
||||
parent = "menu_bi_conf_tools"
|
||||
action="action_olap_saved_query_form"
|
||||
id="menu_action_olap_saved_query_form"/>
|
||||
|
||||
|
||||
<!-- All Logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
@@ -582,7 +578,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_form">
|
||||
<field name="name">olap.query.logs.form</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
@@ -599,21 +595,21 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_query_logs_form">
|
||||
<field name="name">All Logs</field>
|
||||
<field name="res_model">olap.query.logs</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="All Logs"
|
||||
action="action_olap_query_logs_form"
|
||||
id="menu_action_olap_query_logs_form"
|
||||
parent="menu_bi_conf_tools"/>
|
||||
|
||||
|
||||
<!-- All Logs / My logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
@@ -626,7 +622,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
@@ -639,9 +635,9 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Query Logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_form">
|
||||
<field name="name">olap.query.logs.form</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
@@ -657,7 +653,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_query_logs_my_form">
|
||||
<field name="name">My Logs</field>
|
||||
<field name="res_model">olap.query.logs</field>
|
||||
@@ -665,12 +661,12 @@
|
||||
<field name="view_mode">tree,form,mdx</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="My Logs"
|
||||
action="action_olap_query_logs_my_form"
|
||||
id="menu_action_olap_query_logs_my_form"
|
||||
parent="menu_action_olap_query_logs_form"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -11,20 +11,23 @@
|
||||
name: OpenERP
|
||||
type: postgres
|
||||
-
|
||||
I will check the connection for successful login. >>>>>>(Problem)
|
||||
# !python {model: olap.fact.database}: |
|
||||
# self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
|
||||
I will check the connection for successful login.
|
||||
-
|
||||
!python {model: olap.fact.database}: |
|
||||
import tools
|
||||
if tools.config['db_name'] == 'tiny' and tools.config['db_password'] == '123456' and tools.config['db_host'] == 'localhost':
|
||||
self.test_connection(cr, uid, ids ,{'active_ids':[ref('olap_fact_database_openerp0')]})
|
||||
-
|
||||
In order to test schema,I create a new schema record.
|
||||
-
|
||||
!record {model: olap.schema, id: olap_schema_Partners0}:
|
||||
database_id: olap_fact_database_openerp0
|
||||
name: Partners
|
||||
-
|
||||
-
|
||||
I press "Connect to Database" and I see that the Schema State is "Database Connected" now
|
||||
-
|
||||
-
|
||||
!workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
|
||||
-
|
||||
-
|
||||
Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
|
||||
-
|
||||
!record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
|
||||
@@ -45,7 +48,7 @@
|
||||
!workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
|
||||
-
|
||||
Performing a workflow action dbready on module olap.schema
|
||||
-
|
||||
-
|
||||
!workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
|
||||
-
|
||||
In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
|
||||
@@ -93,7 +96,7 @@
|
||||
table_id: olap_cube_table_partnercubetable0
|
||||
-
|
||||
After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
|
||||
-
|
||||
-
|
||||
!record {model: olap.level, id: olap_level_productscode0}:
|
||||
column_id_name: name
|
||||
column_name: olap.columns_res_user_name
|
||||
@@ -107,5 +110,4 @@
|
||||
-
|
||||
!python {model: olap.load.column}: |
|
||||
ids = self.search(cr, uid, [])
|
||||
self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})
|
||||
|
||||
self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})
|
||||
|
||||
@@ -9,9 +9,13 @@
|
||||
<field name="model">olap.load.column</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="">
|
||||
<separator string=" " colspan="4"/>
|
||||
<button name="get_table_data" string="Open" type="object"/>
|
||||
<form string="Open Columns">
|
||||
<label string="Do u Want to Open Columns ?" colspan="6"/>
|
||||
<separator string="" colspan="6"/>
|
||||
<group col="6" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="get_table_data" string="Open" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string=" To Load Data">
|
||||
<field name='user_name'/>
|
||||
<separator string="" colspan="4" />
|
||||
<label string="" colspan="2" />
|
||||
<group colspan="4">
|
||||
<button special="cancel" string="Cancel" />
|
||||
<button name="clear_logs" string="Clear Logs" type="object"/>
|
||||
<separator string="" colspan="6" />
|
||||
<group col="4" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" />
|
||||
<button name="clear_logs" string="Clear Logs" type="object" icon="gtk-clear"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -24,15 +24,15 @@ from osv import osv, fields
|
||||
class res_partner(osv.osv):
|
||||
""" Inherits partner and adds more information in the partner form """
|
||||
_inherit = 'res.partner'
|
||||
|
||||
|
||||
_columns = {
|
||||
'opportunity_ids': fields.one2many('crm.lead', 'partner_id', 'Opportunities', domain=[('type', '=', 'opportunity')]),
|
||||
'opportunity_ids': fields.one2many('crm.lead', 'partner_id', 'Opportunities', domain=[('type', '=', 'opportunity')]),
|
||||
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
|
||||
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices'),
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
|
||||
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices'),
|
||||
'contract_ids': fields.one2many('account.analytic.account', \
|
||||
'partner_id', 'Contracts'),
|
||||
'partner_id', 'Contracts'),
|
||||
'account_line_ids': fields.one2many('hr.analytic.timesheet', \
|
||||
'partner_id', 'Anaylitic account lines '),
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<field name="view_id" ref="product_pricelist_version_tree_view"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="product_pricelist_action" id="menu_product_pricelist_action"
|
||||
action="product_pricelist_action" id="menu_product_pricelist_action"
|
||||
parent="product.menu_product_pricelist_main" sequence="2"/>
|
||||
|
||||
<record id="product_pricelist_item_tree_view" model="ir.ui.view">
|
||||
|
||||
@@ -446,9 +446,9 @@ class product_product(osv.osv):
|
||||
'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'),
|
||||
'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')),
|
||||
'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='List Price', digits_compute=dp.get_precision('Sale Price')),
|
||||
'code': fields.function(_product_code, method=True, type='char', string='Code'),
|
||||
'code': fields.function(_product_code, method=True, type='char', string='Reference'),
|
||||
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
|
||||
'default_code' : fields.char('Code', size=64),
|
||||
'default_code' : fields.char('Reference', size=64),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
|
||||
'variants': fields.char('Variants', size=64),
|
||||
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=False),
|
||||
@@ -676,7 +676,20 @@ class pricelist_partnerinfo(osv.osv):
|
||||
_order = 'min_quantity asc'
|
||||
pricelist_partnerinfo()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="categ_id" select="1" widget="selection" operator="child_of"/>
|
||||
<newline/>
|
||||
<group col='8' colspan='14' expand="1" string="Extended options...">
|
||||
<group col='8' colspan='14' expand="1" string="Extended options..." groups="base.group_extended">
|
||||
<field name="pricelist_id" select="1" widget="selection" context="{'pricelist': self}" />
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<group colspan="2" col="2" name="status">
|
||||
<separator string="Status" colspan="2"/>
|
||||
<field name="categ_id" select="1"/>
|
||||
<field name="categ_id" select="1" groups="base.group_extended"/>
|
||||
<field name="state"/>
|
||||
<field groups="base.group_extended" name="product_manager"/>
|
||||
</group>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<wizard
|
||||
id="report_wizard_price"
|
||||
string="Price List"
|
||||
model="product.product"
|
||||
name="product.price_list"
|
||||
keyword="client_print_multi"
|
||||
groups="base.group_extended"/>
|
||||
</data>
|
||||
</openerp>
|
||||
+1
-2
@@ -49,7 +49,6 @@ def _incoterm_get(self, cr, uid, context=None):
|
||||
cr.execute('select code, code||\', \'||name from stock_incoterms where active')
|
||||
return cr.fetchall()
|
||||
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_name = "sale.order"
|
||||
_description = "Sale Order"
|
||||
@@ -1043,7 +1042,7 @@ class sale_order_line(osv.osv):
|
||||
if product_obj.uos_id.category_id.id != uos2.category_id.id:
|
||||
uos = False
|
||||
else:
|
||||
uos = False
|
||||
uos = False
|
||||
if product_obj.description_sale:
|
||||
result['notes'] = product_obj.description_sale
|
||||
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total" sum="Total amount"/>
|
||||
<button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
|
||||
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" icon="gtk-execute"/>
|
||||
</group>
|
||||
<group col="13" colspan="4">
|
||||
<field name="state"/>
|
||||
@@ -384,6 +385,11 @@
|
||||
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state"/>
|
||||
<button colspan="1"
|
||||
name="%(action_view_sale_order_line_make_invoice)d"
|
||||
string="Make Invoice"
|
||||
type="action"
|
||||
icon="gtk-print" />
|
||||
<group col="2" colspan="2">
|
||||
<button name="button_done"
|
||||
states="confirmed,exception"
|
||||
|
||||
@@ -16,13 +16,14 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Make Invoices"
|
||||
res_model="sale.order.line.make.invoice"
|
||||
src_model="sale.order.line"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_view_sale_order_line_make_invoice"/>
|
||||
<record id="action_view_sale_order_line_make_invoice" model="ir.actions.act_window">
|
||||
<field name="name">Make Invoices</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.order.line.make.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_sale_advance_payment_inv" model="ir.ui.view">
|
||||
@@ -20,15 +19,14 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<act_window name="Advance Invoice"
|
||||
res_model="sale.advance.payment.inv"
|
||||
src_model="sale.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_view_sale_advance_payment_inv"/>
|
||||
|
||||
<record id="action_view_sale_advance_payment_inv" model="ir.actions.act_window">
|
||||
<field name="name">Advance Invoice</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.advance.payment.inv</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_open_invoice" model="ir.ui.view">
|
||||
<field name="name">Open Invoice</field>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="priority" position="after">
|
||||
<button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
|
||||
<button string="Create a Sale Order" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
|
||||
<label colspan="2" string=""/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -28,7 +28,7 @@ import pooler
|
||||
from tools.translate import _
|
||||
|
||||
sale_form = """<?xml version="1.0"?>
|
||||
<form string="Convert to Quote">
|
||||
<form string="Create a Sale Order">
|
||||
<field name="partner_id" required="True"/>
|
||||
<field name="shop_id" required="True"/>
|
||||
<field name="analytic_account"/>
|
||||
@@ -130,10 +130,10 @@ class make_sale(wizard.interface):
|
||||
|
||||
if data['form']['close']:
|
||||
case_obj.case_close(cr, uid, data['ids'])
|
||||
|
||||
|
||||
if not new_ids:
|
||||
return {}
|
||||
|
||||
|
||||
if len(new_ids)<=1:
|
||||
value = {
|
||||
'domain': str([('id', 'in', new_ids)]),
|
||||
@@ -154,14 +154,14 @@ class make_sale(wizard.interface):
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id':new_ids
|
||||
}
|
||||
|
||||
|
||||
return value
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_selectPartner],
|
||||
'result': {'type': 'form', 'arch': sale_form, 'fields': sale_fields,
|
||||
'state' : [('end', 'Cancel', 'gtk-cancel'),('order', 'Create Quote', 'gtk-go-forward')]}
|
||||
'state' : [('end', 'Cancel', 'gtk-cancel'),('order', 'Create', 'gtk-go-forward')]}
|
||||
},
|
||||
'order': {
|
||||
'actions': [],
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
'data/wiki_main.xml',
|
||||
'security/ir.model.access.csv'
|
||||
],
|
||||
'demo_xml': ['test/wiki_test00.yml'],
|
||||
# 'test': ['test/wiki_test00.yml'],
|
||||
'demo_xml': [],
|
||||
'test': ['test/wiki_test00.yml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0086363630317',
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
ids = self.search(cr, uid, [])
|
||||
self.wiki_do_index(cr, uid, ids , {'active_ids': [ref('wiki_wiki_openerpwikiediting0')]})
|
||||
-
|
||||
# Remaining Act window
|
||||
I check the page history for the current page by clicking on "Page History".After that find difference between history.
|
||||
-
|
||||
!act_window {name: Page History,view_type: form,id: act_wiki_wiki_history,domain: "[('wiki_id', '=', active_id)]",res_model: wiki.wiki.history,src_model: wiki.wiki,view_mode: tree,key2: client_action_multi,target: new}
|
||||
-
|
||||
I create a new wiki group on the Given Home Page
|
||||
-
|
||||
@@ -48,7 +49,10 @@
|
||||
ids = self.search(cr, uid, [])
|
||||
self.open_wiki_page(cr, uid, ids, {'active_ids': [ref('wiki_groups_wikigroupediting0')]})
|
||||
-
|
||||
# Remaining beacuse of Act window (I search the page by clicking on the "search page".)
|
||||
I search the page by clicking on the "search page".
|
||||
-
|
||||
!act_window {name: Search Page,view_type: form,id: act_wiki_group_open,domain: "[('group_id', '=', active_id)]",res_model: wiki.wiki,src_model: wiki.groups,view_mode: tree,key2: client_action_multi,target: new}
|
||||
-
|
||||
In order to create a menu I will create wizard data
|
||||
-
|
||||
!record {model: wiki.groups, id: wiki.wiki_groups_wikiformatting0}:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<field name="model">wiki.groups</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Wikis">
|
||||
<tree string="Wiki Groups">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="model">wiki.groups</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Wikis">
|
||||
<form string="Wiki Groups">
|
||||
<group colspan="4" col="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="create_date" readonly="2"/>
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- Wiki Groups Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_groups">
|
||||
<field name="name">Wikis</field>
|
||||
<field name="name">Wiki Groups</field>
|
||||
<field name="res_model">wiki.groups</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -74,7 +74,7 @@
|
||||
action="action_wiki_groups"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_groups_browse">
|
||||
<field name="name">Wikis</field>
|
||||
<field name="name">Wiki Groups</field>
|
||||
<field name="res_model">wiki.groups</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
@@ -126,13 +126,15 @@
|
||||
<form string="Wiki">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name" select="1" colspan="6"/>
|
||||
<field name="group_id" select="1" on_change="onchange_group_id(group_id, text_area)"/>
|
||||
<field name="section" invisible="not context.get('section',False)"/>
|
||||
<field name="parent_id"/>
|
||||
<button name="open_wiki_page" type="object"
|
||||
string="Basic Wiki Editing" icon="gtk-ok" />
|
||||
</group>
|
||||
|
||||
<group col="8" colspan="4">
|
||||
<field name="group_id" select="1" on_change="onchange_group_id(group_id, text_area)"/>
|
||||
<field name="section" invisible="not context.get('section',False)"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Informations"/>
|
||||
<field name="text_area" nolabel="1" colspan="4" select="1" widget="text_wiki"/>
|
||||
<separator colspan="4" string="Modifications"/>
|
||||
<group col="6" colspan="4">
|
||||
@@ -169,7 +171,7 @@
|
||||
<!-- search page for wiki -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki">
|
||||
<field name="name">Search Pages</field>
|
||||
<field name="name">Wiki Pages</field>
|
||||
<field name="res_model">wiki.wiki</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
||||
@@ -41,6 +41,7 @@ class wiki_create_menu(osv.osv_memory):
|
||||
@param ids: List of create menu’s IDs
|
||||
|
||||
"""
|
||||
data = context and context.get('active_id', False) or False
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
action_id = mod_obj._get_id(cr, uid, 'wiki', 'action_view_wiki_wiki_page_open')
|
||||
|
||||
@@ -49,10 +50,10 @@ class wiki_create_menu(osv.osv_memory):
|
||||
'name': menu.menu_name,
|
||||
'parent_id':menu.menu_parent_id.id,
|
||||
'icon': 'STOCK_DIALOG_QUESTION',
|
||||
'action': 'ir.actions.act_window,'+ str(action_id)
|
||||
'action': 'ir.actions.act_window,'+ str(action_id)[0]
|
||||
}, context)
|
||||
home = menu.page.id
|
||||
group_id = menu.id
|
||||
group_id = data
|
||||
res = {
|
||||
'home': home,
|
||||
}
|
||||
@@ -61,7 +62,6 @@ class wiki_create_menu(osv.osv_memory):
|
||||
{'group_id': group_id, 'action_id': menu_id})
|
||||
return {}
|
||||
|
||||
|
||||
wiki_create_menu()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
<field name="model">wiki.make.index</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create Menu">
|
||||
<separator string="Menu Information" colspan="4"/>
|
||||
<label string="Want to create a Index on Selected Pages ? "/>
|
||||
<form string="Create Index">
|
||||
<label string="Want to create a Index on Selected Pages ?" colspan="4"/>
|
||||
<separator string="" colspan="6" />
|
||||
<label string="" colspan="2"/>
|
||||
<group>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" />
|
||||
<group col="4" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="wiki_do_index" string="Create Index" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<field name="diff" nolabel="1" colspan="4" width="300"/>
|
||||
<label string="" colspan="2" />
|
||||
<group>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="OK" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Open Page">
|
||||
<separator string="" colspan="6" />
|
||||
<label string="Want to open a wiki page? "/>
|
||||
<separator string="" colspan="6" />
|
||||
<label string="" colspan="2" />
|
||||
<group>
|
||||
<label string="Want to open a wiki page?" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" />
|
||||
<button name="open_wiki_page" string="Open Wiki Page" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user