diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 095d461ff3b..2dc7f96768f 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -304,7 +304,7 @@ class account_bank_statement(osv.osv): 'date': st_line.date, 'ref': st_line.ref, 'move_id': move_id, - 'partner_id': partner_id, + 'partner_id': par_id, 'account_id': acc_id, 'credit': credit, 'debit': debit, diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index d1b19910365..4ddeaf2f3b4 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2537,7 +2537,7 @@ action = pool.get('res.config').next(cr, uid, [], context)
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index 1353efca1f5..d87e4d04a0c 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -92,14 +92,14 @@ class account_move_journal(osv.osv_memory): journal = False if journal_id: - journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name'] + journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).name journal_string = _("Journal: %s") % tools.ustr(journal) else: journal_string = _("Journal: All") period = False if period_id: - period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name'] + period = period_pool.browse(cr, uid, period_id, context=context).name period_string = _("Period: %s") % tools.ustr(period) open_string = _("Open") diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 47e168a12b8..6b6db168a4f 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -64,11 +64,13 @@ class ir_model_fields_anonymization(osv.osv): state = 'anonymized' # all fields are anonymized else: state = 'unstable' # fields are mixed: this should be fixed + return state def _check_write(self, cr, uid, context=None): # check that the field is created from the menu and not from an database update # otherwise the database update can crash: + if context.get('manual'): global_state = self._get_global_state(cr, uid, context=context) if global_state == 'anonymized': @@ -100,12 +102,16 @@ class ir_model_fields_anonymization(osv.osv): # check field state: all should be clear before we can add a new field to anonymize: self._check_write(cr, uid, context=context) + global_state = self._get_global_state(cr, uid, context=context) + if 'field_name' in vals and vals['field_name'] and 'model_name' in vals and vals['model_name']: vals['model_id'], vals['field_id'] = self._get_model_and_field_ids(cr, uid, vals, context=context) # check not existing fields: if not vals.get('field_id'): vals['state'] = 'not_existing' + else: + vals['state'] = global_state res = super(ir_model_fields_anonymization, self).create(cr, uid, vals, context=context) @@ -340,8 +346,9 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): # remove the placeholer: eview.remove(placeholder) else: - # unstable ? - raise + msg = "The database anonymization is currently in an unstable state. Some fields are anonymized," + \ + " while some fields are not anonymized. You should try to solve this problem before trying to do anything else." + raise osv.except_osv('Error !', msg) res['arch'] = etree.tostring(eview) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 53b252d6379..f3638b421fd 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -101,7 +101,7 @@
- +