[MERGE] [FIX] stock: add some missing context, courtesy of Lionel Sausin (Numérigraphe)
authorMartin Trigaux <mat@openerp.com>
Fri, 14 Mar 2014 16:09:38 +0000 (17:09 +0100)
committerMartin Trigaux <mat@openerp.com>
Fri, 14 Mar 2014 16:09:38 +0000 (17:09 +0100)
bzr revid: mat@openerp.com-20140314160938-px91g81280qff635

16 files changed:
addons/account/i18n/ko.po
addons/base_calendar/base_calendar.py
addons/base_calendar/test/base_calendar_test.yml
addons/base_import/models.py
addons/crm/i18n/ja.po
addons/l10n_be_invoice_bba/i18n/zh_CN.po [new file with mode: 0644]
addons/mail/mail_thread.py
addons/pad/pad.py
addons/pad/static/src/css/etherpad.css
addons/pad/static/src/js/pad.js
addons/share/wizard/share_wizard.py
addons/stock/stock_view.xml
addons/web/static/src/js/data.js
openerp/addons/base/i18n/nl.po
openerp/addons/base/res/wizard/change_password_wizard.py
openerp/netsvc.py

index bf5699c..13dcd8f 100644 (file)
@@ -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: 2014-03-12 05:25+0000\n"
+"X-Launchpad-Export-Date: 2014-03-13 07:15+0000\n"
 "X-Generator: Launchpad (build 16963)\n"
 
 #. module: account
index 44c598f..2ba55ce 100644 (file)
@@ -1015,15 +1015,20 @@ class calendar_event(osv.osv):
                 result[event] = ""
         return result
 
+    # hook method to fix the wrong signature
+    def _set_rulestring(self, cr, uid, ids, field_name, field_value, args, context=None):
+        return self._rrule_write(self, cr, uid, ids, field_name, field_value, args, context=context)
+
     def _rrule_write(self, obj, cr, uid, ids, field_name, field_value, args, context=None):
+        if not isinstance(ids, list):
+            ids = [ids]
         data = self._get_empty_rrule_data()
         if field_value:
             data['recurrency'] = True
             for event in self.browse(cr, uid, ids, context=context):
-                rdate = rule_date or event.date
-                update_data = self._parse_rrule(field_value, dict(data), rdate)
+                update_data = self._parse_rrule(field_value, dict(data), event.date)
                 data.update(update_data)
