+
+
+
+
+ idea.vote.search
+ idea.vote
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -168,7 +206,8 @@
-
+
+
@@ -177,7 +216,6 @@
-
@@ -190,15 +228,15 @@
idea.ideatree
-
+
-
+
-
+
@@ -233,23 +271,6 @@
-
-
-
- idea.comment.tree
- idea.comment
- tree
-
-
-
-
-
-
-
-
-
-
-
Ideasidea.idea
@@ -337,9 +358,10 @@
idea.voteformtree,form
+
-
+
diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv
index 0c720f2ee2d..0fe5dad9ac9 100644
--- a/addons/idea/security/ir.model.access.csv
+++ b/addons/idea/security/ir.model.access.csv
@@ -1,8 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_idea_category","idea.category","model_idea_category","base.group_user",1,0,0,0
"access_idea_idea","idea.idea","model_idea_idea","base.group_user",1,1,1,1
-"access_idea_comment","idea.comment","model_idea_comment","base.group_user",1,1,1,1
"access_idea_vote","idea.vote","model_idea_vote","base.group_user",1,1,1,1
"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
"idea_post_vote","idea.post.vote","model_idea_post_vote","base.group_user",1,1,1,1
+"access_idea_select","idea.select","model_idea_select","base.group_user",1,1,1,1
+"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1
diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml
index 6714fbfc7e2..4c3f5301a5a 100644
--- a/addons/idea/test/test_idea.yml
+++ b/addons/idea/test/test_idea.yml
@@ -8,10 +8,10 @@
name: Technical
- |
I create a New Idea of "Technical presentation for 1 hours in every day" and specify category "Technical".
-
-
!record {model: idea.idea, id: idea_idea_0}:
category_id: idea_category_technical0
+ created_date: '05/13/2010 19:16:26'
description: I want that Technical presentation are arranged for 1 hours in every
day.\nso, on that presentation, we can know all things what improvement and development
are done in our company.\n\n\n\n\n
@@ -44,52 +44,50 @@
!record {model: res.users, id: res_users_user1}:
company_id: base.main_company
context_lang: en_US
+ groups_id:
+ - base.group_system
+ - base.group_user
login: user2
name: user2
password: user2
- |
In order to post vote I connect as user1 and open the idea page
- I click on "Vote" wizard and vote the idea as "Normal"
+ I click on "Submit Vote" wizard button and vote the idea as "Normal"
-
!record {model: idea.post.vote, id: idea_post_vote_0}:
vote: 50
+
- |
- Now I click on "Post Vote" button of wizard.
+ Now I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
uid = ref('res_users_user0')
- self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_id': ref('idea_idea_0')})
+ self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]})
- |
- To add other vote I connect as user2 and open the idea page
- I click on "Vote" wizard and vote the idea as "Very Good"
+ To add other vote I connect as user2 and open the idea page.
+
+ I click on "Submit Vote" wizard button and vote the idea as "Very Good".
+
+ and put comment "We can learn many things from technical presentation".
-
!record {model: idea.post.vote, id: idea_post_vote_1}:
vote: 100
-
+ note: 'We can learn many things from technical presentation'
- |
- I click on "Post Vote" button of this wizard.
+ I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
uid = ref('res_users_user1')
- self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_id': ref('idea_idea_0')})
+ self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]})
- |
I can see that the Average score changed in "Average score" field with value 75
-
!record {model: idea.idea, id: idea_idea_0}:
vote_avg: 75
-
-- |
- I put one comment "We can learn many things from technical presentation" for the idea.
--
- !record {model: idea.idea, id: idea.idea_idea_0}:
- comment_ids:
- - content: "We can learn many things from technical presentation"
- idea_id: idea.idea_idea_0
- user_id: res_users_user1
- |
I connect as Manager and close this idea by click on "Close" button.
diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py
index f68496c8ae5..20ef22a5f2d 100644
--- a/addons/idea/wizard/idea_post_vote.py
+++ b/addons/idea/wizard/idea_post_vote.py
@@ -70,15 +70,28 @@ class idea_post_vote(osv.osv_memory):
@param context: A standard dictionary for contextual values
"""
idea_obj = self.pool.get('idea.idea')
-
+ vote_obj = self.pool.get('idea.vote')
+
for idea in idea_obj.browse(cr, uid, context.get('active_ids', [])):
- if idea.state in ['draft', 'close', 'cancel']:
- raise osv.except_osv(_("Warning !"), _("Draft/Accepted/Cancelled ideas Could not be voted"))
+
+ for active_id in context.get('active_ids'):
+
+ vote_ids = vote_obj.search(cr, uid, [('user_id', '=', uid), ('idea_id', '=', active_id)])
+ vote_obj_id = vote_obj.browse(cr, uid, vote_ids)
+ count = 0
+ for vote in vote_obj_id:
+ count += 1
+
+ user_limit = idea.vote_limit
+ if count >= user_limit:
+ raise osv.except_osv(_('Warning !'),_("You can not give Vote for this idea more than %s times") % (user_limit))
+
if idea.state != 'open':
- raise osv.except_osv(_('Warning !'), _('idea should be in \'Open\' state before vote for that idea.'))
+ raise osv.except_osv(_('Warning !'), _('Idea should be in \
+\'Open\' state before vote for that idea.'))
return False
- def do_vote(self, cr, uid, ids, context):
+ def do_vote(self, cr, uid, ids, context=None):
"""
Create idea vote.
@param cr: the current row, from the database cursor,
@@ -87,30 +100,72 @@ class idea_post_vote(osv.osv_memory):
@return: Dictionary {}
"""
- vote_id = context and context.get('active_id', False) or False
+ vote_ids = context and context.get('active_ids', []) or []
vote_pool = self.pool.get('idea.vote')
comment_pool = self.pool.get('idea.comment')
for do_vote_obj in self.read(cr, uid, ids):
score = str(do_vote_obj['vote'])
comment = do_vote_obj.get('note', False)
- vote = {
- 'idea_id': vote_id,
- 'user_id': uid,
- 'score': score
- }
- if comment:
- comment = {
- 'user_id':uid,
- 'idea_id':vote_id,
- 'content': comment,
- }
- comment = comment_pool.create(cr, uid, comment)
+
+ for vote_id in vote_ids:
- vote = vote_pool.create(cr, uid, vote)
+ vote = {
+ 'idea_id': vote_id,
+ 'user_id': uid,
+ 'score': score
+ }
+ if comment:
+ comment = {
+ 'user_id':uid,
+ 'idea_id':vote_id,
+ 'content': comment,
+ }
+ comment = comment_pool.create(cr, uid, comment)
+
+ vote = vote_pool.create(cr, uid, vote)
return {}
-
+
idea_post_vote()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+class idea_select(osv.osv_memory):
+
+ """ Select idea for vote."""
+
+ _name = "idea.select"
+ _description = "select idea"
+ _columns = {
+ 'idea_id': fields.many2one('idea.idea', 'Idea', required=True),
+ }
+
+ def open_vote(self, cr, uid, ids, context=None):
+ """
+ This function load column.
+ @param cr: the current row, from the database cursor,
+ @param uid: the current users ID for security checks,
+ @param ids: List of load column,
+ @return: dictionary of query logs clear message window
+ """
+ idea_obj = self.browse(cr, uid, ids)
+ for idea in idea_obj:
+ idea_id = idea.idea_id.id
+
+ data_obj = self.pool.get('ir.model.data')
+ id2 = data_obj._get_id(cr, uid, 'idea', 'view_idea_post_vote')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ value = {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'idea.post.vote',
+ 'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': {'active_ids': [idea_id]}
+ }
+ return value
+
+idea_select()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/wizard/idea_post_vote_view.xml b/addons/idea/wizard/idea_post_vote_view.xml
index aa066cdffd3..ef1a338dcd4 100644
--- a/addons/idea/wizard/idea_post_vote_view.xml
+++ b/addons/idea/wizard/idea_post_vote_view.xml
@@ -1,7 +1,6 @@
-
@@ -9,7 +8,7 @@
idea.post.voteform
-
+
@@ -18,12 +17,33 @@
-
+
+
+
+ idea.select.form
+ idea.select
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -33,7 +53,17 @@
tree,formnew
-
-
+
+
+
+ Idea select
+ idea.select
+ form
+ tree,form
+
+ new
+ {'model': 'idea.idea'}
+
+
diff --git a/addons/mail_gateway/__openerp__.py b/addons/mail_gateway/__openerp__.py
index aaf12b926b3..1584067ea38 100644
--- a/addons/mail_gateway/__openerp__.py
+++ b/addons/mail_gateway/__openerp__.py
@@ -24,18 +24,15 @@
'version': '1.0',
'category': 'Generic Modules/Mail Service',
'description': """The generic email gateway system allows to send and receive emails
- * IMAP / IMAP with SSL
- * POP / POP with SSL
- * SMTP / SMTP with TLS
- * ACL based access policy
- * Queueing and History for Emails
+ * History for Emails
* Easy Integration with any Module""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base'],
'init_xml': [],
'update_xml': [
- "mail_gateway_view.xml"
+ "mail_gateway_view.xml",
+ 'security/ir.model.access.csv'
],
'demo_xml': [],
'installable': True,
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index 05d27ce3ef2..fb4920e9632 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -21,6 +21,7 @@
from osv import osv, fields
import time
+import base64
class one2many_domain(fields.one2many):
def set(self, cr, obj, id, field, values, user=None, context=None):
@@ -49,12 +50,12 @@ class mailgate_thread(osv.osv):
_rec_name = 'thread'
_columns = {
- 'thread': fields.char('Thread', size=32, required=False),
+ 'thread': fields.char('Thread', size=32, required=False),
'message_ids': one2many_domain('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False),
- 'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
+ 'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
}
- def __history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
+ def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@@ -64,6 +65,7 @@ class mailgate_thread(osv.osv):
@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 atach: Attachment sent in email
@param context: A standard dictionary for contextual values"""
if context is None:
context = {}
@@ -72,28 +74,43 @@ class mailgate_thread(osv.osv):
cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
model_obj = self.pool.get('ir.model')
-
+ att_obj = self.pool.get('ir.attachment')
obj = self.pool.get('mailgate.message')
+
for case in cases:
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
data = {
- 'name': keyword,
- 'user_id': uid,
- 'model_id' : model_ids and model_ids[0] or False,
- 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
- 'thread_id': case.thread_id.id,
- 'message_id': message_id
+ 'name': keyword,
+ 'user_id': uid,
+ 'model_id' : model_ids and model_ids[0] or False,
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'thread_id': case.thread_id.id,
+ 'message_id': message_id,
}
-
+ attachments = []
if history:
- data['history'] = True
- data['description'] = details or case.description
- data['email_to'] = email or \
- (case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from', False)
- data['email_from'] = email_from or \
- (case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from', False)
+ for att in attach:
+ attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
+
+ data = {
+ 'name': subject or 'History',
+ 'history': True,
+ 'user_id': uid,
+ 'model_id' : model_ids and model_ids[0] or False,
+ 'res_id': case.id,
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'description': details or (hasattr(case, 'description') and case.description or False),
+ 'email_to': email or \
+ (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
+ case.user_id.address_id.email) or tools.config.get('email_from', False),
+ 'email_from': email_from or \
+ (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
+ case.user_id.address_id.email) or tools.config.get('email_from', False),
+ 'partner_id': hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False,
+ 'thread_id': case.thread_id.id,
+ 'message_id': message_id,
+ 'attachment_ids': [(6, 0, attachments)]
+ }
res = obj.create(cr, uid, data, context)
return True
@@ -112,20 +129,22 @@ class mailgate_message(osv.osv):
_order = 'date desc'
_columns = {
- 'name':fields.char('Message', size=64),
- 'model_id': fields.many2one('ir.model', 'Model'),
- 'thread_id':fields.many2one('mailgate.thread', 'Thread'),
- 'date': fields.datetime('Date'),
+ 'name':fields.char('Message', size=64),
+ 'model_id': fields.many2one('ir.model', 'Model'),
+ 'res_id': fields.integer('Resource ID'),
+ 'thread_id':fields.many2one('mailgate.thread', 'Thread'),
+ 'date': fields.datetime('Date'),
'history': fields.boolean('Is History?', required=False),
- 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
- 'message': fields.text('Description'),
- 'email_from': fields.char('Email From', size=84),
- 'email_to': fields.char('Email To', size=84),
- 'email_cc': fields.char('Email From', size=84),
- 'email_bcc': fields.char('Email From', size=84),
- 'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
+ 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
+ 'message': fields.text('Description'),
+ 'email_from': fields.char('Email From', size=84),
+ 'email_to': fields.char('Email To', size=84),
+ 'email_cc': fields.char('Email CC', size=84),
+ 'email_bcc': fields.char('Email BCC', size=84),
+ 'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
'description': fields.text('Description'),
- 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
+ 'partner_id': fields.many2one('res.partner', 'Partner', required=False),
+ 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
}
mailgate_message()
diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml
index dc145754767..611416055f7 100644
--- a/addons/mail_gateway/mail_gateway_view.xml
+++ b/addons/mail_gateway/mail_gateway_view.xml
@@ -1,48 +1,66 @@
-
- maligate.message.form
- maligate.message
+
+ mailgate.message.form
+ mailgate.messageform
-
@@ -135,10 +135,10 @@ class make_sale(wizard.interface):
if data['form']['close']:
case_obj.case_close(cr, uid, data['ids'])
-
+
if not new_ids:
return {}
-
+
if len(new_ids)<=1:
value = {
'domain': str([('id', 'in', new_ids)]),
@@ -159,7 +159,7 @@ class make_sale(wizard.interface):
'type': 'ir.actions.act_window',
'res_id':new_ids
}
-
+
return value
states = {
diff --git a/addons/sale_journal/__init__.py b/addons/sale_journal/__init__.py
index 4cb6588ed18..f846067a3b4 100644
--- a/addons/sale_journal/__init__.py
+++ b/addons/sale_journal/__init__.py
@@ -18,10 +18,8 @@
# along with this program. If not, see .
#
##############################################################################
-
import sale_journal
-import sale_journal_inherit
-import sale_journal_report
-import sale_journal_picking_report
+import report
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_journal/__openerp__.py b/addons/sale_journal/__openerp__.py
index d204d4a3ee5..94d343debb9 100644
--- a/addons/sale_journal/__openerp__.py
+++ b/addons/sale_journal/__openerp__.py
@@ -28,7 +28,7 @@
The sale journal modules allows you to categorise your
sales and deliveries (picking lists) between different journals.
This module is very helpful for bigger companies that
- work by departments.
+ works by departments.
You can use journal for different purposes, some examples:
* isolate sales of different departments
@@ -54,8 +54,7 @@
'update_xml': [
'security/ir.model.access.csv',
'sale_journal_view.xml',
- 'picking_journal_view.xml',
- 'picking_journal_view_report.xml'
+ 'report/sale_journal_report_view.xml',
],
'demo_xml': ['sale_journal_demo.xml'],
'installable': True,
diff --git a/addons/sale_journal/picking_journal_view.xml b/addons/sale_journal/picking_journal_view.xml
deleted file mode 100644
index 4db38bfcd41..00000000000
--- a/addons/sale_journal/picking_journal_view.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- sale_journal.picking.journal.form
- sale_journal.picking.journal
- form
-
-
-
-
-
-
+
+
+
+
+
+
@@ -169,7 +171,7 @@
- Search Pages
+ Wiki Pageswiki.wikiformtree,form
diff --git a/addons/wiki_sale_faq/__init__.py b/addons/wiki_sale_faq/__init__.py
new file mode 100644
index 00000000000..938f045b9fd
--- /dev/null
+++ b/addons/wiki_sale_faq/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/wiki_sale_faq/__openerp__.py b/addons/wiki_sale_faq/__openerp__.py
new file mode 100644
index 00000000000..9619ec98f15
--- /dev/null
+++ b/addons/wiki_sale_faq/__openerp__.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+{
+ 'name': 'Wiki -Sale - FAQ',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Others',
+ 'description': """This module provides a wiki FAQ Template
+ """,
+ 'author': 'Tiny',
+ 'website': 'http://openerp.com',
+ 'depends': ['wiki_faq','document','crm'],
+ 'init_xml': [
+ 'wiki_sale_faq_data.xml'
+ ],
+ 'update_xml': [
+ 'wiki_sale_faq_view.xml'
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/wiki_sale_faq/wiki_sale_faq_data.xml b/addons/wiki_sale_faq/wiki_sale_faq_data.xml
new file mode 100644
index 00000000000..4a8eea1cb38
--- /dev/null
+++ b/addons/wiki_sale_faq/wiki_sale_faq_data.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ Sales Document
+
+
+ 0
+
+
+
+ Sale FAQ
+ list
+
+ == Question ==
+
+== Answer ==
+
+== External Links ==
+
+
+
+
+
+
+
diff --git a/addons/wiki_sale_faq/wiki_sale_faq_view.xml b/addons/wiki_sale_faq/wiki_sale_faq_view.xml
new file mode 100644
index 00000000000..c3643bdf049
--- /dev/null
+++ b/addons/wiki_sale_faq/wiki_sale_faq_view.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+ ir.actions.act_window
+ ir.attachment
+ form
+
+
+
+
+ Wiki Pages
+ wiki.wiki
+ form
+ tree,form
+
+
+
+
+
+
+
+
+
+
+