[MERGE]: Merge with lp:trunk-fix-osvmem-read

bzr revid: aag@tinyerp.co.in-20110214100809-plgvq13mbh3s5hm2
This commit is contained in:
aag (OpenERP)
2011-02-14 15:38:09 +05:30
parent b9fb0a7ff9
commit 0e219e879f
33 changed files with 79 additions and 54 deletions
+2 -3
View File
@@ -7,14 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-02-11 22:50+0000\n"
"PO-Revision-Date: 2011-02-10 00:58+0000\n"
"Last-Translator: Emerson <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-12 05:00+0000\n"
"X-Generator: Launchpad (build 12351)\n"
"X-Launchpad-Export-Date: 2011-02-10 04:35+0000\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
+2
View File
@@ -71,6 +71,8 @@ class account_balance(report_sxw.rml_parse, common_report_header):
def lines(self, form, ids=[], done=None):#, level=1):
def _process_child(accounts, disp_acc, parent):
account_rec = [acct for acct in accounts if acct['id']==parent][0]
if isinstance(account_rec['parent_id'], tuple):
account_rec['parent_id'] = account_rec['parent_id'][0]
currency_obj = self.pool.get('res.currency')
acc_id = self.pool.get('account.account').browse(self.cr, self.uid, account_rec['id'])
currency = acc_id.currency_id and acc_id.currency_id or acc_id.company_id.currency_id
@@ -148,7 +148,7 @@ class account_move_journal(osv.osv_memory):
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
target_move = self.read(cr, uid, ids, [])[0]['target_move']
target_move = self.read(cr, uid, ids, [], context=context)[0]['target_move']
name = _("Journal Items")
if journal_id:
@@ -35,6 +35,8 @@ class account_open_closed_fiscalyear(osv.osv_memory):
move_obj = self.pool.get('account.move')
data = self.read(cr, uid, ids, [], context=context)[0]
if isinstance(data['fyear_id'], tuple):
data['fyear_id'] = data['fyear_id'][0]
data_fyear = fy_obj.browse(cr, uid, data['fyear_id'], context=context)
if not data_fyear.end_journal_period_id:
raise osv.except_osv(_('Error !'), _('No End of year journal defined for the fiscal year'))
@@ -65,7 +65,8 @@ class account_bs_report(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
record = self.browse(cr, uid, ids, context=context)[0]
data['form'].update({'display_type':record.display_type, 'reserve_account_id':record.reserve_account_id.id})
if not data['form']['reserve_account_id']:
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
data = self.pre_print_report(cr, uid, ids, data, context=context)
@@ -131,7 +131,10 @@ class account_common_report(osv.osv_memory):
data = {}
data['ids'] = context.get('active_ids', [])
data['model'] = context.get('active_model', 'ir.ui.menu')
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'])[0]
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'], context=context)[0]
for field in data['form'].keys():
if isinstance(data['form'][field], tuple):
data['form'][field] = data['form'][field][0]
used_context = self._build_contexts(cr, uid, ids, data, context=context)
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
data['form']['used_context'] = used_context
@@ -50,7 +50,7 @@ class account_report_general_ledger(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'], context=context)[0])
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
data['form'].update({'initial_balance': False})
if data['form']['landscape']:
@@ -42,7 +42,7 @@ class account_partner_balance(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
data['form'].update(self.read(cr, uid, ids, ['display_partner'], context=context)[0])
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.partner.balance',
@@ -47,7 +47,7 @@ class account_partner_ledger(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'], context=context)[0])
if data['form']['page_split']:
return {
'type': 'ir.actions.report.xml',
@@ -42,7 +42,7 @@ class account_pl_report(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
data['form'].update(self.read(cr, uid, ids, ['display_type'], context=context)[0])
if data['form']['display_type']:
return {
'type': 'ir.actions.report.xml',
@@ -34,6 +34,9 @@ class validate_account_move(osv.osv_memory):
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)[0]
for field in data.keys():
if isinstance(data[field], tuple):
data[field] = data[field][0]
ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])])
if not ids_move:
raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
+3
View File
@@ -47,6 +47,9 @@ class account_vat_declaration(osv.osv_memory):
datas = {'ids': context.get('active_ids', [])}
datas['model'] = 'account.tax.code'
datas['form'] = self.read(cr, uid, ids)[0]
for field in datas['form'].keys():
if isinstance(datas['form'][field], tuple):
datas['form'][field] = datas['form'][field][0]
datas['form']['company_id'] = self.pool.get('account.tax.code').browse(cr, uid, [datas['form']['chart_tax_id']], context=context)[0].company_id.id
return {
'type': 'ir.actions.report.xml',
+3 -3
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-02-10 13:27+0000\n"
"PO-Revision-Date: 2011-02-09 12:16+0000\n"
"Last-Translator: NOVOTRADE RENDSZERHÁZ <openerp@novotrade.hu>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-11 04:59+0000\n"
"X-Launchpad-Export-Date: 2011-02-10 04:35+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#. module: account_invoice_layout
@@ -160,7 +160,7 @@ msgstr "Megadja a számlasorok listázási sorrendjét."
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Price"
msgstr "Nettó érték"
msgstr "Érték"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
+5 -5
View File
@@ -42,14 +42,14 @@ class auction_pay_sel(osv.osv_memory):
@param context: A standard dictionary
@return:
"""
if context is None:
if context is None:
context = {}
lot = self.pool.get('auction.lots').browse(cr, uid, context['active_id'], context=context)
invoice_obj = self.pool.get('account.invoice')
for datas in self.read(cr, uid, ids, context=context):
account_id = datas.get('writeoff_acc_id', False)
period_id = datas.get('period_id', False)
journal_id = datas.get('journal_id', False)
for datas in self.browse(cr, uid, ids, context=context):
account_id = datas.dest_account_id and datas.dest_account_id.id or False
period_id = datas.period_id and datas.period_id.id or False
journal_id = datas.journal_id and datas.journal_id.id or False
if lot.sel_inv_id:
p = invoice_obj.pay_and_reconcile(['lot.sel_inv_id.id'], datas['amount'], datas['dest_account_id'], journal_id, account_id, period_id, journal_id, context)
return {'type': 'ir.actions.act_window_close'}
+3 -1
View File
@@ -70,7 +70,9 @@ class board_menu_create(osv.osv_memory):
})
obj_menu = self.pool.get('ir.ui.menu')
#start Loop
for data in self.read(cr, uid, ids):
for data in self.read(cr, uid, ids, context=context):
if isinstance(data['menu_parent_id'], tuple):
data['menu_parent_id'] = data['menu_parent_id'][0]
obj_menu.create(cr, uid, {
'name': data.get('menu_name'),
'parent_id': data.get('menu_parent_id'),
@@ -66,7 +66,7 @@ class email_template_send_wizard(osv.osv_memory):
if not id:
id = context['src_rec_ids'][0]
return get_value(cursor, user, id, message, template, context)
def _get_template(self, cr, uid, context=None):
if context is None:
context = {}
@@ -116,13 +116,13 @@ class email_template_send_wizard(osv.osv_memory):
'to':fields.char('To',size=250,required=True),
'cc':fields.char('CC',size=250,),
'bcc':fields.char('BCC',size=250,),
'reply_to':fields.char('Reply-To',
size=250,
'reply_to':fields.char('Reply-To',
size=250,
help="The address recipients should reply to,"
" if different from the From address."
" Placeholders can be used here."),
'message_id':fields.char('Message-ID',
size=250,
'message_id':fields.char('Message-ID',
size=250,
help="The Message-ID header value, if you need to"
"specify it, for example to automatically recognize the replies later."
" Placeholders can be used here."),
@@ -133,12 +133,12 @@ class email_template_send_wizard(osv.osv_memory):
'signature':fields.boolean('Attach my signature to mail'),
#'filename':fields.text('File Name'),
'requested':fields.integer('No of requested Mails',readonly=True),
'generated':fields.integer('No of generated Mails',readonly=True),
'generated':fields.integer('No of generated Mails',readonly=True),
'full_success':fields.boolean('Complete Success',readonly=True),
'attachment_ids': fields.many2many('ir.attachment','send_wizard_attachment_rel', 'wizard_id', 'attachment_id', 'Attachments'),
}
#FIXME: probably better by overriding default_get directly
#FIXME: probably better by overriding default_get directly
_defaults = {
'state': lambda self,cr,uid,ctx: len(ctx['src_rec_ids']) > 1 and 'multi' or 'single',
'rel_model': lambda self,cr,uid,ctx: self.pool.get('ir.model').search(cr,uid,[('model','=',ctx['src_model'])],context=ctx)[0],
@@ -156,7 +156,7 @@ class email_template_send_wizard(osv.osv_memory):
'reply_to': lambda self,cr,uid,ctx: self._get_template_value(cr, uid, 'reply_to', ctx),
'requested':lambda self,cr,uid,ctx: len(ctx['src_rec_ids']),
'full_success': False,
'attachment_ids': [],
'attachment_ids': [],
}
def fields_get(self, cr, uid, fields=None, context=None, write_access=True):
@@ -200,7 +200,7 @@ class email_template_send_wizard(osv.osv_memory):
else:
raise osv.except_osv(_("Email Template"),_("Email sending failed for one or more objects."))
return True
def save_to_mailbox(self, cr, uid, ids, context=None):
def get_end_value(id, value):
if len(context['src_rec_ids']) > 1: # Multiple Mail: Gets value from the template
@@ -213,7 +213,7 @@ class email_template_send_wizard(osv.osv_memory):
mail_ids = []
template = self._get_template(cr, uid, context)
for id in context['src_rec_ids']:
screen_vals = self.read(cr, uid, ids[0], [],context)
screen_vals = self.read(cr, uid, ids[0], [],context=context)
account = self.pool.get('email_template.account').read(cr, uid, screen_vals['from'], context=context)
vals = {
'email_from': tools.ustr(account['name']) + "<" + tools.ustr(account['email_id']) + ">",
+1 -1
View 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: 2011-02-11 04:59+0000\n"
"X-Launchpad-Export-Date: 2011-02-10 04:35+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#. module: hr_timesheet
@@ -31,7 +31,7 @@ class analytical_timesheet_employee(osv.osv_memory):
'Month', required=True),
'year': fields.integer('Year', required=True),
'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
}
def _get_user(self, cr, uid, context=None):
@@ -50,6 +50,8 @@ class analytical_timesheet_employee(osv.osv_memory):
def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, context=context)[0]
if isinstance(data['employee_id'], tuple):
data['employee_id'] = data['employee_id'][0]
datas = {
'ids': [],
'model': 'hr.employee',
@@ -59,6 +59,9 @@ class final_invoice_create(osv.osv_memory):
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
data = self.read(cr, uid, ids, [], context=context)[0]
if isinstance(data['balance_product'], tuple):
data['balance_product'] = data['balance_product'][0]
account_ids = 'active_ids' in context and context['active_ids'] or []
for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):
+2 -3
View File
@@ -7,14 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
"PO-Revision-Date: 2011-02-11 22:02+0000\n"
"PO-Revision-Date: 2011-02-06 16:11+0000\n"
"Last-Translator: jpdborgna <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-12 05:00+0000\n"
"X-Generator: Launchpad (build 12351)\n"
"X-Launchpad-Export-Date: 2011-02-07 05:19+0000\n"
#. module: mrp
#: field:mrp.production,move_created_ids:0
+2 -2
View File
@@ -70,10 +70,10 @@ class mrp_product_produce(osv.osv_memory):
context = {}
prod_obj = self.pool.get('mrp.production')
move_ids = context.get('active_ids', [])
for data in self.read(cr, uid, ids, context=context):
for data in self.browse(cr, uid, ids, context=context):
for move_id in move_ids:
prod_obj.action_produce(cr, uid, move_id,
data['product_qty'], data['mode'], context=context)
data.product_qty, data.mode, context=context)
return {}
mrp_product_produce()
+1 -1
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
'name': 'Enhanced support for (Ether)Pad attachments',
'version': '1.0.3',
'version': '1.0.2',
'category': 'Generic Modules/Others',
'description': """
Adds enhanced support for (Ether)Pad attachments in the web client, lets the
+1 -1
View File
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-11 04:59+0000\n"
"X-Launchpad-Export-Date: 2011-02-10 04:35+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#. module: point_of_sale
@@ -34,7 +34,9 @@ class backlog_create_task(osv.osv_memory):
document_pool = self.pool.get('ir.attachment')
ids_task = []
data = self.read(cr, uid, ids, [], context=context)[0]
record = self.browse(cr, uid, ids, context=context)[0]
user = record.user_id and record.user_id.id or False
backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context)
result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
id = mod_obj.read(cr, uid, result, ['res_id'])
@@ -45,7 +47,7 @@ class backlog_create_task(osv.osv_memory):
'name': backlog.name,
'description': backlog.note,
'project_id': backlog.project_id.id,
'user_id': data['user_id'] or False,
'user_id': user,
'planned_hours': backlog.expected_hours,
'remaining_hours':backlog.expected_hours,
'sequence':backlog.sequence,
@@ -42,6 +42,9 @@ class backlog_sprint_assign(osv.osv_memory):
if context is None:
context = {}
data = self.read(cr, uid, ids, [], context=context)[0]
if isinstance(data['sprint_id'], tuple):
data['sprint_id'] = data['sprint_id'][0]
for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
backlog_ids.append(backlog.id)
if data['convert_to_task']:
@@ -67,19 +67,18 @@ class purchase_requisition_partner(osv.osv_memory):
context = {}
record_ids = context and context.get('active_ids', False)
if record_ids:
data = self.read(cr, uid, ids)
data = self.browse(cr, uid, ids, context=context)[0]
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
order_obj = self.pool.get('purchase.order')
order_line_obj = self.pool.get('purchase.order.line')
partner_obj = self.pool.get('res.partner')
tender_line_obj = self.pool.get('purchase.requisition.line')
pricelist_obj = self.pool.get('product.pricelist')
prod_obj = self.pool.get('product.product')
tender_obj = self.pool.get('purchase.requisition')
acc_pos_obj = self.pool.get('account.fiscal.position')
partner_id = data[0]['partner_id']
supplier_data = partner_obj.browse(cr, uid, partner_id, context=context)
partner_id = data.partner_id and data.partner_id.id or False
supplier_data = data.partner_id
address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
list_line=[]
+1 -1
View File
@@ -107,7 +107,7 @@ class stock_split_move_line(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
pick_obj = self.pool.get('stock.picking')
pick = pick_obj.browse(cr, uid, record_id, context=context)
data = self.read(cr, uid, ids[0])
data = self.read(cr, uid, ids[0], context=context)
for move in pick.move_lines:
quantity = data['move%s' % move.id]
if 0 < quantity < move.product_qty:
+3 -1
View File
@@ -61,9 +61,11 @@ class survey_browse_answer(osv.osv_memory):
@return : Dictionary value for Open the browse answer wizard.
"""
if context is None: context = {}
record = self.read(cr, uid, ids, [])
record = self.read(cr, uid, ids, [],context=context)
record = record and record[0] or {}
if record['response_id']:
if isinstance(record['response_id'], tuple):
record['response_id'] = record['response_id'][0]
res_id = [(record['response_id'])]
else:
sur_response_obj = self.pool.get('survey.response')
+2 -2
View File
@@ -56,9 +56,9 @@ class survey_print(osv.osv_memory):
@return : Dictionary value for print survey form.
"""
datas = {'ids' : self.read(cr, uid, ids, [], context)[0]['survey_ids']}
datas = {'ids' : self.read(cr, uid, ids, [], context=context)[0]['survey_ids']}
res = self.read(cr, uid, ids, ['survey_title', 'orientation', 'paper_size',\
'page_number', 'without_pagebreak'], context)
'page_number', 'without_pagebreak'], context=context)
res = res and res[0] or {}
datas['form'] = res
datas['model'] = 'survey.print'
+1 -1
View File
@@ -59,7 +59,7 @@ class survey_print_answer(osv.osv_memory):
context = {}
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['response_ids', 'orientation', 'paper_size',\
'page_number', 'without_pagebreak'], context)
'page_number', 'without_pagebreak'], context=context)
res = res and res[0] or {}
datas['form'] = res
datas['model'] = 'survey.print.answer'
@@ -44,7 +44,7 @@ class survey_print_statistics(osv.osv_memory):
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['survey_ids'], context)
res = self.read(cr, uid, ids, ['survey_ids'], context=context)
res = res and res[0] or {}
datas['form'] = res
datas['model'] = 'survey.print.statistics'
+2 -2
View File
@@ -122,7 +122,7 @@ class survey_name_wiz(osv.osv_memory):
search_obj = self.pool.get('ir.ui.view')
if context is None: context = {}
sur_id = self.read(cr, uid, ids, [])[0]
sur_id = self.read(cr, uid, ids, [], context=context)[0]
survey_id = sur_id['survey_id']
context.update({'survey_id': survey_id, 'sur_name_id': sur_id['id']})
cr.execute('select count(id) from survey_history where user_id=%s\
@@ -133,7 +133,7 @@ class survey_name_wiz(osv.osv_memory):
if user_limit and res >= user_limit:
raise osv.except_osv(_('Warning !'),_("You can not give response for this survey more than %s times") % (user_limit))
sur_rec = survey_obj.read(cr,uid,self.read(cr,uid,ids)[0]['survey_id'])
sur_rec = survey_obj.read(cr,uid,self.read(cr,uid,ids, context=context)[0]['survey_id'])
if sur_rec['max_response_limit'] and sur_rec['max_response_limit'] <= sur_rec['tot_start_survey']:
raise osv.except_osv(_('Warning !'),_("You can not give more response. Please contact the author of this survey for further assistance."))
@@ -97,7 +97,7 @@ class survey_send_invitation(osv.osv_memory):
if context is None:
context = {}
record = self.read(cr, uid, ids, [])
survey_ids = context.get('active_ids', [])
survey_ids = context.get('active_ids', [], context=context)
record = record and record[0]
partner_ids = record['partner_ids']
user_ref= self.pool.get('res.users')