-                super(calendar_event, obj).write(cr, uid, ids, data, context=context)
+                super(calendar_event, self).write(cr, uid, ids, data, context=context)
         return True
 
     _columns = {
@@ -1051,7 +1056,7 @@ defines the list of date/time exceptions for a recurring calendar component."),
         'exrule': fields.char('Exception Rule', size=352, help="Defines a \
 rule or repeating pattern of time to exclude from the recurring rule."),
         'rrule': fields.function(_get_rulestring, type='char', size=124, \
-                    fnct_inv=_rrule_write, store=True, string='Recurrent Rule'),
+                    fnct_inv=_set_rulestring, store=True, string='Recurrent Rule'),
         'rrule_type': fields.selection([
             ('daily', 'Day(s)'),
             ('weekly', 'Week(s)'),
@@ -1375,7 +1380,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
         #repeat monthly by nweekday ((weekday, weeknumber), )
         if r._bynweekday:
             data['week_list'] = day_list[r._bynweekday[0][0]].upper()
-            data['byday'] = r._bynweekday[0][1]
+            data['byday'] = str(r._bynweekday[0][1])
             data['select1'] = 'day'
             data['rrule_type'] = 'monthly'
 
@@ -1502,7 +1507,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
         # set end_date for calendar searching
         if vals.get('recurrency', True) and vals.get('end_type', 'count') in ('count', unicode('count')) and \
                 (vals.get('rrule_type') or vals.get('count') or vals.get('date') or vals.get('date_deadline')):
-            for data in self.read(cr, uid, ids, ['date', 'date_deadline', 'recurrency', 'rrule_type', 'count', 'end_type'], context=context):
+            for data in self.read(cr, uid, ids, ['end_date', 'date_deadline', 'recurrency', 'rrule_type', 'count', 'end_type'], context=context):
                 end_date = self._set_recurrency_end_date(data, context=context)
                 super(calendar_event, self).write(cr, uid, [data['id']], {'end_date': end_date}, context=context)
 
@@ -1625,21 +1630,23 @@ rule or repeating pattern of time to exclude from the recurring rule."),
         return res
 
     def _set_recurrency_end_date(self, data, context=None):
+        if not data.get('recurrency'):
+            return False
+
+        end_type = data.get('end_type')
         end_date = data.get('end_date')
-        rel_date = False
-        if data.get('recurrency') and data.get('end_type') in ('count', unicode('count')):
-            data_date_deadline = datetime.strptime(data.get('date_deadline'), '%Y-%m-%d %H:%M:%S')
-            if data.get('rrule_type') in ('daily', unicode('count')):
-                rel_date = relativedelta(days=data.get('count')+1)
-            elif data.get('rrule_type') in ('weekly', unicode('weekly')):
-                rel_date = relativedelta(days=(data.get('count')+1)*7)
-            elif data.get('rrule_type') in ('monthly', unicode('monthly')):
-                rel_date = relativedelta(months=data.get('count')+1)
-            elif data.get('rrule_type') in ('yearly', unicode('yearly')):
-                rel_date = relativedelta(years=data.get('count')+1)
-            end_date = data_date_deadline
-            if rel_date:
-                end_date += rel_date
+
+        if end_type == 'count' and all(data.get(key) for key in ['count', 'rrule_type', 'date_deadline']):
+            count = data['count'] + 1
+            delay, mult = {
+                'daily': ('days', 1),
+                'weekly': ('days', 7),
+                'monthly': ('months', 1),
+                'yearly': ('years', 1),
+            }[data['rrule_type']]
+
+            deadline = datetime.strptime(data['date_deadline'], tools.DEFAULT_SERVER_DATETIME_FORMAT)
+            return deadline + relativedelta(**{delay: count * mult})
         return end_date
 
     def create(self, cr, uid, vals, context=None):
@@ -1649,9 +1656,12 @@ rule or repeating pattern of time to exclude from the recurring rule."),
         if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
             vals['vtimezone'] = vals['vtimezone'][40:]
 
-        vals['end_date'] = self._set_recurrency_end_date(vals, context=context)
         res = super(calendar_event, self).create(cr, uid, vals, context)
 
+        data = self.read(cr, uid, [res], ['end_date', 'date_deadline', 'recurrency', 'rrule_type', 'count', 'end_type'], context=context)[0]
+        end_date = self._set_recurrency_end_date(data, context=context)
+        self.write(cr, uid, [res], {'end_date': end_date}, context=context)
+
         alarm_obj = self.pool.get('res.alarm')
         alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
         self.create_attendees(cr, uid, [res], context)
index 7afd2e4..c280bfe 100644 (file)
 -
     !python {model: calendar.event}: |
      self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
+-
+  I create a recuring rule for my event
+-
+  !record {model: crm.meeting, id: crm_meeting_sprintreview1}:
+    name: Begin of month meeting
+    date: !eval time.strftime('%Y-%m-%d 12:00:00')
+    recurrency: true
+    rrule: FREQ=MONTHLY;INTERVAL=1;COUNT=12;BYDAY=1MO
+-
+  I check that the attributes are set correctly
+-
+  !assert {model: crm.meeting, id: crm_meeting_sprintreview1}:
+    - rrule_type == 'monthly'
+    - count == 12
+    - select1 == 'day'
+    - byday == '1'
+    - week_list == 'MO'
index 996dbf7..637bac0 100644 (file)
@@ -11,6 +11,7 @@ except ImportError:
 import psycopg2
 
 from openerp.osv import orm, fields
+from openerp.osv.orm import BaseModel
 from openerp.tools.translate import _
 
 FIELDS_RECURSION_LIMIT = 2
@@ -316,8 +317,12 @@ class ir_import(orm.TransientModel):
             }]
 
         _logger.info('importing %d rows...', len(data))
