From f3067a68f0683f396e817e3e216bedf1230dd53b Mon Sep 17 00:00:00 2001
From: "Foram Katharotiya (OpenERP)"
Date: Tue, 18 Sep 2012 18:25:56 +0530
Subject: [PATCH 102/128] [IMP] improve code
bzr revid: fka@tinyerp.com-20120918125556-sthjavjc6yvc399b
---
addons/hr_evaluation/test/test_hr_evaluation.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml
index 2bdc3513962..a66731531fa 100644
--- a/addons/hr_evaluation/test/test_hr_evaluation.yml
+++ b/addons/hr_evaluation/test/test_hr_evaluation.yml
@@ -54,7 +54,6 @@
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3',
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00',
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR',
- str(ref("survey_question_2")) +"_" +str(ref("survey_answer_98")) + "_multi" :'tpa review'
}, context = ctx)
-
I close this Evaluation survey by giving answer of questions.
From 7ed74bec49d2d12626fb3987da2aaa63dec0b27d Mon Sep 17 00:00:00 2001
From: "Khushboo Bhatt (Open ERP)"
Date: Tue, 18 Sep 2012 18:57:27 +0530
Subject: [PATCH 103/128] [FIX]account:create journal items
bzr revid: kbh@tinyerp.com-20120918132727-7ffkz0q737r5yzmq
---
addons/account/account_move_line.py | 4 +++-
addons/account/account_view.xml | 4 ++--
addons/account/wizard/account_move_journal.py | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index cf3c1e31a82..6c0921de36c 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -215,8 +215,10 @@ class account_move_line(osv.osv):
def _default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
- if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
+ if not context.get('journal_id', False):
context['journal_id'] = context.get('search_default_journal_id')
+ if not context.get('period_id', False):
+ context['period_id'] = context.get('search_default_period_id')
account_obj = self.pool.get('account.account')
period_obj = self.pool.get('account.period')
journal_obj = self.pool.get('account.journal')
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index b15c2ff1e06..18d82ef04ab 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1078,7 +1078,7 @@
-
+
@@ -1152,7 +1152,7 @@
-
+
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
index d87e4d04a0c..da6a142972b 100644
--- a/addons/account/wizard/account_move_journal.py
+++ b/addons/account/wizard/account_move_journal.py
@@ -92,7 +92,7 @@ class account_move_journal(osv.osv_memory):
journal = False
if journal_id:
- journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).name
+ journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).get('name',False)
journal_string = _("Journal: %s") % tools.ustr(journal)
else:
journal_string = _("Journal: All")
From 9ef0184258ffe41e8d5b82f92808cbb075796043 Mon Sep 17 00:00:00 2001
From: "Harry (OpenERP)"
Date: Wed, 19 Sep 2012 10:42:47 +0530
Subject: [PATCH 104/128] [IMP] project: correct tooltip
bzr revid: hmo@tinyerp.com-20120919051247-5jcqc9axl1zilj89
---
addons/project/res_config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/project/res_config.py b/addons/project/res_config.py
index b982507c24c..3adbc830691 100644
--- a/addons/project/res_config.py
+++ b/addons/project/res_config.py
@@ -30,7 +30,7 @@ class project_configuration(osv.osv_memory):
'module_project_mrp': fields.boolean('Generate tasks from sale orders',
help ="""This feature automatically creates project tasks from service products in sale orders.
More precisely, tasks are created for procurement lines with product of type 'Service',
- procurement method 'Make to Order', and supply method 'Produce'.
+ procurement method 'Make to Order', and supply method 'Manufacture'.
This installs the module project_mrp."""),
'module_pad': fields.boolean("Use integrated collaborative note pads on task",
help="""Lets the company customize which Pad installation should be used to link to new pads
From 090b206dd1c071fd8a723cf0cb4e5cd093592824 Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers
Date: Wed, 19 Sep 2012 09:32:40 +0200
Subject: [PATCH 105/128] [IMP] removing partner manager from sale as it will
be in home
bzr revid: fp@tinyerp.com-20120919073240-vdxrevkxii0zzc4x
---
openerp/addons/base/res/res_security.xml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/openerp/addons/base/res/res_security.xml b/openerp/addons/base/res/res_security.xml
index c7d2a77f846..acec903c1a3 100644
--- a/openerp/addons/base/res/res_security.xml
+++ b/openerp/addons/base/res/res_security.xml
@@ -12,9 +12,6 @@
-
From f71dd62f2b5d75fddcb584aa4489d5bf571ff338 Mon Sep 17 00:00:00 2001
From: Christophe Matthieu
Date: Wed, 19 Sep 2012 09:48:22 +0200
Subject: [PATCH 106/128] [IMP] kanban: temp
bzr revid: chm@openerp.com-20120919074822-ytdwjw1ubai4x4lf
---
addons/web_kanban/static/src/js/kanban.js | 26 +++++++++++------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js
index 970a4e81fca..1e88a1f734f 100644
--- a/addons/web_kanban/static/src/js/kanban.js
+++ b/addons/web_kanban/static/src/js/kanban.js
@@ -185,27 +185,30 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
arg={};
// select all widget
self.$el.find(".oe_kanban_many2many_tags").each(function(){
- var model = $(this).attr("model");
- var data = $(this).attr("data");
- var list = data.split(",");
- //select all id (per model)
- if(!arg[model]) arg[model]=[];
- for(var t=0;t0){
+ var block = self.$el.find(".oe_kanban_many2many_tags[model='" + model + "']");
var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
dataset.name_get(_.uniq( arg[model] )).then(
function(result) {
for(var t=0;t'+result[t][1]+'');
}
}
);
+ console.log("kanban 212 ",block);
}
}
},
@@ -396,8 +399,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
} else {
this.$el.find('.oe_kanban_draghandle').removeClass('oe_kanban_draghandle');
}
-
- this.transform_widget_many2many();
+ self.transform_widget_many2many();
},
on_record_moved : function(record, old_group, old_index, new_group, new_index) {
var self = this;
@@ -416,6 +418,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
this.dataset.write(record.id, data, {}, function() {
record.do_reload();
new_group.do_save_sequences();
+ self.transform_widget_many2many();
}).fail(function(error, evt) {
evt.preventDefault();
alert("An error has occured while moving the record to this group.");
@@ -732,9 +735,6 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
transform_record: function(record) {
var self = this,
new_record = {};
-
- console.log(this, record);
-
_.each(record, function(value, name) {
var r = _.clone(self.view.fields_view.fields[name] || {});
if ((r.type === 'date' || r.type === 'datetime') && value) {
From 29572425d147f4b5637b36ab7a36cb3c21a4523d Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Wed, 19 Sep 2012 10:10:40 +0200
Subject: [PATCH 107/128] [FIX] auth_signup: rename duplicate xml id
bzr revid: rco@openerp.com-20120919081040-qh5brnfs1b4c39ou
---
addons/auth_signup/auth_signup_data.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/auth_signup/auth_signup_data.xml b/addons/auth_signup/auth_signup_data.xml
index 4a6bf9ae4b9..39b62148494 100644
--- a/addons/auth_signup/auth_signup_data.xml
+++ b/addons/auth_signup/auth_signup_data.xml
@@ -13,7 +13,7 @@
-
+
auth_signup.template_user_id
From fd4f57e037ae7e38288f3625e1cccaae04b9edcd Mon Sep 17 00:00:00 2001
From: Christophe Matthieu
Date: Wed, 19 Sep 2012 10:32:01 +0200
Subject: [PATCH 108/128] [IMP] note: tags in header for form view
bzr revid: chm@openerp.com-20120919083201-q1vfazurar2kjcew
---
addons/web/static/src/css/base.css | 7 ++++++-
addons/web/static/src/css/base.sass | 8 +++++++-
addons/web_kanban/static/src/js/kanban.js | 6 +++---
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 10ee9dea2de..a665105bc3a 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -531,6 +531,11 @@
.openerp .oe_tags.oe_inline {
min-width: 250px;
}
+.openerp .oe_form header .oe_tags {
+ margin:5px 0 0 5px;
+ width:400px;
+ padding-bottom:0;
+}
.openerp .oe_tags .text-wrap {
width: 100% !important;
}
@@ -1914,7 +1919,7 @@
}
.openerp .oe_form_nosheet > header {
margin: -16px -16px 0 -16px;
- padding: 8px;
+ padding: 0;
}
.openerp .oe_form_sheetbg {
padding: 8px 0;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 1aa4726725c..54e6fe18c7f 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -470,6 +470,12 @@ $sheet-max-width: 860px
text-decoration: none
margin-bottom: 1px
// }}}
+ .oe_form
+ header
+ .oe_tags
+ margin:5px 0 0 5px
+ width:400px
+ padding-bottom:0
// Tooltips {{{
&.oe_tooltip
font-size: 12px
@@ -1520,7 +1526,7 @@ $sheet-max-width: 860px
margin: 16px
> header
margin: -16px -16px 0 -16px
- padding: 8px
+ padding: 0
.oe_form_sheetbg
padding: 8px 0
.oe_form_sheet_width
diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js
index a803ec3e6a8..009f949984b 100644
--- a/addons/web_kanban/static/src/js/kanban.js
+++ b/addons/web_kanban/static/src/js/kanban.js
@@ -130,7 +130,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
case 'field':
if(this.fields_view.fields[ node.attrs['name'] ].type == 'many2many'){
node.tag = 'div';
- node.attrs['class'] = 'oe_kanban_many2many_tags';
+ node.attrs['class'] = 'oe_form_field oe_tags';
node.attrs['model'] = this.fields_view.fields[node.attrs['name']].relation;
node.attrs['t-att-data'] = 'record.' + node.attrs['name'] + '.raw_value';
}else {
@@ -182,7 +182,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
var self=this,
arg={};
// select all widget
- self.$el.find(".oe_kanban_many2many_tags").each(function(){
+ self.$el.find(".oe_form_field.oe_tags").each(function(){
var model = $(this).attr("model");
if(model.length){
var data = $(this).attr("data");
@@ -196,7 +196,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
// only one request by model
for(var model in arg){
if(arg[model].length>0){
- var block = self.$el.find(".oe_kanban_many2many_tags[model='" + model + "']");
+ var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']");
var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
dataset.name_get(_.uniq( arg[model] )).then(
function(result) {
From cd6afa7a45a2869f82a6151182a4bc539d1e59d8 Mon Sep 17 00:00:00 2001
From: Christophe Matthieu
Date: Wed, 19 Sep 2012 10:32:24 +0200
Subject: [PATCH 109/128] [IMP] note: tags in header for form view
bzr revid: chm@openerp.com-20120919083224-tx0t3etaj9wbq5vg
---
addons/note/note_view.xml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml
index ccb07544c09..64e2710cc16 100644
--- a/addons/note/note_view.xml
+++ b/addons/note/note_view.xml
@@ -117,12 +117,10 @@
From 8f5f2c0c40b6de891164de5bf92d8198ce723859 Mon Sep 17 00:00:00 2001
From: Christophe Matthieu
Date: Wed, 19 Sep 2012 11:03:11 +0200
Subject: [PATCH 110/128] [IMP]kanban: many2many_tags reload
bzr revid: chm@openerp.com-20120919090311-x4zj6x7ir7bukepx
---
addons/web_kanban/static/src/js/kanban.js | 74 ++++++++++++-----------
1 file changed, 38 insertions(+), 36 deletions(-)
diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js
index 009f949984b..8336fa9a0e3 100644
--- a/addons/web_kanban/static/src/js/kanban.js
+++ b/addons/web_kanban/static/src/js/kanban.js
@@ -176,40 +176,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
}
}
},
- /* widget for list of tags/categories...
- */
- transform_widget_many2many: function(){
- var self=this,
- arg={};
- // select all widget
- self.$el.find(".oe_form_field.oe_tags").each(function(){
- var model = $(this).attr("model");
- if(model.length){
- var data = $(this).attr("data");
- var list = data.split(",");
- //select all id (per model)
- if(!arg[model]) arg[model]=[];
- for(var t=0;t0){
- var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']");
- var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
- dataset.name_get(_.uniq( arg[model] )).then(
- function(result) {
- for(var t=0;t'+result[t][1]+'');
- }
- }
- );
- console.log("kanban 212 ",block);
- }
- }
- },
do_add_record: function() {
this.dataset.index = null;
this.do_switch_view('form');
@@ -397,7 +363,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
} else {
this.$el.find('.oe_kanban_draghandle').removeClass('oe_kanban_draghandle');
}
- self.transform_widget_many2many();
+ instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags(self);
},
on_record_moved : function(record, old_group, old_index, new_group, new_index) {
var self = this;
@@ -416,7 +382,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
this.dataset.write(record.id, data, {}, function() {
record.do_reload();
new_group.do_save_sequences();
- self.transform_widget_many2many();
}).fail(function(error, evt) {
evt.preventDefault();
alert("An error has occured while moving the record to this group.");
@@ -483,6 +448,42 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
}
});
+/*
+* widget for list of tags/categories
+* make the rpc request for all ids/model and insert value inside .oe_tags fields
+*/
+instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags = function(self){
+ var model_list_id={};
+
+ // select all widget for the kanban view or the widget inside the record
+ self.$el.find(".oe_form_field.oe_tags").each(function(){
+ var model = $(this).attr("model");
+ if(model.length){
+ var data = $(this).attr("data");
+ var list = data.split(",");
+
+ //select all id (per model)
+ if(!model_list_id[model]) model_list_id[model]=[];
+ for(var t=0;t0){
+ var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']");
+ var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
+ dataset.name_get(_.uniq( model_list_id[model] )).then(
+ function(result) {
+ for(var t=0;t'+result[t][1]+'');
+ }
+ }
+ );
+ }
+ }
+}
+
function get_class(name) {
return new instance.web.Registry({'tmp' : name}).get_object("tmp");
}
@@ -915,6 +916,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
self.$el.data('widget', self);
self.bind_events();
self.group.compute_cards_auto_height();
+ instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags(self);
} else {
self.destroy();
}
From 0b699fe7fbcc826159c04f7175ab4fafd60e60a6 Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Wed, 19 Sep 2012 11:04:53 +0200
Subject: [PATCH 111/128] [IMP] portal: send email when user has been withdrawn
from portal
bzr revid: rco@openerp.com-20120919090453-jma9d9rfysbq6l3p
---
addons/portal/wizard/portal_wizard.py | 59 +++++++++++++--------
addons/portal/wizard/portal_wizard_view.xml | 5 +-
2 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index 1dda8fd7dd3..3cc706c2129 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -30,19 +30,31 @@ from openerp import SUPERUSER_ID
from base.res.res_partner import _lang_get
_logger = logging.getLogger(__name__)
-# welcome email sent to new portal users (note that calling tools.translate._
-# has no effect except exporting those strings for translation)
+# welcome/goodbye email sent to portal users
+# (note that calling '_' has no effect except exporting those strings for translation)
WELCOME_EMAIL_SUBJECT = _("Your OpenERP account at %(company)s")
WELCOME_EMAIL_BODY = _("""Dear %(name)s,
-You have been created an OpenERP account of %(portal)s at %(url)s.
+You have been given access to %(portal)s at %(url)s.
Your login account data is:
Database: %(db)s
User: %(login)s
Password: %(password)s
-%(message)s
+%(welcome_message)s
+
+--
+OpenERP - Open Source Business Applications
+http://www.openerp.com
+""")
+
+GOODBYE_EMAIL_SUBJECT = _("Your OpenERP account at %(company)s")
+GOODBYE_EMAIL_BODY = _("""Dear %(name)s,
+
+Your access to %(portal)s has been withdrawn.
+
+%(goodbye_message)s
--
OpenERP - Open Source Business Applications
@@ -78,8 +90,10 @@ class wizard(osv.osv_memory):
'portal_id': fields.many2one('res.groups', domain=[('is_portal', '=', True)], required=True,
string='Portal', help="The portal that users can be added in or removed from."),
'user_ids': fields.one2many('portal.wizard.user', 'wizard_id', string='Users'),
- 'message': fields.text(string='Invitation Message',
- help="This text is included in the welcome email sent to the users."),
+ 'welcome_message': fields.text(string='Invitation Message',
+ help="This text is included in the email sent to new users of the portal."),
+ 'goodbye_message': fields.text(string='Withdrawal Message',
+ help="This text is included in the email sent to users withdrawn from the portal."),
}
def _default_portal(self, cr, uid, context):
@@ -154,16 +168,14 @@ class wizard_user(osv.osv_memory):
self._send_email(cr, uid, wizard_user, context)
else:
# remove the user (if it exists) from the portal group
- if user:
- if portal in user.groups_id:
- if len(user.groups_id) == 1:
- # delete or deactivate the user
- try:
- user.unlink()
- except:
- user.write({'groups_id': [(3, portal.id)], 'active': False})
- else:
- user.write({'groups_id': [(3, portal.id)]})
+ if user and (portal in user.groups_id):
+ # if user belongs to portal only, deactivate it
+ if len(user.groups_id) <= 1:
+ user.write({'groups_id': [(3, portal.id)], 'active': False})
+ else:
+ user.write({'groups_id': [(3, portal.id)]})
+ wizard_user = self.browse(cr, SUPERUSER_ID, wizard_user.id, context)
+ self._send_email(cr, uid, wizard_user, context)
def _retrieve_user(self, cr, uid, wizard_user, context=None):
""" retrieve the (possibly inactive) user corresponding to wizard_user.partner_id
@@ -196,7 +208,7 @@ class wizard_user(osv.osv_memory):
return res_users.browse(cr, uid, user_id, context)
def _send_email(self, cr, uid, wizard_user, context=None):
- """ send invitation email to a new portal user
+ """ send notification email to a new/former portal user
@param wizard_user: browse record of model portal.wizard.user
@return: the id of the created mail.mail record
"""
@@ -208,20 +220,25 @@ class wizard_user(osv.osv_memory):
# determine subject and body in the portal user's language
url = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'web.base.url', context=this_context)
- user = wizard_user.partner_id.user_ids[0]
+ user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
context = dict(this_context or {}, lang=user.lang)
data = {
'company': this_user.company_id.name,
'portal': wizard_user.wizard_id.portal_id.name,
- 'message': wizard_user.wizard_id.message or "",
+ 'welcome_message': wizard_user.wizard_id.welcome_message or "",
+ 'goodbye_message': wizard_user.wizard_id.goodbye_message or "",
'url': url or _("(missing url)"),
'db': cr.dbname,
'login': user.login,
'password': user.password,
'name': user.name
}
- subject = _(WELCOME_EMAIL_SUBJECT) % data
- body = _(WELCOME_EMAIL_BODY) % data
+ if wizard_user.in_portal:
+ subject = _(WELCOME_EMAIL_SUBJECT) % data
+ body = _(WELCOME_EMAIL_BODY) % data
+ else:
+ subject = _(GOODBYE_EMAIL_SUBJECT) % data
+ body = _(GOODBYE_EMAIL_BODY) % data
mail_mail = self.pool.get('mail.mail')
mail_values = {
diff --git a/addons/portal/wizard/portal_wizard_view.xml b/addons/portal/wizard/portal_wizard_view.xml
index b2686b34c27..c8e3f30b128 100644
--- a/addons/portal/wizard/portal_wizard_view.xml
+++ b/addons/portal/wizard/portal_wizard_view.xml
@@ -25,7 +25,10 @@
If necessary, you can fix any contact's email address directly in the list.
-
+
+