Skip to content

Commit bdc4dd4

Browse files
committed
[MERGE] forward port of branch 7.0 up to 95cff0b
2 parents 9c5ecd3 + 95cff0b commit bdc4dd4

File tree

10 files changed

+19
-20
lines changed

10 files changed

+19
-20
lines changed

addons/base_action_rule/base_action_rule.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ def _wrap_create(self, old_create, model):
156156
""" Return a wrapper around `old_create` calling both `old_create` and
157157
`_process`, in that order.
158158
"""
159-
def create(cr, uid, vals, context=None):
159+
def create(cr, uid, vals, context=None, **kwargs):
160160
# avoid loops or cascading actions
161161
if context and context.get('action'):
162162
return old_create(cr, uid, vals, context=context)
163163

164164
context = dict(context or {}, action=True)
165-
new_id = old_create(cr, uid, vals, context=context)
165+
new_id = old_create(cr, uid, vals, context=context, **kwargs)
166166

167167
# retrieve the action rules to run on creation
168168
action_dom = [('model', '=', model), ('kind', 'in', ['on_create', 'on_create_or_write'])]
@@ -180,10 +180,10 @@ def _wrap_write(self, old_write, model):
180180
""" Return a wrapper around `old_write` calling both `old_write` and
181181
`_process`, in that order.
182182
"""
183-
def write(cr, uid, ids, vals, context=None):
183+
def write(cr, uid, ids, vals, context=None, **kwargs):
184184
# avoid loops or cascading actions
185185
if context and context.get('action'):
186-
return old_write(cr, uid, ids, vals, context=context)
186+
return old_write(cr, uid, ids, vals, context=context, **kwargs)
187187

188188
context = dict(context or {}, action=True)
189189
ids = [ids] if isinstance(ids, (int, long, str)) else ids
@@ -199,7 +199,7 @@ def write(cr, uid, ids, vals, context=None):
199199
pre_ids[action] = self._filter(cr, uid, action, action.filter_pre_id, ids, context=context)
200200

201201
# execute write
202-
old_write(cr, uid, ids, vals, context=context)
202+
old_write(cr, uid, ids, vals, context=context, **kwargs)
203203

204204
# check postconditions, and execute actions on the records that satisfy them
205205
for action in actions:

addons/hr_timesheet_sheet/static/src/js/timesheet.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ openerp.hr_timesheet_sheet = function(instance) {
77
events: {
88
"click .oe_timesheet_weekly_account a": "go_to",
99
},
10+
ignore_fields: function() {
11+
return ['line_id'];
12+
},
1013
init: function() {
1114
this._super.apply(this, arguments);
1215
var self = this;
@@ -323,11 +326,8 @@ openerp.hr_timesheet_sheet = function(instance) {
323326
generate_o2m_value: function() {
324327
var self = this;
325328
var ops = [];
326-
329+
var ignored_fields = self.ignore_fields();
327330
_.each(self.accounts, function(account) {
328-
var auth_keys = _.extend(_.clone(account.account_defaults), {
329-
name: true, amount:true, unit_amount: true, date: true, account_id:true,
330-
});
331331
_.each(account.days, function(day) {
332332
_.each(day.lines, function(line) {
333333
if (line.unit_amount !== 0) {
@@ -338,12 +338,8 @@ openerp.hr_timesheet_sheet = function(instance) {
338338
tmp[k] = v[0];
339339
}
340340
});
341-
// we have to remove some keys, because analytic lines are shitty
342-
_.each(_.keys(tmp), function(key) {
343-
if (auth_keys[key] === undefined) {
344-
tmp[key] = undefined;
345-
}
346-
});
341+
// we remove line_id as the reference to the _inherits field will no longer exists
342+
tmp = _.omit(tmp, ignored_fields);
347343
ops.push(tmp);
348344
}
349345
});

addons/l10n_be_coda/l10n_be_coda.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def write(self, cr, uid, ids, vals, context=None):
5656
"""
5757
Same as create function above, but for write function
5858
"""
59-
if 'partner_id' in vals:
59+
if vals.get('partner_id'):
6060
for line in self.pool.get('account.bank.statement.line').browse(cr, uid, ids, context=context):
6161
if line.coda_account_number:
6262
acc_number_ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', line.coda_account_number)])

addons/l10n_fr_hr_payroll/report/fiche_paye.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class fiche_paye_parser(report_sxw.rml_parse):
2929
def __init__(self, cr, uid, name, context):
3030
super(fiche_paye_parser, self).__init__(cr, uid, name, context)
3131
self.localcontext.update({
32+
'lang': "fr_FR",
3233
'get_payslip_lines': self.get_payslip_lines,
3334
'get_total_by_rule_category': self.get_total_by_rule_category,
3435
'get_employer_line': self.get_employer_line,
Binary file not shown.
Binary file not shown.

addons/web/static/src/js/view_list.js

+1
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
16051605
.filter(function (column) { return column.tag === 'field';})
16061606
.pluck('name').value(),
16071607
function (groups) {
1608+
self.view.$pager.hide();
16081609
$el[0].appendChild(
16091610
self.render_groups(groups));
16101611
if (post_render) { post_render(); }

addons/web/static/src/js/views.js

-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ instance.web.ViewManager = instance.web.Widget.extend({
620620
var view_promise;
621621
var form = this.views['form'];
622622
if (!view || (form && form.controller && !form.controller.can_be_discarded())) {
623-
self.trigger('switch_mode', view_type, no_store, view_options);
624623
return $.Deferred().reject();
625624
}
626625
if (!no_store) {

openerp/modules/loading.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def _load_data(cr, module_name, idref, mode, kind):
201201
# Set new modules and dependencies
202202
modobj.write(cr, SUPERUSER_ID, [module_id], {'state': 'installed', 'latest_version': ver})
203203
# Update translations for all installed languages
204-
modobj.update_translations(cr, SUPERUSER_ID, [module_id], None)
204+
modobj.update_translations(cr, SUPERUSER_ID, [module_id], None, {'overwrite': openerp.tools.config["overwrite_existing_translations"]})
205205

206206
package.state = 'installed'
207207
for kind in ('init', 'demo', 'update'):

openerp/report/report_sxw.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ def setLang(self, lang):
241241
def _get_lang_dict(self):
242242
pool_lang = self.pool['res.lang']
243243
lang = self.localcontext.get('lang', 'en_US') or 'en_US'
244-
lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])[0]
245-
lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids)
244+
lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])
245+
if not lang_ids:
246+
lang_ids = pool_lang.search(self.cr,self.uid,[('code','=','en_US')])
247+
lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids[0])
246248
self.lang_dict.update({'lang_obj':lang_obj,'date_format':lang_obj.date_format,'time_format':lang_obj.time_format})
247249
self.default_lang[lang] = self.lang_dict.copy()
248250
return True

0 commit comments

Comments
 (0)