-        import_result = self.pool[record.res_model].load(
-            cr, uid, import_fields, data, context=context)
+        # DO NOT FORWARD PORT, already fixed in trunk
+        # hack to avoid to call the load method from ir_translation (name clash)
+        if record.res_model == 'ir.translation':
+            import_result = BaseModel.load(self.pool['ir.translation'], cr, uid, import_fields, data, context=context)
+        else:
+            import_result = self.pool[record.res_model].load(cr, uid, import_fields, data, context=context)
         _logger.info('done')
 
         # If transaction aborted, RELEASE SAVEPOINT is going to raise
index 629e5b2..80739d4 100644 (file)
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: openobject-addons\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 "POT-Creation-Date: 2014-01-07 16:56+0000\n"
-"PO-Revision-Date: 2014-03-05 21:13+0000\n"
+"PO-Revision-Date: 2014-03-13 08:00+0000\n"
 "Last-Translator: hiro TAKADA <tkhiro0712@gmail.com>\n"
 "Language-Team: Japanese <ja@li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2014-03-06 06:14+0000\n"
-"X-Generator: Launchpad (build 16948)\n"
+"X-Launchpad-Export-Date: 2014-03-14 06:58+0000\n"
+"X-Generator: Launchpad (build 16963)\n"
 
 #. module: crm
 #: view:crm.lead.report:0
@@ -1218,7 +1218,7 @@ msgstr "この項目をチェックした場合、この段階が各営業チー
 msgid ""
 "This field is used to distinguish stages related to Leads from stages "
 "related to Opportunities, or to specify stages available for both types."
-msgstr ""
+msgstr "このフィールドは商談とリードの区別、あるいは両方を指定するために使用します。"
 
 #. module: crm
 #: model:mail.message.subtype,name:crm.mt_lead_create
@@ -1423,7 +1423,7 @@ msgstr ""
 #. module: crm
 #: help:crm.case.stage,sequence:0
 msgid "Used to order stages. Lower is better."
-msgstr ""
+msgstr "ステージの順位に使用します。 低いほど良好です。"
 
 #. module: crm
 #: model:ir.actions.act_window,name:crm.crm_phonecall_categ_action
@@ -2227,7 +2227,7 @@ msgstr ""
 msgid ""
 "This stage is not visible, for example in status bar or kanban view, when "
 "there are no records in that stage to display."
-msgstr ""
+msgstr "ステータスバーやかんばんビューで表示すべきレコードが存在しない場合、このステージは表示されません。"
 
 #. module: crm
 #: field:crm.lead.report,nbr:0
