rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
try: if subdir2: fn = os.path.join(adp, subdir2, name) else: fn = os.path.join(adp, name) fn = os.path.normpath(fn) fo = file_open(fn, mode=mode, subdir=None, pathinfo=pathinfo) if pathinfo: return fo, fn return fo except IOError, e: pass
try: if subdir2: fn = os.path.join(adp, subdir2, name) else: fn = os.path.join(adp, name) fn = os.path.normpath(fn) fo = file_open(fn, mode=mode, subdir=None, pathinfo=pathinfo) if pathinfo: return fo, fn return fo except IOError: pass
def file_open(name, mode="r", subdir='addons', pathinfo=False): """Open a file from the OpenERP root, using a subdir folder. >>> file_open('hr/report/timesheer.xsl') >>> file_open('addons/hr/report/timesheet.xsl') >>> file_open('../../base/report/rml_template.xsl', subdir='addons/hr/report', pathinfo=True) @param nam...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def file_open(name, mode="r", subdir='addons', pathinfo=False): """Open a file from the OpenERP root, using a subdir folder. >>> file_open('hr/report/timesheer.xsl') >>> file_open('addons/hr/report/timesheet.xsl') >>> file_open('../../base/report/rml_template.xsl', subdir='addons/hr/report', pathinfo=True) @param nam...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
from lxml.etree import Element, tostring
from lxml.etree import tostring
def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
title = link.text
def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def write(self, s): self.logger.notifyChannel('email_send', netsvc.LOG_DEBUG, s)
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except Exception, e:
except Exception:
def write(self, s): self.logger.notifyChannel('email_send', netsvc.LOG_DEBUG, s)
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
try: email_body = body.encode('utf-8') except (UnicodeEncodeError, UnicodeDecodeError): email_body = body try: email_text = MIMEText(email_body.encode('utf8') or '',_subtype=subtype,_charset='utf-8') except: email_text = MIMEText(email_body or '',_subtype=subtype,_charset='utf-8')
email_body = ustr(body).encode('utf-8') email_text = MIMEText(email_body or '',_subtype=subtype,_charset='utf-8')
def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3'): """Send an email. Arguments: `email_from`: A string used to fill the `From` header, if falsy, config['email_from...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
f = urllib.urlopen(url+"?"+params)
urllib.urlopen(url+"?"+params)
def sms_send(user, password, api_id, text, to): import urllib url = "http://api.urlsms.com/SendSMS.aspx" #url = "http://196.7.150.220/http/sendmsg" params = urllib.urlencode({'UserID': user, 'Password': password, 'SenderID': api_id, 'MsgText': text, 'RecipientMobileNo':to}) f = urllib.urlopen(url+"?"+params) # FIXME: U...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def exception_to_unicode(e): if (sys.version_info[:2] < (2,6)) and hasattr(e, 'message'): return ustr(e.message) if hasattr(e, 'args'): return "\n".join((ustr(a) for a in e.args)) try: return ustr(e) except: return u"Unknown message"
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import netsvc
def wrapper(*args, **kwargs): import netsvc from pprint import pformat
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import netsvc
>>> def func_foo(bar)
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import re
>>> def func_foo(bar)
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import zipfile import os
def extract_zip_file(zip_file, outdirectory): import zipfile import os zf = zipfile.ZipFile(zip_file, 'r') out = outdirectory for path in zf.namelist(): tgt = os.path.join(out, path) tgtdir = os.path.dirname(tgt) if not os.path.exists(tgtdir): os.makedirs(tgtdir) if not tgt.endswith(os.sep): fp = open(tgt, 'wb') fp.w...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import socket
def _detect_ip_addr(): from array import array import socket from struct import pack, unpack
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def _detect_ip_addr(): from array import array import socket from struct import pack, unpack
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
import time import netsvc
def detect_server_timezone(): """Attempt to detect the timezone to use on the server side. Defaults to UTC if no working timezone can be found. @return: the timezone identifier as expected by pytz.timezone. """ import time import netsvc try: import pytz except: netsvc.Logger().notifyChannel("detect_server_timezone", ne...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def detect_server_timezone(): """Attempt to detect the timezone to use on the server side. Defaults to UTC if no working timezone can be found. @return: the timezone identifier as expected by pytz.timezone. """ import time import netsvc try: import pytz except: netsvc.Logger().notifyChannel("detect_server_timezone", ne...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def detect_server_timezone(): """Attempt to detect the timezone to use on the server side. Defaults to UTC if no working timezone can be found. @return: the timezone identifier as expected by pytz.timezone. """ import time import netsvc try: import pytz except: netsvc.Logger().notifyChannel("detect_server_timezone", ne...
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
except:
except Exception:
def run(self): try: import urllib args = urllib.urlencode(self.args) fp = urllib.urlopen('http://www.openerp.com/scripts/survey.php', args) fp.read() fp.close() except: pass
257bc12dccfde9530fb881850a2378d889594a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/257bc12dccfde9530fb881850a2378d889594a54/misc.py
}
}
def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') ids = modules.search(cr, uid, [('category_id','=','Account Charts')]) charts = list( sorted(((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids)), key=itemgetter(1))) charts.insert(0,('configurable','Generic Chart Of Accou...
f41257d03a5a0fd090e92b4ef0df0b5d31185e56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f41257d03a5a0fd090e92b4ef0df0b5d31185e56/installer.py
}
}
def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') ids = modules.search(cr, uid, [('category_id','=','Account Charts')]) charts = list( sorted(((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids)), key=itemgetter(1))) charts.insert(0,('configurable','Generic Chart Of Accou...
f41257d03a5a0fd090e92b4ef0df0b5d31185e56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f41257d03a5a0fd090e92b4ef0df0b5d31185e56/installer.py
date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
date_and_hours_by_cal = [] for op in ops: date_planned = op.production_id.date_planned and op.date_planned if date_planned: date_and_hours_by_cal.append((date_planned, op.hour, op.workcenter_id.calendar_id.id))
def _get_date_end(self, cr, uid, ids, field_name, arg, context): """ Finds ending date. @return: Dictionary of values. """ ops = self.browse(cr, uid, ids, context=context) date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] intervals = self.pool.get('resourc...
46a478c31557861b1ba54868ad5d905b22fd381f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/46a478c31557861b1ba54868ad5d905b22fd381f/mrp_operations.py
if op.date_planned: i = intervals[(op.date_planned, op.hour, op.workcenter_id.calendar_id.id)]
date_planned = op.production_id.date_planned and op.date_planned if date_planned: i = intervals[(date_planned, op.hour, op.workcenter_id.calendar_id.id)]
def _get_date_end(self, cr, uid, ids, field_name, arg, context): """ Finds ending date. @return: Dictionary of values. """ ops = self.browse(cr, uid, ids, context=context) date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] intervals = self.pool.get('resourc...
46a478c31557861b1ba54868ad5d905b22fd381f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/46a478c31557861b1ba54868ad5d905b22fd381f/mrp_operations.py
def get_module_from_path(path, mod_paths=None):
4178ddbc9b70900eb9d8f154876f79d5602cba5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4178ddbc9b70900eb9d8f154876f79d5602cba5f/translate.py
'decimal_point' : str(locale.localeconv()['decimal_point']).replace('\xa0', '\xc2\xa0'), 'thousands_sep' : str(locale.localeconv()['thousands_sep']).replace('\xa0', '\xc2\xa0'),
'decimal_point' : fix_xa0(str(locale.localeconv()['decimal_point'])), 'thousands_sep' : fix_xa0(str(locale.localeconv()['thousands_sep'])),
def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name=None, verbose=True): logger = netsvc.Logger() if verbose: logger.notifyChannel("i18n", netsvc.LOG_INFO, 'loading translation file for language %s' % (lang)) pool = pooler.get_pool(db_name) lang_obj = pool.get('res.lang') trans_obj = pool.ge...
4178ddbc9b70900eb9d8f154876f79d5602cba5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4178ddbc9b70900eb9d8f154876f79d5602cba5f/translate.py
_timers = {}
"""Singleton that keeps track of cancellable tasks to run at a given timestamp. The tasks are caracterised by: * a timestamp * the database on which the task run * the function to call * the arguments and keyword arguments to pass to the function Implementation details: Tasks are stored as list, allowing the cancellat...
def shutdown(self): logging.shutdown()
a87fef6cdf54ccc5a67aab65906ab22a0d338fed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a87fef6cdf54ccc5a67aab65906ab22a0d338fed/netsvc.py
__logger = logging.getLogger('timer') def setAlarm(self, fn, dt, db_name, *args, **kwargs): wait = dt - time.time() if wait > 0: self.__logger.debug("Job scheduled in %.3g seconds for %s.%s" % (wait, fn.im_class.__name__, fn.func_name)) timer = threading.Timer(wait, fn, args, kwargs) timer.start() self._timers.setdefa...
@classmethod def setAlarm(cls, function, timestamp, db_name, *args, **kwargs): task = [timestamp, db_name, function, args, kwargs] heapq.heappush(cls.__tasks, task) cls.__tasks_by_db.setdefault(db_name, []).append(task)
def shutdown(self): logging.shutdown()
a87fef6cdf54ccc5a67aab65906ab22a0d338fed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a87fef6cdf54ccc5a67aab65906ab22a0d338fed/netsvc.py
"""Cancel all timers for a given database. If None passed, all timers are cancelled""" for db in cls._timers: if db_name is None or db == db_name: for timer in cls._timers[db]: timer.cancel()
"""Cancel all tasks for a given database. If None is passed, all tasks are cancelled""" if db_name is None: cls.__tasks, cls.__tasks_by_db = [], {} else: if db_name in cls.__tasks_by_db: for task in cls.__tasks_by_db[db_name]: task[0] = 0
def cancel(cls, db_name): """Cancel all timers for a given database. If None passed, all timers are cancelled""" for db in cls._timers: if db_name is None or db == db_name: for timer in cls._timers[db]: timer.cancel()
a87fef6cdf54ccc5a67aab65906ab22a0d338fed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a87fef6cdf54ccc5a67aab65906ab22a0d338fed/netsvc.py
partner_id, date_order=False, fiscal_position=False):
partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False):
def product_id_change(self,cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False): warning = {} if not product: return {'value': {'price_unit': 0.0, 'name':'','notes':'', 'product_uom' : False}, 'domain':{'product_uom':[]}} product_obj = self.pool.get('product.product') product...
194ead1ccd772ad13041ea4ec2652165b8b44651 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/194ead1ccd772ad13041ea4ec2652165b8b44651/warning.py
l.company_id company_id
l.company_id as company_id
def init(self, cr): tools.drop_view_if_exists(cr, 'account_followup_stat_by_partner') cr.execute(""" create or replace view account_followup_stat_by_partner as ( SELECT l.partner_id AS id, l.partner_id AS partner_id, min(l.date) AS date_move, max(l.date) AS date_move_last, max(l.followup_date) AS date_followup, max(l.f...
f55b03dc9a8601a3aa3faedfff7b39d6c5635278 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f55b03dc9a8601a3aa3faedfff7b39d6c5635278/account_followup_print.py
res = super(product_product,self).get_product_accounts(cr, uid, product_id, context)
def get_product_accounts(self, cr, uid, product_id, context={}): """ To get the stock input account, stock output account and stock journal related to product. @param product_id: product id @return: dictionary which contains information regarding stock input account, stock output account and stock journal """ product_o...
84acd55b9d613b34eeb934ba951fd8ec2c179151 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/84acd55b9d613b34eeb934ba951fd8ec2c179151/product.py
res = {}
def get_product_accounts(self, cr, uid, product_id, context={}): """ To get the stock input account, stock output account and stock journal related to product. @param product_id: product id @return: dictionary which contains information regarding stock input account, stock output account and stock journal """ product_o...
84acd55b9d613b34eeb934ba951fd8ec2c179151 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/84acd55b9d613b34eeb934ba951fd8ec2c179151/product.py
model = self.get_model(workflow.model)
def process_workflow(self, node): workflow, values = node.items()[0] if self.isnoupdate(workflow) and self.mode != 'init': return model = self.get_model(workflow.model) if workflow.ref: id = self.get_id(workflow.ref) else: if not values: raise YamlImportException('You must define a child node if you do not give a ref.'...
51f8a94d874c0eebd9e404078a02e787e2a14198 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/51f8a94d874c0eebd9e404078a02e787e2a14198/yaml_import.py
wf_service.trg_validate(uid, model, id, workflow.action, self.cr)
wf_service.trg_validate(uid, workflow.model, id, workflow.action, self.cr)
def process_workflow(self, node): workflow, values = node.items()[0] if self.isnoupdate(workflow) and self.mode != 'init': return model = self.get_model(workflow.model) if workflow.ref: id = self.get_id(workflow.ref) else: if not values: raise YamlImportException('You must define a child node if you do not give a ref.'...
51f8a94d874c0eebd9e404078a02e787e2a14198 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/51f8a94d874c0eebd9e404078a02e787e2a14198/yaml_import.py
self.result_sum_dr += self.res_bl['balance']
self.result_sum_dr += self.res_bl['balance']*-1
def sum_dr(self): if self.res_bl['type'] == 'Net Profit': self.result_sum_dr += self.res_bl['balance'] return self.result_sum_dr
0f3a822ce03817e8c9a7fdf24229156a6f1b5304 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f3a822ce03817e8c9a7fdf24229156a6f1b5304/account_balance_sheet.py
self.result_sum_dr += abs(account.debit - account.credit)
self.result_sum_dr += account.balance
def get_data(self,data): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
0f3a822ce03817e8c9a7fdf24229156a6f1b5304 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f3a822ce03817e8c9a7fdf24229156a6f1b5304/account_balance_sheet.py
self.result_sum_cr += abs(account.debit - account.credit)
self.result_sum_cr += account.balance
def get_data(self,data): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
0f3a822ce03817e8c9a7fdf24229156a6f1b5304 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f3a822ce03817e8c9a7fdf24229156a6f1b5304/account_balance_sheet.py
"""
def search(self, cr, obj, args, name, value, offset=0, limit=None, uid=None, operator='like', context=None): return obj.pool.get(self._obj).name_search(cr, uid, value, self._domain, operator, context=context,limit=limit)
7c584a3d18dd9516a7e1e08827579421324df5e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7c584a3d18dd9516a7e1e08827579421324df5e8/fields.py
def search(self, cr, obj, args, name, value, offset=0, limit=None, uid=None, operator='like', context=None): return obj.pool.get(self._obj).name_search(cr, uid, value, self._domain, operator, context=context,limit=limit)
7c584a3d18dd9516a7e1e08827579421324df5e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7c584a3d18dd9516a7e1e08827579421324df5e8/fields.py
tools.debug(ret)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) tools.debug(ret) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
tools.debug(res_company_ldap)
logger.debug(res_company_ldap)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) tools.debug(ret) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
tools.debug(dn)
logger.debug(dn)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) tools.debug(ret) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
tools.debug(res)
logger.debug(res)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) tools.debug(ret) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
tools.debug(e)
logger.warning("Cannot auth", exc_info=True)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) tools.debug(ret) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
except:
except ExceptionNoTb:
def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) except: # AccessDenied pass cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: l = ldap.open(res_company_ldap.ldap_server, res_company...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
tools.debug(e)
logger.warning('cannot check', exc_info=True)
def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) except: # AccessDenied pass cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: l = ldap.open(res_company_ldap.ldap_server, res_company...
7736b371d04d0ca36d91cd61ce83d815406d1f92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7736b371d04d0ca36d91cd61ce83d815406d1f92/users_ldap.py
value = {'costs_hour' :cost.standard_price}
value = {'costs_hour': cost.standard_price}
def on_change_product_cost(self, cr, uid, ids, product_id, context=None): if context is None: context = {} value = {}
c572dd7a4872ce82d06e9d92dd7f6699c3f493e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c572dd7a4872ce82d06e9d92dd7f6699c3f493e6/mrp.py
help="Number of iterations this workcenter has to do in the specified operation of the routing."), 'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for this workcenter to achieve the operation of the specified routing."),
help="Number of iterations this work Center has to do in the specified operation of the routing."), 'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for this work Center to achieve the operation of the specified routing."),
def on_change_product_cost(self, cr, uid, ids, product_id, context=None): if context is None: context = {} value = {}
c572dd7a4872ce82d06e9d92dd7f6699c3f493e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c572dd7a4872ce82d06e9d92dd7f6699c3f493e6/mrp.py
if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
if guarantee_limit and datetime.strptime(date.today().strftime('%Y-%m-%d'), '%Y-%m-%d') > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ if not type: r...
d51ad12b0c17318118198286a61d85c7813aa5aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d51ad12b0c17318118198286a61d85c7813aa5aa/mrp_repair.py
msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...'
msg_txt += self.truncate_data(cr, uid, message.description, context=context)
def _get_display_text(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} tz = context.get('tz') result = {} for message in self.browse(cr, uid, ids, context=context): msg_txt = '' if message.history: msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) ...
81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb/mail_gateway.py
msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t'
msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t'
def _get_display_text(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} tz = context.get('tz') result = {} for message in self.browse(cr, uid, ids, context=context): msg_txt = '' if message.history: msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) ...
81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb/mail_gateway.py
def _hours_get(self, cr, uid, ids, field_names, args, context):
def _hours_get(self, cr, uid, ids, field_names, args, context=None): res = {}
def _hours_get(self, cr, uid, ids, field_names, args, context): cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) res = {} for task in self.browse(cr, uid, ids, context=context): res[task.id] = {} res[task.id]['effectiv...
b00b6e8222756a65a587b01076a260396297d21f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b00b6e8222756a65a587b01076a260396297d21f/project.py
res = {}
def _hours_get(self, cr, uid, ids, field_names, args, context): cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) res = {} for task in self.browse(cr, uid, ids, context=context): res[task.id] = {} res[task.id]['effectiv...
b00b6e8222756a65a587b01076a260396297d21f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b00b6e8222756a65a587b01076a260396297d21f/project.py
res[task.id] = {} res[task.id]['effective_hours'] = hours.get(task.id, 0.0) res[task.id]['total_hours'] = task.remaining_hours + hours.get(task.id, 0.0)
res[task.id] = {'effective_hours': hours.get(task.id, 0.0), 'total_hours': task.remaining_hours + hours.get(task.id, 0.0)}
def _hours_get(self, cr, uid, ids, field_names, args, context): cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) res = {} for task in self.browse(cr, uid, ids, context=context): res[task.id] = {} res[task.id]['effectiv...
b00b6e8222756a65a587b01076a260396297d21f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b00b6e8222756a65a587b01076a260396297d21f/project.py
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 100),2)
if hours.get(task.id, 0.0) > res[task.id]['total_hours']: res[task.id]['progress'] = round(100 - (max(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 100)) % 100, 2) else: res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 100),2)
def _hours_get(self, cr, uid, ids, field_names, args, context): cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) res = {} for task in self.browse(cr, uid, ids, context=context): res[task.id] = {} res[task.id]['effectiv...
b00b6e8222756a65a587b01076a260396297d21f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b00b6e8222756a65a587b01076a260396297d21f/project.py
if (not src_acct.currency_id) or src_acct.currency_id.id == reference_currency_id:
if (not dest_acct.currency_id) or dest_acct.currency_id.id == reference_currency_id:
def _create_account_move_line(self, cr, uid, move, src_account_id, dest_account_id, reference_amount, reference_currency_id, context=None): """ Generate the account.move.line values to post to track the stock valuation difference due to the processing of the given stock move. """ # prepare default values considering th...
fc1a40a1eeeab3e7e352cc62423fc91f2add2df1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fc1a40a1eeeab3e7e352cc62423fc91f2add2df1/stock.py
rml_parser._add_header(processed_rml) processed_rml = self.preprocess_rml(processed_rml,report_xml.report_type)
rml_parser._add_header(processed_rml,self.header)
def create_single_pdf(self, cr, uid, ids, data, report_xml, context=None): if not context: context={} logo = None context = context.copy() title = report_xml.name rml = report_xml.report_rml_content # if no rml file is found if not rml: return False rml_parser = self.parser(cr, uid, self.name2, context=context) objs = ...
ec91b8a264f789c0459462b0571b1dd7ace27461 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ec91b8a264f789c0459462b0571b1dd7ace27461/report_sxw.py
partner = picking.address_id.partner_id
partner = picking.purchase_id.partner_id
def _get_address_invoice(self, cr, uid, picking): """ Gets invoice address of a partner @return {'contact': address, 'invoice': address} for invoice """ partner_obj = self.pool.get('res.partner') partner = picking.address_id.partner_id
8e366d87e12c5c373fe618d796e3f067676ea68d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e366d87e12c5c373fe618d796e3f067676ea68d/stock.py
tools.convert_csv_import(cr, module_name, file, id_map, mode, noupdate)
tools.convert_csv_import(cr, module_name, pathname, file.read(), id_map, mode, noupdate)
def _load_data(cr, module_name, id_map, mode, kind): noupdate = (kind == 'demo') for filename in package.data.get(kind, []): _, ext = os.path.splitext(filename) log.info("module %s: loading %s", module_name, filename) pathname = os.path.join(module_name, filename) file = tools.file_open(pathname) # TODO manage .csv fil...
8e2f0e4e3014055ecda7417004f59230a91c501a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e2f0e4e3014055ecda7417004f59230a91c501a/__init__.py
def name_get(self, cr, uid, ids, context={}): if not len(ids): return [] reads = self.browse(cr, uid, ids, context) res = [] for record in reads: name = record.plan_id.name res.append((record['id'], name)) return res
def create(self, cr, uid, vals, context={}): id = super(hr_employee, self).create(cr, uid, vals, context=context) if vals.get('evaluation_plan_id', False): self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context) return id
e32a158b18f2b5030b1476ae675bd460078f06fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e32a158b18f2b5030b1476ae675bd460078f06fb/hr_evaluation.py
self.write(cr, uid, ids, { 'state' : 'done'})
def survey_req_done(self, cr, uid, ids, context=None): if context is None: context = {} self.write(cr, uid, ids, { 'state' : 'done'}) hr_eval_obj = self.pool.get('hr_evaluation.evaluation') for id in self.browse(cr, uid, ids, context=context): flag = False wating_id = 0 tot_done_req = 0 records = hr_eval_obj.browse(cr,...
e32a158b18f2b5030b1476ae675bd460078f06fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e32a158b18f2b5030b1476ae675bd460078f06fb/hr_evaluation.py
res += [(user_email, case.email_from, case.email_cc, getattr(case,'priority') and case.priority or False)]
res += [(user_email, case.email_from, case.email_cc or False, getattr(case,'priority') and case.priority or False)]
def emails_get(self, cr, uid, ids, context={}):
a55f86723ab040211181dfa864f24c7cac3a1da8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a55f86723ab040211181dfa864f24c7cac3a1da8/crm_mailgate.py
result_pl=self.obj_pl.get_data(data)
result_pl = self.obj_pl.get_data(data)
def get_data(self,data): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
9deb5b1ca995534fcc171939afa3a3c928d8a580 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9deb5b1ca995534fcc171939afa3a3c928d8a580/account_balance_sheet.py
del(node.attrib['groups']) return can_see
del(node.attrib['groups']) return can_see else: return True
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ...
900c2ef4409df0f739e0dc610e49c746ed508e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/900c2ef4409df0f739e0dc610e49c746ed508e86/orm.py
if not check_group(node)
if not check_group(node):
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ...
900c2ef4409df0f739e0dc610e49c746ed508e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/900c2ef4409df0f739e0dc610e49c746ed508e86/orm.py
if message_id: msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id)]) if msg_ids and len(msg_ids): return 0
def history_message(self, cr, uid, vals): dictcreate = dict(vals) ref_ids = str(dictcreate.get('ref_ids')).split(';') msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) server_tools_pool = self.pool.get('email.server.tools') message_id = msg.get('message-id', False) msg_pool = ...
d22523c15d07e927b88485b863f872af06ebccfe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d22523c15d07e927b88485b863f872af06ebccfe/partner.py
self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}) wf_service = netsvc.LocalService("workflow") for id in ids: wf_service.trg_trigger(uid, 'stock.move', id, cr)
if move_ids: self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}) wf_service = netsvc.LocalService("workflow") for id in move_ids: wf_service.trg_trigger(uid, 'stock.move', id, cr)
def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ partial_datas='' picking_ids = [] partial_obj=self.pool.get('stock.partial.picking') partial_id=partial_obj.search(cr,uid,[]) if partial_id: partial_datas=partial_obj.read(cr,ui...
c1692f14597894b58702b8cc317fdfc5dd4030e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c1692f14597894b58702b8cc317fdfc5dd4030e9/stock.py
raise Error("Fuck toi")
def _check_xml(self, cr, uid, ids, context={}): logger = logging.getLogger('init') for view in self.browse(cr, uid, ids, context): eview = etree.fromstring(view.arch.encode('utf8')) frng = tools.file_open(os.path.join('base','rng','view.rng')) relaxng_doc = etree.parse(frng) relaxng = etree.RelaxNG(relaxng_doc) if not ...
a7aebd34897c14bb70867e2a7b69d15606dfd63d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a7aebd34897c14bb70867e2a7b69d15606dfd63d/ir_ui_view.py
def fields_get(self, cr, user, fields=None, context=None, read_access=True):
def fields_get(self, cr, user, allfields=None, context=None, read_access=True):
def fields_get(self, cr, user, fields=None, context=None, read_access=True): if context is None: context = {} res = {} translation_obj = self.pool.get('ir.translation') model_access_obj = self.pool.get('ir.model.access') for parent in self._inherits: res.update(self.pool.get(parent).fields_get(cr, user, fields, context...
e80e8d7d3c198be783205364ac41a47d4ff3572f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e80e8d7d3c198be783205364ac41a47d4ff3572f/orm.py
res.update(self.pool.get(parent).fields_get(cr, user, fields, context))
res.update(self.pool.get(parent).fields_get(cr, user, allfields, context))
def fields_get(self, cr, user, fields=None, context=None, read_access=True): if context is None: context = {} res = {} translation_obj = self.pool.get('ir.translation') model_access_obj = self.pool.get('ir.model.access') for parent in self._inherits: res.update(self.pool.get(parent).fields_get(cr, user, fields, context...
e80e8d7d3c198be783205364ac41a47d4ff3572f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e80e8d7d3c198be783205364ac41a47d4ff3572f/orm.py
if fields and f not in fields:
if allfields and f not in allfields:
def fields_get(self, cr, user, fields=None, context=None, read_access=True): if context is None: context = {} res = {} translation_obj = self.pool.get('ir.translation') model_access_obj = self.pool.get('ir.model.access') for parent in self._inherits: res.update(self.pool.get(parent).fields_get(cr, user, fields, context...
e80e8d7d3c198be783205364ac41a47d4ff3572f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e80e8d7d3c198be783205364ac41a47d4ff3572f/orm.py
if fields:
if allfields:
def fields_get(self, cr, user, fields=None, context=None, read_access=True): if context is None: context = {} res = {} translation_obj = self.pool.get('ir.translation') model_access_obj = self.pool.get('ir.model.access') for parent in self._inherits: res.update(self.pool.get(parent).fields_get(cr, user, fields, context...
e80e8d7d3c198be783205364ac41a47d4ff3572f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e80e8d7d3c198be783205364ac41a47d4ff3572f/orm.py
if r not in fields:
if r not in allfields:
def fields_get(self, cr, user, fields=None, context=None, read_access=True): if context is None: context = {} res = {} translation_obj = self.pool.get('ir.translation') model_access_obj = self.pool.get('ir.model.access') for parent in self._inherits: res.update(self.pool.get(parent).fields_get(cr, user, fields, context...
e80e8d7d3c198be783205364ac41a47d4ff3572f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e80e8d7d3c198be783205364ac41a47d4ff3572f/orm.py
'date' : lambda *a: (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
'date' : lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
def create(self, cr, uid, vals, context=None): if context is None: context = {} id = super(hr_employee, self).create(cr, uid, vals, context=context) if vals.get('evaluation_plan_id', False): self.pool.get('hr_evaluation.evaluation').create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=co...
1b419042533612c9d34cdaffe1873f3c92c526c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1b419042533612c9d34cdaffe1873f3c92c526c5/hr_evaluation.py
'date_deadline': (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
'date_deadline': (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
def button_plan_in_progress(self, cr, uid, ids, context=None): hr_eval_inter_obj = self.pool.get('hr.evaluation.interview') if context is None: context = {} apprai_id = [] for evaluation in self.browse(cr, uid, ids, context=context): wait = False for phase in evaluation.plan_id.phase_ids: childs = [] if phase.action ==...
1b419042533612c9d34cdaffe1873f3c92c526c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1b419042533612c9d34cdaffe1873f3c92c526c5/hr_evaluation.py
planning.id::varchar(32) || '-' || COALESCE(users.id,0)::varchar(32) AS id,
(1000*(planning.id) + users.id)::integer AS id,
def init(self, cr): cr.execute(""" CREATE OR REPLACE VIEW report_account_analytic_planning_user AS ( SELECT planning.id AS planning_id, planning.id::varchar(32) || '-' || COALESCE(users.id,0)::varchar(32) AS id, planning.business_days, users.id AS user_id, (SELECT sum(line1.amount_in_base_uom) FROM report_account_analy...
60321a3fe5d8347efa6b894dd4048f0bb1b0bbf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60321a3fe5d8347efa6b894dd4048f0bb1b0bbf1/project_planning.py
planning.id::varchar(32) || '-' || '0' AS id,
(1000*(planning.id) - 1)::integer AS id,
def init(self, cr): cr.execute(""" CREATE OR REPLACE VIEW report_account_analytic_planning_user AS ( SELECT planning.id AS planning_id, planning.id::varchar(32) || '-' || COALESCE(users.id,0)::varchar(32) AS id, planning.business_days, users.id AS user_id, (SELECT sum(line1.amount_in_base_uom) FROM report_account_analy...
60321a3fe5d8347efa6b894dd4048f0bb1b0bbf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60321a3fe5d8347efa6b894dd4048f0bb1b0bbf1/project_planning.py
def make_po(self, cr, uid, ids, context={}): """ Make purchase order from procurement @return: New created Purchase Orders procurement wise """ res = {} company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id partner_obj = self.pool.get('res.partner') uom_obj = self.pool.get('product.uom') priceli...
bf7ea7c2490d550f1e0659bb94c289ee8324fc57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf7ea7c2490d550f1e0659bb94c289ee8324fc57/purchase.py
if len(qu1): qu1 = ' where ' + ' and '.join(qu1) else: qu1 = ''
where = qu1
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
b6823a7378f82bc67e65bd79e417d939de3d5326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6823a7378f82bc67e65bd79e417d939de3d5326/orm.py
qu1_join = ''
qu1_join = []
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
b6823a7378f82bc67e65bd79e417d939de3d5326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6823a7378f82bc67e65bd79e417d939de3d5326/orm.py
if len(qu1_join): qu1 = qu1 + ' and ' qu1 += ' and '.join(qu1_join)
where.extend(qu1_join) where_str = " WHERE %s" % " AND ".join(where)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
b6823a7378f82bc67e65bd79e417d939de3d5326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6823a7378f82bc67e65bd79e417d939de3d5326/orm.py
','.join(tables) +qu1 + limit_str + offset_str, qu2)
','.join(tables) + where_str + limit_str + offset_str, qu2)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
b6823a7378f82bc67e65bd79e417d939de3d5326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6823a7378f82bc67e65bd79e417d939de3d5326/orm.py
cr.execute('select %s.id from ' % self._table + ','.join(tables) +qu1+' order by '+order_by+limit_str+offset_str, qu2)
cr.execute('select %s.id from ' % self._table + ','.join(tables) + where_str +' order by '+order_by+limit_str+offset_str, qu2)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
b6823a7378f82bc67e65bd79e417d939de3d5326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6823a7378f82bc67e65bd79e417d939de3d5326/orm.py
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True),
'work_phone': fields.related('address_id', 'phone', type='char', size=32, string='Work Phone', readonly=True),
def job_open(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'open'}) return True
fec76a4931d61d17fe6fb7d96fb30989ddf288a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fec76a4931d61d17fe6fb7d96fb30989ddf288a4/hr.py
'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char"),
'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char", size=240),
def _email_set(self, cr, uid, ids, name, value, arg, context=None): if not isinstance(ids,list): ids = [ids] address_obj = self.pool.get('res.partner.address') for user in self.browse(cr, uid, ids, context=context): if user.address_id: address_obj.write(cr, uid, user.address_id.id, {'email': value or None}, context=con...
15081dcb88ecc9c3fcb950bbec10bb2719a3aeec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/15081dcb88ecc9c3fcb950bbec10bb2719a3aeec/res_user.py
return {}
if not journal_id: return False journal_pool = self.pool.get('account.journal') journal = journal_pool.browse(cr, uid, journal_id) account_id = journal.default_credit_account_id or journal.default_debit_account_id tax_id = False if account_id and account_id.tax_ids: tax_id = account_id.tax_ids[0].id return {'value':{'...
def onchange_journal(self, cr, uid, ids, journal_id): return {}
983258cfffdb6828e72515edd9c30c36ac14d401 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/983258cfffdb6828e72515edd9c30c36ac14d401/voucher.py
</form>""" % (str(journal), str(period))
</form>""" % (tools.ustr(journal), tools.ustr(period))
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param cr: A database cursor @param user: ID of the user currently logged in @param view_id: list of fields, which require...
ee6cdce925f885bc6a145f5a668548d4fb6286b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee6cdce925f885bc6a145f5a668548d4fb6286b1/account_move_journal.py
def __init__(self, nodes, localcontext): self.localcontext = localcontext self.styles = {} self.styles_obj = {} self.names = {} self.table_styles = {} self.default_style = reportlab.lib.styles.getSampleStyleSheet()
9b82ab08fd125e5f9d30d16e09aa54e607cec6f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9b82ab08fd125e5f9d30d16e09aa54e607cec6f5/trml2pdf.py
self.cr.execute("select name from account_invoice as ac where id = %d" %(inv_id)) res = self.cr.fetchone() if res:
if inv_id: self.cr.execute("select name from account_invoice as ac where id = %d" %(inv_id)) res = self.cr.fetchone()
def _get_invoice(self,inv_id,user): res={} self.cr.execute("select name from account_invoice as ac where id = %d" %(inv_id)) res = self.cr.fetchone() if res: return res[0] else: return ''
e36a9b47a634fc9453ae5602a4ea6fd03879f550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e36a9b47a634fc9453ae5602a4ea6fd03879f550/pos_details.py
partner_id, date_order=False):
partner_id, date_order=False,fiscal_position=False):
def product_uom_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False): res = self.product_id_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=date_order) if 'product_uom' in res['value']: del res['value']['product_uom'] if not uom: res['value']['price_unit'] = 0...
a1af6dc8c94fbcdad05d26ff9277ad4a8a1027d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a1af6dc8c94fbcdad05d26ff9277ad4a8a1027d3/purchase.py
partner_id, date_order=date_order)
partner_id, date_order=date_order,fiscal_position=fiscal_position)
def product_uom_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False): res = self.product_id_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=date_order) if 'product_uom' in res['value']: del res['value']['product_uom'] if not uom: res['value']['price_unit'] = 0...
a1af6dc8c94fbcdad05d26ff9277ad4a8a1027d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a1af6dc8c94fbcdad05d26ff9277ad4a8a1027d3/purchase.py
return rset1._iter()
return list(rset1._iter())
def todate(date): val = parser.parse(''.join((re.compile('\d')).findall(date))) return val
70a9cac130666365665f34f0e3866bdaf1190137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/70a9cac130666365665f34f0e3866bdaf1190137/base_calendar.py
'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}),
'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}),
def _number_packages(self, cr, uid, ids, field_name, arg, context=None): if context is None: context = {} res = {} for line in self.browse(cr, uid, ids, context=context): try: res[line.id] = int((line.product_uom_qty+line.product_packaging.qty-0.0001) / line.product_packaging.qty) except: res[line.id] = 1 return res
c27087c76cc975f921236dfe617184377b9418ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c27087c76cc975f921236dfe617184377b9418ac/sale.py
result = s.exp_list()
result = s.exp_list(document=True)
def db_list(self): #return pooler.pool_dic.keys() s = netsvc.ExportService.getService('db') result = s.exp_list() self.db_name_list = [] for db_name in result: db, cr = None, None try: try: db = pooler.get_db_only(db_name) cr = db.cursor() cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_...
68737dfd09b87ea94d055a339c143fe7ebf68f4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/68737dfd09b87ea94d055a339c143fe7ebf68f4a/abstracted_fs.py
@param id: List of calendar event's ids.
@param id: List of calendar event's ids.
def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr....
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py
cr.execute("UPDATE %s set freq='',interval=0,count=0,end_date=Null,\
cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\
def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr....
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py
day=0,select1=False,month_list=0 ,byday=False where id=%s" % (self._table, id))
day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id))
def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr....
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py
if int(val.get('interval')) > 1:
if not val.get('interval'): rrule_type = 'custom' elif int(val.get('interval')) > 1:
def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr....
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py
new_val['byday'] = d[:1] new_val['week_list'] = d[1:].upper()
if '-' in d: new_val['byday'] = d[:2] new_val['week_list'] = d[2:4].upper() else: new_val['byday'] = d[:1] new_val['week_list'] = d[1:3].upper()
def _set_rrulestring(self, cr, uid, id, name, value, arg, context): """ Set rule string. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ cr....
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py
@return: string value which compute FREQILY;INTERVAL
@return: string value which compute FREQILY;INTERVAL
def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param datas: dictionary of freq and interval value. @return: string value which compu...
be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py