rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
'sum_currency_amount_account': self._sum_currency_amount_account, | def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period, 'get_account': self._get_account, 'get_filter': self._get_filter, 'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date, 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_fiscalyear': self._get_fiscalyear, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, 'print_data':self._print_data, | 21ed7a5f7a67b9f90d736f8dcd521522ef7f421c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21ed7a5f7a67b9f90d736f8dcd521522ef7f421c/account_journal.py |
|
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() if self.account_currency: return_field = str(total[0]) + self.account_currency return return_field else: currency_total = self.tot_currency = 0.0 return currency_total | def _set_get_account_currency_code(self, account_id): self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() if result: self.account_currency = result[0] else: self.account_currency = False | 21ed7a5f7a67b9f90d736f8dcd521522ef7f421c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21ed7a5f7a67b9f90d736f8dcd521522ef7f421c/account_journal.py |
|
res=self.cr.fetchone()[0] | res=self.cr.fetchone()[0] or 0.0 | def __pos_payment_date__total__(self,form): dt1 = form['date_start'] + ' 00:00:00' dt2 = form['date_end'] + ' 23:59:59' res=[] self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ ,(dt1,dt2,tuple(form['user_id']))) res=self.cr.fetchone()[0] return res | 2f4cc792d8468e34401e533202c5cb9cacebfd83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f4cc792d8468e34401e533202c5cb9cacebfd83/pos_payment_report_date.py |
assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id') % (xml_id) | assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % (xml_id) | def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None): warning = True model_obj = self.pool.get(model) if not context: context = {} if xml_id and ('.' in xml_id): assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id') % (xml_id) warning = False module, xml_id = xml_id.split('.') if (not xml_id) and (not self.doinit): return False action_id = False | 69147e278f1a4f14963cebf5332787c9463e713c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69147e278f1a4f14963cebf5332787c9463e713c/ir_model.py |
partner_address_id = val_invoice['value']['address_invoice_id'] value = inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id) l = inv_lines_pool.read(cr, uid, lines) | def _make_invoice(self, cr, uid, reg, lines, context=None): """ Create Invoice from Invoice lines @param reg : Model of Event Registration @param lines: Ids of Invoice lines """ if context is None: context = {} inv_pool = self.pool.get('account.invoice') inv_lines_pool = self.pool.get('account.invoice.line') | fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py |
|
contact_id = contact_obj.browse(cr, uid, contact) | def onchange_contact_id(self, cr, uid, ids, contact, partner): | fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py |
|
partner_data = res_obj.browse(cr, uid, part) | def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False): """This function returns value of Patner Invoice id, Unit Price, badget title based on partner and Event. @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 Registration IDs @param event_id: Event ID @param partner_invoice_id: Partner Invoice ID """ job_obj = self.pool.get('res.partner.job') res_obj = self.pool.get('res.partner') | fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py |
|
return obj_payment_order.set_done(cr, uid, context['active_id'], context) | obj_payment_order.set_done(cr, uid, context['active_id'], context) return {} | def launch_wizard(self, cr, uid, ids, context=None): """ Search for a wizard to launch according to the type. If type is manual. just confirm the order. """ obj_payment_order = self.pool.get('payment.order') | 0a2b5ca83438242580e1a83455ce54515782f334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a2b5ca83438242580e1a83455ce54515782f334/account_payment_pay.py |
res = self.write(cr, uid, event_id, {'exdate': date_new}) | exdate = (record['exdate'] and (record['exdate'] + ',') or '') + date_new res = self.write(cr, uid, event_id, {'exdate': exdate}) | def unlink(self, cr, uid, ids, context=None): """ Deletes records specified in ids. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: List of calendar event's id. @param context: A standard dictionary for contextual values @return: True """ res = False for event_id in ids: if isinstance(event_id, (int, long)): res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) continue event_id, date_new = event_id.split('-') event_id = [int(event_id)] for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): if record['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) res = self.write(cr, uid, event_id, {'exdate': date_new}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name) return res | 7ec3aa1f03df69bff406e5d582e4da288c7f1af2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ec3aa1f03df69bff406e5d582e4da288c7f1af2/base_calendar.py |
domain = {} | fields_process = {} | def __init__(self, cr, uid, id, table, cache, context=None, list_class=None, fields_process=None): ''' table : the object (inherited from orm) context : dictionary with an optional context ''' if fields_process is None: domain = {} if context is None: context = {} self._list_class = list_class or browse_record_list self._cr = cr self._uid = uid self._id = id self._table = table self._table_name = self._table._name self.__logger = logging.getLogger( 'osv.browse_record.' + self._table_name) self._context = context self._fields_process = fields_process | 8b3bd3cceea2c3861f9714de6c67decbd755547e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8b3bd3cceea2c3861f9714de6c67decbd755547e/orm.py |
default['backorder_id'] = False return super(stock_picking, self).copy(cr, uid, id, default, context) | default['backorder_id'] = False res=super(stock_picking, self).copy(cr, uid, id, default, context) if res: picking_obj = self.browse(cr, uid, [res], context)[0] for move in picking_obj.move_lines: move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False}) return res | def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() picking_obj = self.browse(cr, uid, [id], context)[0] if ('name' not in default) or (picking_obj.name=='/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) default['origin'] = '' default['backorder_id'] = False return super(stock_picking, self).copy(cr, uid, id, default, context) | 1a6f4471f42713b54c4e0269b2be6ba514d8d660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a6f4471f42713b54c4e0269b2be6ba514d8d660/stock.py |
def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True | def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True | 65730d7060b143b313f2ba3eb660ea1ca4ceb4e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65730d7060b143b313f2ba3eb660ea1ca4ceb4e8/stock.py |
|
class account_bank_statement_line(osv.osv): def _default_company(self, cr, uid, context={}): """ To get default company for the object" @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 bank statement ids @param context: A standard dictionary for contextual values @return: company """ user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] _inherit = 'account.bank.statement.line' _columns = { 'company_id':fields.many2one('res.company', 'Company', required=True), } _defaults = { 'company_id': _default_company, } account_bank_statement_line() | def _user_allow(self, cr, uid, ids, statement, context={}): res = False uids = [] for user in statement.journal_id.journal_users: uids.append(user.id) if uid in uids: res = True return res | c4f4f475dd0eef7e9be88811fcf620d03650feeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4f4f475dd0eef7e9be88811fcf620d03650feeb/account_bank_statement.py |
|
return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context))) | adrs_detail = dict(map(operator.attrgetter('id', 'address_id'), self.browse(cr, uid, ids, context=context))) for id,adrs in adrs_detail.items(): adrs_detail[id] = adrs.email return adrs_detail | def _email_get(self, cr, uid, ids, name, arg, context=None): return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context))) | c596d163a5d57a0cbff813207b14c5b13d897c4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c596d163a5d57a0cbff813207b14c5b13d897c4b/res_user.py |
f_size = getattr(f, 'size', 16) | f_size = getattr(f, 'size', None) or 16 | def get_pg_type(f): ''' returns a tuple (type returned by postgres when the column was created, type expression to create the column) ''' type_dict = { fields.boolean: 'bool', fields.integer: 'int4', fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', fields.datetime: 'timestamp', fields.binary: 'bytea', fields.many2one: 'int4', } if type(f) in type_dict: f_type = (type_dict[type(f)], type_dict[type(f)]) elif isinstance(f, fields.float): if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, (fields.char, fields.reference)): f_type = ('varchar', 'VARCHAR(%d)' % (f.size,)) elif isinstance(f, fields.selection): if isinstance(f.selection, list) and isinstance(f.selection[0][0], (str, unicode)): f_size = reduce(lambda x, y: max(x, len(y[0])), f.selection, f.size or 16) elif isinstance(f.selection, list) and isinstance(f.selection[0][0], int): f_size = -1 else: f_size = getattr(f, 'size', 16) if f_size == -1: f_type = ('int4', 'INTEGER') else: f_type = ('varchar', 'VARCHAR(%d)' % f_size) elif isinstance(f, fields.function) and eval('fields.'+(f._type)) in type_dict: t = eval('fields.'+(f._type)) f_type = (type_dict[t], type_dict[t]) elif isinstance(f, fields.function) and f._type == 'float': if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, fields.function) and f._type == 'selection': f_type = ('text', 'text') elif isinstance(f, fields.function) and f._type == 'char': f_type = ('varchar', 'VARCHAR(%d)' % (f.size)) else: logger = netsvc.Logger() logger.notifyChannel("init", netsvc.LOG_WARNING, '%s type not supported!' % (type(f))) f_type = None return f_type | 3816dadb22090212fa6c8eae24b3e9c3076a5e90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3816dadb22090212fa6c8eae24b3e9c3076a5e90/orm.py |
(check_duplicate, 'Warning! Can\'t have duplicate server configuration!', ['user', 'password']) | (check_duplicate, 'Warning! Can\'t have duplicate server configuration!', ['user', 'password']), (check_model, 'Warning! Record for slected Model can not be created\nPlease choose valid Model', ['object_id']) | def check_duplicate(self, cr, uid, ids): | 42d6b54c2dff0fbdd8f86ba5da92ab8e8e1c41e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/42d6b54c2dff0fbdd8f86ba5da92ab8e8e1c41e4/fetchmail.py |
context_wo_lang = context | context_wo_lang = context.copy() | def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values | 63d562de395face054ae4f55c576782a2795e6f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/63d562de395face054ae4f55c576782a2795e6f4/orm.py |
self.ical_set(cal_data.name.lower(), {'name': cal_data.params['CN'][0]}, 'value') | self.ical_set(cal_data.name.lower(), {'name': cal_data.params.get('CN') and cal_data.params.get('CN')[0]}, 'value') | def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @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 context: A standard dictionary for contextual values """ | 59426ee2760aed87a52d78a37d051aaff6d42525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/59426ee2760aed87a52d78a37d051aaff6d42525/calendar.py |
else: rml_head = self.rml_header | def _add_header(self, rml_dom, header='internal'): if header=='internal': rml_head = self.rml_header2 else: rml_head = self.rml_header | 50ea35380abf1157ea8353d36ecb25bc77084de7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50ea35380abf1157ea8353d36ecb25bc77084de7/report_sxw.py |
|
'product_qty': product_qty, 'product_uos_qty': product_qty | 'product_qty': move.product_qty, 'product_uos_qty': move.product_qty | def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) | 3e267b1e3c058b62abc175b642d292a7ded27bfe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e267b1e3c058b62abc175b642d292a7ded27bfe/stock.py |
sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),) | sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id = %d and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit"""%(o.id) | def _get_data(self,o): data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) data = self.cr.dictfetchall() a_l=[] for r in data: a_l.append(r['id']) if len(a_l): sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),) self.cr.execute(sql2) data = self.cr.dictfetchall() for d in data: self.total += d['amt'] return data | e5bef4c1d0badf41aa1f09a6793de244e726648c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5bef4c1d0badf41aa1f09a6793de244e726648c/pos_users_product.py |
name = allocation.resource_id.name if allocation.user_id: name = '%s' %(allocation.user_id.name) | name = allocation.phase_id.name | def get_name(self, cr, uid, ids, field_name, arg, context=None): res = {} for allocation in self.browse(cr, uid, ids, context=context): name = allocation.resource_id.name if allocation.user_id: name = '%s' %(allocation.user_id.name) name += ' (%s%%)' %(allocation.useability) res[allocation.id] = name return res | db6ee299b9bda8561074d6b70f4327b3341ec96d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db6ee299b9bda8561074d6b70f4327b3341ec96d/project_long_term.py |
('shortcut_unique', 'unique(res_id, user_id)', 'Shortcut for this menu already exists!'), | ('shortcut_unique', 'unique(res_id, resource, user_id)', 'Shortcut for this menu already exists!'), | def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context={}): ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context) return self.read(cr, uid, ids, ['res_id','name'], context=context) | b83c7d01c1183b816740aba227d1af1f24f7ca79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b83c7d01c1183b816740aba227d1af1f24f7ca79/ir_ui_view.py |
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) | f377b3696cb8ad93a09d0e09be825ab121eaaa30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f377b3696cb8ad93a09d0e09be825ab121eaaa30/account_entries_report.py |
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) | return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby) | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) | f377b3696cb8ad93a09d0e09be825ab121eaaa30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f377b3696cb8ad93a09d0e09be825ab121eaaa30/account_entries_report.py |
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): | def get_id(self, cr, uid, sequence_id, test='id', context=None): | def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False | 712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py |
cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) | assert test in ('code','id') cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+'=%s AND active=%s FOR UPDATE', (sequence_id, True)) | def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False | 712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py |
return self.get_id(cr, uid, code, test='code=%s') | return self.get_id(cr, uid, code, test='code') | def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s') | 712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py |
if view_ref: | if view_ref and not view_id: | def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None | 502318629321fb71481e1cab6ebf91b34234939e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/502318629321fb71481e1cab6ebf91b34234939e/orm.py |
r = {} | def _debit_calc(self, cr, uid, ids, name, arg, context={}): | 9abd6c97c6ff432e2b5d4eafe678b6b007a231ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9abd6c97c6ff432e2b5d4eafe678b6b007a231ff/project.py |
|
move_ids = [] | def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True | 90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py |
|
move_ids.append(res.id) | def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True | 90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py |
|
self.pool.get('stock.move').action_done(cr, uid, new_moves) | def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True | 90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py |
|
relation,view_load,state,select_level | relation,view_load,state,select_level,relation_field | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | 34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py |
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s | %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | 34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py |
vals['select_level'] | vals['select_level'],vals['relation_field'] | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | 34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py |
view_load=%s, select_level=%s, readonly=%s ,required=%s | view_load=%s, select_level=%s, readonly=%s ,required=%s ,relation_field=%s | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | 34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py |
vals['select_level'], bool(vals['readonly']),bool(vals['required']), vals['model'], vals['name'] | vals['select_level'], bool(vals['readonly']),bool(vals['required']), vals['relation_field'], vals['model'], vals['name'] | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | 34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py |
def process_sql_file(cr, file): | def process_sql_file(cr, fp): | def process_sql_file(cr, file): queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) | af6d826facac8bae1eacf2d1654bd35ee8a8b173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af6d826facac8bae1eacf2d1654bd35ee8a8b173/__init__.py |
process_sql_file(cr, fp) | process_sql_file(cr, file) | 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 file with noupdate == (kind == 'init') if ext == '.sql': process_sql_file(cr, fp) elif ext == '.csv': noupdate = (kind == 'init') tools.convert_csv_import(cr, module_name, pathname, file.read(), id_map, mode, noupdate) elif ext == '.yml': tools.convert_yaml_import(cr, module_name, file, id_map, mode, noupdate) else: tools.convert_xml_import(cr, module_name, file, id_map, mode, noupdate) file.close() | af6d826facac8bae1eacf2d1654bd35ee8a8b173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af6d826facac8bae1eacf2d1654bd35ee8a8b173/__init__.py |
if context is None: | if context is None: | def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {} | 7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py |
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context) | result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=time.strftime('%Y-%m-%d'), context=context) | def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {} | 7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py |
if context is None: | if context is None: | def search_invoices(self, cr, uid, ids, context=None): if context is None: context = {} line_obj = self.pool.get('account.move.line') statement_obj = self.pool.get('account.bank.statement') journal_obj = self.pool.get('account.journal') mod_obj = self.pool.get('ir.model.data') statement_id = 'statement_id' in context and context['statement_id'] | 7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py |
x_headers = { 'Reply-To':"%s" % case.section_id.reply_to, } | x_headers = dict() | def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """ | 7c7be29028dbe4568e7179afc5d193adb86f4db7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7c7be29028dbe4568e7179afc5d193adb86f4db7/crm_send_email.py |
res = defaultdict(list) | res = {} for id in ids: res[id] = [] | def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {} | 2cfe39726e678fc3965077a715a4bc2a2d1ef606 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2cfe39726e678fc3965077a715a4bc2a2d1ef606/fields.py |
res[r[self._fields_id]].append(r['id']) | if r[self._fields_id] in res.values(): res[r[self._fields_id]].append(r['id']) | def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {} | 2cfe39726e678fc3965077a715a4bc2a2d1ef606 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2cfe39726e678fc3965077a715a4bc2a2d1ef606/fields.py |
params.append(max_amount) | params += max_amount | def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 power = form['power'] allow_write_off = form['allow_write_off'] reconciled = unreconciled = 0 if not form['account_ids']: raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile')) for account_id in form['account_ids']: params = (account_id,) if not allow_write_off: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0""" else: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0""" params.append(max_amount) # reconcile automatically all transactions from partners whose balance is 0 cr.execute(query, params) partner_ids = [id for (id,) in cr.fetchall()] for partner_id in partner_ids: cr.execute( "SELECT id " \ "FROM account_move_line " \ "WHERE account_id=%s " \ "AND partner_id=%s " \ "AND state <> 'draft' " \ "AND reconcile_id IS NULL", (account_id, partner_id)) line_ids = [id for (id,) in cr.fetchall()] if len(line_ids): reconciled += len(line_ids) if allow_write_off: move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) else: move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={}) | 81a6bd02b044dfd837951f299d70e5f89af07243 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81a6bd02b044dfd837951f299d70e5f89af07243/account_automatic_reconcile.py |
res[event.id]['register_current'] = len(reg_ids) | res[event.id]['register_current'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | 463d928a0e098afd326eb695c26c8f1e2d65865b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/463d928a0e098afd326eb695c26c8f1e2d65865b/event.py |
res[event.id]['register_prospect'] = len(reg_ids) | res[event.id]['register_prospect'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | 463d928a0e098afd326eb695c26c8f1e2d65865b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/463d928a0e098afd326eb695c26c8f1e2d65865b/event.py |
task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['open', 'draft', 'pending'] , phase.task_ids))) | task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['draft'] , phase.task_ids))) | def schedule_tasks(self, cr, uid, ids, context=None): """ Schedule the tasks according to resource available and priority. """ task_pool = self.pool.get('project.task') resource_pool = self.pool.get('resource.resource') resources_list = self.generate_resources(cr, uid, ids, context=context) return_msg = {} for phase in self.browse(cr, uid, ids, context=context): start_date = phase.date_start if not start_date and phase.project_id.date_start: start_date = phase.project_id.date_start if not start_date: start_date = datetime.now().strftime("%Y-%m-%d") resources = resources_list.get(phase.id, []) calendar_id = phase.project_id.resource_calendar_id.id task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['open', 'draft', 'pending'] , phase.task_ids))) if task_ids: task_pool.generate_schedule(cr, uid, task_ids, resources, calendar_id, start_date, context=context) | f8c4b4e72ffea7448648cb1b5e4e5576c9cfa970 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f8c4b4e72ffea7448648cb1b5e4e5576c9cfa970/project_long_term.py |
res = {} result_acc = [] | def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={} | d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py |
|
parents = ids | def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={} | d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py |
|
accounts = obj_account.read(self.cr, self.uid, ids, ['type','code','name','debit','credit','balance','parent_id','level'], ctx) for account in accounts: if account['id'] in done: continue done[account['id']] = 1 res = { 'id': account['id'], 'type': account['type'], 'code': account['code'], 'name': account['name'], 'level': account['level'], 'debit': account['debit'], 'credit': account['credit'], 'balance': account['balance'], 'parent_id':account['parent_id'], 'bal_type':'', } self.sum_debit += account['debit'] self.sum_credit += account['credit'] if form['display_account'] == 'bal_movement': if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 : result_acc.append(res) elif form['display_account'] == 'bal_solde': if res['balance'] != 0: result_acc.append(res) else: result_acc.append(res) return result_acc | accounts = obj_account.read(self.cr, self.uid, ids, ['type','code','name','debit','credit','balance','parent_id','level','child_id'], ctx) for parent in parents: if parent in done: continue done[parent] = 1 _process_child(accounts,form['display_account'],parent) return self.result_acc | def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={} | d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py |
return new_ids = isinstance(ids, (str, int, long)) and data[0] or data | return isinstance(ids, (str, int, long)) and data[0] or data | def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): """ Read IR Model @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 IR Model’s IDs. @param context: A standard dictionary for contextual values """ | c53fbb38986fa6585a12e05e9148ad64096c194f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c53fbb38986fa6585a12e05e9148ad64096c194f/base_calendar.py |
last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') | last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) task_obj = self.pool.get('project.task.work') | def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result | d0317628aade90d1d8015cae782440683b862e21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0317628aade90d1d8015cae782440683b862e21/task_report.py |
last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 obj=self.pool.get('hr_timesheet_sheet.sheet.day') | last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) obj = self.pool.get('hr_timesheet_sheet.sheet.day') | def get_hrs_timesheet(self, cr, uid, ids, name,args,context): result = {} sum = 0.0 for record in self.browse(cr, uid, ids, context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 obj=self.pool.get('hr_timesheet_sheet.sheet.day') sheet_ids = obj.search(cr, uid, [('sheet_id.user_id','=',record.user_id.id),('name','>=',record.name),('name','<=',last_date.strftime('%Y-%m-%d'))]) data_days = obj.read(cr, uid, sheet_ids, ['name','sheet_id.user_id','total_attendance']) total = 0.0 for day_attendance in data_days: total += day_attendance['total_attendance'] result[record.id] = total return result | d0317628aade90d1d8015cae782440683b862e21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0317628aade90d1d8015cae782440683b862e21/task_report.py |
data = self.read(cr, uid, ids, [], context)[0] line_ids= data['entries'] | payment_obj = self.pool.get('payment.line') if context is None: context = {} data = self.read(cr, uid, ids, [])[0] line_ids = data['entries'] | def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
payment = order_obj.browse(cr, uid, data['active_id'], context=context) | payment = order_obj.browse(cr, uid, context['active_id'], context=context) | def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
line2bank = pool.get('account.move.line').line2bank(cr, uid, line_ids, t, context) | line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) | def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
pool.get('payment.line').create(cr, uid,{ | payment_obj.create(cr, uid,{ | def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
return {} | return {'nodestroy':True,} | def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
if context is None: context = {} | def search_entries(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data') | 0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py |
|
def change_currency(self, cr, uid, ids, context=None): obj_inv = self.pool.get('account.invoice') obj_inv_line = self.pool.get('account.invoice.line') obj_currency = self.pool.get('res.currency') invoice_ids = [] if context is None: context = {} data = self.read(cr, uid, ids)[0] new_currency = data['currency_id'] | eea417316217cb43a25b2464ef3e0371e13a98d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eea417316217cb43a25b2464ef3e0371e13a98d0/account_change_currency.py |
||
last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 | last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 | def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result | ae5b993dce95dcca373e91e88a4cefbbad2c2510 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ae5b993dce95dcca373e91e88a4cefbbad2c2510/task_report.py |
'base_code_id': fields.many2one('account.tax.code', 'Base Code', help="Use this code for the VAT declaration."), 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="Use this code for the VAT declaration."), | 'base_code_id': fields.many2one('account.tax.code', 'Account Base Code', help="Use this code for the VAT declaration."), 'tax_code_id': fields.many2one('account.tax.code', 'Account Tax Code', help="Use this code for the VAT declaration."), | def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() default.update({'line_ids': []}) return super(account_tax_code, self).copy(cr, uid, id, default, context) | 818f9a443842174874f2b491ef26ff25cb3d3338 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/818f9a443842174874f2b491ef26ff25cb3d3338/account.py |
check if it's already installed (neither uninstallable nor uninstalled) | check if it's already installed (either 'to install', 'to upgrade' or 'installed') | def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module') | 26ed95e7729fc93370ca8d9b34e4ed41797f482e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ed95e7729fc93370ca8d9b34e4ed41797f482e/res_config.py |
('state','not in',['uninstallable', 'uninstalled'])], | ('state','in',['to install', 'installed', 'to upgrade'])], | def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module') | 26ed95e7729fc93370ca8d9b34e4ed41797f482e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ed95e7729fc93370ca8d9b34e4ed41797f482e/res_config.py |
_description = "NOte Type" | _description = "Note Type" | def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\ toolbar=False, submenu=False): """ Overrides orm field_view_get. @return: Dictionary of Fields, arch and toolbar. """ | cf7ffa4adc308d0c5bc0d60b96961219651f2306 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf7ffa4adc308d0c5bc0d60b96961219651f2306/board.py |
replaces[rep] = dict(obj.pool.get(rep).name_get(cr, uid, replaces[rep].keys(), context=context)) | nids = obj.pool.get(rep).search(cr, uid, [('id','in',replaces[rep].keys())], context=context) replaces[rep] = dict(obj.pool.get(rep).name_get(cr, uid, nids, context=context)) | def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, context=context) default_val,replaces = self._get_defaults(obj, cr, uid, prop_name, context) | 3ec84880c0b931e3ffaaf444bdff4db18cae69b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3ec84880c0b931e3ffaaf444bdff4db18cae69b9/fields.py |
res_id = model_pool.message_new(cr, uid, msg, context) | res_id = model_pool.message_new(cr, uid, msg, context)fetchmail/fetchmail.py | logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name)) | 85cb8855353dd63ab74f936af9da115e16e5aa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cb8855353dd63ab74f936af9da115e16e5aa06/fetchmail.py |
fp = os.popen('ping www.google.com -c 1 -w 5',"r") if not fp.read(): logger.notifyChannel('imap', netsvc.LOG_WARNING, 'lost internet connection !') | def fetch_mail(self, cr, uid, ids, context={}): | 85cb8855353dd63ab74f936af9da115e16e5aa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cb8855353dd63ab74f936af9da115e16e5aa06/fetchmail.py |
|
date_planned = (date_planned - relativedelta(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') | date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') | def action_ship_create(self, cr, uid, ids, *args): picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = False for line in order.order_line: proc_id = False date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) date_planned = (date_planned - relativedelta(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') if line.state == 'done': continue move_id = False if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'): location_id = order.shop_id.warehouse_id.lot_stock_id.id if not picking_id: loc_dest_id = order.partner_id.property_stock_customer.id pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') picking_id = self.pool.get('stock.picking').create(cr, uid, { 'name': pick_name, 'origin': order.name, 'type': 'out', 'state': 'auto', 'move_type': order.picking_policy, 'sale_id': order.id, 'address_id': order.partner_shipping_id.id, 'note': order.note, 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', 'company_id': order.company_id.id, }) move_id = self.pool.get('stock.move').create(cr, uid, { 'name': line.name[:64], 'picking_id': picking_id, 'product_id': line.product_id.id, 'date_planned': date_planned, 'date_expected': date_planned, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': line.product_uos_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'product_packaging': line.product_packaging.id, 'address_id': line.address_allotment_id.id or order.partner_shipping_id.id, 'location_id': location_id, 'location_dest_id': output_id, 'sale_line_id': line.id, 'tracking_id': False, 'state': 'draft', #'state': 'waiting', 'note': line.notes, 'company_id': order.company_id.id, }) if line.product_id: proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, 'origin': order.name, 'date_planned': date_planned, 'product_id': line.product_id.id, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': (line.product_uos and line.product_uos_qty)\ or line.product_uom_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'location_id': order.shop_id.warehouse_id.lot_stock_id.id, 'procure_method': line.type, 'move_id': move_id, 'property_ids': [(6, 0, [x.id for x in line.property_ids])], 'company_id': order.company_id.id, }) proc_ids.append(proc_id) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id}) | d37ef0a57183ba5ed91064c8bbe32aea90f4a1d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d37ef0a57183ba5ed91064c8bbe32aea90f4a1d1/sale.py |
"AND reconcile_id IS NULL " \ | " " + RECONCILE_TAG + " "\ | def _get_intial_balance(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] | f3d14cd792daaa9a466e49798baad4ded51ca0f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f3d14cd792daaa9a466e49798baad4ded51ca0f7/account_partner_ledger.py |
'am_out': fields.boolean('Controle for Output Operations'), 'disc_controle': fields.boolean('Discount Controle '), | 'am_out': fields.boolean('Control for Output Operations'), 'disc_controle': fields.boolean('Discount Control'), | def _scan_product(self, cr, uid, ean, qty, order): # search pricelist_id product_obj=self.pool.get('product.product') pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] ) if not pricelist_id: return False | c822a92a4058c8393c294cb73857cc166ad85882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c822a92a4058c8393c294cb73857cc166ad85882/pos.py |
LOG_DEBUG2 = 'debug2' | def log(lvl,msg): netsvc.Logger().notifyChannel("index",lvl,msg) | 83f646f97767fb00af65e05abb55642c4edeb4ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83f646f97767fb00af65e05abb55642c4edeb4ec/content_index.py |
|
_columns = { 'year': fields.char('Year', size='4', readonly=True, select=1), 'canceled_number': fields.integer('Canceled', readonly=True), 'waiting_number': fields.integer('Waiting', readonly=True), 'invoiced_number': fields.integer('Invoiced', readonly=True), 'paid_number': fields.integer('Paid', readonly=True), 'canceled_amount': fields.float('Canceled', digits=(16, 2), readonly=True), 'waiting_amount': fields.float('Waiting', digits=(16, 2), readonly=True), 'invoiced_amount': fields.float('Invoiced', digits=(16, 2), readonly=True), 'paid_amount': fields.float('Paid', digits=(16, 2), readonly=True), 'currency': fields.many2one('res.currency', 'Currency', readonly=True, select=2), } def init(self, cr): '''Create the view''' cr.execute(""" CREATE OR REPLACE VIEW report_partner_member_year AS ( SELECT MIN(id) AS id, COUNT(ncanceled) as canceled_number, COUNT(npaid) as paid_number, COUNT(ninvoiced) as invoiced_number, COUNT(nwaiting) as waiting_number, SUM(acanceled) as canceled_amount, SUM(apaid) as paid_amount, SUM(ainvoiced) as invoiced_amount, SUM(awaiting) as waiting_amount, year, currency FROM (SELECT CASE WHEN ai.state = 'cancel' THEN ml.id END AS ncanceled, CASE WHEN ai.state = 'paid' THEN ml.id END AS npaid, CASE WHEN ai.state = 'open' THEN ml.id END AS ninvoiced, CASE WHEN (ai.state = 'draft' OR ai.state = 'proforma') THEN ml.id END AS nwaiting, CASE WHEN ai.state = 'cancel' THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100)) ELSE 0 END AS acanceled, CASE WHEN ai.state = 'paid' THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100)) ELSE 0 END AS apaid, CASE WHEN ai.state = 'open' THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100)) ELSE 0 END AS ainvoiced, CASE WHEN (ai.state = 'draft' OR ai.state = 'proforma') THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100)) ELSE 0 END AS awaiting, TO_CHAR(ml.date_from, 'YYYY') AS year, ai.currency_id AS currency, MIN(ml.id) AS id FROM membership_membership_line ml JOIN (account_invoice_line ail LEFT JOIN account_invoice ai ON (ail.invoice_id = ai.id)) ON (ml.account_invoice_line = ail.id) JOIN res_partner p ON (ml.partner = p.id) GROUP BY TO_CHAR(ml.date_from, 'YYYY'), ai.state, ai.currency_id, ml.id) AS foo GROUP BY year, currency) """) ReportPartnerMemberYear() class ReportPartnerMemberYearNew(osv.osv): '''New Membership by Years''' _name = 'report.partner_member.year_new' _description = __doc__ _auto = False _rec_name = 'year' | def init(self, cr): '''Create the view''' cr.execute(""" | 8ea62c39b6787b3fe12a7b257f8ebc7cfa89bfa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ea62c39b6787b3fe12a7b257f8ebc7cfa89bfa2/membership.py |
|
case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context)[0] for att in case_val.attendees: | case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context) for att in case_val.attendee_ids: | def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): if not context: context = {} cr.execute('select c.id as id, crm_case.date as date, alarm.id as alarm_id, alarm.name as name,\ alarm.trigger_interval, alarm.trigger_duration, alarm.trigger_related, \ alarm.trigger_occurs from crm_meeting c \ join crm_case on c.inherit_case_id = crm_case.id \ join crm_caldav_alarm alarm on (alarm.id=c.alarm_id) \ where alarm_id is not null and alarm.active=True') case_with_alarm = cr.dictfetchall() case_obj = self.pool.get('crm.meeting') attendee_obj = self.pool.get('crm.caldav.attendee') mail_to = [] for alarmdata in case_with_alarm: dtstart = datetime.datetime.strptime(alarmdata['date'], "%Y-%m-%d %H:%M:%S") if alarmdata['trigger_interval'] == 'DAYS': delta = datetime.timedelta(days=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'HOURS': delta = datetime.timedelta(hours=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'MINUTES': delta = datetime.timedelta(minutes=alarmdata['trigger_duration']) alarm_time = dtstart + (alarmdata['trigger_occurs']== 'AFTER' and delta or -delta) if datetime.datetime.now() >= alarm_time: case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context)[0] for att in case_val.attendees: if att.cn.rsplit(': ')[-1]: mail_to.append(att.cn.rsplit(': ')[-1]) if mail_to: sub = 'Event Reminder for ' + case_val.name or '' body = (case_val.name or '')+ '\n\t' + (case_val.description or '') + '\n\nEvent time: ' \ +(case_val.date) + '\n\nLocation: ' + (case_val.location or '') + \ '\n\nMembers Details: ' + '\n'.join(mail_to) tools.email_send( case_val.user_id.address_id.email, mail_to, sub, body ) cr.execute('update crm_caldav_alarm set active=False\ where id = %s' % alarmdata['alarm_id']) cr.commit() return True | 58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py |
ls = common.caldav_id2real_id(caldav_id) | ls = common.caldav_id2real_id(id) | def unlink(self, cr, uid, ids, context=None): for id in ids: ls = common.caldav_id2real_id(caldav_id) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: date_new = ls[1] for record in self.read(cr, uid, [common.caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: exdate = (record['exdate'] and (record['exdate'] + ',') or '') + \ ''.join((re.compile('\d')).findall(date_new)) + 'Z' if record['date'] == date_new: self.write(cr, uid, [common.caldav_id2real_id(id)], {'exdate': exdate}) else: ids = map(lambda x: common.caldav_id2real_id(x), ids) return super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids)) else: return super(crm_meeting, self).unlink(cr, uid, ids) | 58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py |
'availability': fields.selection([('free', 'Free'), \ ('busy', 'Busy'), ('both', 'Both')], 'User Avaliability') } _defaults = { 'availability': lambda *x: 'free', } | } | def _get_user_avail(self, cr, uid, ids, name, args, context=None): res={} if not context or not context.get('model'): return {} else: model = context.get('model') obj = self.pool.get(model) event_obj = obj.browse(cr, uid, context['active_id']) event_start = event_obj.date event_end = datetime.datetime.strptime(event_obj.date, "%Y-%m-%d %H:%M:%S") \ + datetime.timedelta(hours=event_obj.duration) for id in ids: datas = self.browse(cr, uid, id) cr.execute("""SELECT c.date as start, (c.date::timestamp \ + c.duration * interval '1 hour') as end \ from crm_meeting m \ join crm_case c on (c.id=m.inherit_case_id)\ where c.user_id = %s and m.id not in (""" % (datas['id']) + str(context['active_id']) +")") dates = cr.dictfetchall() overlaps = False # check event time for date in dates: start = date['start'] end = date['end'] cr.execute("SELECT (timestamp '%s', timestamp '%s') OVERLAPS\ (timestamp '%s', timestamp '%s')" % (event_start, event_end, start, end)) over = cr.fetchone()[0] if over: overlaps = True | 58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py |
datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) | def do_invite(self, cr, uid, ids, context={}): #TODO: Add attendee return {} | 58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py |
|
res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}} | res = {'value' : {}} | def on_change_parent(self, cr, uid, id, parent_id): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) numchild = len(childs) if parent['partner_id']: partner = parent['partner_id'][0] else: partner = False res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}} if partner: res['value']['partner_id'] = partner return res | c99638ab487563e5166f897714200532dc0afca9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c99638ab487563e5166f897714200532dc0afca9/project.py |
value = acct_obj.search(cr, uid, [('type', 'in',('sale','sale_refund') )]) | value = acct_obj.search(cr, uid, [('type', 'in',('sale','purchase_refund') )]) | def _get_journal_id(self, cr, uid, context=None): if context is None: context = {} | 16620a3fff685df659700434c88a10374d682b86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16620a3fff685df659700434c88a10374d682b86/stock_invoice_onshipping.py |
value = acct_obj.search(cr, uid, [('type', 'in',('purchase','purchase_refund') )]) | value = acct_obj.search(cr, uid, [('type', 'in',('purchase','sale_refund') )]) | def _get_journal_id(self, cr, uid, context=None): if context is None: context = {} | 16620a3fff685df659700434c88a10374d682b86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16620a3fff685df659700434c88a10374d682b86/stock_invoice_onshipping.py |
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \ | cr.execute("select m.id, m.rrule, m.date, m.date_deadline, m.duration, \ | def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): """Gives virtual event ids for recurring events based on value of Recurrence Rule This method gives ids of dates that comes between start date and end date of calendar views @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 base_start_date: Get Start Date @param base_until_date: Get End Date @param limit: The Number of Results to Return """ | d44cd8ca622666b945c2e56d0c8b27c10a0970a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d44cd8ca622666b945c2e56d0c8b27c10a0970a0/base_calendar.py |
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False) | def _get_account(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name return super(journal_print ,self)._get_account(data) 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 _print_data(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).journal_id.currency or False return data['form']['amount_currency'] report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header='internal') | 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() | 1afb884e8d7aed85742d9900e7a9bf36cb857b9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1afb884e8d7aed85742d9900e7a9bf36cb857b9e/central_journal.py |
return super(event_event, self)._check_recursion(self, cr, uid, ids) | return super(event_event, self)._check_recursion(cr, uid, ids) | def _check_recursion(self, cr, uid, ids): return super(event_event, self)._check_recursion(self, cr, uid, ids) | 8fa6d985a7f79f332b6711b15fa6aea0afbade55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8fa6d985a7f79f332b6711b15fa6aea0afbade55/event.py |
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'): | date = time.strptime(vals['date'], '%Y-%m-%d') if not (date >= time.strptime(period.date_start,'%Y-%m-%d') and date <= time.strptime(period.date_stop,'%Y-%m-%d') ): | def check_date(self, cr, uid, vals, context=None, check=True): if not context: context = {} if 'date' in vals.keys(): if 'journal_id' in vals and 'journal_id' not in context: journal_id = vals['journal_id'] if 'period_id' in vals and 'period_id' not in context: period_id = vals['period_id'] elif 'journal_id' not in context and 'move_id' in vals: m = self.pool.get('account.move').browse(cr, uid, vals['move_id']) journal_id = m.journal_id.id period_id = m.period_id.id else: journal_id = context['journal_id'] period_id = context['period_id'] journal=self.pool.get('account.journal').browse(cr,uid,[journal_id])[0] if not journal.allow_date: period=self.pool.get('account.period').browse(cr,uid,[period_id])[0] if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'): raise osv.except_osv(_('Error'),_('The date of your Ledger Posting is not in the defined period !')) else: return True | 011f5100f3282b08855d6f105d0771f90321f094 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/011f5100f3282b08855d6f105d0771f90321f094/account_date_check.py |
'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Real Entry'), | 'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True, states={'draft':[('readonly',False)]}), | def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id else: return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0] | 7f6ef794068c1262a2e0f834b55d6b73b8b29611 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f6ef794068c1262a2e0f834b55d6b73b8b29611/voucher.py |
val = {'invoiced': True} | for line in order.order_line: if line.state == 'exception': self.pool.get('sale.order.line').write(cr, uid, [line.id], {'state': 'confirmed'}, context=context) | def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress' | 06d2f4d107669396fbeb360194fd24f4ad3f41ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d2f4d107669396fbeb360194fd24f4ad3f41ac/sale.py |
val['state'] = 'progress' for line in order.order_line: towrite = [] if line.state == 'exception': towrite.append(line.id) if towrite: self.pool.get('sale.order.line').write(cr, uid, towrite, {'state': 'confirmed'}, context=context) self.write(cr, uid, [order.id], val) | self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context) | def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress' | 06d2f4d107669396fbeb360194fd24f4ad3f41ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d2f4d107669396fbeb360194fd24f4ad3f41ac/sale.py |
'logrotate': '1', | 'logrotate': True, | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
group.add_option("--cert-file", dest="secure_cert_file", default="server.cert", help="specify the certificate file for the SSL connection") group.add_option("--pkey-file", dest="secure_pkey_file", default="server.pkey", help="specify the private key file for the SSL connection") | group.add_option("--cert-file", dest="secure_cert_file", help="specify the certificate file for the SSL connection") group.add_option("--pkey-file", dest="secure_pkey_file", help="specify the private key file for the SSL connection") | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
||
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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
||
help="set the timeout for the cache system", default=100000, type="int") | help="set the timeout for the cache system", type="int") | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
default=None, help="do not rotate the logfile") | help="do not rotate the logfile") | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
group.add_option('--email-from', dest='email_from', default='', help='specify the SMTP email address for sending email') group.add_option('--smtp', dest='smtp_server', default='', help='specify the SMTP server for sending email') group.add_option('--smtp-port', dest='smtp_port', default='25', help='specify the SMTP port', type="int") group.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not') group.add_option('--smtp-user', dest='smtp_user', default='', help='specify the SMTP username for sending email') group.add_option('--smtp-password', dest='smtp_password', default='', help='specify the SMTP password for sending email') | group.add_option('--email-from', dest='email_from', help='specify the SMTP email address for sending email') group.add_option('--smtp', dest='smtp_server', help='specify the SMTP server for sending email') group.add_option('--smtp-port', dest='smtp_port', help='specify the SMTP port', type="int") group.add_option('--smtp-ssl', dest='smtp_ssl', action='store_true', help='specify the SMTP server support SSL or not') group.add_option('--smtp-user', dest='smtp_user', help='specify the SMTP username for sending email') group.add_option('--smtp-password', dest='smtp_password', help='specify the SMTP password for sending email') | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
group.add_option("--db_maxconn", dest="db_maxconn", default='64', | group.add_option("--db_maxconn", dest="db_maxconn", type='int', | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
security.add_option('--no-database-list', action="store_false", dest='list_db', default=True, help="disable the ability to return the list of databases") | security.add_option('--no-database-list', action="store_false", dest='list_db', help="disable the ability to return the list of databases") | 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, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, } | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout','smtp_ssl', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', | 'db_port', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', | def die(cond, msg): if cond: print msg sys.exit(1) | 417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.