diff --git a/addons/l10n_be_invoice_bba/i18n/zh_CN.po b/addons/l10n_be_invoice_bba/i18n/zh_CN.po
new file mode 100644 (file)
index 0000000..6fd7528
--- /dev/null
@@ -0,0 +1,146 @@
+# Chinese (Simplified) translation for openobject-addons
+# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2012-11-24 02:53+0000\n"
+"PO-Revision-Date: 2014-03-13 03:38+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Chinese (Simplified) <zh_CN@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2014-03-14 06:58+0000\n"
+"X-Generator: Launchpad (build 16963)\n"
+
+#. module: l10n_be_invoice_bba
+#: sql_constraint:account.invoice:0
+msgid "Invoice Number must be unique per Company!"
+msgstr "发票号必须在公司范围内唯一"
+
+#. module: l10n_be_invoice_bba
+#: model:ir.model,name:l10n_be_invoice_bba.model_account_invoice
+msgid "Invoice"
+msgstr "发票"
+
+#. module: l10n_be_invoice_bba
+#: constraint:res.partner:0
+msgid "Error ! You cannot create recursive associated members."
+msgstr "错误,您不能创建循环引用的会员用户"
+
+#. module: l10n_be_invoice_bba
+#: constraint:account.invoice:0
+msgid "Invalid BBA Structured Communication !"
+msgstr "BBA结构化传输有误!"
+
+#. module: l10n_be_invoice_bba
+#: selection:res.partner,out_inv_comm_algorithm:0
+msgid "Random"
+msgstr "随机"
+
+#. module: l10n_be_invoice_bba
+#: help:res.partner,out_inv_comm_type:0
+msgid "Select Default Communication Type for Outgoing Invoices."
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: help:res.partner,out_inv_comm_algorithm:0
+msgid ""
+"Select Algorithm to generate the Structured Communication on Outgoing "
+"Invoices."
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:109
+#: code:addons/l10n_be_invoice_bba/invoice.py:135
+#, python-format
+msgid ""
+"The daily maximum of outgoing invoices with an automatically generated BBA "
+"Structured Communications has been exceeded!\n"
+"Please create manually a unique BBA Structured Communication."
+msgstr "自动生成结构化BBA传输已超出每日销售发票的最大值,请手动建立BBA结构化传输"
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:150
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:121
+#, python-format
+msgid ""
+"The Partner should have a 3-7 digit Reference Number for the generation of "
+"BBA Structured Communications!\n"
+"Please correct the Partner record."
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: constraint:res.partner:0
+msgid "Error: Invalid ean code"
+msgstr "错误:无效的EAN编码"
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:108
+#: code:addons/l10n_be_invoice_bba/invoice.py:120
+#: code:addons/l10n_be_invoice_bba/invoice.py:134
+#: code:addons/l10n_be_invoice_bba/invoice.py:162
+#: code:addons/l10n_be_invoice_bba/invoice.py:172
+#: code:addons/l10n_be_invoice_bba/invoice.py:197
+#, python-format
+msgid "Warning!"
+msgstr "警告!"
+
+#. module: l10n_be_invoice_bba
+#: selection:res.partner,out_inv_comm_algorithm:0
+msgid "Customer Reference"
+msgstr "客户参考号"
+
+#. module: l10n_be_invoice_bba
+#: field:res.partner,out_inv_comm_type:0
+msgid "Communication Type"
+msgstr "讯息类型"
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:173
+#: code:addons/l10n_be_invoice_bba/invoice.py:198
+#, python-format
+msgid ""
+"The BBA Structured Communication has already been used!\n"
+"Please create manually a unique BBA Structured Communication."
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: selection:res.partner,out_inv_comm_algorithm:0
+msgid "Date"
+msgstr "事务处理日期"
+
+#. module: l10n_be_invoice_bba
+#: model:ir.model,name:l10n_be_invoice_bba.model_res_partner
+msgid "Partner"
+msgstr "合作伙伴"
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:151
+#, python-format
+msgid ""
+"Unsupported Structured Communication Type Algorithm '%s' !\n"
+"Please contact your OpenERP support channel."
+msgstr "不支持的结构化传输算法类型\"%s\"!请联系你的OpenERP 维护人员"
+
+#. module: l10n_be_invoice_bba
+#: field:res.partner,out_inv_comm_algorithm:0
+msgid "Communication Algorithm"
+msgstr ""
+
+#. module: l10n_be_invoice_bba
+#: code:addons/l10n_be_invoice_bba/invoice.py:163
+#, python-format
+msgid ""
+"Empty BBA Structured Communication!\n"
+"Please fill in a unique BBA Structured Communication."
+msgstr ""
index 40a4fef..0c911bc 100644 (file)
@@ -111,6 +111,7 @@ class mail_thread(osv.AbstractModel):
             if res[id]['message_unread_count']:
                 title = res[id]['message_unread_count'] > 1 and _("You have %d unread messages") % res[id]['message_unread_count'] or _("You have one unread message")
                 res[id]['message_summary'] = "<span class='oe_kanban_mail_new' title='%s'><span class='oe_e'>9</span> %d %s</span>" % (title, res[id].pop('message_unread_count'), _("New"))
