[FIX] Undefined variables: auction, base_module_record, base_report_desinger, crm, event, resource
bzr revid: hmo@tinyerp.com-20100817070450-89httnejhscj30gu
This commit is contained in:
parent
cf839be3e7
commit
9a4d85e957
|
@ -618,7 +618,7 @@ class auction_lots(osv.osv):
|
|||
'price_unit': lot.obj_price,
|
||||
}
|
||||
inv_line_obj.create(cr, uid, inv_line, context)
|
||||
inv_ref.button_compute(cr, uid, invoice.values())
|
||||
inv_ref.button_compute(cr, uid, invoices.values())
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_proforma2', cr)
|
||||
return invoices.values()
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import pooler
|
|||
import time
|
||||
from report import report_sxw
|
||||
|
||||
class lots_list_llandscape(report_sxw.rml_parse):
|
||||
class lots_list_landscape(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(lots_list_landscape, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
#
|
||||
# Does not properly work concurrently !!!
|
||||
#
|
||||
import base64
|
||||
import mimetypes
|
||||
import httplib
|
||||
import threading
|
||||
from tools.translate import _
|
||||
from osv import fields,osv
|
||||
from tools.translate import _
|
||||
import base64
|
||||
import httplib
|
||||
import mimetypes
|
||||
import netsvc
|
||||
import threading
|
||||
|
||||
class auction_lots_send_aie(osv.osv_memory):
|
||||
_name = 'auction.lots.send.aie'
|
||||
|
@ -146,7 +147,7 @@ class auction_lots_send_aie(osv.osv_memory):
|
|||
if len(datas):
|
||||
bin = base64.decodestring(datas[0]['image'])
|
||||
fname = datas[0]['name']
|
||||
_photo_bin_send(uname, passwd, ref, did, fname, bin)
|
||||
self._photo_bin_send(uname, passwd, ref, did, fname, bin)
|
||||
|
||||
def get_dates(self, cr, uid, ids, context={}):
|
||||
import httplib
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv,fields
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import sql_db
|
||||
from osv import osv,fields
|
||||
|
||||
class wiz_auc_lots_buyer_map(osv.osv_memory):
|
||||
_name = 'auction.lots.buyer_map'
|
||||
|
|
|
@ -48,7 +48,7 @@ class auction_lots_sms_send(osv.osv_memory):
|
|||
lot_obj = self.pool.get('auction.lots')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
partner_address_obj = self.pool.get('res.partner.address')
|
||||
for datas in self.read(cr, uid, ids):
|
||||
for data in self.read(cr, uid, ids):
|
||||
lots = lot_obj.read(cr, uid, context['active_ids'], ['obj_num','obj_price','ach_uid'])
|
||||
res = partner_obj.read(cr, uid, [l['ach_uid'][0] for l in lots if l['ach_uid']], ['gsm'], context)
|
||||
|
||||
|
|
|
@ -28,16 +28,7 @@ class auction_transfer_unsold_object(osv.osv):
|
|||
'''
|
||||
_name = 'auction.transfer.unsold.object'
|
||||
_description = 'To transfer unsold objects'
|
||||
|
||||
_columns = {
|
||||
'auction_id_from':fields.many2one('auction.dates', 'From Auction Date', required=True),
|
||||
'auction_id_to':fields.many2one('auction.dates', 'To Auction Date', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'auction_id_from': _start,
|
||||
}
|
||||
|
||||
def _start(self, cr, uid, context):
|
||||
"""
|
||||
To initialize auction_id_from
|
||||
|
@ -52,7 +43,16 @@ class auction_transfer_unsold_object(osv.osv):
|
|||
rec = lots_obj.browse(cr, uid, context['active_id'], context)
|
||||
auction_from = rec and rec.auction_id.id or False
|
||||
return auction_from
|
||||
|
||||
_columns = {
|
||||
'auction_id_from':fields.many2one('auction.dates', 'From Auction Date', required=True),
|
||||
'auction_id_to':fields.many2one('auction.dates', 'To Auction Date', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'auction_id_from': _start,
|
||||
}
|
||||
|
||||
def transfer_unsold_object(self, cr, uid, ids, context):
|
||||
"""
|
||||
To Transfer the unsold object
|
||||
|
|
|
@ -541,29 +541,28 @@ class base_module_record(osv.osv):
|
|||
else:
|
||||
continue
|
||||
if self.mode == "workflow":
|
||||
record= self._generate_object_yaml(cr, uid, rec[1],rec[0])
|
||||
yaml_file+="!comment Performing a workflow action %s on module %s"%(record['action'], record['model']) + '''\n'''
|
||||
object=yaml.load(unicode('''\n !workflow %s \n'''%record,'iso-8859-1'))
|
||||
attrs=attrs.replace("''", '"')
|
||||
record = self._generate_object_yaml(cr, uid, rec[1],rec[0])
|
||||
yaml_file += "!comment Performing a workflow action %s on module %s"%(record['action'], record['model']) + '''\n'''
|
||||
object = yaml.load(unicode('''\n !workflow %s \n'''%record,'iso-8859-1'))
|
||||
yaml_file += str(object) + '''\n\n'''
|
||||
elif self.mode == 'osv_memory_action':
|
||||
osv_action= self._generate_function_yaml(cr, uid, rec[1])
|
||||
yaml_file+="!comment Performing an osv_memory action %s on module %s"%(osv_action['action'], osv_action['model']) + '''\n'''
|
||||
osv_action=yaml.load(unicode('''\n !python %s \n'''%osv_action,'iso-8859-1'))
|
||||
osv_action = self._generate_function_yaml(cr, uid, rec[1])
|
||||
yaml_file += "!comment Performing an osv_memory action %s on module %s"%(osv_action['action'], osv_action['model']) + '''\n'''
|
||||
osv_action = yaml.load(unicode('''\n !python %s \n'''%osv_action,'iso-8859-1'))
|
||||
yaml_file += str(osv_action) + '''\n'''
|
||||
attrs=yaml.dump(osv_action.attrs, default_flow_style=False)
|
||||
attrs=attrs.replace("''", '"')
|
||||
attrs=attrs.replace("'", '')
|
||||
attrs = yaml.dump(osv_action.attrs, default_flow_style=False)
|
||||
attrs = attrs.replace("''", '"')
|
||||
attrs = attrs.replace("'", '')
|
||||
yaml_file += attrs + '''\n\n'''
|
||||
else:
|
||||
record= self._generate_object_yaml(cr, uid, rec[1], rec[3])
|
||||
record = self._generate_object_yaml(cr, uid, rec[1], rec[3])
|
||||
if self.mode == "create" or self.mode == "copy":
|
||||
yaml_file+="!comment Creating a %s record"%(record['model']) + '''\n'''
|
||||
yaml_file += "!comment Creating a %s record"%(record['model']) + '''\n'''
|
||||
else:
|
||||
yaml_file+="!comment Modifying a %s record"%(record['model']) + '''\n'''
|
||||
object= yaml.load(unicode('''\n !record %s \n'''%record,'iso-8859-1'))
|
||||
yaml_file += "!comment Modifying a %s record"%(record['model']) + '''\n'''
|
||||
object = yaml.load(unicode('''\n !record %s \n'''%record,'iso-8859-1'))
|
||||
yaml_file += str(object) + '''\n'''
|
||||
attrs=yaml.dump(object.attrs, default_flow_style=False)
|
||||
attrs = yaml.dump(object.attrs, default_flow_style=False)
|
||||
yaml_file += attrs + '''\n\n'''
|
||||
|
||||
yaml_result=''''''
|
||||
|
|
|
@ -44,6 +44,7 @@ import zipfile
|
|||
import xml.dom.minidom
|
||||
from reportlab.lib.units import toLength
|
||||
import base64
|
||||
import copy
|
||||
|
||||
class DomApiGeneral:
|
||||
"""General DOM API utilities."""
|
||||
|
|
|
@ -59,8 +59,7 @@ class crm_partner2opportunity(osv.osv_memory):
|
|||
return res
|
||||
|
||||
def _select_data(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
part_obj = pool.get('res.partner')
|
||||
part_obj = self.pool.get('res.partner')
|
||||
part = part_obj.read(cr, uid, data['id' ], ['name'])
|
||||
return {'partner_id' : data['id'], 'name' : part['name'] }
|
||||
|
||||
|
@ -120,4 +119,4 @@ class crm_partner2opportunity(osv.osv_memory):
|
|||
|
||||
crm_partner2opportunity()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -129,7 +129,7 @@ class event_event(osv.osv):
|
|||
'target': 'new',
|
||||
'context': context,
|
||||
'nodestroy': True
|
||||
}
|
||||
}
|
||||
return res
|
||||
|
||||
|
||||
|
@ -336,7 +336,7 @@ class event_registration(osv.osv):
|
|||
_defaults = {
|
||||
'nb_register': 1,
|
||||
'tobe_invoiced': True,
|
||||
'state': lambda *a: 'draft',
|
||||
'state': lambda *a: 'draft',
|
||||
'active': lambda *a: 1,
|
||||
'user_id': lambda self, cr, uid, ctx: uid,
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ class event_registration(osv.osv):
|
|||
registrations = self.browse(cr, uid, ids)
|
||||
self.history(cr, uid, registrations, _('Cancel'))
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
return True
|
||||
return True
|
||||
|
||||
def mail_user(self, cr, uid, ids, confirm=False, context=None):
|
||||
"""
|
||||
|
@ -543,7 +543,7 @@ class event_registration(osv.osv):
|
|||
email_to = regestration.email_from
|
||||
if regestration.email_cc:
|
||||
email_cc += [regestration.email_cc]
|
||||
if not (email_to and email_cc):
|
||||
if not (email_to or email_cc):
|
||||
continue
|
||||
subject = ""
|
||||
body = ""
|
||||
|
@ -617,10 +617,10 @@ class event_registration(osv.osv):
|
|||
|
||||
event_obj = self.pool.get('event.event')
|
||||
prod_obj = self.pool.get('product.product')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
|
||||
data_event = event_obj.browse(cr, uid, event_id)
|
||||
res = {'value': {'unit_price': False, 'event_product': False, 'user_id': False,
|
||||
res = {'value': {'unit_price': False, 'event_product': False, 'user_id': False,
|
||||
'date': data_event.date_begin, 'date_deadline': data_event.date_end, 'description': data_event.note, 'name': data_event.name,
|
||||
'section_id': data_event.section_id and data_event.section_id.id or False,
|
||||
}}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
import gettext
|
||||
import os.path
|
||||
import locale
|
||||
|
||||
import sys
|
||||
|
||||
def _get_translation():
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue