rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
serv.sendmail(payload_part['From'], addresses_l['all'], payload_part.as_string()) | serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string()) | def send_mail(self, cr, uid, ids, addresses, subject='', body=None, payload=None, message_id=None, context=None): #TODO: Replace all this with a single email object if body is None: body = {} if payload is None: payload = {} if context is None: context = {} logger = netsvc.Logger() for id in ids: core_obj = self.browse... | a07a09d5d15277aa90af6898f6ae7426472934eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a07a09d5d15277aa90af6898f6ae7426472934eb/email_template_account.py |
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:Server Send Error\nDescription: %s") % (id, error)) | logging.getLogger('email_template').error("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s", id, error, exc_info=True) | def send_mail(self, cr, uid, ids, addresses, subject='', body=None, payload=None, message_id=None, context=None): #TODO: Replace all this with a single email object if body is None: body = {} if payload is None: payload = {} if context is None: context = {} logger = netsvc.Logger() for id in ids: core_obj = self.browse... | a07a09d5d15277aa90af6898f6ae7426472934eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a07a09d5d15277aa90af6898f6ae7426472934eb/email_template_account.py |
return super(report_creator, self).read(cr, user, ids, fields, context, load) | return res | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ overrides orm Read method.Read List of fields for report creator. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of report creator's id. @param fields: Lis... | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py |
if data: | for data in res: if not data.get('sql_query'): return res | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ overrides orm Read method.Read List of fields for report creator. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of report creator's id. @param fields: Lis... | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py |
report = self._sql_query_get(cr, user, [data], 'sql_query', None, ctx, where_plus = wp) sql_query = report[data] cr.execute(sql_query) | cr.execute(data['sql_query']) | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ overrides orm Read method.Read List of fields for report creator. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of report creator's id. @param fields: Lis... | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py |
return res | return res | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ overrides orm Read method.Read List of fields for report creator. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of report creator's id. @param fields: Lis... | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py |
report = self._sql_query_get(cr, user, [context_id], 'sql_query', None, ctx, where_plus = newargs, limit=limit, offset=offset) query = report[context_id] cr.execute(query, newargs2) | sql_query = report.sql_query cr.execute(sql_query, newargs2) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ overrides orm search method. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ..... | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py |
if prodlot_id: self.write(cr, uid, [move.id],{'prodlot_id': prodlot_id,}) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing 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.... | cf53d5cd724d4ea7f051e9ea11fee10dad402ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf53d5cd724d4ea7f051e9ea11fee10dad402ccd/stock.py | |
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet') id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet') id4 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet') if id2: id2 = data_obj.browse(cr, uid, id2, context=context).res_id if id3: id3 = data_obj.browse(cr, uid, id3, conte... | if edit_all and rrule_type: for id in ids: base_calendar.base_calendar_id2real_id(id) | def open_meeting(self, cr, uid, ids, context=None): """ Open Crm Meeting Form for Crm Meeting. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm meeting’s IDs @param context: A standard dictionary for contextual values @return: Dictionar... | 3f93055036a30b4f1eebd31b8448c8649dd62e49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f93055036a30b4f1eebd31b8448c8649dd62e49/crm_meeting.py |
def _get_number_of_days(date_from, date_to): | def _get_number_of_days(self, date_from, date_to): | def _get_number_of_days(date_from, date_to): """Returns a float equals to the timedelta between two dates given as string.""" | f065d01dfcfac1720897e9db863e5229040480ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f065d01dfcfac1720897e9db863e5229040480ec/hr_holidays.py |
diff_day = timedelta.days + float(timedelata.seconds) / 86400 | diff_day = timedelta.days + float(timedelta.seconds) / 86400 | def _get_number_of_days(date_from, date_to): """Returns a float equals to the timedelta between two dates given as string.""" | f065d01dfcfac1720897e9db863e5229040480ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f065d01dfcfac1720897e9db863e5229040480ec/hr_holidays.py |
return onchange_date_from(cr, uid, ids, date_to, date_from) | return self.onchange_date_from(cr, uid, ids, date_to, date_from) | def onchange_date_to(self, cr, uid, ids, date_from, date_to): return onchange_date_from(cr, uid, ids, date_to, date_from) | f065d01dfcfac1720897e9db863e5229040480ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f065d01dfcfac1720897e9db863e5229040480ec/hr_holidays.py |
def createInstance(cls, pool, module, cr): | def createInstance(cls, pool, module, cr): | def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: if isinstance(parent_names, (str, unicode)): name = cls._name or parent_names parent_names = [parent_names] else: name = cls._name if not name: raise TypeError('_name is mandatory in case of multiple inheritance') | e7896ddd46893d47c509e2ce529dd105476b640d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e7896ddd46893d47c509e2ce529dd105476b640d/osv.py |
parent_names = getattr(cls, '_inherit', None) | parent_names = getattr(cls, '_inherit', None) | def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: if isinstance(parent_names, (str, unicode)): name = cls._name or parent_names parent_names = [parent_names] else: name = cls._name if not name: raise TypeError('_name is mandatory in case of multiple inheritance') | e7896ddd46893d47c509e2ce529dd105476b640d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e7896ddd46893d47c509e2ce529dd105476b640d/osv.py |
if key.startswith('default_'): | if key.startswith('default_') and (key[8:] in fields_list): | fld_def = (field in self._columns) and self._columns[field] or self._inherit_fields[field][2] | e81c40c7e7de4684fdfc2e2dfd9546750faa095b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e81c40c7e7de4684fdfc2e2dfd9546750faa095b/orm.py |
message = (n +" '" + case.name + "' "+ _("has been opened.") | message = n +" '" + case.name + "' "+ _("has been opened.") | def case_open(self, cr, uid, ids, *args): """Overrides cancel for crm_case for setting Open Date @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 case's Ids @param *args: Give Tuple Value """ old_state = self... | 70ec3487024fca05e1d35cceb2f21f154e1dfedb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/70ec3487024fca05e1d35cceb2f21f154e1dfedb/crm_lead.py |
if len(sys.argv) == 2 and (sys.argv[1] in ['-h', '--help']): print >>sys.stderr, 'Usage: module_graph.py [module1 module2 module3]\n\tWhen no module is specified, all modules in current directory are used' sys.exit(1) | def get_valid_path(paths, module): for path in paths: full = os.path.join(path, module) if os.path.exists(full): return full return None | def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(module, filename) if os.path.isfile(description_file): return eval(file(description_file).read()) return {} | 1fb39798cc0f193ae4d0fbcff0534fc6832e59bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fb39798cc0f193ae4d0fbcff0534fc6832e59bb/module_graph.py |
modules = sys.argv[1:] if not len(modules): modules = map(os.path.dirname, glob.glob(os.path.join('*', '__openerp__.py'))) modules += map(os.path.dirname, glob.glob(os.path.join('*', '__terp__.py'))) | parser = optparse.OptionParser(usage="%prog [options] [module1 [module2 ...]]") parser.add_option("-p", "--addons-path", dest="path", help="addons directory", action="append") (opt, args) = parser.parse_args() | def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(module, filename) if os.path.isfile(description_file): return eval(file(description_file).read()) return {} | 1fb39798cc0f193ae4d0fbcff0534fc6832e59bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fb39798cc0f193ae4d0fbcff0534fc6832e59bb/module_graph.py |
done = [] | modules = [] if not opt.path: opt.path = ["."] | def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(module, filename) if os.path.isfile(description_file): return eval(file(description_file).read()) return {} | 1fb39798cc0f193ae4d0fbcff0534fc6832e59bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fb39798cc0f193ae4d0fbcff0534fc6832e59bb/module_graph.py |
done.append(f) | module_name = os.path.basename(f) all_modules.add(module_name) | def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(module, filename) if os.path.isfile(description_file): return eval(file(description_file).read()) return {} | 1fb39798cc0f193ae4d0fbcff0534fc6832e59bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fb39798cc0f193ae4d0fbcff0534fc6832e59bb/module_graph.py |
for name in info['depends']: if name not in done+modules: modules.append(name) if not os.path.exists(name): print '\t%s [color=red]' % (name,) print '\t%s -> %s;' % (f, name) | for name in info.get('depends',[]): valid_path = get_valid_path(opt.path, name) if name not in all_modules: if valid_path: modules.append(valid_path) else: all_modules.add(name) print '\t%s [color=red]' % (name,) print '\t%s -> %s;' % (module_name, name) | def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(module, filename) if os.path.isfile(description_file): return eval(file(description_file).read()) return {} | 1fb39798cc0f193ae4d0fbcff0534fc6832e59bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fb39798cc0f193ae4d0fbcff0534fc6832e59bb/module_graph.py |
def _default_get(self, cr, uid, fields, context={}): if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') period_obj = self.pool.get('account.period') | 4f2b28dcb82d25deac85524d0293ff5470f5bb3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f2b28dcb82d25deac85524d0293ff5470f5bb3a/account_move_line.py | ||
def _default_get(self, cr, uid, fields, context={}): if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') period_obj = self.pool.get('account.period') | 4f2b28dcb82d25deac85524d0293ff5470f5bb3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f2b28dcb82d25deac85524d0293ff5470f5bb3a/account_move_line.py | ||
cr = self.get_node_cr(node) | def rmdir(self, datacr): """Remove the specified directory.""" cr, node, rem = datacr assert node cr = self.get_node_cr(node) node.rmcol(cr) cr.commit() | edf874a24be70004afb1eb72863dfa7cef59a3cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/edf874a24be70004afb1eb72863dfa7cef59a3cd/abstracted_fs.py | |
else: where_clause = '' | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields | 2a072834f50bcf48381b9b6d8d5c5ceb57559195 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a072834f50bcf48381b9b6d8d5c5ceb57559195/orm.py | |
self.do_alarm_unlink(cr, uid, ids) | alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_unlink(cr, uid, ids, self._name) | def unlink(self, cr, uid, ids, context=None): res = False for id in ids: ls = common.caldav_id2real_id(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['exd... | 2989254e134c0efd8265d710ce402e27bd1ea1c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2989254e134c0efd8265d710ce402e27bd1ea1c6/crm_meeting.py |
self.do_alarm_unlink(cr, uid, ids) | alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_unlink(cr, uid, ids, self._name) | def unlink(self, cr, uid, ids, context=None): res = False for id in ids: ls = common.caldav_id2real_id(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['exd... | 2989254e134c0efd8265d710ce402e27bd1ea1c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2989254e134c0efd8265d710ce402e27bd1ea1c6/crm_meeting.py |
p = prod_obj.browse(cr, uid, s[0]) invent_line_obj.create(cr, uid, { | p = product_obj.browse(cr, uid, s[0]) inventory_line_obj.create(cr, uid, { | def fill_inventory(self, cr, uid, ids, context): """ To Import stock inventory according to products available in the selected locations. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: the ID or list of IDs if we want more than one @param context... | 16bee80a57cfd4dec9b120a8799cc1eba1176f88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16bee80a57cfd4dec9b120a8799cc1eba1176f88/stock_fill_inventory.py |
data['ids']=data['form']['chart_account_id'] | data['ids'] = [data['form']['chart_account_id']] | def _print_report(self, cr, uid, ids, data, query_line, context=None): | 5fa81be30a49a0d2bb1ae5c2e3e94326850c392f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fa81be30a49a0d2bb1ae5c2e3e94326850c392f/account_balance_report.py |
message = str(production_qty) + " '[" + production.product_id.code + '] ' + production.product_id.name + _("' have been manufactured for ") + production.name | for (id, name) in self.pool.get('product.product').name_get(cr, uid, [production.product_id.id]): message = str(production_qty) + ' ' + production.product_uom.name +" '" + name + _("' have been manufactured for ") + production.name | def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): """ To produce final product base on production mode (consume/consume&produce). If Production mode is consume, all stock move lines of raw materials will be done/consumed. If Production mode is consume & produce, all stock ... | f2ded428006670e45e7dd4c67fcc6bbd814e4837 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2ded428006670e45e7dd4c67fcc6bbd814e4837/mrp.py |
d['__context'] = {'group_by':groupby_list[1:]} | if not isinstance(groupby_list,(str, unicode)): d['__context'] = {'group_by':groupby_list[1:]} | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): groupby_list = groupby if isinstance(groupby, list): groupby = groupby[0] context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | e92975499ffbda6e9baed7f7cf08538611e6e239 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e92975499ffbda6e9baed7f7cf08538611e6e239/orm.py |
drop_view_if_exists(cr, 'stock_report_prodlots') | drop_view_if_exists(cr, 'stock_report_tracklots') | def init(self, cr): drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view stock_report_tracklots as ( select max(id) as id, location_id, product_id, tracking_id, sum(qty) as name from ( select -max(sm.id) as id, sm.location_id, sm.product_id, sm.tracking_id, -sum(sm.product_qty /uo.fac... | 89aa554e79c8b2b3ea00e1b69fd573165e646c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89aa554e79c8b2b3ea00e1b69fd573165e646c17/report_stock.py |
drop_view_if_exists(cr, 'stock_report_prodlots') | drop_view_if_exists(cr, 'report_stock_lines_date') | def init(self, cr): drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view report_stock_lines_date as ( select p.id as id, p.id as product_id, max(s.date) as date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) left join stock_inventory s on (l.invent... | 89aa554e79c8b2b3ea00e1b69fd573165e646c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89aa554e79c8b2b3ea00e1b69fd573165e646c17/report_stock.py |
return 1 | res = res.values() return len(res) and res[0] or 0 | def action_produce_assign_product(self, cr, uid, ids, context={}): """ @summary : This is action which call from workflow to assign production order to procuments @return : True """ res = self.make_mo(cr, uid, ids, context=context) return 1 #TO CHECK: why workflow is generated error if return True | 6be5a0c212c5dadd5a7b0f65d239e3dd933f75a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6be5a0c212c5dadd5a7b0f65d239e3dd933f75a9/mrp.py |
return 1 | res = res.values() return len(res) and res[0] or 0 | def action_po_assign(self, cr, uid, ids, context={}): """ @summary : This is action which call from workflow to assign purchase order to procuments @return : True """ res = self.make_po(cr, uid, ids, context=context) return 1 #TO CHECK: why workflow is generated error if return True | 6be5a0c212c5dadd5a7b0f65d239e3dd933f75a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6be5a0c212c5dadd5a7b0f65d239e3dd933f75a9/mrp.py |
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context) | product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context) | def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id, unit=False, journal_id=False, context=None): if context==None: context={} if not journal_id: j_ids = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=','purchase')]) journal_id = j_ids and j_ids[0] or False if not journal_id... | 057c282cfbd5be50401c9f74b0a4a88315a3c0cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/057c282cfbd5be50401c9f74b0a4a88315a3c0cf/account_analytic_line.py |
if uid == 1: | if uid == 1 or count: | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | cb3d7ab0f2d6c03b221494fc3904a9047d3995d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb3d7ab0f2d6c03b221494fc3904a9047d3995d8/ir_ui_menu.py |
if count and ids: return ids | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | cb3d7ab0f2d6c03b221494fc3904a9047d3995d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb3d7ab0f2d6c03b221494fc3904a9047d3995d8/ir_ui_menu.py | |
value = { 'duration': 24 } duration = 0.0 | value = {'duration': 24} duration = 24.0 | def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context=None): """Returns duration and/or end date based on values passed @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 i... | d5d6e2ff0e42853cbade251abf914b345eb9b359 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5d6e2ff0e42853cbade251abf914b345eb9b359/base_calendar.py |
elif end_date and duration: | elif end_date and duration and not allday: | def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context=None): """Returns duration and/or end date based on values passed @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 i... | d5d6e2ff0e42853cbade251abf914b345eb9b359 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5d6e2ff0e42853cbade251abf914b345eb9b359/base_calendar.py |
if field._properties and ((not field.store) or field._fnct_search): | if field._properties and not field.store: | def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent) | 2c5035fe444113d6b13046478accb10f209112cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c5035fe444113d6b13046478accb10f209112cd/expression.py |
ret.setdefault(key, []).extend(val) | if key in ret: ret[key] = ret[key][:] else: ret[key] = [] ret[key].extend(val) | def prep_http_options(self, uri, opts): """see HttpOptions._prep_OPTIONS """ self.parent.log_message('get options: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) | 080e951518629a0a2567304aa9406d1014b1369d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/080e951518629a0a2567304aa9406d1014b1369d/dav_fs.py |
def _path_get(self,cr, uid, models, filter_ids=[]): | 90f676823b0514aa3e4ba3b1494558e98bcc98cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90f676823b0514aa3e4ba3b1494558e98bcc98cd/base_report_creator.py | ||
and not (isinstance(model_pool._columns[x[0]],fields.function) or isinstance(model_pool._columns[x[0]],fields.related)), fields_get.items())) | and not (isinstance(model_columns[x[0]],fields.function) or isinstance(model_columns[x[0]],fields.related)), fields_get.items())) | def _path_get(self,cr, uid, models, filter_ids=[]): | 90f676823b0514aa3e4ba3b1494558e98bcc98cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90f676823b0514aa3e4ba3b1494558e98bcc98cd/base_report_creator.py |
str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' where_list.append(str_where) | if k in self.pool.get(model)._columns: str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' where_list.append(str_where) | def _path_get(self,cr, uid, models, filter_ids=[]): | 90f676823b0514aa3e4ba3b1494558e98bcc98cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90f676823b0514aa3e4ba3b1494558e98bcc98cd/base_report_creator.py |
'report_rml_content_data'): | 'report_rml_content_data', 'search_view', 'search_view_id'): | def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') id = int(id) fields = self.pool.get(model).fields_get_keys(cr, uid) pos = 0 while pos<len(fields): if fields[pos] in ('report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml', 'report_sxw_content_... | 5472c050aff29d0cb40d80c4e5166b2dc3cea1f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5472c050aff29d0cb40d80c4e5166b2dc3cea1f0/ir_values.py |
data_lines = invoice.move_id.line_id | data_lines = [x for x in invoice.move_id.line_id if x.account_id.id == invoice.account_id.id] | def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for invoice in self.browse(cr, uid, ids, context=context): id = invoice.id res[id] = [] if not invoice.move_id: continue data_lines = invoice.move_id.line_id partial_ids = [] for line in data_lines: ids_line = [] if line.reconcile_id: ids_line = line... | 05f53b95f109f912f65d03c41b2bae9573540e46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05f53b95f109f912f65d03c41b2bae9573540e46/invoice.py |
if form['display_account'] == 'movement': | if form['display_account'] == 'bal_movement': | def get_children_accounts(self, account, form): res = [] ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id) for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc): sql = """ SELECT count(id) FROM account_move_line l WHERE %s AND l.account... | 861a151467642540c3e8c4b9ccdad5cc88a2e90e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/861a151467642540c3e8c4b9ccdad5cc88a2e90e/account_general_ledger.py |
elif form['display_account'] == 'balance': | elif form['display_account'] == 'bal_solde': | def get_children_accounts(self, account, form): res = [] ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id) for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc): sql = """ SELECT count(id) FROM account_move_line l WHERE %s AND l.account... | 861a151467642540c3e8c4b9ccdad5cc88a2e90e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/861a151467642540c3e8c4b9ccdad5cc88a2e90e/account_general_ledger.py |
id = super(wiki_wiki2, self).create(cr, uid, vals, context) | id = super(wiki_wiki2, self).create(cr, uid, {'create_id':vals.get('create_id',''), 'name':vals.get('name',''), 'minor_edit':vals.get('minor_edit',''), 'review':vals.get('review',''), 'write_uid':vals.get('write_uid',''), 'parent_id':vals.get('parent_id',''), 'text_area':vals.get('text_area',''), 'toc':vals.get('toc','... | def create(self, cr, uid, vals, context=None): | a4db164cb427e6c05465a71ab6f87c37cdd84e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a4db164cb427e6c05465a71ab6f87c37cdd84e1c/wiki.py |
def write(self, cr, uid, ids, vals, context=None): | a4db164cb427e6c05465a71ab6f87c37cdd84e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a4db164cb427e6c05465a71ab6f87c37cdd84e1c/wiki.py | ||
new_cc = '' | new_cc = [] | def action_forward(self, cr, uid, ids, context=None): """ Forward the lead to a partner """ this = self.browse(cr, uid, ids[0], context=context) case_pool = self.pool.get(context.get('active_model')) res_id = context and context.get('active_id', False) or False case = case_pool.browse(cr, uid, res_id, context=context) | e368981d2e2655b33fecd446bd12baaef5e7f9f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e368981d2e2655b33fecd446bd12baaef5e7f9f4/crm_forward_to_partner.py |
new_cc += ', ' + to to_write.update({'email_cc' : case.email_cc and case.email_cc + new_cc}) | new_cc.append(to) to_write.update({'email_cc' : case.email_cc or '' + ','.join(new_cc)}) | def action_forward(self, cr, uid, ids, context=None): """ Forward the lead to a partner """ this = self.browse(cr, uid, ids[0], context=context) case_pool = self.pool.get(context.get('active_model')) res_id = context and context.get('active_id', False) or False case = case_pool.browse(cr, uid, res_id, context=context) | e368981d2e2655b33fecd446bd12baaef5e7f9f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e368981d2e2655b33fecd446bd12baaef5e7f9f4/crm_forward_to_partner.py |
(_check_dates, 'Error! Task start-date must be lower then task end-date.', ['date_start', 'date_end']), | def _check_recursion(self, cr, uid, ids): obj_task = self.browse(cr, uid, ids[0]) parent_ids = [x.id for x in obj_task.parent_ids] children_ids = [x.id for x in obj_task.child_ids] | d5b36b50c4b4bd9b2ecad23fe7000b8bc93da25a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5b36b50c4b4bd9b2ecad23fe7000b8bc93da25a/project.py | |
raise _('The read_group method is not implemented on this object !') | raise NotImplementedError(_('The read_group method is not implemented on this object !')) | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): raise _('The read_group method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('The read method is not implemented on this object !') | raise NotImplementedError(_('The read method is not implemented on this object !')) | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): raise _('The read method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('The perm_read method is not implemented on this object !') | raise NotImplementedError(_('The perm_read method is not implemented on this object !')) | def perm_read(self, cr, user, ids, context=None, details=True): raise _('The perm_read method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('The unlink method is not implemented on this object !') | raise NotImplementedError(_('The unlink method is not implemented on this object !')) | def unlink(self, cr, uid, ids, context=None): raise _('The unlink method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('The write method is not implemented on this object !') | raise NotImplementedError(_('The write method is not implemented on this object !')) | def write(self, cr, user, ids, vals, context=None): raise _('The write method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('The create method is not implemented on this object !') | raise NotImplementedError(_('The create method is not implemented on this object !')) | def create(self, cr, user, vals, context=None): raise _('The create method is not implemented on this object !') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
raise _('This method does not exist anymore') | raise NotImplementedError(_('This method does not exist anymore')) | def perm_write(self, cr, user, ids, fields, context=None): raise _('This method does not exist anymore') | 3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py |
context)['object_name'] | context)['object_name'] or False | def _default_model(self, cursor, user, context=None): """ Returns the default value for model field @param cursor: Database Cursor @param user: ID of current user @param context: OpenERP Context """ return self.pool.get('email.template').read( cursor, user, context['template_id'], ['object_name'], context)['object_name... | b7ddcdfe5eb9833293d51b16639eb35b94f8a429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b7ddcdfe5eb9833293d51b16639eb35b94f8a429/email_template.py |
'ref_template': lambda self, cr, uid, ctx:ctx['template_id'], | 'ref_template': lambda self, cr, uid, ctx:ctx['template_id'] or False, | def _default_model(self, cursor, user, context=None): """ Returns the default value for model field @param cursor: Database Cursor @param user: ID of current user @param context: OpenERP Context """ return self.pool.get('email.template').read( cursor, user, context['template_id'], ['object_name'], context)['object_name... | b7ddcdfe5eb9833293d51b16639eb35b94f8a429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b7ddcdfe5eb9833293d51b16639eb35b94f8a429/email_template.py |
'name': _("%s Mail Form") % template_obj.name, | 'name': template_obj.name, | def create_action(self, cr, uid, ids, context): vals = {} template_obj = self.browse(cr, uid, ids)[0] src_obj = template_obj.object_name.model vals['ref_ir_act_window'] = self.pool.get('ir.actions.act_window').create(cr, uid, { 'name': _("%s Mail Form") % template_obj.name, 'type': 'ir.actions.act_window', 'res_model':... | 3ea3c8107e5e5e70fd9c893a0ad21e8f9019655c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3ea3c8107e5e5e70fd9c893a0ad21e8f9019655c/email_template.py |
'amount': fields.float('Amount'), | 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')), | def onchange_type(self, cr, uid, line_id, partner_id, type, context=None): res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res account_id = False line = self.browse(cr, uid, line_id) if not line or (line and not line[0].account_id): part = obj_pa... | 0b58b44b56810e79e2ec636c3f12cd213fe37160 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0b58b44b56810e79e2ec636c3f12cd213fe37160/account_bank_statement.py |
class contentIndex() : | class contentIndex(): __logger = logging.getLogger('addons.document.content_index') | def mime_match(mime, mdict): if mdict.has_key(mime): return (mime, mdict[mime]) if '/' in mime: mpat = mime.split('/')[0]+'/*' if mdict.has_key(mpat): return (mime, mdict[mpat]) return (None, None) | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
log(netsvc.LOG_DEBUG, "Register content indexer: %r" % obj) | self.__logger.debug('Register content indexer: %s', obj) | def register(self, obj): f = False for mime in obj._getMimeTypes(): self.mimes[mime] = obj f = True for ext in obj._getExtensions(): self.exts[ext] = obj f = True if f: log(netsvc.LOG_DEBUG, "Register content indexer: %r" % obj) if not f: raise Exception("Your indexer should at least suport a mimetype or extension") | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
log(netsvc.LOG_DEBUG,"File gave us: %s" % mime2) | self.__logger.debug('File gave us: %s', mime2) | def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj... | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
except Exception, e: log(netsvc.LOG_WARNING,"Cannot determine mime type: %s" % str(e)) | except Exception: self.__logger.exception('Cannot determine mime type') | def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj... | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
log(netsvc.LOG_DEBUG,"Have no object, return (%s, None)" % mime) | self.__logger.debug("Have no object, return (%s, None)", mime) | def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj... | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
except Exception, e: log(netsvc.LOG_WARNING,"Could not index file, %s" % e) | except Exception: self.__logger.exception("Could not index file %s (%s)", filename, fname or realfname) | def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj... | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
except Exception, e: log(netsvc.LOG_WARNING,"Could not unlink %s, %s" %(fname, e)) | except Exception: self.__logger.exception("Could not unlink %s", fname) | def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj... | cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py |
'section_id' : case.section_id and case.section_id or False, | 'section_id' : case.section_id and case.section_id.id or False, | def _default_values(self, cr, uid, data, context): case_obj = pooler.get_pool(cr.dbname).get('crm.opportunity') categ_id = pooler.get_pool(cr.dbname).get('crm.phonecall.categ').search(cr, uid, [('name','=','Outbound')]) case = case_obj.browse(cr, uid, data['id']) return { 'user_id' : case.user_id and case.user_id.id, '... | b54d8bbd7e84a6e6b28d71357863517725ea45ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b54d8bbd7e84a6e6b28d71357863517725ea45ca/crm_opportunity_wizard.py |
date_local = cal_data.value.astimezone(_server_tzinfo) self.ical_set(cal_data.name.lower(), date_local, 'value') | self.ical_set('vtimezone', cal_data.params.get('X-VOBJ-ORIGINAL-TZID'), 'value') date_utc = cal_data.value.astimezone(pytz.utc) self.ical_set(cal_data.name.lower(), date_utc, '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 ... | 6164d129ab39fb51db558049315906776d9837c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6164d129ab39fb51db558049315906776d9837c2/calendar.py |
def _get_id(self, cr, uid, model, id): if type(id)==type(()): id=id[0] if (model,id) in self.ids: return self.ids[(model,id)], False dt = self.pool.get('ir.model.data') dtids = dt.search(cr, uid, [('model','=',model), ('res_id','=',id)]) if not dtids: return False, None obj = dt.browse(cr, uid, dtids[0]) self.depends[o... | e1eeb3549e1229078548489f2c70b6d1d2967d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1eeb3549e1229078548489f2c70b6d1d2967d9d/base_module_record.py | ||
self.ids[(rec[3], result)] = id | self.ids[(rec[2], result)] = id | def _generate_object_xml(self, cr, uid, rec, recv, doc, result=None): record_list = [] noupdate = False if rec[4]=='write': for id in rec[5]: id,update = self._get_id(cr, uid, rec[3], id) noupdate = noupdate or update if not id: continue record,update = self._create_record(cr, uid, doc, rec[3], rec[6], id) noupdate = n... | e1eeb3549e1229078548489f2c70b6d1d2967d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1eeb3549e1229078548489f2c70b6d1d2967d9d/base_module_record.py |
wkf.setAttribute("model", rec[1][3]) wkf.setAttribute("action", rec[1][4]) | wkf.setAttribute("model", rec[1][2]) wkf.setAttribute("action", rec[1][3]) | def generate_xml(self, cr, uid): # Create the minidom document if len(self.recording_data): self.ids = {} doc = minidom.Document() terp = doc.createElement("openerp") doc.appendChild(terp) for rec in self.recording_data: if rec[0]=='workflow': rec_id,noupdate = self._get_id(cr, uid, rec[1][2], rec[1][4]) if not rec_id:... | e1eeb3549e1229078548489f2c70b6d1d2967d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1eeb3549e1229078548489f2c70b6d1d2967d9d/base_module_record.py |
yaml_file += str(object) + '''\n''' | yaml_file += str(object) + '''\n\n''' | def generate_yaml(self, cr, uid): self.ids = {} if len(self.recording_data): yaml_file='''\n''' for rec in self.recording_data: if rec[1][3] == 'create': self.mode="create" elif rec[1][3] == 'write': self.mode="write" elif rec[1][3] == 'copy': self.mode="copy" elif rec[0] == 'workflow': self.mode="workflow" else: cont... | e1eeb3549e1229078548489f2c70b6d1d2967d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1eeb3549e1229078548489f2c70b6d1d2967d9d/base_module_record.py |
line = "- \n" + " " + line | line = "- \n" + " " + line elif line.find('!comment') == 0: line=line.replace('!comment','- \n ') | def generate_yaml(self, cr, uid): self.ids = {} if len(self.recording_data): yaml_file='''\n''' for rec in self.recording_data: if rec[1][3] == 'create': self.mode="create" elif rec[1][3] == 'write': self.mode="write" elif rec[1][3] == 'copy': self.mode="copy" elif rec[0] == 'workflow': self.mode="workflow" else: cont... | e1eeb3549e1229078548489f2c70b6d1d2967d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1eeb3549e1229078548489f2c70b6d1d2967d9d/base_module_record.py |
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] limit_str = self._limit is not None and ' limit %d' % self._limit or '' obj = obj.pool.get(self._obj) | 54ae6b587525f841e2b3fccdeb40b23eb33ccafc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/54ae6b587525f841e2b3fccdeb40b23eb33ccafc/fields.py | ||
res[r[1]].append(r[0]) | if r[0] not in res[r[1]]: ids2 = obj.search(cr, user, self._domain + [('id', '=', r[0])], context=context) if ids2:res[r[1]] += ids2 | def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] limit_str = self._limit is not None and ' limit %d' % self._limit or '' obj = obj.pool.get(self._obj) | 54ae6b587525f841e2b3fccdeb40b23eb33ccafc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/54ae6b587525f841e2b3fccdeb40b23eb33ccafc/fields.py |
amount2 = data['amount'] | amount2 = data.get('amount', 0.0) | def _unit_compute(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None, quantity=0): taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner) res = [] cur_price_unit=price_unit for tax in taxes: # we compute the amount for the current tax object and append it to the re... | cf0cddde124c83e71d82a803a7f221b8b79037ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf0cddde124c83e71d82a803a7f221b8b79037ca/account.py |
def compute_tax(self, cr, uid, ids, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') voucher_line_pool = self.pool.get('account.voucher.line') voucher_pool = self.pool.get('account.voucher') for voucher in voucher_... | bd1b5674537d536d304b971fd32f9cebb57caaf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bd1b5674537d536d304b971fd32f9cebb57caaf2/voucher.py | ||
def unlink(self, cr, uid, ids, context=None): for t in self.read(cr, uid, ids, ['state'], context=context): if t['state'] not in ('draft', 'cancel'): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Voucher(s) which are already opened or paid !')) return super(account_voucher, self).unlink(cr, uid, ids, con... | bd1b5674537d536d304b971fd32f9cebb57caaf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bd1b5674537d536d304b971fd32f9cebb57caaf2/voucher.py | ||
result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0))) | to_translate = tools.ustr(sps.pop(0)) result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate)) | def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0))) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcon... | 14b584718de83cf15504b5132d0fd20c55633f73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/14b584718de83cf15504b5132d0fd20c55633f73/utils.py |
txt = eval(expr,self.localcontext) if txt and (isinstance(txt, unicode) or isinstance(txt, str)): txt = unicode(txt) except Exception,e: tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) if type(txt)==type('') or type(txt)==type(u''): txt2 = str2xml(txt) result ... | txt = eval(expr, self.localcontext) if txt and isinstance(txt, basestring): txt = tools.ustr(txt) except Exception: pass if isinstance(txt, basestring): result += str2xml(txt) | def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0))) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcon... | 14b584718de83cf15504b5132d0fd20c55633f73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/14b584718de83cf15504b5132d0fd20c55633f73/utils.py |
result += unicode(txt) | result += txt | def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0))) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcon... | 14b584718de83cf15504b5132d0fd20c55633f73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/14b584718de83cf15504b5132d0fd20c55633f73/utils.py |
print 'Error' | def geo_find(addr): import urllib,re regex = '<coordinates>([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+)</coordinates>' url = 'http://maps.google.com/maps/geo?q=' + urllib.quote(addr) + '&output=xml&oe=utf8&sensor=false' xml = urllib.urlopen(url).read() if '<error>' in xml: print 'Error' return None result = re.searc... | 7a71b9f00d4e71b639ab6482b626658363304821 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a71b9f00d4e71b639ab6482b626658363304821/partner_geo_assign.py | |
print 'No Regex', xml | def geo_find(addr): import urllib,re regex = '<coordinates>([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+)</coordinates>' url = 'http://maps.google.com/maps/geo?q=' + urllib.quote(addr) + '&output=xml&oe=utf8&sensor=false' xml = urllib.urlopen(url).read() if '<error>' in xml: print 'Error' return None result = re.searc... | 7a71b9f00d4e71b639ab6482b626658363304821 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a71b9f00d4e71b639ab6482b626658363304821/partner_geo_assign.py | |
}, {'active_id': lead.id, 'active_ids': [lead.id]}) | }, context) fobj.action_forward(cr, uid, [forward], context) | def forward_to_partner(self, cr, uid, ids, context=None): fobj = self.pool.get('crm.lead.forward.to.partner') for lead in self.browse(cr, uid, ids, context=context): if lead.partner_assigned_id: email = False if lead.partner_assigned_id.address: email = lead.partner_assigned_id.address[0].email forward = fobj.create(cr... | 7a71b9f00d4e71b639ab6482b626658363304821 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a71b9f00d4e71b639ab6482b626658363304821/partner_geo_assign.py |
'state' : lambda *a: 'current', | 'state' : lambda *a: 'current', | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): for arg in args: if arg[0]=='address_id': self._order = 'sequence_partner' if arg[0]=='contact_id': self._order = 'sequence_contact' return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, cou... | 8e6746a79422a59046f314bba5be6ba5e8634bc1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e6746a79422a59046f314bba5be6ba5e8634bc1/base_contact.py |
def _get_users(self, cr, uid, context={}): return self.pool.get('res.users').search(cr, uid, []) | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
def _get_users(self, cr, uid, context={}): return self.pool.get('res.users').search(cr, uid, []) | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
def _get_users(self, cr, uid, context={}): return self.pool.get('res.users').search(cr, uid, []) | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
def create(self, cr, user, vals, context={}): if vals.get('password', False) != False: vals['password'] = base64.b64encode(vals.get('password')) res_id = super(smtpclient, self).create(cr, user, vals, context) return res_id | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
def create(self, cr, user, vals, context={}): if vals.get('password', False) != False: vals['password'] = base64.b64encode(vals.get('password')) res_id = super(smtpclient, self).create(cr, user, vals, context) return res_id | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
if flag: | if flag: | def write(self, cr, user, ids, vals, context=None): flag = False if vals.get('password', False) != False: for pass_char in vals.get('password'): if pass_char != '*': flag= True break | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py |
del vals['password'] | del vals['password'] | def write(self, cr, user, ids, vals, context=None): flag = False if vals.get('password', False) != False: for pass_char in vals.get('password'): if pass_char != '*': flag= True break | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py |
def write(self, cr, user, ids, vals, context=None): flag = False if vals.get('password', False) != False: for pass_char in vals.get('password'): if pass_char != '*': flag= True break | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py | ||
def override_password(o): if len(o) > 0: for field in o[0]: if field == 'password': o[0][field] = '********' return o | 5a558b6b1034593b8c71deeda96db7e8dd5329c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a558b6b1034593b8c71deeda96db7e8dd5329c3/smtpclient.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.