+            res[id].pop('message_unread_count', None)
         return res
 
     def _get_subscription_data(self, cr, uid, ids, name, args, context=None):
index 22e8931..0a72e2a 100644 (file)
@@ -14,6 +14,10 @@ _logger = logging.getLogger(__name__)
 class pad_common(osv.osv_memory):
     _name = 'pad.common'
 
+    def pad_is_configured(self, cr, uid, context=None):
+        user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+        return bool(user.company_id.pad_server)
+
     def pad_generate_url(self, cr, uid, context=None):
         company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id;
 
index facf15b..d2d8b74 100644 (file)
@@ -71,6 +71,7 @@
 .oe_pad_loading{
     text-align: center;
     opacity: 0.75;
+    font-style: italic;
 }
 
 .etherpad_readonly ul, .etherpad_readonly ol {
index 97f8719..e04184b 100644 (file)
@@ -1,65 +1,81 @@
 openerp.pad = function(instance) {
+    var _t = instance.web._t;
     
     instance.web.form.FieldPad = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeWidgetMixin, {
         template: 'FieldPad',
         content: "",
         init: function() {
+            var self = this;
             this._super.apply(this, arguments);
-            this.set("configured", true);
-            this.on("change:configured", this, this.switch_configured);
+            this._configured_deferred = this.view.dataset.call('pad_is_configured').done(function(data) {
+                self.set("configured", !!data);
+            }).fail(function(data, event) {
+                event.preventDefault();
+                self.set("configured", true);
+            });
         },
         initialize_content: function() {
             var self = this;
-            this.switch_configured();
             this.$('.oe_pad_switch').click(function() {
                 self.$el.toggleClass('oe_pad_fullscreen');
                 self.view.$el.find('.oe_chatter').toggle();
             });
+            this._configured_deferred.always(function() {
+                var configured = self.get('configured');
+                self.$(".oe_unconfigured").toggle(!configured);
+                self.$(".oe_configured").toggle(configured);
+            });
             this.render_value();
         },
-        switch_configured: function() {
-            this.$(".oe_unconfigured").toggle(! this.get("configured"));
-            this.$(".oe_configured").toggle(this.get("configured"));
-        },
         render_value: function() {
-            var self  = this;
-            if (this.get("configured") && ! this.get("value")) {
-                self.view.dataset.call('pad_generate_url', {
-                    context: {
-                        model: self.view.model,
-                        field_name: self.name,
-                        object_id: self.view.datarecord.id
-                    },
-                }).done(function(data) {
-                    if (! data.url) {
-                        self.set("configured", false);
+            var self = this;
+            this._configured_deferred.always(function() {
+                if (! self.get('configured')) {
+                    return;
+                };
+                var value = self.get('value');
+                if (self.get('effective_readonly')) {
+                    if (_.str.startsWith(value, 'http')) {
+                        this.pad_loading_request = self.view.dataset.call('pad_get_content', {url: value}).done(function(data) {
+                            self.$('.oe_pad_content').removeClass('oe_pad_loading').html('<div class="oe_pad_readonly"><div>');
+                            self.$('.oe_pad_readonly').html(data);
+                        }).fail(function() {
+                            self.$('.oe_pad_content').text(_t('Unable to load pad'));
+                        });
                     } else {
-                        self.set("value", data.url);
+                        self.$('.oe_pad_content').addClass('oe_pad_loading').show().text(_t("This pad will be initialized on first edit"));
+                    }
+                }
+                else {
+                    var def = $.when();
+                    if (! value || !_.str.startsWith(value, 'http')) {
+                        def = self.view.dataset.call('pad_generate_url', {
+                            context: {
+                                model: self.view.model,
+                                field_name: self.name,
+                                object_id: self.view.datarecord.id
+                            },
+                        }).done(function(data) {
+                            if (! data.url) {
+                                self.set("configured", false);
+                            } else {
+                                self.set("value", data.url);
+                            }
+                        });
                     }
-                });
-            }
-            this.$('.oe_pad_content').html("");
-            var value = this.get('value');
-            if (this.pad_loading_request) {
-                this.pad_loading_request.abort();
-            }
-            if (_.str.startsWith(value, 'http')) {
-                if (! this.get('effective_readonly')) {
-                    var content = '<iframe width="100%" height="100%" frameborder="0" src="' + value + '?showChat=false&userName=' + this.session.username + '"></iframe>';
-                    this.$('.oe_pad_content').html(content);
-                    this._dirty_flag = true;
-                } else {
-                    this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';
-                    this.pad_loading_request = $.get(value + '/export/html').done(function(data) {
-                        groups = /\<\s*body\s*\>(.*?)\<\s*\/body\s*\>/.exec(data);
-                        data = (groups || []).length >= 2 ? groups[1] : '';
-                        self.$('.oe_pad_content').html('<div class="oe_pad_readonly"><div>');
-                        self.$('.oe_pad_readonly').html(data);
-                    }).fail(function() {
-                        self.$('.oe_pad_content').text('Unable to load pad');
+                    def.then(function() {
+                        value = self.get('value');
+                        if (_.str.startsWith(value, 'http')) {
+                            var content = '<iframe width="100%" height="100%" frameborder="0" src="' + value + '?showChat=false&userName=' + self.session.username + '"></iframe>';
+                            self.$('.oe_pad_content').html(content);
+                            self._dirty_flag = true;
+                        }
+                        else {
+                            self.$('.oe_pad_content').text(value);
+                        }
                     });
                 }
-            }
+            });
         },
     });
 
index b5072f2..e9d83be 100644 (file)
@@ -925,7 +925,7 @@ class share_result_line(osv.osv_memory):
         'login': fields.related('user_id', 'login', string='Login', type='char', size=64, required=True, readonly=True),
         'password': fields.char('Password', size=64, readonly=True),
         'share_url': fields.function(_share_url, string='Share URL', type='char', size=512),
-        'share_wizard_id': fields.many2one('share.wizard', 'Share Wizard', required=True),
+        'share_wizard_id': fields.many2one('share.wizard', 'Share Wizard', required=True, ondelete='cascade'),
         'newly_created': fields.boolean('Newly created', readonly=True),
     }
     _defaults = {
index 72adde4..8a78747 100644 (file)
                     </group>
                     <notebook>
                         <page string="Products">
-                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'picking_type': 'internal'}" options='{"reload_on_button": true}'/>
+                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'picking_type': 'internal'}" options='{"reload_on_button": true}'/>
                             <field name="note" placeholder="Add an internal note..." class="oe_inline"/>
                         </page>
                         <page string="Additional Info">
                     <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Customer" domain="[('customer','=',True)]" />
                 </xpath>
                 <xpath expr="//field[@name='move_lines']" position="replace">
-                    <field name="move_lines" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}" options='{"reload_on_button": true}'/>
+                    <field name="move_lines" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
                 </xpath>
                 <xpath expr="/form/sheet" position="after">
                     <div class="oe_chatter">
                     <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Supplier" domain="[('supplier','=',True)]" context="{'default_supplier':1,'default_customer':0}"/>
                 </xpath>
                 <xpath expr="//field[@name='move_lines']" position="replace">
-                    <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}" options='{"reload_on_button": true}'/>
+                    <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
                 </xpath>
                 <xpath expr="/form/sheet" position="after">
                     <div class="oe_chatter">
index 04b0229..ee24c48 100644 (file)
@@ -880,6 +880,10 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
                             sign = -1;
                             field = field.slice(1);
                         }
