diff --git a/addons/account/account.py b/addons/account/account.py index 1a44e480e03..529cbf96623 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1384,6 +1384,7 @@ class account_move(osv.osv): 'ref':False, 'balance':False, 'account_tax_id':False, + 'statement_id': False, }) if 'journal_id' in vals and vals.get('journal_id', False): @@ -1420,6 +1421,7 @@ class account_move(osv.osv): context = {} if context is None else context.copy() default.update({ 'state':'draft', + 'ref': False, 'name':'/', }) context.update({ @@ -3401,7 +3403,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): try: tmp2 = obj_data.get_object_reference(cr, uid, *ref) if tmp2: - self.pool.get(tmp2[0]).write(cr, uid, tmp2[1], { + self.pool[tmp2[0]].write(cr, uid, tmp2[1], { 'currency_id': obj_wizard.currency_id.id }) except ValueError, e: diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 222a0bebbb4..4feee980ae5 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -313,7 +313,7 @@ class account_invoice(osv.osv): context = {} if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']: - partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0] + partner = self.pool[context['active_model']].read(cr, uid, context['active_ids'], ['supplier','customer'])[0] if not view_type: view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')]) view_type = 'tree' @@ -367,18 +367,6 @@ class account_invoice(osv.osv): context['view_id'] = view_id return context - def create(self, cr, uid, vals, context=None): - if context is None: - context = {} - try: - return super(account_invoice, self).create(cr, uid, vals, context) - except Exception, e: - if '"journal_id" viol' in e.args[0]: - raise orm.except_orm(_('Configuration Error!'), - _('There is no Sale/Purchase Journal(s) defined.')) - else: - raise orm.except_orm(_('Unknown Error!'), str(e)) - def invoice_print(self, cr, uid, ids, context=None): ''' This function prints the invoice and mark it as sent, so that we can see more easily the next step of the workflow diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py index 49178dfd3ea..810d101eefd 100644 --- a/addons/account/wizard/pos_box.py +++ b/addons/account/wizard/pos_box.py @@ -21,7 +21,7 @@ class CashBox(osv.osv_memory): active_model = context.get('active_model', False) or False active_ids = context.get('active_ids', []) or [] - records = self.pool.get(active_model).browse(cr, uid, active_ids, context=context) + records = self.pool[active_model].browse(cr, uid, active_ids, context=context) return self._run(cr, uid, ids, records, context=None) diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 5834db99cd3..40a227d8ceb 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -40,10 +40,10 @@ class one2many_mod2(fields.one2many): plan = journal.plan_id if plan and len(plan.plan_ids) > pnum: acc_id = plan.plan_ids[pnum].root_analytic_id.id - ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids),('analytic_account_id','child_of',[acc_id])], limit=self._limit) + ids2 = obj.pool[self._obj].search(cr, user, [(self._fields_id,'in',ids),('analytic_account_id','child_of',[acc_id])], limit=self._limit) if ids2 is None: - ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids)], limit=self._limit) - for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'): + ids2 = obj.pool[self._obj].search(cr, user, [(self._fields_id,'in',ids)], limit=self._limit) + for r in obj.pool[self._obj]._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'): res[r[self._fields_id]].append( r['id'] ) return res diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml index 3dcbcda6952..be46b9a6923 100644 --- a/addons/account_analytic_plans/account_analytic_plans_view.xml +++ b/addons/account_analytic_plans/account_analytic_plans_view.xml @@ -64,30 +64,6 @@ - - - - account.invoice.line.form.inherit - account.invoice.line - - - - - - - - - - account.invoice.supplier.form.inherit - account.invoice - - 2 - - - - - - diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 5a22a888772..c35e1c4e807 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -80,7 +80,7 @@ class account_asset_asset(osv.osv): for asset in self.browse(cr, uid, ids, context=context): if asset.account_move_line_ids: raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.')) - return super(account_account, self).unlink(cr, uid, ids, context=context) + return super(account_asset_asset, self).unlink(cr, uid, ids, context=context) def _get_period(self, cr, uid, context=None): periods = self.pool.get('account.period').find(cr, uid) diff --git a/addons/account_check_writing/i18n/hu.po b/addons/account_check_writing/i18n/hu.po new file mode 100644 index 00000000000..528cb4fed60 --- /dev/null +++ b/addons/account_check_writing/i18n/hu.po @@ -0,0 +1,247 @@ +# Hungarian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-11 22:57+0000\n" +"Last-Translator: krnkris \n" +"Language-Team: Hungarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-12 05:21+0000\n" +"X-Generator: Launchpad (build 16564)\n" + +#. module: account_check_writing +#: selection:res.company,check_layout:0 +msgid "Check on Top" +msgstr "Fennt lévő csekk" + +#. module: account_check_writing +#: report:account.print.check.top:0 +msgid "Open Balance" +msgstr "Nyitó egyenleg" + +#. module: account_check_writing +#: view:account.check.write:0 +#: view:account.voucher:0 +msgid "Print Check" +msgstr "Csekk nyomtatása" + +#. module: account_check_writing +#: selection:res.company,check_layout:0 +msgid "Check in middle" +msgstr "Középen lévő csekk" + +#. module: account_check_writing +#: help:res.company,check_layout:0 +msgid "" +"Check on top is compatible with Quicken, QuickBooks and Microsoft Money. " +"Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on " +"bottom is compatible with Peachtree, ACCPAC and DacEasy only" +msgstr "" +"Fennt lévő csekk kompatibilis a Quicken, QuickBooks és Microsoft Money " +"csekkekekl. A középen lévő csekkek kompatibilisek a Peachtree, ACCPAC és " +"DacEasy csekkekel. Az alul lévő csekkek kompatibilisek a Peachtree, ACCPAC " +"és DacEasy only csekkekel." + +#. module: account_check_writing +#: selection:res.company,check_layout:0 +msgid "Check on bottom" +msgstr "Alul lévő csekkek" + +#. module: account_check_writing +#: model:ir.actions.act_window,name:account_check_writing.action_account_check_write +msgid "Print Check in Batch" +msgstr "Csekkek kötegelt nyomtatása" + +#. module: account_check_writing +#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59 +#, python-format +msgid "One of the printed check already got a number." +msgstr "Egyik, már kinyomtatott csekk már el van látva számmal." + +#. module: account_check_writing +#: help:account.journal,allow_check_writing:0 +msgid "Check this if the journal is to be used for writing checks." +msgstr "Jelölje be ezt, ha naplót csekkírásra használja." + +#. module: account_check_writing +#: field:account.journal,allow_check_writing:0 +msgid "Allow Check writing" +msgstr "Csekk írás engedélyezése." + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Description" +msgstr "Leírás" + +#. module: account_check_writing +#: model:ir.model,name:account_check_writing.model_account_journal +msgid "Journal" +msgstr "Napló" + +#. module: account_check_writing +#: model:ir.actions.act_window,name:account_check_writing.action_write_check +#: model:ir.ui.menu,name:account_check_writing.menu_action_write_check +msgid "Write Checks" +msgstr "Csekkek írása" + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Discount" +msgstr "Kedvezmény" + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Original Amount" +msgstr "Eredeti összeg" + +#. module: account_check_writing +#: field:res.company,check_layout:0 +msgid "Check Layout" +msgstr "Csekk elrendezése" + +#. module: account_check_writing +#: field:account.voucher,allow_check:0 +msgid "Allow Check Writing" +msgstr "Csekk írás engedélyezése" + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Payment" +msgstr "Kifizetés" + +#. module: account_check_writing +#: field:account.journal,use_preprint_check:0 +msgid "Use Preprinted Check" +msgstr "Előre nyomtatott csekk használata" + +#. module: account_check_writing +#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom +msgid "Print Check (Bottom)" +msgstr "Csekk nyomtatás (Alsó)" + +#. module: account_check_writing +#: model:ir.actions.act_window,help:account_check_writing.action_write_check +msgid "" +"

\n" +" Click to create a new check. \n" +"

\n" +" The check payment form allows you to track the payment you " +"do\n" +" to your suppliers using checks. When you select a supplier, " +"the\n" +" payment method and an amount for the payment, OpenERP will\n" +" propose to reconcile your payment with the open supplier\n" +" invoices or bills.\n" +"

\n" +" " +msgstr "" +"

\n" +" Kattintson új csekk létrehozásához. \n" +"

\n" +" A csekk kifizetési lap lehetővé teszi a beszállítókhoz " +"történt \n" +" csekken történt kifizetések nyomon követését. Ha kiválaszt " +"egy beszállítót,\n" +" a fizetési módot és az összeget, OpenERP javasolni fogja \n" +" a fizetés összeegyeztetését a még nyitott beszállítói " +"számlákkal és\n" +" fizetésekkel.\n" +"

\n" +" " + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Due Date" +msgstr "Fizetési határidő" + +#. module: account_check_writing +#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle +msgid "Print Check (Middle)" +msgstr "Csekk nyomtatás (Középső)" + +#. module: account_check_writing +#: model:ir.model,name:account_check_writing.model_res_company +msgid "Companies" +msgstr "Vállalatok" + +#. module: account_check_writing +#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59 +#, python-format +msgid "Error!" +msgstr "Hiba!" + +#. module: account_check_writing +#: help:account.check.write,check_number:0 +msgid "The number of the next check number to be printed." +msgstr "A következő csekkszám nyomtatása" + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +msgid "Balance Due" +msgstr "Esedékes egyenleg" + +#. module: account_check_writing +#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top +msgid "Print Check (Top)" +msgstr "Csekk nyomtatás (Felső)" + +#. module: account_check_writing +#: report:account.print.check.bottom:0 +#: report:account.print.check.middle:0 +#: report:account.print.check.top:0 +msgid "Check Amount" +msgstr "Csekk végösszege" + +#. module: account_check_writing +#: model:ir.model,name:account_check_writing.model_account_voucher +msgid "Accounting Voucher" +msgstr "Könyvelési bizonylat" + +#. module: account_check_writing +#: view:account.check.write:0 +msgid "or" +msgstr "vagy" + +#. module: account_check_writing +#: field:account.voucher,amount_in_word:0 +msgid "Amount in Word" +msgstr "Összeg szavakkal" + +#. module: account_check_writing +#: model:ir.model,name:account_check_writing.model_account_check_write +msgid "Prin Check in Batch" +msgstr "Csekk kötegelt nyomtatása" + +#. module: account_check_writing +#: view:account.check.write:0 +msgid "Cancel" +msgstr "Mégse" + +#. module: account_check_writing +#: field:account.check.write,check_number:0 +msgid "Next Check Number" +msgstr "Következő csekk száma" + +#. module: account_check_writing +#: view:account.check.write:0 +msgid "Check" +msgstr "Csekk" diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml index ca2315d81b1..02675baf0b2 100644 --- a/addons/account_payment/report/order.rml +++ b/addons/account_payment/report/order.rml @@ -253,10 +253,10 @@ [[ get_invoice_name(line.ml_inv_ref.id) or '-' ]] - [[line.date=='False' and '-' or formatLang(line.date,date=True) ]] + [[not line.date and '-' or formatLang(line.date,date=True) ]] - [[ formatLang(line.amount or '-', currency_obj=line.company_currency) ]] + [[ formatLang(line.amount or 0.0, currency_obj=line.company_currency) ]] [[ formatLang(line.amount_currency, currency_obj=line.currency) ]] diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 42651acb0c6..ac298713b04 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -171,9 +171,9 @@ class account_analytic_account(osv.osv): return result _columns = { - 'name': fields.char('Account/Contract Name', size=128, required=True), + 'name': fields.char('Account/Contract Name', size=128, required=True, track_visibility='onchange'), 'complete_name': fields.function(_get_full_name, type='char', string='Full Name'), - 'code': fields.char('Reference', select=True), + 'code': fields.char('Reference', select=True, track_visibility='onchange'), 'type': fields.selection([('view','Analytic View'), ('normal','Analytic Account'),('contract','Contract or Project'),('template','Template of Contract')], 'Type of Account', required=True, help="If you select the View Type, it means you won\'t allow to create journal entries using that account.\n"\ "The type 'Analytic account' stands for usual accounts that you only want to use in accounting.\n"\ @@ -191,10 +191,10 @@ class account_analytic_account(osv.osv): 'quantity': fields.function(_debit_credit_bal_qtty, type='float', string='Quantity', multi='debit_credit_bal_qtty'), 'quantity_max': fields.float('Prepaid Service Units', help='Sets the higher limit of time to work on the contract, based on the timesheet. (for instance, number of hours in a limited support contract.)'), 'partner_id': fields.many2one('res.partner', 'Customer'), - 'user_id': fields.many2one('res.users', 'Project Manager'), - 'manager_id': fields.many2one('res.users', 'Account Manager'), + 'user_id': fields.many2one('res.users', 'Project Manager', track_visibility='onchange'), + 'manager_id': fields.many2one('res.users', 'Account Manager', track_visibility='onchange'), 'date_start': fields.date('Start Date'), - 'date': fields.date('End Date', select=True), + 'date': fields.date('End Date', select=True, track_visibility='onchange'), 'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts. 'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'),('pending','To Renew'),('close','Closed'),('cancelled', 'Cancelled')], 'Status', required=True, track_visibility='onchange'), 'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, #the currency_id field is readonly except if it's a view account and if there is no company diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index de46e2e8d03..025f1f79f70 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -411,7 +411,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): model_name = field.model_id.model field_name = field.field_id.name field_type = field.field_id.ttype - table_name = self.pool.get(model_name)._table + table_name = self.pool[model_name]._table # get the current value sql = "select id, %s from %s" % (field_name, table_name) @@ -543,7 +543,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): fixes = group(fixes, ('model_name', 'field_name')) for line in data: - table_name = self.pool.get(line['model_id'])._table if self.pool.get(line['model_id']) else None + table_name = self.pool[line['model_id']]._table if line['model_id'] in self.pool else None # check if custom sql exists: key = (line['model_id'], line['field_id']) diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 811c5387697..159baf3a9e7 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -70,8 +70,7 @@ class audittrail_rule(osv.osv): obj_model = self.pool.get('ir.model.data') #start Loop for thisrule in self.browse(cr, uid, ids): - obj = self.pool.get(thisrule.object_id.model) - if not obj: + if thisrule.object_id.model not in self.pool: raise osv.except_osv( _('WARNING: audittrail is not part of the pool'), _('Change audittrail depends -- Setting rule as DRAFT')) @@ -131,7 +130,7 @@ class audittrail_log(osv.osv): model_object = resname.object_id res_id = resname.res_id if model_object and res_id: - model_pool = self.pool.get(model_object.model) + model_pool = self.pool[model_object.model] res = model_pool.read(cr, uid, res_id, ['name']) data[resname.id] = res['name'] else: @@ -190,7 +189,7 @@ def get_value_text(cr, uid, pool, resource_pool, method, field, value): field_obj = (resource_pool._all_columns.get(field)).column if field_obj._type in ('one2many','many2many'): - data = pool.get(field_obj._obj).name_get(cr, uid, value) + data = pool[field_obj._obj].name_get(cr, uid, value) #return the modifications on x2many fields as a list of names res = map(lambda x:x[1], data) elif field_obj._type == 'many2one': @@ -212,7 +211,7 @@ def create_log_line(cr, uid, log_id, model, lines=None): if lines is None: lines = [] pool = openerp.registry(cr.dbname) - obj_pool = pool.get(model.model) + obj_pool = pool[model.model] model_pool = pool.get('ir.model') field_pool = pool.get('ir.model.fields') log_line_pool = pool.get('audittrail.log.line') @@ -251,7 +250,7 @@ def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw): @return: Returns result as per method of Object proxy """ pool = openerp.registry(cr.dbname) - resource_pool = pool.get(model) + resource_pool = pool[model] model_pool = pool.get('ir.model') model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)]) model_id = model_ids and model_ids[0] or False @@ -321,7 +320,7 @@ def get_data(cr, uid, pool, res_ids, model, method): } """ data = {} - resource_pool = pool.get(model.model) + resource_pool = pool[model.model] # read all the fields of the given resources in super admin mode for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids): values = {} @@ -390,7 +389,7 @@ def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_v key: [] } # loop on all the fields - for field_name, field_definition in pool.get(model.model)._all_columns.items(): + for field_name, field_definition in pool[model.model]._all_columns.items(): if field_name in ('__last_update', 'id'): continue #if the field_list param is given, skip all the fields not in that list @@ -457,7 +456,7 @@ def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_val # if at least one modification has been found for model_id, resource_id in lines: - name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1] + name = pool[model.model].name_get(cr, uid, [resource_id])[0][1] vals = { 'method': method, 'object_id': model_id, diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 62c808ed556..9d7d4d34ac4 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -96,7 +96,7 @@ class base_action_rule(osv.osv): """ filter the list record_ids that satisfy the action filter """ if record_ids and action_filter: assert action.model == action_filter.model_id, "Filter model different from action rule model" - model = self.pool.get(action_filter.model_id) + model = self.pool[action_filter.model_id] domain = [('id', 'in', record_ids)] + eval(action_filter.domain) ctx = dict(context or {}) ctx.update(eval(action_filter.context)) @@ -106,7 +106,7 @@ class base_action_rule(osv.osv): def _process(self, cr, uid, action, record_ids, context=None): """ process the given action on the records """ # execute server actions - model = self.pool.get(action.model_id.model) + model = self.pool[action.model_id.model] if action.server_action_ids: server_action_ids = map(int, action.server_action_ids) for record in model.browse(cr, uid, record_ids, context): @@ -195,7 +195,7 @@ class base_action_rule(osv.osv): ids = self.search(cr, SUPERUSER_ID, []) for action_rule in self.browse(cr, SUPERUSER_ID, ids): model = action_rule.model_id.model - model_obj = self.pool.get(model) + model_obj = self.pool[model] if not hasattr(model_obj, 'base_action_ruled'): model_obj.create = self._wrap_create(model_obj.create, model) model_obj.write = self._wrap_write(model_obj.write, model) @@ -232,7 +232,7 @@ class base_action_rule(osv.osv): last_run = get_datetime(action.last_run) if action.last_run else False # retrieve all the records that satisfy the action's condition - model = self.pool.get(action.model_id.model) + model = self.pool[action.model_id.model] domain = [] ctx = dict(context) if action.filter_id: diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index ca75c9e20fc..9dac1c4d262 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -591,7 +591,7 @@ property or property parameter."), for vals in self.browse(cr, uid, ids, context=context): if vals.ref and vals.ref.user_id: - mod_obj = self.pool.get(vals.ref._name) + mod_obj = self.pool[vals.ref._name] res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context) defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']} mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context) @@ -684,7 +684,7 @@ true, it will allow you to hide the event alarm information without removing it. ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] - model_obj = self.pool.get(model) + model_obj = self.pool[model] for data in model_obj.browse(cr, uid, ids, context=context): basic_alarm = data.alarm_id @@ -754,7 +754,7 @@ true, it will allow you to hide the event alarm information without removing it. alarm_obj = self.pool.get('calendar.alarm') ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] - model_obj = self.pool.get(model) + model_obj = self.pool[model] for data in model_obj.browse(cr, uid, ids, context=context): alarm_ids = alarm_obj.search(cr, uid, [('model_id', '=', model_id), ('res_id', '=', data.id)]) if alarm_ids: @@ -853,13 +853,15 @@ class calendar_alarm(osv.osv): for alarm in self.browse(cr, uid, alarm_ids, context=context): next_trigger_date = None update_vals = {} - model_obj = self.pool.get(alarm.model_id.model) + model_obj = self.pool[alarm.model_id.model] res_obj = model_obj.browse(cr, uid, alarm.res_id, context=context) re_dates = [] if hasattr(res_obj, 'rrule') and res_obj.rrule: event_date = datetime.strptime(res_obj.date, '%Y-%m-%d %H:%M:%S') - recurrent_dates = get_recurrent_dates(res_obj.rrule, res_obj.exdate, event_date, res_obj.exrule) + #exdate is a string and we need a list + exdate = res_obj.exdate and res_obj.exdate.split(',') or [] + recurrent_dates = get_recurrent_dates(res_obj.rrule, exdate, event_date, res_obj.exrule) trigger_interval = alarm.trigger_interval if trigger_interval == 'days': diff --git a/addons/base_calendar/base_calendar_data.xml b/addons/base_calendar/base_calendar_data.xml index 727a0703db2..64aa7ba59b6 100644 --- a/addons/base_calendar/base_calendar_data.xml +++ b/addons/base_calendar/base_calendar_data.xml @@ -126,7 +126,7 @@ Run Event Reminder - 1 + 5 minutes -1 diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 6010f5ccfca..aa476002abc 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -135,7 +135,7 @@ class mail_message(osv.osv): def _find_allowed_model_wise(self, cr, uid, doc_model, doc_dict, context=None): if doc_model == 'crm.meeting': - for virtual_id in self.pool.get(doc_model).get_recurrent_ids(cr, uid, doc_dict.keys(), [], context=context): + for virtual_id in self.pool[doc_model].get_recurrent_ids(cr, uid, doc_dict.keys(), [], context=context): doc_dict.setdefault(virtual_id, doc_dict[get_real_ids(virtual_id)]) return super(mail_message, self)._find_allowed_model_wise(cr, uid, doc_model, doc_dict, context=context) diff --git a/addons/base_report_designer/openerp_sxw2rml/normalized_odt2rml.xsl b/addons/base_report_designer/openerp_sxw2rml/normalized_odt2rml.xsl index 50ffb3d81be..9f9e5050d69 100644 --- a/addons/base_report_designer/openerp_sxw2rml/normalized_odt2rml.xsl +++ b/addons/base_report_designer/openerp_sxw2rml/normalized_odt2rml.xsl @@ -414,7 +414,7 @@ - . + diff --git a/addons/base_report_designer/openerp_sxw2rml/normalized_oo2rml.xsl b/addons/base_report_designer/openerp_sxw2rml/normalized_oo2rml.xsl index 66ef0b5b53c..ae68ae1ed1b 100644 --- a/addons/base_report_designer/openerp_sxw2rml/normalized_oo2rml.xsl +++ b/addons/base_report_designer/openerp_sxw2rml/normalized_oo2rml.xsl @@ -414,7 +414,7 @@ - . + diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 6d195fec383..2361f12d61b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -92,15 +92,6 @@ class crm_lead(base_stage, format_address, osv.osv): context['empty_list_help_document_name'] = _("leads") return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context) - def onchange_user_id(self, cr, uid, ids, section_id, user_id, context=None): - """ When changing the user, also set a section_id or restrict section id - to the ones user_id is member of. """ - if user_id: - section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context) - if len(section_ids) > 0 and section_id not in section_ids: - section_id = section_ids[0] - return {'value': {'section_id': section_id}} - def create(self, cr, uid, vals, context=None): if context is None: context = {} @@ -372,6 +363,16 @@ class crm_lead(base_stage, format_address, osv.osv): } return {'value' : values} + def on_change_user(self, cr, uid, ids, user_id, context=None): + """ When changing the user, also set a section_id or restrict section id + to the ones user_id is member of. """ + section_id = False + if user_id: + section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context) + if section_ids: + section_id = section_ids[0] + return {'value': {'section_id': section_id}} + def _check(self, cr, uid, ids=False, context=None): """ Override of the base.stage method. Function called by the scheduler to process cases for date actions diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 3001e8b1d88..d94683f895f 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -152,7 +152,7 @@ --> -