rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
res[partner.id]['membership_cancel'] = member_line_obj.read(cr, uid, line_id2[0],['date_cancel'])['date_cancel']
res[partner.id]['membership_cancel'] = member_line_obj.read(cr, uid, line_id2[0], ['date_cancel'], context=context)['date_cancel']
def _membership_date(self, cr, uid, ids, name, args, context=None):
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
return super(Partner, self).copy(cr, uid, id, default, context)
return super(Partner, self).copy(cr, uid, id, default, context=context)
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} if context is None: context = {} default = default.copy() default['member_lines'] = [] return super(Partner, self).copy(cr, uid, id, default, context)
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
} )
}, context=context)
def create_membership_invoice(self, cr, uid, ids, product_id=None, datas=None, context=None): """ Create Customer Invoice of Membership for partners. @param datas: datas has dictionary value which consist Id of Membership product and Cost Amount of Membership. datas = {'membership_product_id': None, 'amount':None} """ ...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
model_data_ids_form = model_obj.search(cr,user,[('model','=','ir.ui.view'),('name','in',['membership_products_form','membership_products_tree'])]) resource_id_form = model_obj.read(cr, user, model_data_ids_form, fields=['res_id','name'])
model_data_ids_form = model_obj.search(cr,user,[('model','=','ir.ui.view'),('name','in',['membership_products_form','membership_products_tree'])], context=context) resource_id_form = model_obj.read(cr, user, model_data_ids_form, fields=['res_id','name'], context=context)
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): model_obj = self.pool.get('ir.model.data')
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
def action_cancel(self, cr, uid, ids, context=None):
def action_cancel(self, cr, uid, ids, *args):
def action_cancel(self, cr, uid, ids, context=None): '''Create a 'date_cancel' on the membership_line object''' if context is None: context = {} member_line_obj = self.pool.get('membership.membership_line') today = time.strftime('%Y-%m-%d') for invoice in self.browse(cr, uid, ids): mlines = member_line_obj.search(cr, u...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
if context is None: context = {}
def action_cancel(self, cr, uid, ids, context=None): '''Create a 'date_cancel' on the membership_line object''' if context is None: context = {} member_line_obj = self.pool.get('membership.membership_line') today = time.strftime('%Y-%m-%d') for invoice in self.browse(cr, uid, ids): mlines = member_line_obj.search(cr, u...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
[ l.id for l in invoice.invoice_line])], context) member_line_obj.write(cr, uid, mlines, {'date_cancel':today}, context) return super(Invoice, self).action_cancel(cr, uid, ids, context)
[ l.id for l in invoice.invoice_line])]) member_line_obj.write(cr, uid, mlines, {'date_cancel':today}) return super(Invoice, self).action_cancel(cr, uid, ids)
def action_cancel(self, cr, uid, ids, context=None): '''Create a 'date_cancel' on the membership_line object''' if context is None: context = {} member_line_obj = self.pool.get('membership.membership_line') today = time.strftime('%Y-%m-%d') for invoice in self.browse(cr, uid, ids): mlines = member_line_obj.search(cr, u...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
for line in self.browse(cr, uid, ids):
for line in self.browse(cr, uid, ids, context=context):
def write(self, cr, uid, ids, vals, context=None): """Overrides orm write method """ if not context: context={} res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context) member_line_obj = self.pool.get('membership.membership_line') for line in self.browse(cr, uid, ids): if line.invoice_id.type ...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)], context=context)
def write(self, cr, uid, ids, vals, context=None): """Overrides orm write method """ if not context: context={} res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context) member_line_obj = self.pool.get('membership.membership_line') for line in self.browse(cr, uid, ids): if line.invoice_id.type ...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
})
}, context=context)
def write(self, cr, uid, ids, vals, context=None): """Overrides orm write method """ if not context: context={} res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context) member_line_obj = self.pool.get('membership.membership_line') for line in self.browse(cr, uid, ids): if line.invoice_id.type ...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',id)])
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',id)], context=context)
def unlink(self, cr, uid, ids, context=None): """Remove Membership Line Record for Account Invoice Line """ if not context: context={} member_line_obj = self.pool.get('membership.membership_line') for id in ids: ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',id)]) member_line_obj.unlink(cr, uid, ...
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
def create(self, cr, uid, vals, context={}): """Overrides orm create method """ result = super(account_invoice_line, self).create(cr, uid, vals, context) line = self.browse(cr, uid, result) member_line_obj = self.pool.get('membership.membership_line') if line.invoice_id.type == 'out_invoice':
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
result = super(account_invoice_line, self).create(cr, uid, vals, context) line = self.browse(cr, uid, result)
result = super(account_invoice_line, self).create(cr, uid, vals, context=context) line = self.browse(cr, uid, result, context=context)
def create(self, cr, uid, vals, context={}): """Overrides orm create method """ result = super(account_invoice_line, self).create(cr, uid, vals, context) line = self.browse(cr, uid, result) member_line_obj = self.pool.get('membership.membership_line') if line.invoice_id.type == 'out_invoice':
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)], context=context)
def create(self, cr, uid, vals, context={}): """Overrides orm create method """ result = super(account_invoice_line, self).create(cr, uid, vals, context) line = self.browse(cr, uid, result) member_line_obj = self.pool.get('membership.membership_line') if line.invoice_id.type == 'out_invoice':
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
})
}, context=context)
def create(self, cr, uid, vals, context={}): """Overrides orm create method """ result = super(account_invoice_line, self).create(cr, uid, vals, context) line = self.browse(cr, uid, result) member_line_obj = self.pool.get('membership.membership_line') if line.invoice_id.type == 'out_invoice':
2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py
uid = self.uid
def _tag_act_window(self, cr, rec, data_node=None): name = rec.get('name','').encode('utf-8') xml_id = rec.get('id','').encode('utf8') self._test_xml_id(xml_id) type = rec.get('type','').encode('utf-8') or 'ir.actions.act_window' view_id = False if rec.get('view'): view_id = self.id_get(cr, 'ir.actions.act_window', rec...
197f89966ba51d68a406fb4bd5525173913d354e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/197f89966ba51d68a406fb4bd5525173913d354e/convert.py
gid = super(groups, self).create(cr, uid, vals, context=context)
gid = super(groups, self).create(cr, uid, vals, context=context)
def create(self, cr, uid, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): raise osv.except_osv(_('Error'), _('The name of the group can not start with "-"')) gid = super(groups, self).create(cr, uid, vals, context=context) if context and context.get('noadmin', False): pass else: # assign this n...
288fc76f2950280ae04edfd8ac2e0b88888cfcf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/288fc76f2950280ae04edfd8ac2e0b88888cfcf2/res_user.py
def _companies_get(self,cr, uid, context={}): res=[] ids = self.pool.get('res.users').browse(cr, uid, uid, context).company_ids res = [(i.id,i.name) for i in ids] return res
288fc76f2950280ae04edfd8ac2e0b88888cfcf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/288fc76f2950280ae04edfd8ac2e0b88888cfcf2/res_user.py
return res
return res
def get_current_company(self, cr, uid): res=[] cr.execute('select company_id, res_company.name from res_users left join res_company on res_company.id = company_id where res_users.id=%s' %uid) res = cr.fetchall() return res
288fc76f2950280ae04edfd8ac2e0b88888cfcf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/288fc76f2950280ae04edfd8ac2e0b88888cfcf2/res_user.py
'company': fields.selection(_companies_get, 'Company', size=64),
'company': fields.selection(_companies_get, 'Company', size=64),
def get_current_company(self, cr, uid): res=[] cr.execute('select company_id, res_company.name from res_users left join res_company on res_company.id = company_id where res_users.id=%s' %uid) res = cr.fetchall() return res
288fc76f2950280ae04edfd8ac2e0b88888cfcf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/288fc76f2950280ae04edfd8ac2e0b88888cfcf2/res_user.py
wquery = obj._where_calc(cr, user, self._domain, context=context)
domain = isinstance(self._domain, list) and self._domain or [] wquery = obj._where_calc(cr, user, domain, context=context)
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] if offset: warnings.warn("Specifying offset at a many2many.get() may produce unpredictable results.", DeprecationWarning,...
be2926de630f8547dc2e25d4060f79cf299bf533 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be2926de630f8547dc2e25d4060f79cf299bf533/fields.py
def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': return
0f03d60fdf6a48b1188bbcfb17fb01c17e1c420d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f03d60fdf6a48b1188bbcfb17fb01c17e1c420d/marketing_campaign.py
run = False if transition.trigger != 'signal' and campaign_mode != 'manual': if transition.trigger == 'auto' or campaign_mode == 'test': run = True
run = transition.trigger == 'auto' \ or (transition.trigger == 'time' \ and campaign_mode == 'test')
def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': return
0f03d60fdf6a48b1188bbcfb17fb01c17e1c420d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f03d60fdf6a48b1188bbcfb17fb01c17e1c420d/marketing_campaign.py
'get_contract':self.get_contract,
def __init__(self, cr, uid, name, context): super(salary_structure_report, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_type':self.get_type, 'get_contract':self.get_contract, 'get_line_amount_type':self.get_line_amount_type, 'get_line_type':self.get_line_type, 'get_line_amount_sy...
62592beb07d76af1f063837d4cda2225290aba2e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62592beb07d76af1f063837d4cda2225290aba2e/report_emp_salary_structure.py
def get_contract(self,emp): curr_date = "'"+time.strftime("%Y-%m-%d")+"'" sql_req= ''' SELECT c.id as id, c.wage as wage, struct_id as struct FROM hr_contract c LEFT JOIN hr_employee emp on (c.employee_id=emp.id) LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) LEFT JOIN hr_contract_wage_type_period p o...
def get_contract(self,emp): curr_date = "'"+time.strftime("%Y-%m-%d")+"'" sql_req= ''' SELECT c.id as id, c.wage as wage, struct_id as struct FROM hr_contract c LEFT JOIN hr_employee emp on (c.employee_id=emp.id) LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) LEFT JOIN hr_contract_wage_type_period p o...
62592beb07d76af1f063837d4cda2225290aba2e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62592beb07d76af1f063837d4cda2225290aba2e/report_emp_salary_structure.py
tools.drop_view_if_exists(cr, 'stock_report_prodlots')
drop_view_if_exists(cr, 'stock_report_prodlots')
def init(self, cr): tools.drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view stock_report_prodlots as ( select max(id) as id, location_id, product_id, prodlot_id, sum(qty) as name from ( select -max(sm.id) as id, sm.location_id, sm.product_id, sm.prodlot_id, -sum(sm.product_qty /uo.f...
609058edda3ef483b46de9f5cb61bb3c1485b4b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/609058edda3ef483b46de9f5cb61bb3c1485b4b9/report_stock.py
tools.drop_view_if_exists(cr, 'stock_report_tracklots')
drop_view_if_exists(cr, 'stock_report_prodlots')
def init(self, cr): tools.drop_view_if_exists(cr, 'stock_report_tracklots') cr.execute(""" create or replace view stock_report_tracklots as ( select max(id) as id, location_id, product_id, tracking_id, sum(qty) as name from ( select -max(sm.id) as id, sm.location_id, sm.product_id, sm.tracking_id, -sum(sm.product_qty ...
609058edda3ef483b46de9f5cb61bb3c1485b4b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/609058edda3ef483b46de9f5cb61bb3c1485b4b9/report_stock.py
tools.drop_view_if_exists(cr, 'report_stock_lines_date')
drop_view_if_exists(cr, 'stock_report_prodlots')
def init(self, cr): tools.drop_view_if_exists(cr, 'report_stock_lines_date') cr.execute(""" create or replace view report_stock_lines_date as ( select p.id as id, p.id as product_id, max(s.date) as date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) left join stock_inventory s on (...
609058edda3ef483b46de9f5cb61bb3c1485b4b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/609058edda3ef483b46de9f5cb61bb3c1485b4b9/report_stock.py
date_close = tasks[task.id][-1][1]
date_close = tasks[task.id] and tasks[task.id][-1][1] or False
def _compute_tasks(cr, uid, task_list, date_begin): sequences = [] users = {} tasks = {} last_date = date_begin for task in task_list: # TODO: reorder ! with dependencies if not task.planned_hours: continue if task.state in ('draft','open','progress') and task.user_id: # Find the starting date of the task if task.user...
7f747fa4ee68c7f469369a6e131469771ec1ba95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f747fa4ee68c7f469369a6e131469771ec1ba95/_date_compute.py
users[task.user_id.id] = date_close sequences.append((task.sequence, date_close)) if date_close>last_date: last_date=date_close
if date_close: users[task.user_id.id] = date_close sequences.append((task.sequence, date_close)) if date_close>last_date: last_date=date_close
def _compute_tasks(cr, uid, task_list, date_begin): sequences = [] users = {} tasks = {} last_date = date_begin for task in task_list: # TODO: reorder ! with dependencies if not task.planned_hours: continue if task.state in ('draft','open','progress') and task.user_id: # Find the starting date of the task if task.user...
7f747fa4ee68c7f469369a6e131469771ec1ba95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f747fa4ee68c7f469369a6e131469771ec1ba95/_date_compute.py
'soap': False,
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, ...
733fe62640bc88bc49f02c217c754d05c3337de4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/733fe62640bc88bc49f02c217c754d05c3337de4/config.py
def _email_send(message, openobject_id=None, debug=False):
def _email_send(smtp_from, smtp_to_list, message, openobject_id=None, ssl=False, debug=False):
def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True ...
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/misc.py
s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), message.as_string())
s.sendmail(smtp_from, smtp_to_list, message.as_string())
def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True ...
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/misc.py
s.quit() if debug: smtplib.stderr = oldstderr
try: s.quit() if debug: smtplib.stderr = oldstderr except: pass
def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True ...
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/misc.py
if not ssl: ssl = config.get('smtp_ssl', False)
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...
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/misc.py
smtp_server = config['smtp_server'] if smtp_server.startswith('maildir:/'): from mailbox import Maildir maildir_path = smtp_server[8:] try: mdir = Maildir(maildir_path,factory=None, create = True) mdir.add(msg.as_string(True)) return True except Exception,e: netsvc.Logger().notifyChannel('email_send (maildir)', netsvc....
return _email_send(email_from, flatten([email_to, email_cc, email_bcc]), msg, openobject_id=openobject_id, ssl=ssl, debug=debug)
def write(self, s): self.logger.notifyChannel('email_send', netsvc.LOG_DEBUG, s)
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/misc.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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/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...
213a206587059f59e6cbff6938e3c2fba1a9a2c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/213a206587059f59e6cbff6938e3c2fba1a9a2c8/users_ldap.py
return user.context_section_id
print "section id",type(user.context_section_id) return int(user.context_section_id)
def _get_section(self, cr, uid, context): user = self.pool.get('res.users').browse(cr,uid,uid,context=context) return user.context_section_id
cf177047b120d4c034e6d8b3baabd1cd1b388856 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf177047b120d4c034e6d8b3baabd1cd1b388856/sale_crm.py
GROUP BY partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
def _get_lines(self, form): res = [] self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ res_partner.name AS name \ FROM res_partner,account_move_line AS l, account_account\ WHERE (l.account_id=account_account.id) \ AND ((reconcile_id IS NULL)\ OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS rec...
595ef2d6e13b76d5c184711468c3410a3d802412 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/595ef2d6e13b76d5c184711468c3410a3d802412/account_aged_partner_balance.py
if not password: return False
try: return self._login(db, login, password) except Exception, e: import logging logging.getLogger('netsvc').exception('Could not authenticate') return Exception('Access Denied') def _login(self, db, login, password): if not password: return False if db is False: raise RuntimeError("Cannot authenticate to False db!")
def login(self, db, login, password):
72ad853a208dccfdbe3ce398196a6ff87507db8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/72ad853a208dccfdbe3ce398196a6ff87507db8d/crypt.py
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
action_pool.run(cr, user, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
def fetch_mail(self, cr, uid, ids, context={}): email_tool = self.pool.get('email.server.tools') action_pool = self.pool.get('ir.actions.server') context.update({'get_server': True}) for server in self.browse(cr, uid, ids, context): count = 0 user = server.user_id.id or uid try: if server.type == 'imap': imap_server = ...
670d636d4ba8dd7f85ac1f811b04eeafce582c7a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/670d636d4ba8dd7f85ac1f811b04eeafce582c7a/fetchmail.py
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
action_pool.run(cr, user, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
def fetch_mail(self, cr, uid, ids, context={}): email_tool = self.pool.get('email.server.tools') action_pool = self.pool.get('ir.actions.server') context.update({'get_server': True}) for server in self.browse(cr, uid, ids, context): count = 0 user = server.user_id.id or uid try: if server.type == 'imap': imap_server = ...
670d636d4ba8dd7f85ac1f811b04eeafce582c7a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/670d636d4ba8dd7f85ac1f811b04eeafce582c7a/fetchmail.py
res = node.open_data(cr, mode)
try: res = node.open_data(cr, mode) except TypeError, e: raise IOError(errno.EINVAL, "No data")
def open(self, datacr, mode): if not (datacr and datacr[1]): raise OSError(1, 'Operation not permited.') # Reading operation cr, node, rem = datacr res = node.open_data(cr, mode) return res
8cd367f9ed6e49bc46c5dcccd2d52c5b9a6c4329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8cd367f9ed6e49bc46c5dcccd2d52c5b9a6c4329/abstracted_fs.py
def _get_fiscalyear(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name return super(journal_print ,self)._get_fiscalyear(data)
def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone()
5004d0011ec9a4b02969f23cf1a3fb47fcc7d0dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5004d0011ec9a4b02969f23cf1a3fb47fcc7d0dc/account_journal.py
cr.execute(sql,(data['form']['date1']))
cr.execute(sql,(data['form']['date1'],))
def _check_date(self, cr, uid, data, context):
a64e07de85f468adf4e9c5ec85fbb1c3acc33984 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a64e07de85f468adf4e9c5ec85fbb1c3acc33984/wizard_third_party_ledger.py
def _get_chart_account(cursor, user, account): if account.parent_id: chart_account = _get_chart_account(cursor, user, account.parent_id) else: chart_account = account return chart_account
def _get_chart_account(cursor, user, account): if account.parent_id: chart_account = _get_chart_account(cursor, user, account.parent_id) else: chart_account = account return chart_account
e71bd619ec9bebf983df925970b9998b48c3c741 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e71bd619ec9bebf983df925970b9998b48c3c741/account.py
s = decode_header(s) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s))
s = decode_header(s) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
def _decode_header(self, s): from email.Header import decode_header s = decode_header(s) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s))
78cade20a308bf13c487351d3c6cf1912d29e6d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/78cade20a308bf13c487351d3c6cf1912d29e6d4/openerp_mailgate.py
'title': lead.title,
'title': lead.title and lead.title.id or False,
def _create_partner(self, cr, uid, ids, context=None): """ This function Creates partner based on action. @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 ids: List of Lead to Partner's IDs @param context: A standard dict...
a2e42c4e73cfb97108bcdb5b6322e6c5ec077396 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a2e42c4e73cfb97108bcdb5b6322e6c5ec077396/crm_lead_to_partner.py
elif fget[groupby]['type'] == 'many2one': d[groupby] = d[groupby] and ((type(d[groupby])==type(1)) and d[groupby] or d[groupby][1]) or ''
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields
7f3254ab275c7317557f0ed8f3a20ff2e6511461 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f3254ab275c7317557f0ed8f3a20ff2e6511461/orm.py
for test in expressions.get('test', ''):
for test in expressions:
def process_assert(self, node): assertion, expressions = node.items()[0]
8d62e97ff5030095ea3ab415a09fe5d8062d5cf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8d62e97ff5030095ea3ab415a09fe5d8062d5cf0/yaml_import.py
tables, where_clause = self._inherits_join_calc(groupby,tables,where_clause)
tables, where_clause, qfield = self._inherits_join_calc(groupby,tables,where_clause)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields
502defb1a4c78024cbec1da9838616766d5fe254 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/502defb1a4c78024cbec1da9838616766d5fe254/orm.py
tax_obj.compute(cr, uid, line.product_id.taxes_id,
tax_obj.compute_all(cr, uid, line.product_id.taxes_id,
def _amount_all(self, cr, uid, ids, name, args, context=None): tax_obj = self.pool.get('account.tax') res={} for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_paid': 0.0, 'amount_return':0.0, 'amount_tax':0.0, } for payment in order.statement_ids: res[order.id]['amount_paid'] += payment.amount for paym...
f0b124d52dc24d9175dfa030b6c8608151b92479 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0b124d52dc24d9175dfa030b6c8608151b92479/pos.py
computed_taxes = account_tax_obj.compute(
computed_taxes = account_tax_objcompute_all(
order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
f0b124d52dc24d9175dfa030b6c8608151b92479 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0b124d52dc24d9175dfa030b6c8608151b92479/pos.py
computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty)
computed_taxes = account_tax_objcompute_all(cr, uid, taxes, line.price_unit, line.qty)
def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context): res = {} account_tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty) for tax in...
f0b124d52dc24d9175dfa030b6c8608151b92479 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0b124d52dc24d9175dfa030b6c8608151b92479/pos.py
self.write(cr, uid, ids, { 'groups_id': [((3 if value == 'simple' else 4), extended_group_id)]}, context=context)
if type(ids) in (int,long,): ids = [ids] if value != 'simple': for user in self.browse(cr, uid, ids, context=context): group_ids = map(lambda x:x.id, user.groups_id) if extended_group_id not in group_ids: self.write(cr, uid, [user.id], {'groups_id': [(4, extended_group_id)]}, context=context) else: self.write(cr, uid,...
def _set_interface_type(self, cr, uid, ids, name, value, arg, context=None): """Implementation of 'view' function field setter, sets the type of interface of the users. @param name: Name of the field @param arg: User defined argument @param value: new value returned @return: True/False """ if not value or value not in...
87fd857d724c5333250c5a84322917b021116a83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87fd857d724c5333250c5a84322917b021116a83/res_user.py
search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])] contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, \ limit=limit, order=order, context=context, count=count) contacts = contact_obj.browse(cr, user, contact_ids, context=context) for contact in contacts: job_ids.extend([it...
if arg[2] and not count: search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])] contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, limit=limit, order=order, context=context, count=count) contacts = contact_obj.browse(cr, user, contact_ids, context=context) for contact in conta...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @...
c522cbff3b9240c195c0a3bec86e84039f3c1713 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c522cbff3b9240c195c0a3bec86e84039f3c1713/base_contact.py
trigger_date = dtstart + (vals['trigger_occurs'] == 'AFTER' and delta or -delta) vals['trigger_date'] = trigger_date
trigger_date = dtstart + (vals['trigger_occurs'] == 'AFTER' and delta or -delta) vals['trigger_date'] = trigger_date
def create(self, cr, uid, vals, context={}): event_date = vals.get('event_date', False) if event_date: dtstart = datetime.datetime.strptime(vals['event_date'], "%Y-%m-%d %H:%M:%S") if vals['trigger_interval'] == 'DAYS': delta = datetime.timedelta(days=vals['trigger_duration']) if vals['trigger_interval'] == 'HOURS': de...
363fd1ca01676d0c35ffe9725222b04e2ac96cf4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/363fd1ca01676d0c35ffe9725222b04e2ac96cf4/common.py
txt = unicode(self.localcontext.get('translate', lambda x:x)(txt))
txt = unicode(txt)
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0))) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcon...
d25532fb01af050e91c88f39d3d89ea2664057e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d25532fb01af050e91c88f39d3d89ea2664057e7/utils.py
self.blacklist_for_save = set(["publisher_warranty_url"])
self.blacklist_for_save = set(["publisher_warranty_url", "load_language"])
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
a8422b1b091b222d016e1295c57536a415697a58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a8422b1b091b222d016e1295c57536a415697a58/config.py
import pdb pdb.set_trace()
def set_context(self, objects, data, ids, report_type = None): new_ids = ids if (data['model'] == 'ir.ui.menu'): new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) import pdb pdb.set_trace() super(journal_print...
6c6fb8c3592b12aa9b1b3096d347a82c681171f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6c6fb8c3592b12aa9b1b3096d347a82c681171f9/account_journal.py
m2o_order = m2o_order.split(",",1)[0].strip().split(" ",1)[0]
m2o_order_list = [] for order_part in m2o_order.split(",",1): m2o_order_list.append(order_part.strip().split(" ",1)[0].strip()) m2o_order = m2o_order_list
def _generate_m2o_order_by(self, order_field, query): """ Add possibly missing JOIN to ``query`` and generate the ORDER BY clause for m2o fields, either native m2o fields or function/related fields that are stored, including intermediate JOINs for inheritance if required.
162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py
return '"%s"."%s"' % (dest_model._table, m2o_order)
qualify = lambda field: '"%s"."%s"' % (dest_model._table, field) return map(qualify, m2o_order) if isinstance(m2o_order, list) else qualify(m2o_order)
def _generate_m2o_order_by(self, order_field, query): """ Add possibly missing JOIN to ``query`` and generate the ORDER BY clause for m2o fields, either native m2o fields or function/related fields that are stored, including intermediate JOINs for inheritance if required.
162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py
continue
continue
def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction.
162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py
continue
continue
def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction.
162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py
order_by_elements.append("%s %s" % (inner_clause, order_direction))
if isinstance(inner_clause, list): for clause in inner_clause: order_by_elements.append("%s %s" % (clause, order_direction)) else: order_by_elements.append("%s %s" % (inner_clause, order_direction))
def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction.
162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py
field_search[2] = "'%"+str(search_value)+"%'"
field_search[2] = "'%%"+str(search_value)+"%%'"
def set_field_operator(self,field_name,field_type,search_operator,search_value): field_search = [field_name,search_operator,search_value] if search_operator == '=': if field_type=='many2one': field_search[1]='in' field_search[2] = "("+','.join([str(x) for x in search_value])+")" elif field_type in char_type or field_ty...
ee33d85b03b66815a4bfc186a755e761f321af61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee33d85b03b66815a4bfc186a755e761f321af61/wiz_set_filter_fields.py
field_search[2] = "'%"+str(search_value)+"%'"
field_search[2] = "'%%"+str(search_value)+"%%'"
def set_field_operator(self,field_name,field_type,search_operator,search_value): field_search = [field_name,search_operator,search_value] if search_operator == '=': if field_type=='many2one': field_search[1]='in' field_search[2] = "("+','.join([str(x) for x in search_value])+")" elif field_type in char_type or field_ty...
ee33d85b03b66815a4bfc186a755e761f321af61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee33d85b03b66815a4bfc186a755e761f321af61/wiz_set_filter_fields.py
def exp_list(self): if not tools.config['list_db']:
def exp_list(self, document=False): if not tools.config['list_db'] and not document:
def exp_list(self): if not tools.config['list_db']: raise Exception('AccessDenied')
47c1d217598f96e25db3d38baada091d7937055f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/47c1d217598f96e25db3d38baada091d7937055f/web_services.py
def setTTFontMapping(self,face, fontname,filename, mode='all'): from reportlab.lib.fonts import addMapping from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont pdfmetrics.registerFont(TTFont(fontname, filename )) if (mode == 'all'): addMapping(face, 0, 0, fontname) #normal addMappin...
c6543844f45c7f3604611a585c1a3ce1f2ef1f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6543844f45c7f3604611a585c1a3ce1f2ef1f2d/trml2pdf.py
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase import pdfmetrics
def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
c6543844f45c7f3604611a585c1a3ce1f2ef1f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6543844f45c7f3604611a585c1a3ce1f2ef1f2d/trml2pdf.py
def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
c6543844f45c7f3604611a585c1a3ce1f2ef1f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6543844f45c7f3604611a585c1a3ce1f2ef1f2d/trml2pdf.py
fname = self.canvas._fontname
fname = self.canvas._fontname
def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
c6543844f45c7f3604611a585c1a3ce1f2ef1f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6543844f45c7f3604611a585c1a3ce1f2ef1f2d/trml2pdf.py
self.localcontext = localcontext
self.localcontext = localcontext.copy
def __init__(self, node, localcontext, styles, self2): self.localcontext = localcontext self.node = node self.styles = styles self.width = utils.unit_get(node.get('width')) self.height = utils.unit_get(node.get('height')) self.self2 = self2
c6543844f45c7f3604611a585c1a3ce1f2ef1f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6543844f45c7f3604611a585c1a3ce1f2ef1f2d/trml2pdf.py
"HTMLParser", "select", "libxslt", "libxml2", "mako", "poplib",
"HTMLParser", "select", "mako", "poplib",
def run(self): # create startup script start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-server.py $@\n"\ % (join(self.install_libbase, "openerp-server"), sys.executable) # write script f = open('openerp-server', 'w') f.write(start_script) f.close() install.run(self)
d2ad2f4355965fc2bd38e9f75d2e62f38329d1bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d2ad2f4355965fc2bd38e9f75d2e62f38329d1bf/setup.py
for x in ('CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'DEBUG_RPC', 'NOTSET')])
for x in ('CRITICAL', 'ERROR', 'WARNING', 'INFO', 'TEST', 'DEBUG', 'DEBUG_RPC', 'NOTSET')])
def __init__(self, fname=None): self.options = { 'email_from':False, 'interface': '', # this will bind the server to all interfaces 'port': 8069, 'netinterface': '', 'netport': 8070, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'ne...
231336c878cef4cd3b8054cbea8ce187c2bf470f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/231336c878cef4cd3b8054cbea8ce187c2bf470f/config.py
basic_alarm = meeting.alarm_id
def do_alarm_create(self, cr, uid, ids, context={}): alarm_obj = self.pool.get('calendar.alarm') model_obj = self.pool.get('ir.model') model_id = model_obj.search(cr, uid, [('model', '=', self._name)])[0]
26cfa4092073a5af135483c80028c6b7529d485f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26cfa4092073a5af135483c80028c6b7529d485f/crm_meeting.py
cr.execute('Update crm_meeting set caldav_alarm_id=%s \ where id=%s' % (alarm_id, meeting.id))
cr.execute('Update crm_meeting set caldav_alarm_id=%s, \ alarm_id=%s where id=%s' % (alarm_id, basic_alarm.id, meeting.id))
def do_alarm_create(self, cr, uid, ids, context={}): alarm_obj = self.pool.get('calendar.alarm') model_obj = self.pool.get('ir.model') model_id = model_obj.search(cr, uid, [('model', '=', self._name)])[0]
26cfa4092073a5af135483c80028c6b7529d485f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26cfa4092073a5af135483c80028c6b7529d485f/crm_meeting.py
self.do_alarm_create(cr, uid, new_ids)
if vals.get('alarm_id'): self.do_alarm_create(cr, uid, new_ids)
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids new_ids = [] for id in select: id = common.caldav_id2real_id(id) if not id in new_ids: new_ids.append(id) res = super(crm_meeting, self).write(cr, uid, new_ids, vals,...
26cfa4092073a5af135483c80028c6b7529d485f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26cfa4092073a5af135483c80028c6b7529d485f/crm_meeting.py
def _select_signals(self, cr, uid, context={}): cr.execute("select distinct t.signal as key, t.signal || ' - [ ' || w.osv || ' ] ' as val from wkf w, wkf_activity a, wkf_transition t "\ " where w.id = a.wkf_id " \ " and t.act_from = a.id " \ " or t.act_to = a.id and t.signal not in (null, NULL)") result = cr.fetchall()...
c8bcdda9537cbb5a43955f848009a3eda39ef36b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c8bcdda9537cbb5a43955f848009a3eda39ef36b/ir_actions.py
'obj':obj
'object':obj
def run(self, cr, uid, ids, context={}): logger = netsvc.Logger() for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context':context, 'object': obj, 'time':time, 'cr': cr, 'pool' : self.pool, ...
c8bcdda9537cbb5a43955f848009a3eda39ef36b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c8bcdda9537cbb5a43955f848009a3eda39ef36b/ir_actions.py
self._parents = []
def __init__(self, *args, **kwargs): self._cache = {} self._parents = [] r = super(ir_ui_menu, self).__init__(*args, **kwargs) self.pool.get('ir.model.access').register_cache_clearing_method(self._name, 'clear_cache') return r
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
self._parents = []
def clear_cache(self): # radical but this doesn't frequently happen self._cache = {} self._parents = []
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
if uid !=1: flag = True for dom in args: if dom[0] == 'parent_id': flag = False break if flag: args += [('parent_id','child_of',self._parents)] ids = osv.orm.orm.search(self, cr, uid, args, offset, uid==1 and limit or None, order, context=context, count=(count and uid==1))
ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1))
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
if limit and not count: ids = ids[:int(limit)]
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
continue
continue
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
if not menu.parent_id.id: self._parents.append(menu.id)
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
if not menu.parent_id.id: self._parents.append(menu.id)
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
self._cache[key] = True
self._cache[key] = True
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
if limit: result = result[:int(limit)]
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {}
db13ceee7aa2221b49dc8645871e12986ebe822f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db13ceee7aa2221b49dc8645871e12986ebe822f/ir_ui_menu.py
resource_id = len(resource_ids) or resource_ids[0]
if len(resource_ids): resource_id = resource_ids[0]
def _compute_day(self, cr, uid, ids, fields, args, context={}): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual va...
fa45d444e5204e7692cca42278563b3042906cfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa45d444e5204e7692cca42278563b3042906cfd/crm_lead.py
tsk.remaining_hours as remaining_hours
tsk.remaining_hours as remaining_hours, tsk.date_end as date_close
def init(self, cr): cr.execute(''' create or replace view report_closed_task as ( select tsk.id as id, tsk.sequence as sequence, tsk.name as name, tsk.project_id as project_id, tsk.user_id as user_id, tsk.date_deadline as date_deadline, tsk.planned_hours as planned_hours, tsk.delay_hours as delay_hours, tsk.progress as...
0111d8b79e1d60e6ece8573e33dc103e2ec72a3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0111d8b79e1d60e6ece8573e33dc103e2ec72a3b/report_task.py
where (tsk.date_end <= CURRENT_DATE AND tsk.date_end > (CURRENT_DATE-15))
def init(self, cr): cr.execute(''' create or replace view report_closed_task as ( select tsk.id as id, tsk.sequence as sequence, tsk.name as name, tsk.project_id as project_id, tsk.user_id as user_id, tsk.date_deadline as date_deadline, tsk.planned_hours as planned_hours, tsk.delay_hours as delay_hours, tsk.progress as...
0111d8b79e1d60e6ece8573e33dc103e2ec72a3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0111d8b79e1d60e6ece8573e33dc103e2ec72a3b/report_task.py
message = type_list.get(vals.get('type',_('Picking'))) + " '" + vals['name'] + "' "+ _("created.")
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + "' "+ _("created.")
def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): vals['name'] = self.pool.get('ir.sequence').get(cr, user, 'stock.picking') type_list = { 'out':_('Packing List'), 'in':_('Reception'), 'internal': _('Internal picking'), 'delivery': _('Delivery order') } if not vals.get(...
04479073567222206d120f3c501672dc33a16512 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/04479073567222206d120f3c501672dc33a16512/stock.py