+                        //m2o should be searched based on value[1] not based whole value(i.e. [id, value])
+                        if(_.isArray(a[field]) && a[field].length == 2 && _.isString(a[field][1])){
+                            return sign * compare(a[field][1], b[field][1]);
+                        }
                         return sign * compare(a[field], b[field]);
                     }, 0);
                 });
index 04b3c4e..b3e5aff 100644 (file)
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: openobject-server\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 "POT-Creation-Date: 2013-06-07 19:35+0000\n"
-"PO-Revision-Date: 2014-03-07 12:12+0000\n"
+"PO-Revision-Date: 2014-03-13 08:48+0000\n"
 "Last-Translator: Erwin van der Ploeg (BAS Solutions) <Unknown>\n"
 "Language-Team: Dutch <nl@li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2014-03-08 06:53+0000\n"
-"X-Generator: Launchpad (build 16948)\n"
+"X-Launchpad-Export-Date: 2014-03-14 06:58+0000\n"
+"X-Generator: Launchpad (build 16963)\n"
 
 #. module: base
 #: model:ir.module.module,description:base.module_account_check_writing
@@ -14768,7 +14768,7 @@ msgstr "Luxemburg"
 #. module: base
 #: view:res.partner:0
 msgid "(edit company address)"
-msgstr "(bijwerken adres bedrijf)"
+msgstr "(bijwerken bedrijfsadres)"
 
 #. module: base
 #: model:ir.module.module,summary:base.module_base_calendar
