diff --git a/addons/account/i18n/bg.po b/addons/account/i18n/bg.po
index 11d92443f73..21d61219493 100644
--- a/addons/account/i18n/bg.po
+++ b/addons/account/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
diff --git a/addons/account/i18n/ca.po b/addons/account/i18n/ca.po
index 6ff1b7a22e7..5337799482b 100644
--- a/addons/account/i18n/ca.po
+++ b/addons/account/i18n/ca.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
diff --git a/addons/account/i18n/de.po b/addons/account/i18n/de.po
index b1186085eb9..0ec2f0fc2a3 100644
--- a/addons/account/i18n/de.po
+++ b/addons/account/i18n/de.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
diff --git a/addons/account_analytic_plans/i18n/ko.po b/addons/account_analytic_plans/i18n/ko.po
index 4695d7c6f35..b0f4a4ab8d3 100644
--- a/addons/account_analytic_plans/i18n/ko.po
+++ b/addons/account_analytic_plans/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
diff --git a/addons/account_anglo_saxon/i18n/es.po b/addons/account_anglo_saxon/i18n/es.po
index e5e324757a8..89400a43155 100644
--- a/addons/account_anglo_saxon/i18n/es.po
+++ b/addons/account_anglo_saxon/i18n/es.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_anglo_saxon
diff --git a/addons/account_balance/i18n/oc.po b/addons/account_balance/i18n/oc.po
index 353d32d50de..b0818900099 100644
--- a/addons/account_balance/i18n/oc.po
+++ b/addons/account_balance/i18n/oc.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_balance
diff --git a/addons/account_followup/i18n/oc.po b/addons/account_followup/i18n/oc.po
index ec23a0f5a84..4f531d50472 100644
--- a/addons/account_followup/i18n/oc.po
+++ b/addons/account_followup/i18n/oc.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
diff --git a/addons/account_invoice_layout/i18n/oc.po b/addons/account_invoice_layout/i18n/oc.po
index 75538d6bf99..88dc0b3b1ae 100644
--- a/addons/account_invoice_layout/i18n/oc.po
+++ b/addons/account_invoice_layout/i18n/oc.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
diff --git a/addons/account_tax_include/i18n/cs.po b/addons/account_tax_include/i18n/cs.po
index 6c3c83511cc..bb8f08ae2a7 100644
--- a/addons/account_tax_include/i18n/cs.po
+++ b/addons/account_tax_include/i18n/cs.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_tax_include
diff --git a/addons/analytic_user_function/i18n/ko.po b/addons/analytic_user_function/i18n/ko.po
index 53ff398e82e..79fa7192edc 100644
--- a/addons/analytic_user_function/i18n/ko.po
+++ b/addons/analytic_user_function/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: analytic_user_function
diff --git a/addons/analytic_user_function/i18n/ru.po b/addons/analytic_user_function/i18n/ru.po
index fffd713522f..052f0387292 100644
--- a/addons/analytic_user_function/i18n/ru.po
+++ b/addons/analytic_user_function/i18n/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: analytic_user_function
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index 6a29b023301..30bc83e0616 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -91,7 +91,7 @@ def real_id2base_calendar_id(real_id, recurrent_date):
if real_id and recurrent_date:
recurrent_date = time.strftime("%Y%m%d%H%M%S", \
- time.strptime(recurrent_date, "%Y-%m-%d %H:%M:%S"))
+ time.strptime(recurrent_date, "%Y-%m-%d %H:%M:%S"))
return '%d-%s' % (real_id, recurrent_date)
return real_id
@@ -253,7 +253,7 @@ class calendar_attendee(osv.osv):
result[id][name] = ''
continue
else:
- result[id][name] = self._get_address(attdata.sent_by_uid.name, \
+ result[id][name] = self._get_address(attdata.sent_by_uid.name, \
attdata.sent_by_uid.address_id.email)
if name == 'cn':
if attdata.user_id:
@@ -327,59 +327,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'),
- ('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='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"),
'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'),
- 'parent_ids': fields.many2many('calendar.attendee', 'calendar_attendee_parent_rel',\
- 'attendee_id', 'parent_id', 'Delegrated From'),
- 'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel',\
- '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"),
- 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User',\
- 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),
+ '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'),
+ 'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel', \
+ '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"),
+ 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', \
+ 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),
'dir': fields.char('URI Reference', size=124, help="Reference to the URI\
- 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'),
- '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"),
- 'event_date': fields.function(_compute_data, method=True, string='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"),
+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'),
+ '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"),
+ 'event_date': fields.function(_compute_data, method=True, string='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"),
}
_defaults = {
- 'state': lambda *x: 'needs-action',
+ 'state': lambda *x: 'needs-action',
}
response_re = re.compile("Are you coming\?.*\n*.*(YES|NO|MAYBE).*", re.UNICODE)
@@ -421,7 +422,7 @@ request was delegated to"),
if msg_actions['state'] in ['YES', 'NO', 'MAYBE']:
mapping = {'YES': 'accepted', 'NO': 'declined', 'MAYBE': 'tentative'}
status = mapping[msg_actions['state']]
- print 'Got response for invitation id: %s as %s' % (ids, status)
+ print 'Got response for invitation id: %s as %s' % (ids, status)
self.write(cr, uid, ids, {'state': status})
return True
@@ -440,37 +441,37 @@ request was delegated to"),
sign = att.sent_by_uid and att.sent_by_uid.signature or ''
sign = ' '.join(sign and sign.split('\n') or [])
res_obj = att.ref
- sub = '[%s Invitation][%d] %s' % (company, att.id, res_obj.name)
+ sub = '[%s Invitation][%d] %s' % (company, att.id, res_obj.name)
att_infos = []
- other_invitaion_ids = self.search(cr, uid, [('ref','=', att.ref._name + ',' + str(att.ref.id))])
+ other_invitaion_ids = self.search(cr, uid, [('ref', '=', att.ref._name + ',' + str(att.ref.id))])
for att2 in self.browse(cr, uid, other_invitaion_ids):
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': ' '.join(att_infos),
- 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
- 'sign': sign,
- 'company': company
+ 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': ' '.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
if mail_to and email_from:
tools.email_send(
- email_from,
- mail_to,
- sub,
- body,
- subtype='html',
- reply_to=email_from
- )
+ email_from,
+ mail_to,
+ sub,
+ body,
+ subtype='html',
+ reply_to=email_from
+ )
return True
def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv):
"""
- Make entry on email and availbility on change of user_id field.
+ Make entry on email and availbility on change of user_id field.
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of calendar attendee’s IDs.
@@ -496,7 +497,7 @@ request was delegated to"),
def do_accept(self, cr, uid, ids, context=None, *args):
"""
- Update state which value is accepted.
+ Update state which value is accepted.
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of calendar attendee’s IDs.
@@ -512,7 +513,7 @@ request was delegated to"),
mod_obj = self.pool.get(vals.ref._name)
if vals.ref:
if vals.ref.user_id.id != user.id:
- defaults = {'user_id': user.id}
+ defaults = {'user_id': user.id}
new_event = mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
self.write(cr, uid, vals.id, {'state': 'accepted'}, context)
@@ -539,7 +540,7 @@ request was delegated to"),
context = {}
if not vals.get("email") and vals.get("cn"):
cnval = vals.get("cn").split(':')
- email = filter(lambda x:x.__contains__('@'), cnval)
+ email = filter(lambda x:x.__contains__('@'), cnval)
vals['email'] = email[0]
vals['cn'] = vals.get("cn")
res = super(calendar_attendee, self).create(cr, uid, vals, context)
@@ -551,26 +552,30 @@ class res_alarm(osv.osv):
_name = 'res.alarm'
_description = 'Basic Alarm Information'
_columns = {
- 'name':fields.char('Name', size=256, required=True),
- 'trigger_occurs': fields.selection([('before', 'Before'), ('after', 'After')], \
- 'Triggers', required=True),
- 'trigger_interval': fields.selection([('minutes', 'Minutes'), ('hours', 'Hours'), \
- ('days', 'Days')], 'Interval', 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),
+ 'name':fields.char('Name', size=256, required=True),
+ 'trigger_occurs': fields.selection([('before', 'Before'), \
+ ('after', 'After')], \
+ 'Triggers', required=True),
+ 'trigger_interval': fields.selection([('minutes', 'Minutes'), \
+ ('hours', 'Hours'), \
+ ('days', 'Days')], 'Interval', \
+ 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),
'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={}):
@@ -598,20 +603,20 @@ are both optional, but if one occurs, so MUST the other"""),
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)
@@ -640,7 +645,7 @@ are both optional, but if one occurs, so MUST the other"""),
if alarm_ids:
alarm_obj.unlink(cr, uid, alarm_ids)
cr.execute('Update %s set base_calendar_alarm_id=NULL, alarm_id=NULL\
- where id=%s' % (model_obj._table, datas.id))
+ where id=%s' % (model_obj._table, datas.id))
cr.commit()
return True
@@ -653,41 +658,40 @@ class calendar_alarm(osv.osv):
__attribute__ = {}
_columns = {
- 'alarm_id': fields.many2one('res.alarm', 'Basic Alarm', ondelete='cascade'),
- 'name': fields.char('Summary', size=124, help="""Contains the text to be \
- used as the message subject for email \
- or contains the text to be used for display"""),
- 'action': fields.selection([('audio', 'Audio'), ('display', 'Display'), \
- ('procedure', 'Procedure'), ('email', 'Email') ], 'Action', \
- required=True, help="Defines the action to be invoked when an alarm is triggered"),
- 'description': fields.text('Description', help='Provides a more complete \
- description of the calendar component, than that \
- provided by the "SUMMARY" property'),
- 'attendee_ids': fields.many2many('calendar.attendee', 'alarm_attendee_rel', \
- 'alarm_id', 'attendee_id', 'Attendees', readonly=True),
- 'attach': fields.binary('Attachment', help="""* Points to a sound resource,\
- which is rendered when the alarm is triggered for audio,
- * File which is intended to be sent as message attachments for email,
- * Points to a procedure resource, which is invoked when\
- the alarm is triggered for procedure."""),
- 'res_id': fields.integer('Resource ID'),
- 'model_id': fields.many2one('ir.model', 'Model'),
- 'user_id': fields.many2one('res.users', 'Owner'),
- 'event_date': fields.datetime('Event Date'),
- 'event_end_date': fields.datetime('Event End Date'),
- 'trigger_date': fields.datetime('Trigger Date', readonly="True"),
- 'state':fields.selection([
- ('draft', 'Draft'),
- ('run', 'Run'),
- ('stop', 'Stop'),
- ('done', 'Done'),
- ], 'State', select=True, readonly=True),
- }
+ 'alarm_id': fields.many2one('res.alarm', 'Basic Alarm', ondelete='cascade'),
+ 'name': fields.char('Summary', size=124, help="""Contains the text to be \
+ used as the message subject for email \
+ or contains the text to be used for display"""),
+ 'action': fields.selection([('audio', 'Audio'), ('display', 'Display'), \
+ ('procedure', 'Procedure'), ('email', 'Email') ], 'Action', \
+ required=True, help="Defines the action to be invoked when an alarm is triggered"),
+ 'description': fields.text('Description', help='Provides a more complete \
+ description of the calendar component, than that \
+ provided by the "SUMMARY" property'),
+ 'attendee_ids': fields.many2many('calendar.attendee', 'alarm_attendee_rel', \
+ 'alarm_id', 'attendee_id', 'Attendees', readonly=True),
+ 'attach': fields.binary('Attachment', help="""* Points to a sound resource,\
+ which is rendered when the alarm is triggered for audio,
+ * File which is intended to be sent as message attachments for email,
+ * Points to a procedure resource, which is invoked when\
+ the alarm is triggered for procedure."""),
+ 'res_id': fields.integer('Resource ID'),
+ 'model_id': fields.many2one('ir.model', 'Model'),
+ 'user_id': fields.many2one('res.users', 'Owner'),
+ 'event_date': fields.datetime('Event Date'),
+ 'event_end_date': fields.datetime('Event End Date'),
+ 'trigger_date': fields.datetime('Trigger Date', readonly="True"),
+ 'state':fields.selection([('draft', 'Draft'),
+ ('run', 'Run'),
+ ('stop', 'Stop'),
+ ('done', 'Done'),
+ ], 'State', select=True, readonly=True),
+ }
_defaults = {
- 'action': lambda *x: 'email',
- 'state': lambda *x: 'run',
- }
+ 'action': lambda *x: 'email',
+ 'state': lambda *x: 'run',
+ }
def create(self, cr, uid, vals, context={}):
"""
@@ -708,7 +712,7 @@ class calendar_alarm(osv.osv):
delta = timedelta(hours=vals['trigger_duration'])
if vals['trigger_interval'] == 'minutes':
delta = timedelta(minutes=vals['trigger_duration'])
- trigger_date = dtstart + (vals['trigger_occurs'] == 'after' and delta or -delta)
+ trigger_date = dtstart + (vals['trigger_occurs'] == 'after' and delta or -delta)
vals['trigger_date'] = trigger_date
res = super(calendar_alarm, self).create(cr, uid, vals, context)
return res
@@ -738,12 +742,12 @@ 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,
- 'ref_doc1': '%s,%s' % (alarm.model_id.model, alarm.res_id)
+ '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)
request_ids = [request_id]
@@ -755,7 +759,7 @@ class calendar_alarm(osv.osv):
request_obj.request_send(cr, uid, request_ids)
if alarm.action == 'email':
- sub = '[Openobject Remainder] %s' % (alarm.name)
+ sub = '[Openobject Remainder] %s' % (alarm.name)
body = """
Name: %s
Date: %s
@@ -772,9 +776,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'})
@@ -813,7 +817,7 @@ class calendar_event(osv.osv):
if end_date and not duration:
end = datetime.strptime(end_date, "%Y-%m-%d %H:%M:%S")
diff = end - start
- duration = float(diff.days)* 24 + (float(diff.seconds) / 3600)
+ duration = float(diff.days)* 24 + (float(diff.seconds) / 3600)
value['duration'] = round(duration, 2)
elif not end_date:
end = start + timedelta(hours=duration)
@@ -825,15 +829,16 @@ class calendar_event(osv.osv):
Set rule string.
@param self: The object pointer
@param cr: the current row, from the database cursor,
- @param id: List of calendar event's ids.
+ @param id: List of calendar event's ids.
@param context: A standard dictionary for contextual values
@return: dictionary of rrule value.
"""
- cr.execute("UPDATE %s set freq='',interval=0,count=0,end_date=Null,\
+ 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=False,month_list=0 ,byday=False where id=%s" % (self._table, id))
+ 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
val = {}
for part in value.split(';'):
@@ -846,7 +851,9 @@ class calendar_event(osv.osv):
ans = value.split(';')
for i in ans:
val[i.split('=')[0].lower()] = i.split('=')[1].lower()
- if int(val.get('interval')) > 1: #If interval is other than 1 rule is custom
+ if not val.get('interval'):
+ rrule_type = 'custom'
+ elif int(val.get('interval')) > 1: #If interval is other than 1 rule is custom
rrule_type = 'custom'
qry = "UPDATE %(table)s set rrule_type=\'%(rule_type)s\' "
@@ -873,8 +880,12 @@ class calendar_event(osv.osv):
if val.get('byday'):
d = val.get('byday')
- new_val['byday'] = d[:1]
- new_val['week_list'] = d[1:].upper()
+ if '-' in d:
+ new_val['byday'] = d[:2]
+ new_val['week_list'] = d[2:4].upper()
+ else:
+ new_val['byday'] = d[:1]
+ new_val['week_list'] = d[1:3].upper()
new_val['select1'] = 'day'
if val.get('bymonth'):
@@ -901,92 +912,100 @@ class calendar_event(osv.osv):
Get rule string.
@param self: The object pointer
@param cr: the current row, from the database cursor,
- @param id: List of calendar event's ids.
+ @param id: List of calendar event's ids.
@param context: A standard dictionary for contextual values
@return: dictionary of rrule value.
"""
result = {}
- for datas in self.read(cr, uid, ids):
+ for datas in self.read(cr, uid, ids, context=context):
+ event = datas['id']
if datas.get('rrule_type'):
if datas.get('rrule_type') == 'none':
result[event] = False
elif datas.get('rrule_type') == 'custom':
- rrule_custom = self.compute_rule_string(cr, uid, datas)
+ if datas.get('interval', 0) < 0:
+ 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,\
+ context=context)
result[event] = rrule_custom
else:
- result[event] = self.compute_rule_string(cr, uid, {'freq':\
- datas.get('rrule_type').upper(), \
- 'interval': 1}, context=context)
+ result[event] = self.compute_rule_string(cr, uid, {'freq': datas.get('rrule_type').upper(), 'interval': 1}, context=context)
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': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
+ '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 anexception to a recurrence set"),
- 'rrule': fields.function(_get_rulestring, type='char', size=124, method=True,\
- string='Recurrent Rule', store=True, fnct_inv=_set_rrulestring),
+ rule or repeating pattern for anexception 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'),
'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'),
- 'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24,\
- string='Timezone', store=True),
- 'user_id': fields.many2one('res.users', 'Responsible'),
+ ('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'),
+ 'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24, \
+ string='Timezone', store=True),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
'freq': fields.selection([('None', 'No Repeat'), \
- ('secondly', 'Secondly'), \
- ('minutely', 'Minutely'), \
- ('hourly', 'Hourly'), \
- ('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'),
+ ('secondly', 'Secondly'), \
+ ('minutely', 'Minutely'), \
+ ('hourly', 'Hourly'), \
+ ('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'),
'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'),
+ ('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'),
+ ('3', 'Third'), ('4', 'Fourth'), \
+ ('5', 'Fifth'), ('-1', 'Last')], 'By day'),
+ 'month_list': fields.selection(months.items(), 'Month'),
'end_date': fields.date('Repeat Until')
}
_defaults = {
- 'class': lambda *a: 'public',
- 'show_as': lambda *a: 'busy',
- 'freq': lambda *x: 'None',
- 'select1': lambda *x: 'date',
- 'interval': lambda *x: 1,
+ 'class': lambda *a: 'public',
+ 'show_as': lambda *a: 'busy',
+ 'freq': lambda *x: 'None',
+ 'select1': lambda *x: 'date',
+ 'interval': lambda *x: 1,
}
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args):
@@ -1004,11 +1023,11 @@ class calendar_event(osv.osv):
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',
- 'rrule': ''
- })
+ '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 []
if real_date and defaults.get('date'):
exdate.append(real_date)
@@ -1032,7 +1051,7 @@ class calendar_event(osv.osv):
defaults.update({'table': self._table})
qry = "UPDATE %(table)s set name = '%(name)s', \
- date = '%(date)s', date_deadline = '%(date_deadline)s'"
+ date = '%(date)s', date_deadline = '%(date_deadline)s'"
if defaults.get('alarm_id'):
qry += ", alarm_id = %(alarm_id)s"
if defaults.get('location'):
@@ -1060,7 +1079,7 @@ class calendar_event(osv.osv):
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 from " + self._table + \
" m where m.id in ("\
+ ','.join(map(lambda x: str(x), ids))+")")
@@ -1129,7 +1148,7 @@ class calendar_event(osv.osv):
@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
+ @return: string value which compute FREQILY;INTERVAL
"""
weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
@@ -1141,9 +1160,8 @@ class calendar_event(osv.osv):
if freq == 'None':
return ''
- if datas.get('interval') < 1:
- raise osv.except_osv(_('Error!'), ("Please select proper Interval"))
-
+ 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))
@@ -1159,7 +1177,7 @@ class calendar_event(osv.osv):
monthstring = ';BYMONTHDAY=' + str(datas.get('day'))
elif freq == 'yearly':
- if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
+ 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':
@@ -1170,19 +1188,19 @@ class calendar_event(osv.osv):
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 '') +\
+ enddate = (datas.get('count') and (';COUNT=' + str(datas.get('count'))) or '') +\
((datas.get('end_date') and (';UNTIL=' + datas.get('end_date'))) or '')
- rrule_string = 'FREQ=' + freq.upper() + weekstring + ';INTERVAL=' + \
- str(datas.get('interval')) + enddate + monthstring + yearstring
+ rrule_string = 'FREQ=' + freq.upper() + weekstring + interval_srting \
+ + enddate + monthstring + yearstring
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.
+ Overrides orm search method.
@param cr: the current row, from the database cursor,
@param user: the current user’s ID for security checks,
@param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...].
@@ -1248,7 +1266,7 @@ class calendar_event(osv.osv):
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}):
"""
- Overrides orm browse method.
+ Overrides orm browse method.
@param self: the object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -1269,7 +1287,7 @@ class calendar_event(osv.osv):
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'):
"""
- Overrides orm Read method.Read List of fields for calendar event.
+ Overrides orm Read method.Read List of fields for calendar event.
@param cr: the current row, from the database cursor,
@param user: the current user’s ID for security checks,
@param ids: List of calendar event's id.
@@ -1285,8 +1303,7 @@ class calendar_event(osv.osv):
if fields and 'date' not in fields:
fields.append('date')
for base_calendar_id, real_id in select:
- res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, \
- load=load)
+ res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load)
ls = base_calendar_id2real_id(base_calendar_id, with_date=res.get('duration', 0))
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
res['date'] = ls[1]
@@ -1328,7 +1345,7 @@ class calendar_event(osv.osv):
for record in self.read(cr, uid, [base_calendar_id2real_id(id)], \
['date', 'rrule', 'exdate']):
if record['rrule']:
- exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) + 'Z'
+ exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) + 'Z'
if record['date'] == date_new:
res = self.write(cr, uid, [base_calendar_id2real_id(id)], {'exdate': exdate})
else:
@@ -1396,14 +1413,14 @@ class calendar_todo(osv.osv):
"""
event = self.browse(cr, uid, id, context=context)
- cr.execute("UPDATE %s set date_start='%s' where id=%s" \
- % (self._table, value, id))
+ cr.execute("UPDATE %s set date_start='%s' where id=%s" \
+ % (self._table, value, id))
return True
_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__ = {}
@@ -1429,7 +1446,7 @@ 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
@@ -1445,8 +1462,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()
@@ -1497,7 +1514,7 @@ 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
@@ -1557,7 +1574,7 @@ class res_users(osv.osv):
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)
])
@@ -1589,8 +1606,9 @@ 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()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_calendar/wizard/calendar_event_edit_all.py b/addons/base_calendar/wizard/calendar_event_edit_all.py
index d99e864a148..d17195f9a27 100755
--- a/addons/base_calendar/wizard/calendar_event_edit_all.py
+++ b/addons/base_calendar/wizard/calendar_event_edit_all.py
@@ -35,7 +35,7 @@ class calendar_event_edit_all(osv.osv_memory):
context_id = context and context.get('active_id', False) or False
if context_id:
if context.get('date'):
- return context.get('date')
+ return context.get('date')
else:
model = context.get('model', False)
model_obj = self.pool.get(model)
diff --git a/addons/base_contact/__openerp__.py b/addons/base_contact/__openerp__.py
index af632e532b5..df9992b2ab8 100644
--- a/addons/base_contact/__openerp__.py
+++ b/addons/base_contact/__openerp__.py
@@ -47,7 +47,10 @@
'base_contact_view.xml',
'process/base_contact_process.xml'
],
- 'demo_xml': ['base_contact_demo.xml'],
+ 'demo_xml': ['base_contact_demo.xml'],
+ 'test': [
+ 'test/base_contact00.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0031287885469',
diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py
index d4fc8b2b007..9b4cc656acc 100644
--- a/addons/base_contact/base_contact.py
+++ b/addons/base_contact/base_contact.py
@@ -205,12 +205,12 @@ class res_partner_job(osv.osv):
self._order = 'sequence_contact'
contact_obj = self.pool.get('res.partner.contact')
- search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])]
- contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, \
- limit=limit, order=order, context=context, count=count)
- contacts = contact_obj.browse(cr, user, contact_ids, context=context)
- for contact in contacts:
- job_ids.extend([item.id for item in contact.job_ids])
+ if arg[2] and not count:
+ search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])]
+ contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, limit=limit, order=order, context=context, count=count)
+ contacts = contact_obj.browse(cr, user, contact_ids, context=context)
+ for contact in contacts:
+ job_ids.extend([item.id for item in contact.job_ids])
res = super(res_partner_job,self).search(cr, user, args, offset=offset,\
limit=limit, order=order, context=context, count=count)
diff --git a/addons/base_contact/test/base_contact00.yml b/addons/base_contact/test/base_contact00.yml
new file mode 100644
index 00000000000..a1b112e4e2a
--- /dev/null
+++ b/addons/base_contact/test/base_contact00.yml
@@ -0,0 +1,96 @@
+- |
+ I will test base_contact for following cases:
+ *contacts unrelated to a partner,
+ *contacts working at several addresses (possibly for different partners),
+ *contacts with possibly different functions for each of its job's addresses
+- |
+ In order to assign language to contacts first I will create Language FR
+ (Remove)
+-
+ !record {model: res.lang, id: res_lang_french0}:
+ code: fr_BE
+ date_format: '%m/%d/%Y'
+ decimal_point: .
+ direction: ltr
+ grouping: '[]'
+ name: French
+ time_format: '%H:%M:%S'
+- |
+ In order to check contacts first I will create contact unrelated to a partner
+-
+ !record {model: res.partner.contact, id: res_partner_contact_williams0}:
+ country_id: base.be
+ first_name: Laura
+ job_ids:
+ - email: lwilliams@mydomain.com
+ function_id: base_contact.res_partner_function_privateaddress0
+ phone: (+32).10.45.18.77
+ sequence_contact: 1
+ state: current
+ lang_id: res_lang_french0
+ mobile: (+32).10.45.18.77
+ name: Williams
+ title: Mss
+- |
+ Now in order to assign this contact to partner I will create one partner assign contact laura to this partner
+-
+ !record {model: res.partner, id: res_partner_laurascompany0}:
+ address:
+ - city: Namur
+ country_id: base.be
+ phone: (+32).10.45.18.77
+ street: 23, street ways
+ type: default
+ zip: '2324324'
+ job_ids:
+ - address_id: res_partner_address_1
+ function_id: base.function_director
+ contact_id: res_partner_contact_williams0
+ sequence_partner: 2
+ state: current
+ lang: fr_BE
+ name: Laura's Company
+ ref: LC
+ title: ltd
+- |
+ Now I will check that the new job is assigned properly to contact or not
+-
+ !assert {model: res.partner.contact, id: res_partner_contact_williams0}:
+ - len(job_ids) > 2
+- |
+ In order to check contacts working at several addresses for different partners
+ I will create contact with 2 different addresses
+-
+ !record {model: res.partner.contact, id: res_partner_contact_pauwels0}:
+ country_id: base.be
+ first_name: Nicolas
+ job_ids:
+ - address_id: base.main_address
+ function_id: base.function_it
+ state: current
+ - address_id: base.res_partner_address_3000
+ function_id: base.function_director
+ state: current
+ lang_id: res_lang_french0
+ mobile: (+32).23.44.32.12
+ name: Pauwels
+ title: M.
+- |
+ In order to check one contact working at one partner with different functions
+ I will create contact with 2 different jobs with different function but the same address
+-
+ !record {model: res.partner.contact, id: res_partner_contact_mortier0}:
+ country_id: base.be
+ first_name: Christina
+ job_ids:
+ - address_id: base.res_partner_address_1
+ function_id: base.function_director
+ state: past
+ - address_id: base.res_partner_address_1
+ function_id: base.function_it
+ state: current
+ lang_id: base_contact.res_lang_french0
+ mobile: (+32).10.45.18.77
+ name: Mortier
+ title: Mss
+
diff --git a/addons/base_module_merge/i18n/ru.po b/addons/base_module_merge/i18n/ru.po
index 0def5fa78c4..3de045ac954 100644
--- a/addons/base_module_merge/i18n/ru.po
+++ b/addons/base_module_merge/i18n/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_module_merge
diff --git a/addons/base_module_publish/i18n/ru.po b/addons/base_module_publish/i18n/ru.po
index 41d6d0f5111..f8a4d09a982 100644
--- a/addons/base_module_publish/i18n/ru.po
+++ b/addons/base_module_publish/i18n/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_module_publish
diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py
index cda1f4ebb82..97c0ada4bca 100644
--- a/addons/base_module_record/base_module_record.py
+++ b/addons/base_module_record/base_module_record.py
@@ -143,7 +143,7 @@ class base_module_record(osv.osv):
obj = dt.browse(cr, uid, dtids[0])
self.depends[obj.module] = True
return obj.module+'.'+obj.name, obj.noupdate
-
+
def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False):
data_pool = self.pool.get('ir.model.data')
@@ -384,7 +384,7 @@ class base_module_record(osv.osv):
elif rec[3]=='create':
id = self._create_id(cr, uid, rec[2],rec[4])
record,noupdate = self._create_record(cr, uid, doc, rec[2], rec[4], id)
- self.ids[(rec[3], result)] = id
+ self.ids[(rec[2], result)] = id
record_list += record
elif rec[3]=='copy':
@@ -446,8 +446,8 @@ class base_module_record(osv.osv):
terp.appendChild(data)
wkf = doc.createElement('workflow')
data.appendChild(wkf)
- wkf.setAttribute("model", rec[1][3])
- wkf.setAttribute("action", rec[1][4])
+ wkf.setAttribute("model", rec[1][2])
+ wkf.setAttribute("action", rec[1][3])
if noupdate:
data.setAttribute("noupdate", "1")
wkf.setAttribute("ref", rec_id)
@@ -482,10 +482,12 @@ class base_module_record(osv.osv):
continue
if self.mode == "workflow":
record= self._generate_object_yaml(cr, uid, rec[1],rec[0])
+ yaml_file+="!comment Performing a workflow action %s on module %s"%(record['action'], record['model']) + '''\n'''
object=yaml.load(unicode('''\n !workflow %s \n'''%record,'iso-8859-1'))
- yaml_file += str(object) + '''\n'''
+ yaml_file += str(object) + '''\n\n'''
else:
record= self._generate_object_yaml(cr, uid, rec[1],rec[3])
+ yaml_file+="!comment Creating an %s record"%(record['model']) + '''\n'''
object= yaml.load(unicode('''\n !record %s \n'''%record,'iso-8859-1'))
yaml_file += str(object) + '''\n'''
attrs=yaml.dump(object.attrs, default_flow_style=False)
@@ -497,7 +499,9 @@ class base_module_record(osv.osv):
if line.find('!record') == 0:
line = "- \n" + " " + line
elif line.find('!workflow') == 0:
- line = "- \n" + " " + line
+ line = "- \n" + " " + line
+ elif line.find('!comment') == 0:
+ line=line.replace('!comment','- \n ')
elif line.find('- -') != -1:
line=line.replace('- -',' -')
line = " " + line
diff --git a/addons/base_module_record/i18n/ru.po b/addons/base_module_record/i18n/ru.po
index b048d092d41..9e578b177c1 100644
--- a/addons/base_module_record/i18n/ru.po
+++ b/addons/base_module_record/i18n/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_module_record
diff --git a/addons/board_document/__openerp__.py b/addons/board_document/__openerp__.py
index 77fd09fdf45..3dcd00627b4 100644
--- a/addons/board_document/__openerp__.py
+++ b/addons/board_document/__openerp__.py
@@ -32,7 +32,7 @@
* Files by Month (graph)
""",
'author': 'Tiny',
- 'depends': ['board', 'document', 'report_document'],
+ 'depends': ['board', 'document'],
'update_xml': ['board_document_view.xml'],
'demo_xml': ['board_document_demo.xml'],
'installable': True,
diff --git a/addons/board_document/board_document_view.xml b/addons/board_document/board_document_view.xml
index ec2b9d69de1..4d89f96cbfb 100644
--- a/addons/board_document/board_document_view.xml
+++ b/addons/board_document/board_document_view.xml
@@ -15,24 +15,24 @@
+ domain="[('name','=',time.strftime('%%Y')),('month','=',time.strftime('%%m'))]"/>
@@ -75,19 +75,19 @@
diff --git a/addons/board_manufacturing/i18n/ru.po b/addons/board_manufacturing/i18n/ru.po
index 4a9c83edcc9..7b3b847ae72 100644
--- a/addons/board_manufacturing/i18n/ru.po
+++ b/addons/board_manufacturing/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2008-11-04 11:49+0000\n"
-"Last-Translator: Sergei Kostigoff \n"
+"PO-Revision-Date: 2010-04-19 09:39+0000\n"
+"Last-Translator: Nikolay Chesnokov \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_manufacturing
@@ -34,7 +34,7 @@ msgstr "Неправильный XML для просмотра архитект
#. module: board_manufacturing
#: view:board.board:0
msgid "Deliveries (Out packing)"
-msgstr ""
+msgstr "Поставки(Исходящие)"
#. module: board_manufacturing
#: view:board.board:0
@@ -49,7 +49,7 @@ msgstr "Производство"
#. module: board_manufacturing
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Недопустимое имя модели в определении действия"
#. module: board_manufacturing
#: model:ir.actions.act_window,name:board_manufacturing.open_board_manufacturing
@@ -60,7 +60,7 @@ msgstr "Панель аналитики производства"
#. module: board_manufacturing
#: model:ir.module.module,shortdesc:board_manufacturing.module_meta_information
msgid "Board for manufacturing"
-msgstr ""
+msgstr "Панель для производства"
#. module: board_manufacturing
#: view:board.board:0
@@ -70,4 +70,4 @@ msgstr "Изменения оценки запасов"
#. module: board_manufacturing
#: view:board.board:0
msgid "Workcenter futur load"
-msgstr ""
+msgstr "Загрузка мощности в будущем"
diff --git a/addons/board_sale/i18n/ru.po b/addons/board_sale/i18n/ru.po
index b16eb2c3421..b5bf9118f35 100644
--- a/addons/board_sale/i18n/ru.po
+++ b/addons/board_sale/i18n/ru.po
@@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-28 07:55+0000\n"
-"Last-Translator: Artem Karimov \n"
+"PO-Revision-Date: 2010-04-19 09:44+0000\n"
+"Last-Translator: Nikolay Chesnokov \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:59+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_sale
#: model:ir.module.module,shortdesc:board_sale.module_meta_information
msgid "Dashboard for sales"
-msgstr ""
+msgstr "Панель для продаж"
#. module: board_sale
#: model:ir.actions.act_window,name:board_sale.open_board_sales_manager
@@ -40,7 +40,7 @@ msgstr "Панель менеджера продаж"
#. module: board_sale
#: view:board.board:0
msgid "Cases of the month"
-msgstr ""
+msgstr "Случаи месяца"
#. module: board_sale
#: constraint:ir.ui.view:0
@@ -55,7 +55,7 @@ msgstr "Мои незакрытые предложения"
#. module: board_sale
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Недопустимое имя модели в определении действия"
#. module: board_sale
#: model:ir.ui.menu,name:board_sale.next_id_88
@@ -65,7 +65,7 @@ msgstr "Продажи"
#. module: board_sale
#: view:board.board:0
msgid "Cases statistics"
-msgstr ""
+msgstr "Статистика случаев"
#. module: board_sale
#: view:board.board:0
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 7c569fade21..adfbf0ca772 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -30,18 +30,18 @@ from tools.translate import _
MAX_LEVEL = 15
AVAILABLE_STATES = [
- ('draft', 'Draft'),
- ('open', 'Open'),
- ('cancel', 'Cancelled'),
- ('done', 'Closed'),
+ ('draft', 'Draft'),
+ ('open', 'Open'),
+ ('cancel', 'Cancelled'),
+ ('done', 'Closed'),
('pending', 'Pending')
]
AVAILABLE_PRIORITIES = [
- ('5', 'Lowest'),
- ('4', 'Low'),
- ('3', 'Normal'),
- ('2', 'High'),
+ ('5', 'Lowest'),
+ ('4', 'Low'),
+ ('3', 'Normal'),
+ ('2', 'High'),
('1', 'Highest')
]
@@ -53,12 +53,12 @@ class crm_case_section(osv.osv):
_order = "name"
_columns = {
- 'name': fields.char('Sales Team', size=64, required=True, translate=True),
- 'code': fields.char('Code', size=8),
+ 'name': fields.char('Sales Team', size=64, required=True, translate=True),
+ 'code': fields.char('Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to \
- true, it will allow you to hide the sales team without removing it."),
- 'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
- 'user_id': fields.many2one('res.users', 'Responsible User'),
+ true, it will allow you to hide the sales team without removing it."),
+ 'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
+ 'user_id': fields.many2one('res.users', 'Responsible User'),
'reply_to': fields.char('Reply-To', size=64, help="The email address put \
in the 'Reply-To' of all emails sent by Open ERP about cases in this sales team"),
'parent_id': fields.many2one('crm.case.section', 'Parent Team'),
@@ -69,8 +69,8 @@ class crm_case_section(osv.osv):
}
_defaults = {
- 'active': lambda *a: 1,
- 'allow_unlink': lambda *a: 1,
+ 'active': lambda *a: 1,
+ 'allow_unlink': lambda *a: 1,
}
_sql_constraints = [
@@ -100,18 +100,20 @@ class crm_case_section(osv.osv):
(_check_recursion, 'Error ! You cannot create recursive sections.', ['parent_id'])
]
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
"""Overrides orm name_get method
@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 section ids
"""
+ if not context:
+ context = {}
- if not len(ids):
- return []
- reads = self.read(cr, uid, ids, ['name', 'parent_id'], context)
res = []
+ if not ids:
+ return res
+ reads = self.read(cr, uid, ids, ['name', 'parent_id'], context)
for record in reads:
name = record['name']
@@ -119,6 +121,7 @@ class crm_case_section(osv.osv):
name = record['parent_id'][1] + ' / ' + name
res.append((record['id'], name))
return res
+
crm_case_section()
@@ -129,13 +132,13 @@ class crm_case_categ(osv.osv):
_description = "Category of case"
_columns = {
- 'name': fields.char('Case Category Name', size=64, required=True, translate=True),
- 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
- 'object_id': fields.many2one('ir.model', 'Object Name'),
+ 'name': fields.char('Case Category Name', size=64, required=True, translate=True),
+ 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
+ 'object_id': fields.many2one('ir.model', 'Object Name'),
}
def _find_object_id(self, cr, uid, context=None):
- """
+ """Finds id for case object
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -149,7 +152,7 @@ class crm_case_categ(osv.osv):
_defaults = {
'object_id' : _find_object_id
}
-#
+
crm_case_categ()
@@ -161,19 +164,17 @@ class crm_case_resource_type(osv.osv):
_rec_name = "name"
_columns = {
- 'name': fields.char('Case Resource Type', size=64, required=True, translate=True),
- 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
- 'object_id': fields.many2one('ir.model', 'Object Name'),
+ 'name': fields.char('Case Resource Type', size=64, required=True, translate=True),
+ 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
+ 'object_id': fields.many2one('ir.model', 'Object Name'),
}
def _find_object_id(self, cr, uid, context=None):
- """
+ """Finds id for case object
@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 context: A standard dictionary for contextual values
"""
-
-
object_id = context and context.get('object_id', False) or False
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
return ids and ids[0]
@@ -194,46 +195,44 @@ class crm_case_stage(osv.osv):
_order = "sequence"
_columns = {
- 'name': fields.char('Stage Name', size=64, required=True, translate=True),
- 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
+ 'name': fields.char('Stage Name', size=64, required=True, translate=True),
+ 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'sequence': fields.integer('Sequence', help="Gives the sequence order \
- when displaying a list of case stages."),
- 'object_id': fields.many2one('ir.model', 'Object Name'),
- 'probability': fields.float('Probability (%)', required=True),
- 'on_change': fields.boolean('Change Probability Automatically',\
- help="Change Probability on next and previous stages."),
+ when displaying a list of case stages."),
+ 'object_id': fields.many2one('ir.model', 'Object Name'),
+ 'probability': fields.float('Probability (%)', required=True),
+ 'on_change': fields.boolean('Change Probability Automatically', \
+ help="Change Probability on next and previous stages."),
'requirements': fields.text('Requirements')
}
def _find_object_id(self, cr, uid, context=None):
-
- """
+ """Finds id for case object
@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 context: A standard dictionary for contextual values
"""
-
object_id = context and context.get('object_id', False) or False
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
return ids and ids[0]
_defaults = {
- 'sequence': lambda *args: 1,
- 'probability': lambda *args: 0.0,
+ 'sequence': lambda *args: 1,
+ 'probability': lambda *args: 0.0,
'object_id' : _find_object_id
}
crm_case_stage()
-def _links_get(self, cr, uid, context={}):
+def _links_get(self, cr, uid, context=None):
+ """Gets links value for reference field
+ @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 context: A standard dictionary for contextual 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 context: A standard dictionary for contextual values
- """
-
-
+ if not context:
+ context = {}
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
@@ -246,16 +245,13 @@ class crm_case(osv.osv):
_description = "Case"
def _email_last(self, cursor, user, ids, name, arg, context=None):
-
- """Return History
+ """Return last email from History
@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 case’s IDs
@param context: A standard dictionary for contextual values
"""
-
-
res = {}
for case in self.browse(cursor, user, ids):
if case.history_line:
@@ -264,30 +260,31 @@ class crm_case(osv.osv):
res[case.id] = False
return res
- def copy(self, cr, uid, id, default=None, context={}):
-
- """
+ def copy(self, cr, uid, id, default=None, context=None):
+ """Overrides orm copy method
@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 case’s IDs
@param context: A standard dictionary for contextual values
"""
-
+ if not context:
+ context = {}
if not default:
default = {}
default.update({'state': 'draft', 'id': False})
return super(crm_case, self).copy(cr, uid, id, default, context)
- def _get_log_ids(self, cr, uid, ids, field_names, arg, context={}):
-
- """
+ def _get_log_ids(self, cr, uid, ids, field_names, arg, context=None):
+ """Gets id for case log from history of particular case
@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 case log’s IDs
+ @param ids: List of Case IDs
@param context: A standard dictionary for contextual values
"""
+ if not context:
+ context = {}
result = {}
history_obj = False
@@ -306,7 +303,7 @@ class crm_case(osv.osv):
for case in self.browse(cr, uid, ids, context):
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
- history_ids = history_obj.search(cr, uid, [('model_id', '=', model_ids[0]),\
+ history_ids = history_obj.search(cr, uid, [('model_id', '=', model_ids[0]), \
('res_id', '=', case.id)])
if history_ids:
result[case.id] = {name: history_ids}
@@ -316,64 +313,60 @@ class crm_case(osv.osv):
return result
_columns = {
- 'id': fields.integer('ID', readonly=True),
- 'name': fields.char('Description', size=1024, required=True),
+ 'id': fields.integer('ID', readonly=True),
+ 'name': fields.char('Description', size=1024, required=True),
'active': fields.boolean('Active', help="If the active field is set to\
- true, it will allow you to hide the case without removing it."),
- 'description': fields.text('Description'),
- 'section_id': fields.many2one('crm.case.section', 'Sales Team',\
+ true, it will allow you to hide the case without removing it."),
+ 'description': fields.text('Description'),
+ '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.'),
- 'email_from': fields.char('Email', size=128, help="These people will receive email."),
+ Define Responsible user and Email account for mail gateway.'),
+ 'email_from': fields.char('Email', size=128, help="These people will receive email."),
'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"),
- 'probability': fields.float('Probability'),
- 'email_last': fields.function(_email_last, method=True,
- string='Latest E-Mail', type='text'),
- 'partner_id': fields.many2one('res.partner', 'Partner'),
- 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact',\
- domain="[('partner_id','=',partner_id)]"),
- 'create_date': fields.datetime('Creation Date' , readonly=True),
- 'write_date': fields.datetime('Update Date' , readonly=True),
- 'date_deadline': fields.date('Deadline'),
- 'user_id': fields.many2one('res.users', 'Responsible'),
- 'history_line': fields.function(_get_log_ids, method=True, type='one2many',\
- multi="history_line", relation="crm.case.history", string="Communication"),
- 'log_ids': fields.function(_get_log_ids, method=True, type='one2many',\
- multi="log_ids", relation="crm.case.log", string="Logs History"),
- 'stage_id': fields.many2one ('crm.case.stage', 'Stage',\
+ " communication between partner and users by email"),
+ 'probability': fields.float('Probability'),
+ 'email_last': fields.function(_email_last, method=True,
+ string='Latest E-Mail', type='text'),
+ 'partner_id': fields.many2one('res.partner', 'Partner'),
+ 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
+ domain="[('partner_id','=',partner_id)]"),
+ 'create_date': fields.datetime('Creation Date' , readonly=True),
+ 'write_date': fields.datetime('Update Date' , readonly=True),
+ 'date_deadline': fields.date('Deadline'),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
+ 'history_line': fields.function(_get_log_ids, method=True, type='one2many', \
+ multi="history_line", relation="crm.case.history", string="Communication"),
+ 'log_ids': fields.function(_get_log_ids, method=True, type='one2many', \
+ multi="log_ids", relation="crm.case.log", string="Logs History"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.opportunity')]"),
- 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True,
+ ('object_id.model', '=', 'crm.opportunity')]"),
+ 'state': fields.selection(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\'.'),
- 'company_id': fields.many2one('res.company', 'Company'),
+ \nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
+ 'company_id': fields.many2one('res.company', 'Company'),
}
def _get_default_partner_address(self, cr, uid, context):
-
- """
+ """Gives id of default address for current user
@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 context: A standard dictionary for contextual values
"""
-
if not context.get('portal', False):
return False
return self.pool.get('res.users').browse(cr, uid, uid, context).address_id.id
def _get_default_partner(self, cr, uid, context):
-
- """
+ """Gives id of partner for current user
@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 context: A standard dictionary for contextual values
"""
-
if not context.get('portal', False):
return False
user = self.pool.get('res.users').browse(cr, uid, uid, context)
@@ -382,14 +375,12 @@ class crm_case(osv.osv):
return user.address_id.partner_id.id
def _get_default_email(self, cr, uid, context):
-
- """
+ """Gives default email address for current user
@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 context: A standard dictionary for contextual values
"""
-
if not context.get('portal', False):
return False
user = self.pool.get('res.users').browse(cr, uid, uid, context)
@@ -398,63 +389,66 @@ class crm_case(osv.osv):
return user.address_id.email
def _get_default_user(self, cr, uid, context):
- """
+ """Gives current user id
@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 context: A standard dictionary for contextual values
"""
-
if context.get('portal', False):
return False
return uid
def _get_section(self, cr, uid, context):
- """
+ """Gives section id for current User
@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 context: A standard dictionary for contextual values
"""
-
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.context_section_id.id or False
_defaults = {
- 'active': lambda *a: 1,
- 'user_id': _get_default_user,
- 'partner_id': _get_default_partner,
- 'partner_address_id': _get_default_partner_address,
- 'email_from': _get_default_email,
- 'state': lambda *a: 'draft',
- 'section_id': _get_section,
- 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
+ 'active': lambda *a: 1,
+ 'user_id': _get_default_user,
+ 'partner_id': _get_default_partner,
+ 'partner_address_id': _get_default_partner_address,
+ 'email_from': _get_default_email,
+ 'state': lambda *a: 'draft',
+ 'section_id': _get_section,
+ 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
}
_order = 'date_deadline desc, create_date desc,id desc'
- def unlink(self, cr, uid, ids, context={}):
-
- """
+ def unlink(self, cr, uid, ids, context=None):
+ """Overrides orm unlink method
@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 case’s IDs
- @param context: A standard dictionary for contextual values"""
+ @param ids: List of case IDs
+ @param context: A standard dictionary for contextual values
+ """
+ if not context:
+ context = {}
for case in self.browse(cr, uid, ids, context):
if (not case.section_id.allow_unlink) and (case.state <> 'draft'):
- raise osv.except_osv(_('Warning !'),
+ raise osv.except_osv(_('Warning !'),
_('You can not delete this case. You should better cancel it.'))
return super(crm_case, self).unlink(cr, uid, ids, context)
- def stage_next(self, cr, uid, ids, context={}):
- """
+ def stage_next(self, cr, uid, ids, context=None):
+ """This function computes next stage for case from its current stage
+ using available stage for that case type
@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 stage next’s IDs
+ @param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
+ if not context:
+ context = {}
s = self.get_stage_dict(cr, uid, ids, context=context)
for case in self.browse(cr, uid, ids, context):
@@ -465,15 +459,17 @@ class crm_case(osv.osv):
self.write(cr, uid, [case.id], {'stage_id': s[section][st]})
return True
- def get_stage_dict(self, cr, uid, ids, context={}):
- """
+ def get_stage_dict(self, cr, uid, ids, context=None):
+ """This function gives dictionary for stage according to stage levels
@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 stage dict’s IDs
+ @param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
+ if not context:
+ context = {}
- sid = self.pool.get('crm.case.stage').search(cr, uid,\
+ sid = self.pool.get('crm.case.stage').search(cr, uid, \
[('object_id.model', '=', self._name)], context=context)
s = {}
previous = {}
@@ -484,20 +480,23 @@ class crm_case(osv.osv):
previous[section] = stage.id
return s
- def stage_previous(self, cr, uid, ids, context={}):
- """
+ def stage_previous(self, cr, uid, ids, context=None):
+ """This function computes previous stage for case from its current stage
+ using available stage for that case type
@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 stage previous’s IDs
+ @param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
+ if not context:
+ context = {}
s = self.get_stage_dict(cr, uid, ids, context=context)
for case in self.browse(cr, uid, ids, context):
section = (case.section_id.id or False)
if section in s:
- st = case.stage_id.id or False
+ st = case.stage_id.id or False
s[section] = dict([(v, k) for (k, v) in s[section].iteritems()])
if st in s[section]:
self.write(cr, uid, [case.id], {'stage_id': s[section][st]})
@@ -508,12 +507,17 @@ class crm_case(osv.osv):
@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 History’s IDs
+ @param ids: List of Case ids
+ @param keyword: Case action keyword e.g.: If case is closed "Close" keyword is used
+ @param history: Value True/False, If True it makes entry in case History otherwise in Case Log
+ @param email: Email address if any
+ @param details: Details of case history if any
@param context: A standard dictionary for contextual values"""
-
+ if not context:
+ context = {}
model_obj = self.pool.get('ir.model')
-
+ obj = self.pool.get('crm.case.log')
for case in cases:
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
data = {
@@ -526,33 +530,31 @@ class crm_case(osv.osv):
'message_id':message_id
}
- obj = self.pool.get('crm.case.log')
if history:
obj = self.pool.get('crm.case.history')
data['description'] = details or case.description
data['email_to'] = email or \
(case.section_id and case.section_id.reply_to) or \
(case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from',False)
+ case.user_id.address_id.email) or tools.config.get('email_from', False)
data['email_from'] = email_from or \
(case.section_id and case.section_id.reply_to) or \
(case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from',False)
+ case.user_id.address_id.email) or tools.config.get('email_from', False)
res = obj.create(cr, uid, data, context)
return True
+
_history = __history
history = __history
def create(self, cr, uid, *args, **argv):
-
- """
+ """Overrides orm create method
@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 *args: Give Tuple Value
- @Paran **args: Give Dictionay of Keyword Value
+ @param *args: Tuple Value for additional Params
+ @param **argv: Dictionay of Keyword Params
"""
-
res = super(crm_case, self).create(cr, uid, *args, **argv)
cases = self.browse(cr, uid, [res])
cases[0].state # to fill the browse record cache
@@ -560,97 +562,33 @@ class crm_case(osv.osv):
return res
def add_reply(self, cursor, user, ids, context=None):
-
- """
+ """This function finds last email and gives its description value for reply mail
@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 cursor: the current row, from the database cursor,
+ @param user: the current user’s ID for security checks
+ @param ids: List of case IDs
@param context: A standard dictionary for contextual values
"""
-
for case in self.browse(cursor, user, ids, context=context):
if case.email_last:
description = case.email_last
self.write(cursor, user, case.id, {
- 'description': '> ' + description.replace('\n', '\n> '),
+ 'description': '> ' + description.replace('\n', '\n> '),
}, context=context)
return True
- def case_log(self, cr, uid, ids, context={}, email=False, *args):
-
- """
- @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 context: A standard dictionary for contextual values
- @param *args: Give Tuple Value
- """
-
- cases = self.browse(cr, uid, ids)
- self.__history(cr, uid, cases, _('Historize'), history=True, email=email)
- return self.write(cr, uid, ids, {'description': False, 'som': False,
- 'canal_id': False})
-
- def case_log_reply(self, cr, uid, ids, context={}, email=False, *args):
-
- """
- @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 context: A standard dictionary for contextual values
- @param *args: Give Tuple Value
- """
-
- cases = self.browse(cr, uid, ids)
- for case in cases:
- if not case.email_from:
- raise osv.except_osv(_('Error!'),
- _('You must put a Partner eMail to use this action!'))
-
- if not case.user_id:
- raise osv.except_osv(_('Error!'),
- _('You must define a responsible user for this case in order to use this action!'))
-
- if not case.description:
- raise osv.except_osv(_('Error!'),
- _('Can not send mail with empty body,you should have description in the body'))
-
- self.__history(cr, uid, cases, _('Send'), history=True, email=False)
- for case in cases:
- self.write(cr, uid, [case.id], {
- 'description': False,
- })
- emails = [case.email_from] + (case.email_cc or '').split(',')
- emails = filter(None, emails)
- body = case.description or ''
- if case.user_id.signature:
- body += '\n\n%s' % (case.user_id.signature)
-
- emailfrom = case.user_id.address_id and case.user_id.address_id.email or False
- if not emailfrom:
- raise osv.except_osv(_('Error!'),
- _("No E-Mail ID Found for your Company address!"))
-
- tools.email_send(
- emailfrom,
- emails,
- '[' + str(case.id) + '] ' + case.name,
- self.format_body(body),
- reply_to = case.section_id.reply_to,
- openobject_id = str(case.id)
- )
- self.__history(cr, uid, [case], _('Send'), history=True, email=emails, details=body, email_from=emailfrom)
- return True
-
def onchange_partner_id(self, cr, uid, ids, part, email=False):
- """
+ """This function returns value of partner address based on partner
@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 case IDs
+ @param part: Partner's id
+ @email: Partner's email ID
"""
if not part:
- return {'value': {'partner_address_id': False,
- 'email_from': False,
+ return {'value': {'partner_address_id': False,
+ 'email_from': False,
}}
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
data = {'partner_address_id': addr['contact']}
@@ -658,29 +596,27 @@ class crm_case(osv.osv):
return {'value': data}
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
-
- """
+ """This function returns value of partner email based on Partner Address
@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 case IDs
+ @param add: Id of Partner's address
+ @email: Partner's email ID
"""
-
- data = {}
if not add:
return {'value': {'email_from': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
- data['email_from'] = address.email
- return {'value': data}
+ return {'value': {'email_from': address.email}}
def case_close(self, cr, uid, ids, *args):
- """
+ """Closes Case
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Close'))
@@ -692,14 +628,13 @@ class crm_case(osv.osv):
return True
def case_escalate(self, cr, uid, ids, *args):
- """
+ """Escalates case to top level
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
for case in cases:
data = {'active': True, 'user_id': False}
@@ -716,36 +651,33 @@ class crm_case(osv.osv):
self._action(cr, uid, cases, 'escalate')
return True
-
def case_open(self, cr, uid, ids, *args):
- """
+ """Opens Case
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
self.__history(cr, uid, cases, _('Open'))
+
for case in cases:
data = {'state': 'open', 'active': True}
if not case.user_id:
data['user_id'] = uid
- self.write(cr, uid, ids, data)
+ self.write(cr, uid, case.id, data)
self._action(cr, uid, cases, 'open')
return True
-
def case_cancel(self, cr, uid, ids, *args):
- """
+ """Cancels Case
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Cancel'))
@@ -754,15 +686,13 @@ class crm_case(osv.osv):
return True
def case_pending(self, cr, uid, ids, *args):
-
- """
+ """Marks case as pending
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Pending'))
@@ -771,15 +701,13 @@ class crm_case(osv.osv):
return True
def case_reset(self, cr, uid, ids, *args):
-
- """
+ """Resets case as draft
@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 case's Ids
- @param *args: Give Tuple Value
+ @param ids: List of case Ids
+ @param *args: Tuple Value for additional Params
"""
-
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Draft'))
@@ -797,16 +725,16 @@ class crm_case_log(osv.osv):
_order = "id desc"
_columns = {
- 'name': fields.char('Status', size=64),
- 'date': fields.datetime('Date'),
- 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
- 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
- 'model_id': fields.many2one('ir.model', "Model"),
- 'res_id': fields.integer('Resource ID'),
+ 'name': fields.char('Status', size=64),
+ 'date': fields.datetime('Date'),
+ 'section_id': fields.many2one('crm.case.section', 'Section'),
+ 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
+ 'model_id': fields.many2one('ir.model', "Model"),
+ 'res_id': fields.integer('Resource ID'),
}
_defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
crm_case_log()
@@ -820,14 +748,13 @@ class crm_case_history(osv.osv):
_inherits = {'crm.case.log': "log_id"}
def _note_get(self, cursor, user, ids, name, arg, context=None):
-
- """ @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 case History’s IDs
- @param context: A standard dictionary for contextual values
+ """ Gives case History Description
+ @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 case History’s IDs
+ @param context: A standard dictionary for contextual values
"""
-
res = {}
for hist in self.browse(cursor, user, ids, context or {}):
res[hist.id] = (hist.email or '/') + ' (' + str(hist.date) + ')\n'
@@ -850,7 +777,7 @@ class users(osv.osv):
_inherit = 'res.users'
_description = "Users"
_columns = {
- 'context_section_id': fields.many2one('crm.case.section', 'Sales Team'),
+ 'context_section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
users()
@@ -858,7 +785,7 @@ users()
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
- 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
+ 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
res_partner()
diff --git a/addons/crm/crm_mailgate.py b/addons/crm/crm_mailgate.py
index 17d182728a3..65ca7626468 100644
--- a/addons/crm/crm_mailgate.py
+++ b/addons/crm/crm_mailgate.py
@@ -32,6 +32,8 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
+from tools import command_re
+
class crm_cases(osv.osv):
""" crm cases """
@@ -39,7 +41,7 @@ class crm_cases(osv.osv):
_inherit = "crm.case"
def message_new(self, cr, uid, msg, context):
- """
+ """
Automatically calls when new email message arrives
@param self: The object pointer
@@ -90,15 +92,20 @@ class crm_cases(osv.osv):
if msg.get('priority', False):
vals['priority'] = msg.get('priority')
-# act = 'case_'+default_act
-# if 'state' in msg_actions:
-# if msg_actions['state'] in ['draft','close','cancel','open','pending']:
-# act = 'case_' + msg_actions['state']
-
-# for k1,k2 in [('cost','planned_cost'),('revenue','planned_revenue'),('probability','probability')]:
-# if k1 in msg_actions:
-# data[k2] = float(msg_actions[k1])
-
+ maps = {
+ 'cost':'planned_cost',
+ 'revenue': 'planned_revenue',
+ 'probability':'probability'
+ }
+ vls = { }
+ for line in msg['body'].split('\n'):
+ line = line.strip()
+ res = command_re.match(line)
+ if res and maps.get(res.group(1).lower(), False):
+ key = maps.get(res.group(1).lower())
+ vls[key] = res.group(2).lower()
+
+ vals.update(vls)
res = self.write(cr, uid, ids, vals)
cases = self.browse(cr, uid, ids)
message_id = context.get('references_id', False)
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index d566bd25b22..3e1fc24a803 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -88,7 +88,8 @@ class crm_opportunity(osv.osv):
resource_id = False
if opportunity.user_id:
resource_ids = res_obj.search(cr, uid, [('user_id','=',opportunity.user_id.id)])
- resource_id = len(resource_ids) and resource_ids[0] or False
+ if resource_ids and len(resource_ids):
+ resource_id = resource_ids[0]
duration = float(ans.days)
if opportunity.section_id.resource_calendar_id:
diff --git a/addons/crm/crm_opportunity_demo.xml b/addons/crm/crm_opportunity_demo.xml
index e88e0f1ec8e..b893d536e44 100644
--- a/addons/crm/crm_opportunity_demo.xml
+++ b/addons/crm/crm_opportunity_demo.xml
@@ -18,7 +18,6 @@
-
@@ -34,7 +33,6 @@
-
@@ -51,7 +49,6 @@
-
@@ -68,7 +65,6 @@
-
@@ -84,7 +80,6 @@
-
diff --git a/addons/crm/wizard/crm_lead_to_partner.py b/addons/crm/wizard/crm_lead_to_partner.py
index 2cd0ab541fe..267c3296844 100644
--- a/addons/crm/wizard/crm_lead_to_partner.py
+++ b/addons/crm/wizard/crm_lead_to_partner.py
@@ -53,42 +53,41 @@ class crm_lead2partner(osv.osv_memory):
raise osv.except_osv(_('Warning !'),
_('A partner is already defined on this lead.'))
- def _select_partner(self, cr, uid, context=None):
+ def default_get(self, cr, uid, fields, context=None):
"""
- This function Searches for Partner from selected lead.
+ This function gets default 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 fields: List of fields for default value
@param context: A standard dictionary for contextual values
- @return : Partner id if any for selected lead.
+ @return : default values of fields.
"""
- if not context:
- context = {}
-
lead_obj = self.pool.get('crm.lead')
partner_obj = self.pool.get('res.partner')
contact_obj = self.pool.get('res.partner.address')
rec_ids = context and context.get('active_ids', [])
partner_id = False
- for lead in lead_obj.browse(cr, uid, rec_ids, context=context):
+ data = context and context.get('active_ids', []) or []
+ res = super(crm_lead2partner, self).default_get(cr, uid, fields, context=context)
+
+ for lead in lead_obj.browse(cr, uid, data, context=context):
partner_ids = partner_obj.search(cr, uid, [('name', '=', lead.partner_name or lead.name)])
if not partner_ids and lead.email_from:
address_ids = contact_obj.search(cr, uid, [('email', '=', lead.email_from)])
if address_ids:
addresses = contact_obj.browse(cr, uid, address_ids)
partner_ids = addresses and [addresses[0].partner_id.id] or False
-
partner_id = partner_ids and partner_ids[0] or False
- return partner_id
-
- _defaults = {
- 'action': lambda *a:'exist',
- 'partner_id': _select_partner
- }
+ if 'partner_id' in fields:
+ res.update({'partner_id': partner_id})
+ if 'action' in fields:
+ res.update({'action': partner_id and 'exist' or 'create'})
+ return res
+
def open_create_partner(self, cr, uid, ids, context=None):
"""
This function Opens form of create partner.
diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py
index 99f32443b36..434035cd2df 100644
--- a/addons/crm/wizard/crm_send_email.py
+++ b/addons/crm/wizard/crm_send_email.py
@@ -70,8 +70,8 @@ class crm_send_new_email(osv.osv_memory):
for data in self.read(cr, uid, ids, context=context):
attach = filter(lambda x: x, [data['doc1'], data['doc2'], data['doc3']])
- attach = map(lambda x: x and ('Attachment'+str(attach.index(x)+1), base64.decodestring(x)), attach)
-
+ attach = map(lambda x: (data['doc' + str(attach.index(x) + 1) \
+ + '_fname'], base64.decodestring(x)), attach)
message_id = None
case = case_pool.browse(cr, uid, res_id)
@@ -132,11 +132,6 @@ class crm_send_new_email(osv.osv_memory):
getattr(case_pool, act)(cr, uid, [case.id])
cr.commit()
-# Commented because form does not close due to raise
-# raise osv.except_osv(_('Email!'), ("Email Successfully Sent"))
-# else:
-# raise osv.except_osv(_('Warning!'), _("Email not sent !"))
-
return {}
def default_get(self, cr, uid, fields, context=None):
diff --git a/addons/crm_profiling/i18n/ko.po b/addons/crm_profiling/i18n/ko.po
index 10fd9676dae..919e0c79acf 100644
--- a/addons/crm_profiling/i18n/ko.po
+++ b/addons/crm_profiling/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm_profiling
diff --git a/addons/document/document.py b/addons/document/document.py
index f6cbddebae7..2b2ac2f7587 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -73,7 +73,7 @@ class document_file(osv.osv):
_columns = {
'user_id': fields.many2one('res.users', 'Owner', select=1),
- 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
+ 'group_ids': fields.many2many('res.groups', 'document_group_rel', 'item_id', 'group_id', 'Groups'),
# the directory id now is mandatory. It can still be computed automatically.
'parent_id': fields.many2one('document.directory', 'Directory', select=1, required=True),
'file_size': fields.integer('File Size', required=True),
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py
index 270f2d9353f..c9c124cdfe0 100644
--- a/addons/document/document_directory.py
+++ b/addons/document/document_directory.py
@@ -52,7 +52,7 @@ class document_directory(osv.osv):
'ressource_type_id': fields.many2one('ir.model', 'Directories Mapped to Objects',
help="Select an object here and Open ERP will create a mapping for each of these " \
"objects, using the given domain, when browsing through FTP."),
- 'resource_field': fields.char('Name field',size=32,help='Field to be used as name on resource directories. If empty, the "name" will be used.'),
+ 'resource_field': fields.many2one('ir.model.fields', 'Name field', help='Field to be used as name on resource directories. If empty, the "name" will be used.'),
'ressource_parent_type_id': fields.many2one('ir.model', 'Parent Model',
help="If you put an object here, this directory template will appear bellow all of these objects. " \
"Don't put a parent directory if you select a parent model."),
@@ -61,10 +61,12 @@ class document_directory(osv.osv):
help="Check this if you want to use the same tree structure as the object selected in the system."),
'dctx_ids': fields.one2many('document.directory.dctx', 'dir_id', 'Context fields'),
}
+
+
def _get_root_directory(self, cr,uid, context=None):
objid=self.pool.get('ir.model.data')
try:
- mid = objid._get_id(cr, uid, 'document', 'dir_root')
+ mid = objid._get_id(cr, uid, 'document', 'dir_root')
if not mid:
return False
root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py
index bea11d6d12e..421c423b900 100644
--- a/addons/document/document_storage.py
+++ b/addons/document/document_storage.py
@@ -103,7 +103,7 @@ class document_storage(osv.osv):
'create_date': fields.datetime('Date Created', readonly=True),
'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
'user_id': fields.many2one('res.users', 'Owner'),
- 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
+ 'group_ids': fields.many2many('res.groups', 'document_storage_group_rel', 'item_id', 'group_id', 'Groups'),
'dir_ids': fields.one2many('document.directory', 'parent_id', 'Directories'),
'type': fields.selection([('db', 'Database'), ('filestore', 'Internal File storage'),
('realstore', 'External file storage'), ('virtual', 'Virtual storage')], 'Type', required=True),
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index f00448b94ac..0185f9fe444 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -13,12 +13,16 @@
form
@@ -67,13 +71,13 @@
-
-
+
+
-
+
@@ -320,9 +322,10 @@
+
-
+
diff --git a/addons/olap/olap.py b/addons/olap/olap.py
index 5081619ce71..338d61f81fa 100644
--- a/addons/olap/olap.py
+++ b/addons/olap/olap.py
@@ -40,15 +40,17 @@ class olap_fact_database(osv.osv):
_description = "Olap Fact Database"
def _connection_get(self, cr, uid, ids, field_name, arg, context = {}):
- """
- Return a connection string url needed by SQL Alchemy. Exemple:
+ """ Return a connection string url needed by SQL Alchemy. Exemple:
'postgres://scott:tiger@localhost:5432/mydatabase'
+
+ @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 connection’s IDs
+ @param arg: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...].
@param context: A standard dictionary for contextual values
-
"""
+
res = {}
for obj in self.browse(cr, uid, ids, context):
res[obj.id] = '%s://%s:%s@%s:%d/%s' % (obj.type, obj.db_login, \
@@ -56,14 +58,13 @@ class olap_fact_database(osv.osv):
return res
def test_connection(self, cr, uid, ids, context = {}):
-
""" Test connection for postgres Or ,MySql Or ,Oracle
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Test Connection’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Test Connection’s IDs
+ @param context: A standard dictionary for contextual values
"""
-
try:
self_obj = self.browse(cr, uid, ids, context)
for obj in self_obj:
@@ -140,16 +141,16 @@ class olap_schema(osv.osv ):
_description = "Olap Schema"
def _app_detect(self, cr, uid, ids, field_name, arg, context = {}):
-
"""
Return a Application type
+ @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 Detected Application’s IDs
@param context: A standard dictionary for contextual values
"""
- res = {}
+ res = {}
app_objs = self.pool.get('olap.application')
app_ids = app_objs.search(cr, uid, [])
app_res = app_objs.browse(cr, uid, app_ids)
@@ -202,13 +203,13 @@ class olap_schema(osv.osv ):
}
def action_dbconnect(self, cr, uid, ids, context = {}):
-
- """ Connect DB with postgres ,Or MySql , Or Orcale
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Database Connection action’s IDs
- @param context: A standard dictionary for contextual values
- """
+ """ Connect DB with postgres ,Or MySql,Or Orcale
+ @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 Database Connection action’s IDs
+ @param context: A standard dictionary for contextual values
+ """
schema = self.browse(cr, uid, ids, context)[0]
type = schema.database_id.type
@@ -255,12 +256,12 @@ class olap_schema(osv.osv ):
return True
def action_dbload(self, cr, uid, ids, context = {}):
-
- """ Load DB
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Database Load Action’s IDs
- @param context: A standard dictionary for contextual values
+ """ Load DB
+ @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 Database Load Action’s IDs
+ @param context: A standard dictionary for contextual values
"""
for id in ids:
@@ -271,12 +272,12 @@ class olap_schema(osv.osv ):
def action_dbconfigure(self, cr, uid, ids, context = {}):
-
- """ Configure with Database
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Database Configuraion Action’s IDs
- @param context: A standard dictionary for contextual values
+ """ Configure with Database
+ @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 Database Configuraion Action’s IDs
+ @param context: A standard dictionary for contextual values
"""
for id in ids:
@@ -288,11 +289,12 @@ class olap_schema(osv.osv ):
return True
def action_dbready(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Database Action’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Database Action’s IDs
+ @param context: A standard dictionary for contextual values """
for id in ids:
self.write(cr, uid, id, {'ready': True})
@@ -300,11 +302,12 @@ class olap_schema(osv.osv ):
return True
def action_done(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Action’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Action’s IDs
+ @param context: A standard dictionary for contextual values """
for id in ids:
self.write(cr, uid, id, {'state': 'done'})
@@ -343,12 +346,12 @@ class olap_schema(osv.osv ):
raise 'Not implemented !'
def request(self, cr, uid, name, request, context = {}):
-
"""
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Request’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Request’s IDs
+ @param context: A standard dictionary for contextual values
"""
ids = self.search(cr, uid, [('name', '=', name)])
@@ -387,7 +390,7 @@ olap_schema()
class olap_database_tables(osv.osv):
- """ Database Tables """
+ """Database Tables"""
_name = "olap.database.tables"
_description = "Olap Database Tables"
@@ -408,15 +411,15 @@ class olap_database_tables(osv.osv):
}
def name_get(self, cr, uid, ids, context = {}):
-
""" Get Database Name
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Name’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Name’s IDs
+ @param context: A standard dictionary for contextual values
+ """
result = []
-
for t in self.browse(cr, uid, ids, context):
if t.name <> t.table_db_name:
@@ -427,10 +430,12 @@ class olap_database_tables(osv.osv):
def show_col_view(self, cr, uid, ids, context = {}):
""" Open Tree View of Database Columns
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Column’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Column’s IDs
+ @param context: A standard dictionary for contextual values
+ """
ids_cols = self.pool.get('olap.database.columns').search(cr, uid, ([('table_id', '=', ids[0])]))
id = self.pool.get('ir.ui.view').search(cr, uid, \
@@ -448,16 +453,30 @@ class olap_database_tables(osv.osv):
def hide_col(self, cr, uid, ids, context = {}):
# To hide all the related columns also
+ """ Hide all the related columns
+ @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 Hide Column’s IDs
+ @param context: A standard dictionary for contextual values
+ """
+
for id in ids:
- self.write(cr, uid, id, {'hide':True})
+ self.write(cr, uid, id, {'hide': True})
return {}
def show_col(self, cr, uid, ids, context = {}):
# To show or unhide all the columns also
- for id in ids:
- self.write(cr, uid, id, {'hide':False})
- return {}
+ """ show all the related columns
+ @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 Column’s IDs
+ @param context: A standard dictionary for contextual values """
+ for id in ids:
+ self.write(cr, uid, id, {'hide': False})
+ return {}
olap_database_tables()
@@ -476,20 +495,22 @@ class olap_database_columns(osv.osv):
'float8': 'Double Precesion',
'varchar': 'Character Varying',
'bool': 'Boolean',
- 'bytea':'Byte A',
- 'int2':'Small Integer',
- 'int4':'Integer',
- 'int8':'Big Integer',
- 'text':'Text',
- 'date':'Date',
+ 'bytea': 'Byte A',
+ 'int2': 'Small Integer',
+ 'int4': 'Integer',
+ 'int8': 'Big Integer',
+ 'text': 'Text',
+ 'date': 'Date',
'time': 'TimeStamp without Time Zone',
- 'number':'NUMBER',
+ 'number': 'NUMBER',
}
def _datatypes_get(self, *args, **argv):
-
- """ @param *args: For Positional Argument
- @param **args: For Keyword Argument """
+ """
+ @param self: The object pointer
+ @param *args: For Positional Argument
+ @param **args: For Keyword Argument
+ """
return self.datatypes.items()
@@ -512,15 +533,15 @@ class olap_database_columns(osv.osv):
}
def name_get(self, cr, uid, ids, context = {}):
-
""" Get Database Column
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Name’s IDs
- @param context: A standard dictionary for contextual 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 ids: List of Name’s IDs
+ @param context: A standard dictionary for contextual values
+ """
result = []
-
for t in self.browse(cr, uid, ids, context):
if t.name <> t.column_db_name:
@@ -532,6 +553,15 @@ class olap_database_columns(osv.osv):
def search(self, cr, uid, args, offset = 0, limit = None, order = None,
context = None, count = False):
+ """ olap search method.
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param user: the current user’s ID for security checks,
+ @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...].
+ @param offset: The Number of Results to Pass
+ @param limit: The Number of Results to Return
+ @param context: A standard dictionary for contextual values
+ """
if not context:
return super(olap_database_columns, self).search(cr, uid, args, offset, limit,
@@ -594,7 +624,7 @@ class olap_database_columns(osv.osv):
for lines in cube_obj.table_id.line_ids:
make_ids.append(lines.table_id.id)
- if make_ids:
+ if make_ids and cube_obj.table_id.line_ids:
make_ids.append(cube_obj.table_id.line_ids[len(cube_obj.table_id.line_ids) - 1].field_id.related_to.id)
args = [('table_id', 'in', make_ids), ('related_to', '=', False), \
('primary_key', '<>', True), \
@@ -647,33 +677,39 @@ class olap_database_columns(osv.osv):
def hide_col(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ Hide all the related columns
+ @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 Hide Column’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
for id in ids:
self.write(cr, uid, id, {'hide':True})
return {}
def show_col(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ show all the related columns
+ @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 column’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
for id in ids:
self.write(cr, uid, id, {'hide': True})
return {}
def field_add(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ Add all the Related Field
+ @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 Field’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
col_data = self.pool.get('olap.database.columns').read(cr, uid, ids, [], context)[0]
ctx_list = []
@@ -687,9 +723,9 @@ class olap_database_columns(osv.osv):
if context['parent_id']:
parent_id = context['parent_id']
val = {
- 'cube_table_id':parent_id,
- 'table_id':table_id,
- 'field_id':ids[0]
+ 'cube_table_id': parent_id,
+ 'table_id': table_id,
+ 'field_id': ids[0]
}
id = self.pool.get('olap.cube.table.line').create(cr, uid, val, context)
@@ -701,11 +737,13 @@ class olap_database_columns(osv.osv):
return ctx_list
def make_hierarchy(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ Make Hierarchy on the cube
+ @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 Hierarchy’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
col_data = self.pool.get('olap.database.columns').read(cr, uid, ids, [], context)[0]
ctx_list = []
@@ -719,9 +757,9 @@ class olap_database_columns(osv.osv):
pk_table = cube_table_obj.name
val = {
- 'field_name':col_data['name'],
- 'name':col_data['name'],
- 'primary_key_table':pk_table
+ 'field_name': col_data['name'],
+ 'name': col_data['name'],
+ 'primary_key_table': pk_table
}
if context['hier_parent_id']:
@@ -751,11 +789,14 @@ class olap_cube_table(osv.osv):
_description = "Olap cube table"
def write(self, cr, uid, ids, vals, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 Cube Table’s IDs
- @param context: A standard dictionary for contextual values """
+ @param vals: Get the Value's of cube table
+ @param context: A standard dictionary for contextual values
+ """
if vals and vals.get('available_table_ids', 0) and context and \
(context.has_key('master_dim') or context.has_key('d_id') or \
@@ -816,10 +857,13 @@ class olap_cube_table(osv.osv):
return super(olap_cube_table, self).write(cr, uid, ids, vals, context)
def create(self, cr, uid, vals, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param vals: Get the Value's of cube table
+ @param context: A standard dictionary for contextual values
+ """
cube_table_id = super(olap_cube_table, self).create(cr, uid, vals, context)
@@ -839,22 +883,35 @@ class olap_cube_table(osv.osv):
def search(self, cr, uid, args, offset = 0, limit = None, order = None,
context = None, count = False):
+ """ olap search method.
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param user: the current user’s ID for security checks,
+ @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...].
+ @param offset: The Number of Results to Pass
+ @param limit: The Number of Results to Return
+ @param context: A standard dictionary for contextual values
+ """
+
if context and context.has_key('parent_schema_id'):
args = [('schema_id', '=', context['parent_schema_id'])]
if context and context.has_key('d_id'):
- dim_obj = self.pool.get('olap.dimension').browse(cr, uid, int(['d_id']))
+ dim_obj = self.pool.get('olap.dimension').browse(cr, uid, int(context['d_id']))
args = [('schema_id', '=', dim_obj.cube_id.schema_id.id)]
return super(olap_cube_table, self).search(cr, uid, args, offset, limit, \
order, context = context, count = count)
def _available_table_get(self, cr, uid, ids, name, arg, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 Available Table’s IDs
- @param context: A standard dictionary for contextual values """
+ @param arg: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]
+ @param context: A standard dictionary for contextual values
+ """
result = {}
parent_table_id = []
@@ -871,10 +928,12 @@ class olap_cube_table(osv.osv):
return result
def _set_schema(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ Set Schema for cube table
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
if context and context.has_key('d_id'):
dim_obj = self.pool.get('olap.dimension').browse(cr, uid, int(context['d_id']))
@@ -884,20 +943,24 @@ class olap_cube_table(osv.osv):
return context['parent_schema_id']
def _set_name(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ set name for cube table
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
if context and context.has_key('d_id'):
dim_obj = self.pool.get('olap.dimension').browse(cr, uid, int(context['d_id']))
return dim_obj.cubeAid.table_id.name
def _get_id(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
if context and context.has_key('d_id'):
dim_obj = self.pool.get('olap.dimension').browse(cr, uid, int(context['d_id']))
@@ -914,10 +977,12 @@ class olap_cube_table(osv.osv):
return col_ids
def _def_set(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
return []
@@ -925,8 +990,8 @@ class olap_cube_table(osv.osv):
'name': fields.char('Table name', size = 64, required = True),
'line_ids': fields.one2many('olap.cube.table.line', 'cube_table_id',\
'Database Tables', required = True),
- 'schema_id':fields.many2one('olap.schema', 'Schema id', ondelete = 'cascade'),
- 'column_link_id':fields.many2one('olap.database.columns', 'Relational Column' , required = True),
+ 'schema_id': fields.many2one('olap.schema', 'Schema id', ondelete = 'cascade'),
+ 'column_link_id': fields.many2one('olap.database.columns', 'Relational Column' , required = True),
'available_table_ids': fields.function(
_available_table_get,
method = True,
@@ -937,13 +1002,16 @@ class olap_cube_table(osv.osv):
}
_defaults = {
- 'schema_id':_set_schema,
+ 'schema_id': _set_schema,
}
def field_add(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ Add the Field for the cube table
+ @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 context: A standard dictionary for contextual values """
+ @param ids: List of cube table’s IDs
+ @param context: A standard dictionary for contextual values
+ """
return {}
@@ -966,10 +1034,11 @@ class olap_cube_table_line(osv.osv):
}
# Set the Table when changing field_id
def onchange_field_id(self, *args, **argv):
-
- """ @param *args: For Positional Argument
- @param **args: For Keyword Argument """
-
+ """
+ @param self: The object pointer
+ @param *args: For Positional Argument
+ @param **argv: For Keyword Argument
+ """
pass
olap_cube_table_line()
@@ -982,10 +1051,11 @@ class olap_cube(osv.osv):
_description = "Olap cube"
def _set_schema(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param context: A standard dictionary for contextual values
+ """ set schema for olap cube
+ @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 context: A standard dictionary for contextual values
"""
if context and context.has_key('schema_id'):
@@ -1038,10 +1108,11 @@ class olap_dimension(osv.osv):
_description = "Olap dimension"
def _set_cube(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param context: A standard dictionary for contextual values
+ """ set cube for Olap Dimension
+ @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 context: A standard dictionary for contextual values
"""
if context and context.has_key('cube_id'):
@@ -1076,10 +1147,11 @@ class olap_hierarchy(osv.osv):
}
def _set_dimension(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param context: A standard dictionary for contextual values
+ """ set Dimension for Olap Hierarchy
+ @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 context: A standard dictionary for contextual values
"""
if context and context.has_key('dimension_id'):
@@ -1087,10 +1159,11 @@ class olap_hierarchy(osv.osv):
return False
def _set_name(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param context: A standard dictionary for contextual values
+ """ set name for Olap Hierarchy
+ @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 context: A standard dictionary for contextual values
"""
if context and context.has_key('dimension_id'):
@@ -1099,10 +1172,11 @@ class olap_hierarchy(osv.osv):
return False
def _hierarchy_get(self, *args, **argv):
-
- """ @param *args: For Positional Argument
- @param **args: For Keyword Argument """
-
+ """
+ @param self: The object pointer
+ @param *args: For Positional Argument
+ @param **args: For Keyword Argument
+ """
return self.hierarchy_type.items()
_columns = {
@@ -1140,30 +1214,37 @@ class olap_level(osv.osv):
}
def _set_hierarchy(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param context: A standard dictionary for contextual values """
+ """ set Hierarchy for Olap Level
+ @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 context: A standard dictionary for contextual values
+ """
if context and context.has_key('hierarchy_id'):
return context['hierarchy_id']
return False
def _set_name(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ set name for Olap Level
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
if context and context.has_key('hierarchy_id'):
hier_obj = self.pool.get('olap.hierarchy').browse(cr, uid, int(context['hierarchy_id']))
return hier_obj.name
def onchange_column_name(self, cr, uid, ids, column, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param ids: List of Olap Level’s IDs
+ @param context: A standard dictionary for contextual values
+ """
if not column:
return {}
@@ -1173,21 +1254,23 @@ class olap_level(osv.osv):
val['column_id_name'] = col.column_db_name
if (col.type == 'date'):
val['type'] = 'date_year'
- return {'value':val}
+ return {'value': val}
def _type_get(self, cr, uid, *args, **argv):
-
- """ @param *args: For Positional Argument
- @param **args: For Keyword Argument
+ """
+ @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 *args: For Positional Argument
+ @param **args: For Keyword Argument
"""
keys = self._types.keys()
return map(lambda x: (x,x),keys)
-
_columns = {
'name': fields.char('Level name', size = 64, required = True),
- 'column_name':fields.many2one('olap.database.columns', 'Columns Name', required = True),
+ 'column_name': fields.many2one('olap.database.columns', 'Columns Name', required = True),
'column_id_name': fields.char('Column ID', size = 64, required = True),
'type': fields.selection(selection = _type_get, string = 'Level class', size = 64, required = True),
'table_name': fields.char('Table name', size = 64, required = True, \
@@ -1199,8 +1282,8 @@ class olap_level(osv.osv):
_defaults = {
'column_id_name': lambda * args: 'name',
- 'sequence':lambda * args: '1',
- 'type':lambda * args:'normal',
+ 'sequence': lambda * args: '1',
+ 'type': lambda * args:'normal',
'hierarchy_id': _set_hierarchy,
'name': _set_name
}
@@ -1214,20 +1297,25 @@ class olap_measure(osv.osv):
_description = "Olap measure"
def _set_cube(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """ set cube for Olap Measure
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
if context and context.has_key('cube_id'):
return context['cube_id']
return False
def onchange_measure_name(self, cr, uid, ids, column, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param ids: List of Olap Measure’s IDs
+ @param context: A standard dictionary for contextual values
+ """
val = {}
if not column:
@@ -1236,7 +1324,7 @@ class olap_measure(osv.osv):
val['table_name'] = col.table_id.table_db_name
val['value_column_id_name'] = col.column_db_name
val['name'] = col.column_db_name
- return {'value':val}
+ return {'value': val}
_columns = {
'name': fields.char('Measure name', size = 64, required = True),
@@ -1249,7 +1337,7 @@ class olap_measure(osv.osv):
('sql_expr', 'SQL Expression')],\
'Measure Type', required = True,\
help = "Select between auto column or sql expression for the measures"),
- 'value_sql': fields.char('SQL Expression', size = 200, help = "You can \
+ 'value_sql': fields.text('SQL Expression', help = "You can \
provide valid sql expression. Make sure it have \
function with fully qualified column name like \
(sum,avg ...)(tablename.columnname (+,- ...) tablename.columnname)"),
@@ -1271,7 +1359,7 @@ class olap_measure(osv.osv):
'datatype': lambda * args: 'float',
'formatstring': lambda * args: 'none',
'cube_id': _set_cube,
- 'measure_type':lambda * args:'fact_column',
+ 'measure_type': lambda * args:'fact_column',
}
olap_measure()
@@ -1316,7 +1404,7 @@ class olap_application_field(osv.osv):
_columns = {
'name': fields.char('Application field name', size = 64, required = True),
'table_name': fields.char('Application table name', size = 64),
- 'field_name':fields.char('Field name', size = 64),
+ 'field_name': fields.char('Field name', size = 64),
'is_hidden': fields.boolean('Hidden'),
'application_id': fields.many2one('olap.application', 'Application Id', required = True),
}
@@ -1348,10 +1436,12 @@ class bi_load_db_wizard(osv.osv_memory):
_name = 'bi.load.db.wizard'
def _get_fact_table(self, cr, uid, ctx):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 ctx: A standard dictionary for contextual values """
+ @param ctx: A standard dictionary for contextual values
+ """
if ctx and ctx.has_key('active_id'):
schema_obj = self.pool.get('olap.schema').browse(cr, uid, ctx['active_id'])
@@ -1359,10 +1449,12 @@ class bi_load_db_wizard(osv.osv_memory):
return False
def _get_db_name(self, cr, uid, ctx):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 ctx: A standard dictionary for contextual values """
+ @param ctx: A standard dictionary for contextual values
+ """
if ctx and ctx.has_key('active_id'):
schema_obj = self.pool.get('olap.schema').browse(cr, uid, ctx['active_id'])
@@ -1370,8 +1462,8 @@ class bi_load_db_wizard(osv.osv_memory):
return False
_columns = {
- 'fact_table':fields.char('Fact Name' , size = 64, readonly = True),
- 'db_name':fields.char('Database Name', size = 64, readonly = True)
+ 'fact_table': fields.char('Fact Name' , size = 64, readonly = True),
+ 'db_name': fields.char('Database Name', size = 64, readonly = True)
}
_defaults = {
@@ -1380,11 +1472,13 @@ class bi_load_db_wizard(osv.osv_memory):
}
def action_load(self, cr, uid, ids, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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: Load Action’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
data = context and context.get('active_id', False) or False
if context and context.has_key('active_id'):
@@ -1413,8 +1507,8 @@ class bi_load_db_wizard(osv.osv_memory):
INFORMATION_SCHEMA.tables as a where a.table_schema = 'public'")
for table in cr_db.fetchall():
val = {
- 'fact_database_id':id_db,
- 'table_db_name':table[0]
+ 'fact_database_id': id_db,
+ 'table_db_name': table[0]
}
if table[0] in tables.keys():
table_id = tobj.write(cr, uid, [tables[table[0]]], val, context)
@@ -1480,7 +1574,7 @@ class bi_load_db_wizard(osv.osv_memory):
print "Updating the Primary Key Constraint"
for constraint in cr_db.fetchall():
val = {
- 'primary_key':True
+ 'primary_key': True
}
id_to_write = filter(lambda x:(int(cols[x][1]) == int(tables[constraint[0]])and(constraint[1] == cols[x][0])), cols)
@@ -1510,7 +1604,7 @@ class bi_load_db_wizard(osv.osv_memory):
for constraint in cr_db.fetchall():
val = {
- 'related_to':tables[for_key[constraint[2]]]
+ 'related_to': tables[for_key[constraint[2]]]
}
id_to_write = filter(lambda x:(int(cols[x][1]) == int(tables[constraint[0]])\
and (constraint[1] == cols[x][0])), cols)
@@ -1550,8 +1644,8 @@ class bi_load_db_wizard(osv.osv_memory):
for table in cr_db.fetchall():
val = {
- 'fact_database_id':id_db,
- 'table_db_name':table[0]
+ 'fact_database_id': id_db,
+ 'table_db_name': table[0]
}
if table[0] in tables.keys():
@@ -1596,12 +1690,12 @@ class bi_load_db_wizard(osv.osv_memory):
if constraint[0]:
val = {
- 'related_to':tables[constraint[1]]
+ 'related_to': tables[constraint[1]]
}
else:
val = {
- 'primary_key':True
+ 'primary_key': True
}
id_to_write = filter(lambda x:(int(cols[x][1]) == int(tables[constraint[3]])and \
(constraint[2] == cols[x][0])), cols)
@@ -1639,8 +1733,8 @@ class bi_load_db_wizard(osv.osv_memory):
temp = cr_db.fetchall()
for table in temp:
val = {
- 'fact_database_id':id_db,
- 'table_db_name':table[0]
+ 'fact_database_id': id_db,
+ 'table_db_name': table[0]
}
if table[0] in tables.keys():
@@ -1742,16 +1836,17 @@ class bi_load_db_wizard(osv.osv_memory):
resource_id = self.pool.get('ir.model.data').read(cr, uid, \
model_data_ids, fields = ['res_id'])[0]['res_id']
- return {'type':'ir.actions.act_window_close' }
+ return {'type': 'ir.actions.act_window_close' }
def action_cancel(self, cr, uid, ids, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 create menu’s IDs
- @param context: A standard dictionary for contextual values """
-
- return {'type':'ir.actions.act_window_close' }
+ @param context: A standard dictionary for contextual values
+ """
+ return {'type': 'ir.actions.act_window_close' }
bi_load_db_wizard()
# Wizard for the Automatic Application Configuration
@@ -1760,10 +1855,12 @@ class bi_auto_configure_wizard(osv.osv_memory):
_name = 'bi.auto.configure.wizard'
def _get_name(self, cr, uid, context):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
data = context and context.get('active_id', False) or False
if context and context.has_key('active_id'):
@@ -1772,20 +1869,21 @@ class bi_auto_configure_wizard(osv.osv_memory):
return False
_columns = {
- 'name':fields.char('Fact Name' , size = 64, readonly = True),
-
+ 'name': fields.char('Fact Name' , size = 64, readonly = True),
}
_defaults = {
- 'name':_get_name,
+ 'name': _get_name,
}
def action_load(self, cr, uid, ids, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 create menu’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
vals = {}
apptabnew_vals = {}
@@ -1931,11 +2029,18 @@ class bi_auto_configure_wizard(osv.osv_memory):
resource_id = self.pool.get('ir.model.data').read(cr, uid, \
model_data_ids, fields = ['res_id'])[0]['res_id']
- return {'type':'ir.actions.act_window_close' }
+ return {'type': 'ir.actions.act_window_close' }
def action_cancel(self, cr, uid, ids, context = None):
+ """
+ @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 create menu’s IDs
+ @param context: A standard dictionary for contextual values
+ """
- return {'type':'ir.actions.act_window_close' }
+ return {'type': 'ir.actions.act_window_close' }
bi_auto_configure_wizard()
@@ -1947,10 +2052,12 @@ class olap_warehouse_wizard(osv.osv_memory):
_description = "Olap Warehouse"
def _get_queries(self, cr, uid, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
query_obj = self.pool.get('olap.query.logs')
qry_ids = query_obj.search(cr, uid, [('user_id', '=', uid), ('count', '>=', 3)])
@@ -1967,20 +2074,23 @@ class olap_warehouse_wizard(osv.osv_memory):
else:
return ''
def action_ok(self, cr, uid, ids, context = {}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 Action’s IDs
- @param context: A standard dictionary for contextual values """
- return {'type':'ir.actions.act_window_close' }
+ @param context: A standard dictionary for contextual values
+ """
+ return {'type': 'ir.actions.act_window_close' }
_columns = {
- 'query':fields.text('Query', readonly=True),
+ 'query': fields.text('Query', readonly=True),
}
_defaults = {
'query': _get_queries,
}
+
olap_warehouse_wizard()
@@ -1990,11 +2100,12 @@ class olap_parameters_config_wizard(osv.osv_memory):
_description = "Olap Server Parameters"
def _get_host(self, cr, uid, context = None):
-
""" Get Host ID
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
obj = self.pool.get('olap')
objid = self.pool.get('ir.model.data')
@@ -2008,11 +2119,12 @@ class olap_parameters_config_wizard(osv.osv_memory):
return s_p.parseString(aid.url)[0]
def _get_port(self, cr, uid, context = None):
-
""" Get Port
+ @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 context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
obj = self.pool.get('olap')
objid = self.pool.get('ir.model.data')
@@ -2026,9 +2138,9 @@ class olap_parameters_config_wizard(osv.osv_memory):
return s_p.parseString(aid.url)[1]
_columns = {
- 'host_name' : fields.char('Server Name', size = 64, help = "Put here the server address or IP \
+ 'host_name': fields.char('Server Name', size = 64, help = "Put here the server address or IP \
Put localhost if its not clear.", required = True),
- 'host_port' : fields.char('Port', size = 4, help = "Put the port for the server. Put 8080 if \
+ 'host_port': fields.char('Port', size = 4, help = "Put the port for the server. Put 8080 if \
its not clear.", required = True),
}
@@ -2038,11 +2150,13 @@ class olap_parameters_config_wizard(osv.osv_memory):
}
def action_cancel(self, cr, uid, ids, conect = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 create menu’s IDs
- @param context: A standard dictionary for contextual values """
+ @param ids: List of olap parameter’s IDs
+ @param context: A standard dictionary for contextual values
+ """
return {
'view_type': 'form',
@@ -2053,11 +2167,13 @@ class olap_parameters_config_wizard(osv.osv_memory):
}
def action_config(self, cr, uid, ids, context = None):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @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 create menu’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
conf = self.browse(cr, uid, ids[0], context)
obj = self.pool.get('olap')
diff --git a/addons/olap_sale/i18n/de.po b/addons/olap_sale/i18n/de.po
index 0abfadcba34..d4b3b05e56d 100644
--- a/addons/olap_sale/i18n/de.po
+++ b/addons/olap_sale/i18n/de.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_sale
diff --git a/addons/olap_sale/i18n/ro.po b/addons/olap_sale/i18n/ro.po
index b1d8ecc3b86..24eba2905e6 100644
--- a/addons/olap_sale/i18n/ro.po
+++ b/addons/olap_sale/i18n/ro.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_sale
diff --git a/addons/profile_manufacturing/i18n/nl.po b/addons/profile_manufacturing/i18n/nl.po
index f3c782fdd92..b37c873a521 100644
--- a/addons/profile_manufacturing/i18n/nl.po
+++ b/addons/profile_manufacturing/i18n/nl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: profile_manufacturing
diff --git a/addons/project/i18n/pl.po b/addons/project/i18n/pl.po
index cbe327502b0..ede02cd2b22 100644
--- a/addons/project/i18n/pl.po
+++ b/addons/project/i18n/pl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 1ad0d017706..75f1a4d5e8d 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -173,29 +173,6 @@
-
-
- Requests for Quotation
- ir.actions.act_window
- purchase.order
- form
- {'search_default_draft': 1}
- tree,form
-
-
-
-
-
- Purchase Orders
- ir.actions.act_window
- purchase.order
- tree,form,calendar,graph
-
- {'search_default_approved': 1}
-
-
-
purchase.order.tree
purchase.order
@@ -218,6 +195,27 @@
+
+ Requests for Quotation
+ ir.actions.act_window
+ purchase.order
+ form
+ {'search_default_draft': 1}
+ tree,form,graph,calendar
+
+
+
+
+ Purchase Orders
+ ir.actions.act_window
+ purchase.order
+ tree,form,graph,calendar
+ {'search_default_approved': 1}
+
+
+
+
purchase.order.line.form
purchase.order.line
diff --git a/addons/report_document/i18n/ro.po b/addons/report_document/i18n/ro.po
index ea6a0b26579..f1dde26a74e 100644
--- a/addons/report_document/i18n/ro.po
+++ b/addons/report_document/i18n/ro.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_document
diff --git a/addons/report_mrp/i18n/bg.po b/addons/report_mrp/i18n/bg.po
index 6ee3ec24adc..965ace7b2da 100644
--- a/addons/report_mrp/i18n/bg.po
+++ b/addons/report_mrp/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_mrp
diff --git a/addons/report_project/i18n/bg.po b/addons/report_project/i18n/bg.po
index b36de773ce4..93aa024338f 100644
--- a/addons/report_project/i18n/bg.po
+++ b/addons/report_project/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_project
diff --git a/addons/report_purchase/i18n/bg.po b/addons/report_purchase/i18n/bg.po
index fccdd4b19ff..804a998a451 100644
--- a/addons/report_purchase/i18n/bg.po
+++ b/addons/report_purchase/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_purchase
diff --git a/addons/sale/i18n/id.po b/addons/sale/i18n/id.po
index 53106924cac..9bc3cbc4d1c 100644
--- a/addons/sale/i18n/id.po
+++ b/addons/sale/i18n/id.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
diff --git a/addons/sale_analytic_plans/i18n/bg.po b/addons/sale_analytic_plans/i18n/bg.po
index 374835f0a4c..3915119c550 100644
--- a/addons/sale_analytic_plans/i18n/bg.po
+++ b/addons/sale_analytic_plans/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale_analytic_plans
diff --git a/addons/sale_crm/i18n/bg.po b/addons/sale_crm/i18n/bg.po
index f4d5fea0969..69722d72d32 100644
--- a/addons/sale_crm/i18n/bg.po
+++ b/addons/sale_crm/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale_crm
diff --git a/addons/sale_crm/i18n/ko.po b/addons/sale_crm/i18n/ko.po
index 526c0eb4d10..9202610d918 100644
--- a/addons/sale_crm/i18n/ko.po
+++ b/addons/sale_crm/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale_crm
diff --git a/addons/smtpclient/smtpclient.py b/addons/smtpclient/smtpclient.py
index 87aadcc7749..3cb6c4854c0 100644
--- a/addons/smtpclient/smtpclient.py
+++ b/addons/smtpclient/smtpclient.py
@@ -396,7 +396,7 @@ class smtpclient(osv.osv):
if body == False:
body = ''
- if smtp_server.disclaimers != False:
+ if smtp_server.disclaimers:
body = body + "\n" + smtp_server.disclaimers
try:
diff --git a/addons/smtpclient/smtpclient_view.xml b/addons/smtpclient/smtpclient_view.xml
index b5b88c436ba..0772dba233a 100644
--- a/addons/smtpclient/smtpclient_view.xml
+++ b/addons/smtpclient/smtpclient_view.xml
@@ -98,7 +98,6 @@
-
diff --git a/addons/stock/i18n/de.po b/addons/stock/i18n/de.po
index 6d6b48ffa98..5b510b544ba 100644
--- a/addons/stock/i18n/de.po
+++ b/addons/stock/i18n/de.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
diff --git a/addons/stock/i18n/ru.po b/addons/stock/i18n/ru.po
index b8c750f43ba..dd40c9836cd 100644
--- a/addons/stock/i18n/ru.po
+++ b/addons/stock/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-02-03 11:06+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-19 05:33+0000\n"
+"Last-Translator: grisha \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:56+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
@@ -44,7 +44,7 @@ msgstr ""
#. module: stock
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Недопустимое имя модели в определении действия"
#. module: stock
#: model:ir.module.module,shortdesc:stock.module_meta_information
@@ -70,7 +70,7 @@ msgstr ""
#. module: stock
#: rml:lot.location:0
msgid "Total :"
-msgstr ""
+msgstr "Итого:"
#. module: stock
#: selection:stock.location,icon:0
@@ -81,7 +81,7 @@ msgstr ""
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "UoM"
-msgstr ""
+msgstr "Ед. изм."
#. module: stock
#: model:ir.actions.wizard,name:stock.return_picking
@@ -114,7 +114,7 @@ msgstr ""
#. module: stock
#: view:stock.picking:0
msgid "Products Received"
-msgstr ""
+msgstr "Получено изделий"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_picking_tree4
@@ -141,7 +141,7 @@ msgstr "Партнер"
#. module: stock
#: help:product.product,track_incoming:0
msgid "Force to use a Production Lot during receptions"
-msgstr ""
+msgstr "Принудительно назначать серийный номер партии при приёмке"
#. module: stock
#: field:stock.move,move_history_ids:0
@@ -154,7 +154,7 @@ msgstr "Журнал перемещений"
#: field:stock.production.lot.revision,lot_id:0
#: field:stock.report.prodlots,prodlot_id:0
msgid "Production lot"
-msgstr ""
+msgstr "Партия изделий"
#. module: stock
#: selection:stock.location,icon:0
@@ -196,17 +196,17 @@ msgstr "Ед. изм."
#: selection:stock.picking,state:0
#: field:stock.production.lot,stock_available:0
msgid "Available"
-msgstr ""
+msgstr "Доступно"
#. module: stock
#: view:stock.move:0
msgid "Make Parcel"
-msgstr ""
+msgstr "Сформировать упаковку"
#. module: stock
#: wizard_view:stock.partial_picking,end2:0
msgid "Packing result"
-msgstr ""
+msgstr "Сформировать упаковку"
#. module: stock
#: selection:stock.location,icon:0
@@ -256,7 +256,7 @@ msgstr ""
#. module: stock
#: view:stock.picking:0
msgid "Products Sent"
-msgstr ""
+msgstr "Отправлено изделий"
#. module: stock
#: selection:stock.location,icon:0
@@ -284,7 +284,7 @@ msgstr ""
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Grand Total:"
-msgstr ""
+msgstr "Общий итог"
#. module: stock
#: view:stock.location:0
@@ -327,12 +327,12 @@ msgstr ""
#: view:stock.move:0
#: view:stock.picking:0
msgid "Move Information"
-msgstr ""
+msgstr "Сведения о перемещении товаров"
#. module: stock
#: view:stock.picking:0
msgid "Unreceived Products"
-msgstr ""
+msgstr "Неполученные изделия"
#. module: stock
#: field:stock.inventory,state:0
@@ -370,7 +370,7 @@ msgstr "Местоположение снабжения"
#: model:ir.actions.act_window,name:stock.action_production_lot_form
#: model:ir.ui.menu,name:stock.menu_action_production_lot_form
msgid "Production Lots"
-msgstr ""
+msgstr "Партии изделий"
#. module: stock
#: rml:stock.picking.list:0
@@ -424,7 +424,7 @@ msgstr "Адрес местоположения"
#. module: stock
#: help:stock.move,prodlot_id:0
msgid "Production lot is used to put a serial number on the production"
-msgstr ""
+msgstr "Партии изделий используются для присвоения серийных номеров"
#. module: stock
#: model:stock.location,name:stock.stock_location_13
@@ -485,12 +485,12 @@ msgstr ""
#. module: stock
#: field:product.template,property_stock_inventory:0
msgid "Inventory Location"
-msgstr ""
+msgstr "Расположение склада"
#. module: stock
#: help:product.product,track_production:0
msgid "Force to use a Production Lot during production order"
-msgstr ""
+msgstr "Принудительно назначать серийны номера для партий изделий"
#. module: stock
#: selection:stock.location,icon:0
@@ -639,7 +639,7 @@ msgstr ""
#. module: stock
#: selection:stock.location,chained_auto_packing:0
msgid "Manual Operation"
-msgstr ""
+msgstr "Ручное управление"
#. module: stock
#: field:stock.picking,date_done:0
@@ -680,7 +680,7 @@ msgstr "Метоположения партнера"
#: help:stock.move,tracking_id:0
msgid ""
"Tracking lot is the code that will be put on the logistical unit/pallet"
-msgstr ""
+msgstr "Логистическая единица - это код, присваиваемый упаковке."
#. module: stock
#: view:stock.tracking:0
@@ -700,7 +700,7 @@ msgstr ""
#. module: stock
#: rml:stock.picking.list:0
msgid "Packing List:"
-msgstr ""
+msgstr "Упаковочный перечень"
#. module: stock
#: selection:stock.location,icon:0
@@ -715,12 +715,12 @@ msgstr ""
#. module: stock
#: wizard_field:stock.location.products,init,from_date:0
msgid "From"
-msgstr ""
+msgstr "От"
#. module: stock
#: rml:stock.picking.list:0
msgid "weight"
-msgstr ""
+msgstr "Вес"
#. module: stock
#: rml:stock.picking.list:0
@@ -735,7 +735,7 @@ msgstr ""
#. module: stock
#: model:ir.model,name:stock.model_stock_production_lot_revision
msgid "Production lot revisions"
-msgstr ""
+msgstr "Ревизии партий изделий"
#. module: stock
#: view:stock.picking:0
@@ -918,12 +918,12 @@ msgstr "Отправка товаров"
#. module: stock
#: view:stock.picking:0
msgid "Cancel Availability"
-msgstr ""
+msgstr "Отменить доступность"
#. module: stock
#: field:stock.inventory,move_ids:0
msgid "Created Moves"
-msgstr ""
+msgstr "Созданные перемещения товаров"
#. module: stock
#: selection:stock.location,icon:0
@@ -950,7 +950,7 @@ msgstr ""
#: view:stock.move:0
#: field:stock.move,date_planned:0
msgid "Date"
-msgstr ""
+msgstr "Дата"
#. module: stock
#: view:product.product:0
@@ -1042,7 +1042,7 @@ msgstr "Отменить"
#: view:stock.move:0
#: view:stock.picking:0
msgid "Split in production lots"
-msgstr ""
+msgstr "Разделить партию по отдельным серийным номерам"
#. module: stock
#: model:ir.model,name:stock.model_stock_inventory
@@ -1070,7 +1070,7 @@ msgstr ""
#. module: stock
#: model:ir.model,name:stock.model_stock_tracking
msgid "Stock Tracking Lots"
-msgstr ""
+msgstr "Отслеживание партий"
#. module: stock
#: rml:lot.stock.overview:0
@@ -1110,7 +1110,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_move_form4
#: model:ir.ui.menu,name:stock.menu_action_move_form4
msgid "Available Moves"
-msgstr ""
+msgstr "Доступные перемещения товаров"
#. module: stock
#: selection:stock.location,icon:0
@@ -1269,7 +1269,7 @@ msgstr ""
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Value"
-msgstr ""
+msgstr "Значение"
#. module: stock
#: field:stock.picking,type:0
@@ -1289,7 +1289,7 @@ msgstr "Метод доставки"
#. module: stock
#: model:ir.actions.wizard,name:stock.partial_picking
msgid "Partial packing"
-msgstr ""
+msgstr "Упаковка по частям"
#. module: stock
#: selection:stock.location,icon:0
@@ -1422,7 +1422,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_picking_tree
#: model:ir.ui.menu,name:stock.menu_action_picking_tree
msgid "Outgoing Products"
-msgstr ""
+msgstr "Изделия к отправке"
#. module: stock
#: selection:stock.location,icon:0
@@ -1452,7 +1452,7 @@ msgstr ""
#. module: stock
#: field:stock.production.lot,date:0
msgid "Created Date"
-msgstr ""
+msgstr "Дата создания"
#. module: stock
#: selection:stock.location,usage:0
@@ -1467,7 +1467,7 @@ msgstr ""
#. module: stock
#: view:stock.picking:0
msgid "Force Availability"
-msgstr ""
+msgstr "Сделать доступным принудительно"
#. module: stock
#: wizard_view:stock.location.products,init:0
@@ -1504,7 +1504,7 @@ msgstr "Учет движения партий"
#. module: stock
#: wizard_button:inventory.merge,init,merge:0
msgid "Yes"
-msgstr ""
+msgstr "Да"
#. module: stock
#: field:stock.inventory,inventory_line_id:0
@@ -1524,7 +1524,7 @@ msgstr ""
#. module: stock
#: field:stock.location,stock_real:0
msgid "Real Stock"
-msgstr ""
+msgstr "Доступные запасы"
#. module: stock
#: model:ir.actions.wizard,name:stock.wizard_fill_inventory
@@ -1546,7 +1546,7 @@ msgstr ""
#. module: stock
#: rml:stock.picking.list:0
msgid "Lot"
-msgstr ""
+msgstr "Партия"
#. module: stock
#: wizard_view:inventory.merge.stock.zero,init:0
@@ -1556,7 +1556,7 @@ msgstr ""
#. module: stock
#: field:stock.move,product_uos_qty:0
msgid "Quantity (UOS)"
-msgstr ""
+msgstr "Количество(единицы продажи)"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_picking_tree5
@@ -1620,7 +1620,7 @@ msgstr "Инкотермс"
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Total:"
-msgstr ""
+msgstr "Итого:"
#. module: stock
#: selection:stock.location,icon:0
@@ -1650,7 +1650,7 @@ msgstr ""
#. module: stock
#: field:stock.production.lot.revision,name:0
msgid "Revision Name"
-msgstr ""
+msgstr "Наименование ревизии"
#. module: stock
#: selection:stock.location,icon:0
@@ -1723,7 +1723,7 @@ msgstr "Склады"
#. module: stock
#: help:product.product,track_outgoing:0
msgid "Force to use a Production Lot during deliveries"
-msgstr ""
+msgstr "Принудительно назначать серийный номер партии при перевозке"
#. module: stock
#: view:stock.picking:0
@@ -1862,7 +1862,7 @@ msgstr ""
#. module: stock
#: view:product.product:0
msgid "Lots"
-msgstr ""
+msgstr "Партии"
#. module: stock
#: selection:stock.picking,move_type:0
@@ -1872,7 +1872,7 @@ msgstr "Все сразу"
#. module: stock
#: field:product.product,track_outgoing:0
msgid "Track Outging Lots"
-msgstr ""
+msgstr "Отслеживать исходящие партии"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_stock_line_date
@@ -1910,7 +1910,7 @@ msgstr ""
#. module: stock
#: field:stock.location,icon:0
msgid "Icon"
-msgstr ""
+msgstr "Значок"
#. module: stock
#: field:stock.tracking,name:0
@@ -1934,12 +1934,12 @@ msgstr ""
#. module: stock
#: model:stock.location,name:stock.stock_location_8
msgid "Non European Customers"
-msgstr ""
+msgstr "Неевропейские заказчики"
#. module: stock
#: model:stock.location,name:stock.stock_location_components
msgid "Components"
-msgstr ""
+msgstr "Компоненты"
#. module: stock
#: wizard_view:inventory.merge,init:0
@@ -2008,7 +2008,7 @@ msgstr "Подтвердить"
#. module: stock
#: view:stock.picking:0
msgid "Check Availability"
-msgstr ""
+msgstr "Проверять доступность"
#. module: stock
#: wizard_view:inventory.merge,init:0
@@ -2078,7 +2078,7 @@ msgstr ""
#: model:ir.ui.menu,name:stock.menu_stock_report_prodlots
#: view:stock.report.prodlots:0
msgid "Stock by Lots"
-msgstr ""
+msgstr "Склады с партиями этого товара"
#. module: stock
#: field:stock.move,auto_validate:0
@@ -2100,7 +2100,7 @@ msgstr ""
#: selection:stock.move,state:0
#: selection:stock.picking,state:0
msgid "Canceled"
-msgstr ""
+msgstr "Отменено"
#. module: stock
#: selection:stock.location,icon:0
@@ -2163,7 +2163,7 @@ msgstr "Полки (Y)"
#. module: stock
#: model:ir.actions.wizard,name:stock.wizard_merge_inventory_zero
msgid "Set Stock to 0"
-msgstr ""
+msgstr "Установить запасы в 0"
#. module: stock
#: view:stock.location:0
@@ -2188,7 +2188,7 @@ msgstr ""
#. module: stock
#: field:product.product,track_production:0
msgid "Track Production Lots"
-msgstr ""
+msgstr "Отслеживать партии изделий"
#. module: stock
#: view:stock.picking:0
@@ -2218,7 +2218,7 @@ msgstr ""
#: field:stock.move,prodlot_id:0
#: view:stock.production.lot:0
msgid "Production Lot"
-msgstr ""
+msgstr "Партия изделий"
#. module: stock
#: model:ir.ui.menu,name:stock.menu_traceability
@@ -2229,7 +2229,7 @@ msgstr "Возможность учета движения"
#. module: stock
#: field:stock.picking,date:0
msgid "Date Order"
-msgstr ""
+msgstr "Дата заказа"
#. module: stock
#: selection:stock.invoice_onshipping,init,type:0
@@ -2267,12 +2267,12 @@ msgstr ""
#. module: stock
#: model:ir.actions.report.xml,name:stock.report_move_labels
msgid "Print Item Labels"
-msgstr ""
+msgstr "Печать этикеток товаров"
#. module: stock
#: view:stock.move:0
msgid "Moves"
-msgstr ""
+msgstr "Перемещения тоаров"
#. module: stock
#: field:stock.move,location_dest_id:0
@@ -2380,7 +2380,7 @@ msgstr ""
#: view:stock.move:0
#: view:stock.picking:0
msgid "Move State"
-msgstr ""
+msgstr "Состояни перемещния товаров"
#. module: stock
#: model:stock.location,name:stock.stock_location_locations
diff --git a/addons/stock_location/i18n/ro.po b/addons/stock_location/i18n/ro.po
index ceeab4f0e25..26895ded4c8 100644
--- a/addons/stock_location/i18n/ro.po
+++ b/addons/stock_location/i18n/ro.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock_location
diff --git a/addons/stock_no_autopicking/i18n/ko.po b/addons/stock_no_autopicking/i18n/ko.po
index 55cfd964409..ef6920af9f9 100644
--- a/addons/stock_no_autopicking/i18n/ko.po
+++ b/addons/stock_no_autopicking/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock_no_autopicking
diff --git a/addons/subscription/i18n/ko.po b/addons/subscription/i18n/ko.po
index 23b144ce963..775ea2a0285 100644
--- a/addons/subscription/i18n/ko.po
+++ b/addons/subscription/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
+"X-Launchpad-Export-Date: 2010-04-20 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: subscription
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 7cb308d10d8..968590a5d07 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -128,6 +128,7 @@ class survey(osv.osv):
'context' : context
}
else:
+
datas['form'] = page_setting
datas['model'] = 'survey.print'
report = {
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 2bc48cf339d..b5f88f20432 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -588,14 +588,15 @@ class survey_question_wiz(osv.osv_memory):
self.pool.get(context.get('object',False)).survey_req_done(cr, uid, [int(context.get('cur_id'))], context)
else:
self.pool.get(context.get('object',False)).write(cr, uid, [int(context.get('cur_id',False))], {'response' : response_id})
-
- for key,val in sur_name_read['store_ans'].items():
- for field in vals:
- if field.split('_')[0] == val['question_id']:
- click_state = False
- click_update.append(key)
- break
-
+ if sur_name_read['store_ans'] and type(sur_name_read['store_ans']) == dict:
+ for key,val in sur_name_read['store_ans'].items():
+ for field in vals:
+ if field.split('_')[0] == val['question_id']:
+ click_state = False
+ click_update.append(key)
+ break
+ else:
+ sur_name_read['store_ans'] = {}
if click_state:
que_li = []
resp_id_list = []
diff --git a/addons/wiki/__openerp__.py b/addons/wiki/__openerp__.py
index b15346dba39..033060ad1a7 100644
--- a/addons/wiki/__openerp__.py
+++ b/addons/wiki/__openerp__.py
@@ -36,7 +36,6 @@
'wizard/wizard_view.xml',
'wizard/wiki_wiki_page_open_view.xml',
'wizard/wiki_create_menu_view.xml',
- 'wizard/wiki_wiki_help_open_view.xml',
'wizard/wiki_make_index_view.xml',
'wiki_view.xml',
'data/wiki_quickstart.xml',
diff --git a/addons/wiki/security/ir.model.access.csv b/addons/wiki/security/ir.model.access.csv
index 9ddfa27eee2..14ee1c656db 100644
--- a/addons/wiki/security/ir.model.access.csv
+++ b/addons/wiki/security/ir.model.access.csv
@@ -8,5 +8,4 @@
"wiki_wizard_wiki_history_show_diff","wizard.wiki.history.show_diff","model_wizard_wiki_history_show_diff","base.group_user",1,1,1,1
"wiki_wiki_page_open","wiki.wiki.page.open","model_wiki_wiki_page_open","base.group_user",1,1,1,1
"wiki_create_menu","wiki.create.menu","model_wiki_create_menu","base.group_user",1,1,1,1
-"wiki_wiki_help_open","wiki.wiki.help.open","model_wiki_wiki_help_open","base.group_user",1,1,1,1
"wiki_make_index","wiki.make.index","model_wiki_make_index","base.group_user",1,1,1,1
diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py
index 55b71b8ae10..a9b623611b8 100644
--- a/addons/wiki/wiki.py
+++ b/addons/wiki/wiki.py
@@ -27,6 +27,7 @@
##############################################################################
from osv import fields, osv
+from tools.translate import _
import difflib
class Wiki(osv.osv):
@@ -44,19 +45,19 @@ class WikiGroup(osv.osv):
_order = 'name'
_columns = {
- 'name':fields.char('Wiki Group', size=256, select=True, required=True),
- 'page_ids':fields.one2many('wiki.wiki', 'group_id', 'Pages'),
- 'notes':fields.text("Description"),
- 'create_date':fields.datetime("Created Date", select=True),
- 'template': fields.text('Wiki Template'),
- 'section': fields.boolean("Make Section ?"),
+ 'name':fields.char('Wiki Group', size=256, select=True, required=True),
+ 'page_ids':fields.one2many('wiki.wiki', 'group_id', 'Pages'),
+ 'notes':fields.text("Description"),
+ 'create_date':fields.datetime("Created Date", select=True),
+ 'template': fields.text('Wiki Template'),
+ 'section': fields.boolean("Make Section ?"),
'method':fields.selection([('list', 'List'), ('page', 'Home Page'), \
- ('tree', 'Tree')], 'Display Method'),
- 'home':fields.many2one('wiki.wiki', 'Pages'),
+ ('tree', 'Tree')], 'Display Method'),
+ 'home':fields.many2one('wiki.wiki', 'Home Page'),
}
_defaults = {
- 'method': lambda *a: 'page',
+ 'method': lambda *a: 'page',
}
WikiGroup()
@@ -70,7 +71,7 @@ class GroupLink(osv.osv):
_rec_name = 'action_id'
_columns = {
- 'group_id': fields.many2one('wiki.groups', 'Parent Group', ondelete='set null'),
+ 'group_id': fields.many2one('wiki.groups', 'Parent Group', ondelete='set null'),
'action_id': fields.many2one('ir.ui.menu', 'Menu')
}
@@ -85,22 +86,22 @@ class Wiki(osv.osv):
_order = 'section,create_date desc'
_columns = {
- 'name': fields.char('Title', size=256, select=True, required=True),
- 'write_uid': fields.many2one('res.users', "Last Author"),
- 'text_area': fields.text("Content"),
- 'create_uid': fields.many2one('res.users', 'Author', select=True),
- 'create_date': fields.datetime("Created on", select=True),
- 'write_date': fields.datetime("Modification Date", select=True),
- 'tags': fields.char('Tags', size=1024),
- 'history_id': fields.one2many('wiki.wiki.history', 'wiki_id', 'History Lines'),
- 'minor_edit': fields.boolean('Minor edit', select=True),
- 'summary': fields.char('Summary', size=256),
- 'section': fields.char('Sequence', size=32, help="Use page section code like 1.2.1"),
- 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null'),
- 'toc': fields.boolean('Table of Contents'),
- 'review': fields.boolean('Need Review'),
- 'parent_id': fields.many2one('wiki.wiki', 'Parent Page'),
- 'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'),
+ 'name': fields.char('Title', size=256, select=True, required=True),
+ 'write_uid': fields.many2one('res.users', "Last Author"),
+ 'text_area': fields.text("Content"),
+ 'create_uid': fields.many2one('res.users', 'Author', select=True),
+ 'create_date': fields.datetime("Created on", select=True),
+ 'write_date': fields.datetime("Modification Date", select=True),
+ 'tags': fields.char('Tags', size=1024),
+ 'history_id': fields.one2many('wiki.wiki.history', 'wiki_id', 'History Lines'),
+ 'minor_edit': fields.boolean('Minor edit', select=True),
+ 'summary': fields.char('Summary', size=256),
+ 'section': fields.char('Sequence', size=32, help="Use page section code like 1.2.1"),
+ 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null'),
+ 'toc': fields.boolean('Table of Contents'),
+ 'review': fields.boolean('Need Review'),
+ 'parent_id': fields.many2one('wiki.wiki', 'Parent Page'),
+ 'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'),
}
def onchange_group_id(self, cr, uid, ids, group_id, content, context={}):
@@ -125,7 +126,7 @@ class Wiki(osv.osv):
section = '.'.join(s)
return {
'value':{
- 'text_area': template,
+ 'text_area': template,
'section': section
}
}
@@ -147,10 +148,10 @@ class Wiki(osv.osv):
history = self.pool.get('wiki.wiki.history')
if vals.get('text_area'):
res = {
- 'minor_edit': vals.get('minor_edit', True),
- 'text_area': vals.get('text_area', ''),
- 'write_uid': uid,
- 'wiki_id': id,
+ 'minor_edit': vals.get('minor_edit', True),
+ 'text_area': vals.get('text_area', ''),
+ 'write_uid': uid,
+ 'wiki_id': id,
'summary':vals.get('summary', '')
}
history.create(cr, uid, res)
@@ -166,15 +167,37 @@ class Wiki(osv.osv):
if vals.get('text_area'):
for id in ids:
res = {
- 'minor_edit': vals.get('minor_edit', True),
- 'text_area': vals.get('text_area', ''),
- 'write_uid': uid,
- 'wiki_id': id,
+ 'minor_edit': vals.get('minor_edit', True),
+ 'text_area': vals.get('text_area', ''),
+ 'write_uid': uid,
+ 'wiki_id': id,
'summary': vals.get('summary', '')
}
history.create(cr, uid, res)
return result
+ def open_wiki_page(self, cr, uid, ids, context):
+
+ """ Opens Wiki Page for Editing
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of wiki page’s IDs
+
+ """
+ pages = self.pool.get('wiki.wiki').search(cr, uid, [('name', '=', 'Basic Wiki Editing')])
+ if not pages:
+ raise osv.except_osv(_('Warning !'), _("No Help page is defined"))
+ value = {
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'wiki.wiki',
+ 'view_id': False,
+ 'res_id': pages[0],
+ 'type': 'ir.actions.act_window',
+ 'nodestroy': True,
+ }
+ return value
+
Wiki()
@@ -187,16 +210,16 @@ class History(osv.osv):
_order = 'id DESC'
_columns = {
- 'create_date': fields.datetime("Date", select=True),
- 'text_area': fields.text("Text area"),
- 'minor_edit': fields.boolean('This is a major edit ?', select=True),
- 'summary': fields.char('Summary', size=256, select=True),
- 'write_uid': fields.many2one('res.users', "Modify By", select=True),
+ 'create_date': fields.datetime("Date", select=True),
+ 'text_area': fields.text("Text area"),
+ 'minor_edit': fields.boolean('This is a major edit ?', select=True),
+ 'summary': fields.char('Summary', size=256, select=True),
+ 'write_uid': fields.many2one('res.users', "Modify By", select=True),
'wiki_id': fields.many2one('wiki.wiki', 'Wiki Id', select=True)
}
_defaults = {
- 'write_uid': lambda obj, cr, uid, context: uid,
+ 'write_uid': lambda obj, cr, uid, context: uid,
}
def getDiff(self, cr, uid, v1, v2, context={}):
diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml
index dbbce1c8f38..4675cea75f9 100644
--- a/addons/wiki/wiki_view.xml
+++ b/addons/wiki/wiki_view.xml
@@ -124,12 +124,15 @@
form
-
+
+
+
@@ -250,7 +253,7 @@
tree_but_open
wiki.groups
Search a Page
-
+
diff --git a/addons/wiki/wizard/__init__.py b/addons/wiki/wizard/__init__.py
index 739966e5557..90b18b261ea 100644
--- a/addons/wiki/wizard/__init__.py
+++ b/addons/wiki/wizard/__init__.py
@@ -21,8 +21,7 @@
import wiki_wiki_page_open
import wiki_create_menu
-import wiki_wiki_help_open
import wiki_make_index
-import show_diff
+import wiki_show_diff
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/wiki/wizard/wiki_make_index_view.xml b/addons/wiki/wizard/wiki_make_index_view.xml
index 3e5a87d4462..f9b0acbf273 100644
--- a/addons/wiki/wizard/wiki_make_index_view.xml
+++ b/addons/wiki/wizard/wiki_make_index_view.xml
@@ -12,10 +12,12 @@
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/wiki_show_diff.py
similarity index 93%
rename from addons/wiki/wizard/show_diff.py
rename to addons/wiki/wizard/wiki_show_diff.py
index 83708a8d8ce..d1a17f0fa45 100644
--- a/addons/wiki/wizard/show_diff.py
+++ b/addons/wiki/wizard/wiki_show_diff.py
@@ -27,14 +27,13 @@ class showdiff(osv.osv_memory):
_name = 'wizard.wiki.history.show_diff'
- def _get_diff(self, cr, uid, ctx):
+ def get_diff(self, cr, uid, context=None):
""" @param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
"""
-
history = self.pool.get('wiki.wiki.history')
- ids = ctx.get('active_ids')
+ ids = context.get('active_ids')
diff = ""
if len(ids) == 2:
if ids[0] > ids[1]:
@@ -49,14 +48,15 @@ class showdiff(osv.osv_memory):
diff = history.getDiff(cr, uid, ids[0], nids[-1])
else:
raise osv.except_osv(_('Warning'), _('You need to select minimum 1 or maximum 2 history revision!'))
+
return diff
_columns = {
- 'diff': fields.text('Diff'),
+ 'diff': fields.text('Diff'),
}
_defaults = {
- 'diff': _get_diff
+ 'diff': get_diff
}
showdiff()
diff --git a/addons/wiki/wizard/wiki_show_diff_view.xml b/addons/wiki/wizard/wiki_show_diff_view.xml
new file mode 100644
index 00000000000..ec8fcb3ca6d
--- /dev/null
+++ b/addons/wiki/wizard/wiki_show_diff_view.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ Show Difference
+ wizard.wiki.history.show_diff
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Difference
+ ir.actions.act_window
+ wizard.wiki.history.show_diff
+ form
+ form
+ new
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/wiki/wizard/wiki_wiki_help_open.py b/addons/wiki/wizard/wiki_wiki_help_open.py
deleted file mode 100644
index 1333f80b96f..00000000000
--- a/addons/wiki/wizard/wiki_wiki_help_open.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-
-class wiki_wiki_help_open(osv.osv_memory):
- """ Basic Wiki Editing """
- _name = "wiki.wiki.help.open"
- _description = "Basic Wiki Editing"
-
- def open_wiki_page(self, cr, uid, ids, context):
-
- """ Opens Wiki Page for Editing
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of wiki page’s IDs
-
- """
- pages = self.pool.get('wiki.wiki').search(cr, uid, [('name', '=', 'Basic Wiki Editing')])
-
- value = {
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'wiki.wiki',
- 'view_id': False,
- 'res_id': pages[0],
- 'type': 'ir.actions.act_window',
- }
-
- return value
-
-wiki_wiki_help_open()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/wiki/wizard/wiki_wiki_help_open_view.xml b/addons/wiki/wizard/wiki_wiki_help_open_view.xml
deleted file mode 100644
index 226ceab271f..00000000000
--- a/addons/wiki/wizard/wiki_wiki_help_open_view.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
- Basic Wiki Editing
- wiki.wiki.help.open
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Basic Wiki Editing
- ir.actions.act_window
- wiki.wiki.help.open
- form
- form
- new
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/wiki/wizard/wiki_wiki_page_open.py b/addons/wiki/wizard/wiki_wiki_page_open.py
index d65748f989a..d6b8f4f0285 100644
--- a/addons/wiki/wizard/wiki_wiki_page_open.py
+++ b/addons/wiki/wizard/wiki_wiki_page_open.py
@@ -35,18 +35,17 @@ class wiki_wiki_page_open(osv.osv_memory):
@param ids: List of open wiki page’s IDs
@return: dictionay of open wiki window on give group id
"""
-
- for group in self.pool.get('wiki.groups').browse(cr, uid, ids):
-
+ group_ids = context.get('active_ids', [])
+ for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids):
value = {
- 'domain': "[('group_id','=',%d)]" % (group.id),
- 'name': 'Wiki Page',
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'wiki.wiki',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- }
+ 'domain': "[('group_id','=',%d)]" % (group.id),
+ 'name': 'Wiki Page',
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'wiki.wiki',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ }
if group.method == 'page':
value['res_id'] = group.home.id
elif group.method == 'list':
diff --git a/addons/wiki/wizard/wiki_wiki_page_open_view.xml b/addons/wiki/wizard/wiki_wiki_page_open_view.xml
index d0c41d0d37f..507f3d5cdac 100644
--- a/addons/wiki/wizard/wiki_wiki_page_open_view.xml
+++ b/addons/wiki/wizard/wiki_wiki_page_open_view.xml
@@ -11,8 +11,13 @@
-
-
+
+
+
+
+
+
+