index 5812460..5ebe9a5 100644 (file)
@@ -50,15 +50,21 @@ class change_password_wizard(osv.TransientModel):
 
     def change_password_button(self, cr, uid, id, context=None):
         wizard = self.browse(cr, uid, id, context=context)[0]
-        user_ids = []
-        for user in wizard.user_ids:
-            user_ids.append(user.id)
-        self.pool.get('change.password.user').change_password_button(cr, uid, user_ids, context=context)
+        need_reload = any(uid == user.user_id.id for user in wizard.user_ids)
+        line_ids = [user.id for user in wizard.user_ids]
+
+        self.pool.get('change.password.user').change_password_button(cr, uid, line_ids, context=context)
         # don't keep temporary password copies in the database longer than necessary
-        self.pool.get('change.password.user').unlink(cr, uid, user_ids)
-        return {
-            'type': 'ir.actions.act_window_close',
-        }
+        self.pool.get('change.password.user').write(cr, uid, line_ids, {'new_passwd': False}, context=context)
+
+        if need_reload:
+            return {
+                'type': 'ir.actions.client',
+                'tag': 'reload'
+            }
+
+        return {'type': 'ir.actions.act_window_close'}
+
 
 class change_password_user(osv.TransientModel):
     """
index d96449c..6e477f3 100644 (file)
@@ -2,7 +2,7 @@
 ##############################################################################
 #
 #    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>)
+#    Copyright (C) 2004-2014 OpenERP SA (<http://www.openerp.com>)
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU Affero General Public License as
@@ -149,7 +149,13 @@ class ColoredFormatter(DBFormatter):
         record.levelname = COLOR_PATTERN % (30 + fg_color, 40 + bg_color, record.levelname)
         return DBFormatter.format(self, record)
 
+_logger_init = False
 def init_logger():
+    global _logger_init
+    if _logger_init:
+        return
+    _logger_init = True
+
     from tools.translate import resetlocale
     resetlocale()
 
@@ -197,6 +203,8 @@ def init_logger():
         formatter = DBFormatter(format)
     handler.setFormatter(formatter)
 
+    logging.getLogger().addHandler(handler)
+
     # Configure handlers
     default_config = [
         'openerp.netsvc.rpc.request:INFO',
@@ -233,11 +241,7 @@ def init_logger():
         loggername, level = logconfig_item.split(':')
         level = getattr(logging, level, logging.INFO)
         logger = logging.getLogger(loggername)
-        logger.handlers = []
         logger.setLevel(level)
-        logger.addHandler(handler)
-        if loggername != '':
-            logger.propagate = False
 
     for logconfig_item in default_config + pseudo_config + logconfig:
         _logger.debug('logger level set: "%s"', logconfig_item)