rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
if context.get('contact_display', 'contact')=='partner_address': | if (context.get('contact_display', 'contact')=='partner_address') and r['partner_id']: | def name_get(self, cr, user, ids, context={}): if not len(ids): return [] res = [] for r in self.read(cr, user, ids, ['name','zip','country_id', 'city','partner_id', 'street']): if context.get('contact_display', 'contact')=='partner' and r['partner_id']: res.append((r['id'], r['partner_id'][1])) else: addr = r['name'] ... | 292908690a895fb4a4fab303f0790a28b3b23eaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/292908690a895fb4a4fab303f0790a28b3b23eaf/partner.py |
newdate = newdate -(delay and relativedelta(days=delay) or datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') ) | if delay: newdate = (newdate - (delay and relativedelta(days=delay))) else: newdate = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') | def create_order(self, cr, uid, ids, context): """ To Create a purchase orders . | 1abc54ac2541ae97a8a7d46c393a80d1197b001d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1abc54ac2541ae97a8a7d46c393a80d1197b001d/purchase_requisition_partner.py |
self.__tables = {} | self.__field_tables = {} self.__all_tables = set() | def __init__(self, exp): # check if the expression is valid if not reduce(lambda acc, val: acc and (self._is_operator(val) or self._is_leaf(val)), exp, True): raise ValueError('Bad domain expression: %r' % (exp,)) self.__exp = exp self.__tables = {} # used to store the table to use for the sql generation. key = index ... | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
index = i | 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) | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py | |
self.__tables[i] = working_table | self.__field_tables[i] = working_table | 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) | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
if working_table not in self.__tables.values(): self.__joins.append(('%s.%s=%s.%s' % (working_table._table, 'id', main_table._table, main_table._inherits[working_table._name]), working_table._table)) self.__tables[index] = working_table index += 1 | if working_table not in self.__all_tables: self.__joins.append('%s.%s=%s.%s' % (working_table._table, 'id', main_table._table, main_table._inherits[working_table._name])) self.__all_tables.add(working_table) | 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) | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
table = self.__tables.get(i, self.__main_table) | table = self.__field_tables.get(i, self.__main_table) | def to_sql(self): stack = [] params = [] for i, e in reverse_enumerate(self.__exp): if self._is_leaf(e, internal=True): table = self.__tables.get(i, self.__main_table) q, p = self.__leaf_to_sql(e, table) params.insert(0, p) stack.append(q) else: if e == '!': stack.append('(NOT (%s))' % (stack.pop(),)) else: ops = {'&':... | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
joins = ' AND '.join(map(lambda j: j[0], self.__joins)) | joins = ' AND '.join(self.__joins) | def to_sql(self): stack = [] params = [] for i, e in reverse_enumerate(self.__exp): if self._is_leaf(e, internal=True): table = self.__tables.get(i, self.__main_table) q, p = self.__leaf_to_sql(e, table) params.insert(0, p) stack.append(q) else: if e == '!': stack.append('(NOT (%s))' % (stack.pop(),)) else: ops = {'&':... | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
return ['"%s"' % t._table for t in set(self.__tables.values()+[self.__main_table])] | return ['"%s"' % t._table for t in self.__all_tables] | def get_tables(self): return ['"%s"' % t._table for t in set(self.__tables.values()+[self.__main_table])] | 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bd5550e21ac7f767660d721d5bdcfa3a970e7e2/expression.py |
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): super_offset = cond(uid == 1, offset, 0) super_limit = cond(uid == 1, limit, None) super_count = cond(uid == 1, count, False) ids = super(ir_ui_menu, self).search(cr, uid, args, super_offset, super_limit, order, context=cont... | def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) | 9b0ec193f3a0a7a84c59dcc93ba9f909757a7566 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9b0ec193f3a0a7a84c59dcc93ba9f909757a7566/ir_ui_menu.py |
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'), | 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Form'), | def write(self, cr, uid, ids, vals, context=None): if 'date' in vals: new_vals = {'date_deadline': vals.get('date')} obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview') for evalutation in self.browse(cr, uid, ids, context=context): for survey_req in evalutation.survey_request_ids: obj_hr_eval_iterview.write... | 2aa75f76c9b60350e7ecfb318ecb38da45302566 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2aa75f76c9b60350e7ecfb318ecb38da45302566/hr_evaluation.py |
'code': wc.code | 'ref': wc.code | def _costs_generate(self, cr, uid, production): """ Calculates total costs at the end of the production. @param production: Id of production order. @return: Calculated amount. """ amount = 0.0 analytic_line_obj = self.pool.get('account.analytic.line') for wc_line in production.workcenter_lines: wc = wc_line.workcenter_... | 01c15d9ccec76a4d67d6f614f99b7fd46e82622f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/01c15d9ccec76a4d67d6f614f99b7fd46e82622f/mrp.py |
'code': wc.code | 'ref': wc.code, 'product_id': production.product_id.id | def _costs_generate(self, cr, uid, production): """ Calculates total costs at the end of the production. @param production: Id of production order. @return: Calculated amount. """ amount = 0.0 analytic_line_obj = self.pool.get('account.analytic.line') for wc_line in production.workcenter_lines: wc = wc_line.workcenter_... | 01c15d9ccec76a4d67d6f614f99b7fd46e82622f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/01c15d9ccec76a4d67d6f614f99b7fd46e82622f/mrp.py |
Example of fields to import for a sale.order .id, (=database_id) partner_id, (=name_search) order_line/.id, (=database_id) order_line/name, order_line/product_id/id, (=xml id) order_line/price_unit, order_line/product_uom_qty, order_line/product_uom/id (=xml_i... | def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None): """ Import given data in given module | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py | |
fields = map(lambda x: x.split('/'), fields) | def _replace_field(x): x = re.sub('([a-z0-9A-Z_])\\.id$', '\\1/.id', x) return x.replace(':id','/id').split('/') fields = map(_replace_field, fields) | def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None): """ Import given data in given module | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
def _check_db_id(self, model_name, db_id): obj_model = self.pool.get(model_name) ids = obj_model.search(cr, uid, [('id', '=', int(db_id))]) if not len(ids): raise Exception(_("Database ID doesn't exist: %s : %s") %(model_name, db_id)) return True def process_liness(self, datas, prefix, current_module, model_name,... | def _get_id(model_name, id, current_module=False, mode='id'): if mode=='.id': id = int(id) obj_model = self.pool.get(model_name) ids = obj_model.search(cr, uid, [('id', '=', int(id))]) if not len(ids): raise Exception(_("Database ID doesn't exist: %s : %s") %(model_name, id)) elif mode=='id': if '.' in id: module, xml... | def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None): """ Import given data in given module | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
translate = {} todo = [] | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py | |
data_id = False | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py | |
is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') | nbrmax = position+1 done = {} | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
if not line[i]: | field = fields[i] if field[:len(prefix)] <> prefix: if line[i] and skip: return False | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
field = fields[i] if prefix and not prefix[0] in field: | if field[len(prefix)]=='id': data_res_id = _get_id(model_name, line[i], current_module, 'id') | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
if (len(field)==len(prefix)+1) and field[len(prefix)].endswith('.id') and (field[len(prefix)]<>'.id'): res = False if line[i]: field_name = field[0].split('.')[0] model_rel = fields_def[field_name]['relation'] if fields_def[field[len(prefix)][:-3]]['type'] == 'many2many': res_id = [] for db_id in line[i].split(config... | elif field[len(prefix)]=='.id': data_res_id = _get_id(model_name, line[i], current_module, '.id') continue if fields_def[field[len(prefix)]]['type']=='one2many': if field[len(prefix)] in done: | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':id'): res_id = False if line[i]: if fields_def[field[len(prefix)][:-3]]['type'] == 'many2many': res_id = [] for word in line[i].split(config.get('csv_internal_sep')): if '.' in word: module, xml_id = word.rsplit('.', 1) else: module, xml_id = current_mod... | done[field[len(prefix)]] = True relation_obj = self.pool.get(fields_def[field[len(prefix)]]['relation']) newfd = relation_obj.fields_get( cr, uid, context=context ) pos = position res = [] first = 0 while pos < len(datas): res2 = process_liness(self, datas, prefix + [field[len(prefix)]], current_module, relation_obj._n... | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
res = line[i] or False row[field[len(prefix)]] = res elif (prefix==field[0:len(prefix)]): if field[0] not in todo: todo.append(field[len(prefix)]) nbrmax = 1 for field in todo: relation_obj = self.pool.get(fields_def[field]['relation']) newfd = relation_obj.fields_get( cr, uid, context=context) res = process_liness(... | mode = field[len(prefix)+1] res = _get_id(relation, line[i], current_module, mode) elif fields_def[field[len(prefix)]]['type']=='many2many': relation = fields_def[field[len(prefix)]]['relation'] if len(field) == len(prefix)+1: mode = False else: mode = field[len(prefix)+1] res = [] for db_id in line[i].split(config.... | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0): line = datas[position] row = {} translate = {} todo = [] warning = [] data_id = False data_res_id = False is_xml_id = False is_db_id = False ir_model_data_obj = self.pool.get('ir.model.data') # # Import normal fields # for i in... | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
done = 0 initial_size = len(datas) | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py | |
counter = 0 while len(datas): counter += 1 | position = 0 while position<len(datas): | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
(res, other, warning, translate, data_id, res_id) = \ process_liness(self, datas, [], current_module, self._name, fields_def) | (res, position, warning, res_id) = \ process_liness(self, datas, [], current_module, self._name, fields_def, position=position) | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
return (-1, res, 'Line ' + str(counter) +' : ' + '!\n'.join(warning), '') | return (-1, res, 'Line ' + str(position) +' : ' + '!\n'.join(warning), '') | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
current_module, res, xml_id=data_id, mode=mode, | current_module, res, mode=mode, | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
import psycopg2 import osv cr.rollback() if isinstance(e, psycopg2.IntegrityError): msg = _('Insertion Failed! ') for key in self.pool._sql_error.keys(): if key in e[0]: msg = self.pool._sql_error[key] if hasattr(msg, '__call__'): msg = msg(cr, uid, [res_id,], context=context) else: msg = _(msg) break return (-1, res, ... | return (-1, res, 'Line ' + str(position) +' : ' + str(e), '') if config.get('import_partial', False) and filename and (not (position%100)): | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
data[filename] = initial_size - len(datas) + original_value | data[filename] = position | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
done += 1 | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py | |
return (done, 0, 0, 0) | return (position, 0, 0, 0) | fields_def = self.fields_get(cr, uid, context=context) | dd442961fb22ce4f457f30e5df720a3ad7325cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dd442961fb22ce4f457f30e5df720a3ad7325cb4/orm.py |
res_id = model_pool.message_new(cr, uid, msg, context)fetchmail/fetchmail.py | res_id = model_pool.message_new(cr, uid, msg, context) | logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name)) | f48401d560c1c1fbf63c985d02e337f0cdf67698 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f48401d560c1c1fbf63c985d02e337f0cdf67698/fetchmail.py |
def get_id(self, cr, uid, sequence_id, test='id', context={}): | def get_id(self, cr, uid, sequence_id, test='id', context={}): if test not in ('id=%s', 'code=%s'): raise ValueError('invalid test') | def get_id(self, cr, uid, sequence_id, test='id', context={}): cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,)) res = cr.dictfetchone() if res: for line in self.browse(cr, uid, res['id'], context=context).fiscal_ids: if line.fiscalyear_id.id==context.get('fiscalyear_id', Fa... | 97f81a14e5080ffcac0e86ab8c5df9e494b650a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/97f81a14e5080ffcac0e86ab8c5df9e494b650a0/sequence.py |
attendee_obj.write(cr, uid, [res_id], {'del_to_user_ids' : [(6, 0, del_to_user_ids)]}) | attendee_obj.write(cr, uid, [res_id], {'state':'delegated','del_to_user_ids' : [(6, 0, del_to_user_ids)]}) | def create(self, cr, uid, vals, context={}): attendee_ids = vals.get('attendee_ids',False) model = context.get('model', False) res_id = context.get('active_id', False) state = context.get('state', False) attendee_obj = self.pool.get('calendar.attendee') if attendee_ids and model and res_id: attend = False if model == ... | 9c566f09394685c059a127f6de31e15a692b2fda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9c566f09394685c059a127f6de31e15a692b2fda/common.py |
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' Call the scheduler to check the procurement order @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param use_... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
@return: Dictionary of values | @return: Dictionary of values | def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' Call the scheduler to check the procurement order @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param use_... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py |
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' Call the scheduler to check the procurement order @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param use_... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' Call the scheduler to check the procurement order @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param use_... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' Call the scheduler to check the procurement order @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param use_... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
def create_automatic_op(self, cr, uid, context=None): """ Create procurement of virtual stock < 0 @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param context: A standard dictionary for contextual values @return: Dictionary o... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
if product.virtual_available >= 0.0: continue newdate = datetime.today() if product.supply_method == 'buy': location_id = warehouse.lot_input_id.id elif product.supply_method == 'produce': location_id = warehouse.lot_stock_id.id else: continue proc_id = proc_obj.create(cr, uid, { 'name': _('Automatic OP: %s') % (produ... | if (product.active == True) and (product.purchase_ok == True): if product.virtual_available >= 0.0: continue newdate = datetime.today() if product.supply_method == 'buy': location_id = warehouse.lot_input_id.id elif product.supply_method == 'produce': location_id = warehouse.lot_stock_id.id else: continue proc_id = pr... | def create_automatic_op(self, cr, uid, context=None): """ Create procurement of virtual stock < 0 @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param context: A standard dictionary for contextual values @return: Dictionary o... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py |
def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\ use_new_cursor=False, context=None, user_id=False): ''' Create procurement based on Orderpoint use_new_cursor: False or the dbname @param self: The object pointer @param cr: The current row, from the database cursor, @param user_id: The current user ID f... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py | ||
""" | """ | def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\ use_new_cursor=False, context=None, user_id=False): ''' Create procurement based on Orderpoint use_new_cursor: False or the dbname @param self: The object pointer @param cr: The current row, from the database cursor, @param user_id: The current user ID f... | cdbdc6e29c80206930b70387e6ac9348586a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdbdc6e29c80206930b70387e6ac9348586a8b62/schedulers.py |
'name': bom.routing_id.name, | 'name': tools.ustr(wc_use.name) + ' - ' + tools.ustr(bom.product_id.name), | def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0): """ Finds Products and Workcenters for related BoM for manufacturing order. @param bom: BoM of particular product. @param factor: Factor of product UoM. @param properties: A List of properties Ids. @param addthis: If BoM found then Tru... | 36dd47081b0e526172d13ebc62e3b06af0546302 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36dd47081b0e526172d13ebc62e3b06af0546302/mrp.py |
rr_name = self.pool.get(rr._table_name).name_get(cr, uid, [rr.id]) | rr_name = self.pool.get(rr._table_name).name_get(cr, uid, [rr.id], context=context) | def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False | 7b881e314f5e295546010ee186a92408360d6b15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b881e314f5e295546010ee186a92408360d6b15/orm.py |
r = self.pool.get(r._table_name).name_get(cr, uid, [r.id]) | r = self.pool.get(r._table_name).name_get(cr, uid, [r.id], context=context) | def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False | 7b881e314f5e295546010ee186a92408360d6b15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b881e314f5e295546010ee186a92408360d6b15/orm.py |
'name': vals_bnk['name'] + ' Journal', | 'name': vals_bnk['name'] + _(' Journal'), | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac... | 4aaa3a4354926dd3c4b9def8844853da1df5f8d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4aaa3a4354926dd3c4b9def8844853da1df5f8d2/installer.py |
'name': fields.char('Auction date', size=64, required=True), | 'name': fields.char('Auction Name', size=64, required=True), | def name_get(self, cr, uid, ids, context={}): if not len(ids): return [] reads = self.read(cr, uid, ids, ['name', 'auction1'], context) name = [(r['id'],'['+r['auction1']+'] '+ r['name']) for r in reads] return name | fa8a34a438eef052b9d349a3e7116306598e0163 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa8a34a438eef052b9d349a3e7116306598e0163/auction.py |
logger.debug("No namespace: %s ( for prop: %s)",ns, prop) | logger.debug('No namespace: %s ("%s")',ns, prop) | def get_dav_eprop(self, cr, ns, prop): if not self.DAV_M_NS: return None if self.DAV_M_NS.has_key(ns): prefix = self.DAV_M_NS[ns] else: logger.debug("No namespace: %s ( for prop: %s)",ns, prop) return None | 8c4fccfca4fc22ac1a31935f485f97d35f74d004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8c4fccfca4fc22ac1a31935f485f97d35f74d004/nodes.py |
print "cul" print index | def _find_next_stage(self, cr, uid, stage_list, index, current_seq, stage_pool, context=None): if index + 1 == len(stage_list): return False print "cul" print index next_stage_id = stage_list[index + 1] next_stage = stage_pool.browse(cr, uid, next_stage_id, context=context) if not next_stage: return False next_seq = n... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py | |
print next_stage | def _find_next_stage(self, cr, uid, stage_list, index, current_seq, stage_pool, context=None): if index + 1 == len(stage_list): return False print "cul" print index next_stage_id = stage_list[index + 1] next_stage = stage_pool.browse(cr, uid, next_stage_id, context=context) if not next_stage: return False next_seq = n... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py | |
return _find_next_stage(cr, uid, stage_list, index + 1, current_seq, stage_pool) | return self._find_next_stage(cr, uid, stage_list, index + 1, current_seq, stage_pool) | def _find_next_stage(self, cr, uid, stage_list, index, current_seq, stage_pool, context=None): if index + 1 == len(stage_list): return False print "cul" print index next_stage_id = stage_list[index + 1] next_stage = stage_pool.browse(cr, uid, next_stage_id, context=context) if not next_stage: return False next_seq = n... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py |
print case | def stage_change(self, cr, uid, ids, context=None, order='sequence'): if not context: context = {} stage_pool = self.pool.get('crm.case.stage') stage_type = context and context.get('stage_type','') current_seq = False next_stage_id = False for case in self.browse(cr, uid, ids, context): print case next_stage = False da... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py | |
print stage_type | def stage_change(self, cr, uid, ids, context=None, order='sequence'): if not context: context = {} stage_pool = self.pool.get('crm.case.stage') stage_type = context and context.get('stage_type','') current_seq = False next_stage_id = False for case in self.browse(cr, uid, ids, context): print case next_stage = False da... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py | |
print stages print "call" | def stage_change(self, cr, uid, ids, context=None, order='sequence'): if not context: context = {} stage_pool = self.pool.get('crm.case.stage') stage_type = context and context.get('stage_type','') current_seq = False next_stage_id = False for case in self.browse(cr, uid, ids, context): print case next_stage = False da... | f856489f5b2105f3d50e1c7d93d2711b5b6f1669 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f856489f5b2105f3d50e1c7d93d2711b5b6f1669/crm.py | |
if not config.get('import_partial', False): logger = netsvc.Logger() | if not config.get('import_partial'): | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py |
logger.notifyChannel('init', netsvc.LOG_INFO, 'Deleting %s@%s' % (res_id, model)) | self.__logger.info('Deleting %s@%s', res_id, model) | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py |
id = self.unlink_mark[(model, res_id)] | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py | |
self.unlink(cr, uid, [id]) cr.execute('DELETE FROM ir_values WHERE value=%s', ('%s,%s' % (model, res_id),)) | ids = self.search(cr, uid, [('res_id','=',res_id), ('model','=',model)]) self.__logger.debug('=> Deleting %s: %s', self._name, ids) if len(ids) > 1 and \ self.__logger.isEnabledFor(logging.WARNING): self.__logger.warn( 'Got %d %s for (%s, %d): %s', len(ids), self._name, model, res_id, map(itemgetter('module','name'), s... | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py |
except Exception, e: | except Exception: | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py |
logger.notifyChannel('init', netsvc.LOG_ERROR, e) logger.notifyChannel('init', netsvc.LOG_ERROR, 'Could not delete id: %d of model %s\nThere should be some relation that points to this resource\nYou should manually fix this and restart --update=module' % (res_id, model)) | self.__logger.exception( 'Could not delete id: %d of model %s\nThere ' 'should be some relation that points to this ' 'resource\nYou should manually fix this and ' 'restart with --update=module', res_id, model) | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,... | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py |
can_see = False | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py | |
for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break | can_see = any(access_pool.check_groups(cr, user, group) for group in groups) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py |
relation = column._obj | relation = self.pool.get(column._obj) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py |
xarch, xfields = self.pool.get(relation).__view_look_dom_arch(cr, user, f, view_id, ctx) | xarch, xfields = relation.__view_look_dom_arch(cr, user, f, view_id, ctx) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py |
attrs['selection'] = [] | name = node.get('name') default = self.default_get(cr, user, [name], context=context).get(name) if default: attrs['selection'] = relation.name_get(cr, 1, default, context=context) else: attrs['selection'] = [] | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py |
attrs['selection'] = self.pool.get(relation)._name_search(cr, user, '', dom, context=context, limit=None, name_get_uid=1) | attrs['selection'] = relation._name_search(cr, user, '', dom, context=context, limit=None, name_get_uid=1) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: ... | fea00d94296fd6d0511e5165e070c4acc61acab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fea00d94296fd6d0511e5165e070c4acc61acab0/orm.py |
:param context: usual context dictionary - it may contains keys in the form ``default_XXX`` | :param context: usual context dictionary - it may contains keys in the form ``default_XXX``, | def default_get(self, cr, uid, fields_list, context=None): """ Returns default values for the fields in fields_list. :param fields_list: list of fields to get the default values for (example ['field1', 'field2',]) :type fields_list: list :param context: usual context dictionary - it may contains keys in the form ``defa... | d74468b30303fa316f30ac247dcf41a5507314c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d74468b30303fa316f30ac247dcf41a5507314c6/orm.py |
'prefix': 'BAN/', | 'prefix': 'BNK/%(year)s/', | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
seq_prefix = "CSH/" | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | |
seq_prefix = "BAN/" | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | |
seq_prefix = "CHK/" | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | |
'name': _(vals_bnk['name']), | 'name': _(vals_bnk['name'] + ' ' + 'Journal'), | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
'prefix': seq_prefix, | 'prefix': _((vals_bnk['name'][:3].upper()) + '/%(year)s/'), | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
vals_journal['code']= _(vals_bnk['name'][:3]) | vals_journal['code']= _(vals_bnk['name'][:3]).upper() | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | ||
'prefix': '%(year)s/', | 'prefix': 'SAJ/%(year)s/', | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
'prefix': '%(year)s/', | 'prefix': 'EXJ/%(year)s/', | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py |
seq_id_sale_refund = seq_id seq_id_purchase_refund = seq_id | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | |
seq_id_sale_refund = seq_id_sale seq_id_purchase_refund = seq_id_purchase | def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_posi... | 7676a0740d502c403459953096357b1bd84fb9e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7676a0740d502c403459953096357b1bd84fb9e5/installer.py | |
'Membership amount', digites=(16, 2), | 'Membership amount', digits=(16, 2), | def _get_partners(self, cr, uid, ids, context={}): ids2 = ids while ids2: ids2 = self.search(cr, uid, [('associate_member','in',ids2)], context=context) ids+=ids2 return ids | c247e6bf440a6a2bf23fb8f45ef4a027849c7ce7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c247e6bf440a6a2bf23fb8f45ef4a027849c7ce7/membership.py |
return super(scrum_sprint, self).copy(cr, uid, id, default=default, context=context) | return super(project_scrum_sprint, self).copy(cr, uid, id, default=default, context=context) | def copy(self, cr, uid, id, default=None, context=None): """Overrides orm copy method @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 context: A standard dictionary for contextual values ""... | d95c7049a54b00559a675df900d5e3d9c96f300d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d95c7049a54b00559a675df900d5e3d9c96f300d/project_scrum.py |
attrs['selection'] = relation._name_search(cr, 1, '', dom, context=search_context, limit=None, name_get_uid=1) | attrs['selection'] = relation._name_search(cr, user, '', dom, context=search_context, limit=None, name_get_uid=1) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making f... | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for records based on a search domain. :param cr: database cursor :param user: current user id :param args: list of tuples specifying the search domain [('field_name', 'operator', value), ...]. Pass an empty list t... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): raise NotImplementedError(_('The search method is not implemented on this object !')) | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): | def _search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None): | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if not context: context = {} | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. :param cr: database cursor :param user: current user id :param args: list of tuples specifying the search domain [('field_name', 'operator', value), ...]. Pass an empty list ... | def _search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None): """ Private implementation of search() method, allowing specifying the uid to use for the access right check. This is useful for example when filling in the selection list for a drop-down and avoiding... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
self.pool.get('ir.model.access').check(cr, user, self._name, 'read', context=context) | self.pool.get('ir.model.access').check(cr, access_rights_uid or user, self._name, 'read', context=context) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
ids = self.search(cr, user, args, limit=limit, context=context) res = self.name_get(cr, name_get_uid or user, ids, context) | access_rights_uid = name_get_uid or user ids = self._search(cr, user, args, limit=limit, context=context, access_rights_uid=access_rights_uid) res = self.name_get(cr, access_rights_uid, ids, context) | def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None): if args is None: args = [] if context is None: context = {} args = args[:] if name: args += [(self._rec_name, operator, name)] ids = self.search(cr, user, args, limit=limit, context=context) res = self.na... | 1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py |
fnode.set_data(cr, data, fil) | if data is not None: fnode.set_data(cr, data, fil) | def create_child(self, cr, path, data): """ API function to create a child file object and node Return the node_* created """ dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) fil_obj=dirobj.pool.get('ir.attachment') val = { 'name': path, 'datas_fname': path, '... | 3f4c75919c7b2b6a5b2a7b72a80b37adc39ec1d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f4c75919c7b2b6a5b2a7b72a80b37adc39ec1d3/nodes.py |
product_ids = [] for location in res_location.keys(): res = res_location[location] for product_id in res.keys(): prod = product_obj.browse(cr, uid, [product_id])[0] uom = prod.uom_id.id context.update({'uom': uom}) amount = stock_location_obj._product_get(cr, uid, location, [product_id], context=context)[product_id] | if(amount): line_ids=inventory_line_obj.search(cr, uid, [('inventory_id', '=', context['active_ids']), ('location_id', '=', location), ('product_id', '=', product_id), ('product_uom', '=', uom), ('product_qty', '=', amount)]) if not len(line_ids): inventory_line = {'inventory_id': context['active_ids'][0], 'location_id... | def fill_inventory(self, cr, uid, ids, context): """ To fill 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... | b0ada2f850d7c25935262b0c0b5091224563027e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b0ada2f850d7c25935262b0c0b5091224563027e/stock_fill_inventory.py |
if(amount): line_ids=inventory_line_obj.search(cr, uid, [('inventory_id', '=', context['active_ids']), ('location_id', '=', location), ('product_id', '=', product_id), ('product_uom', '=', uom), ('product_qty', '=', amount)]) if not len(line_ids): inventory_line = {'inventory_id': context['active_ids'][0], 'location_id... | if(len(product_ids) == 0): raise osv.except_osv(_('Message !'), _('No product in this location.')) | def fill_inventory(self, cr, uid, ids, context): """ To fill 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... | b0ada2f850d7c25935262b0c0b5091224563027e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b0ada2f850d7c25935262b0c0b5091224563027e/stock_fill_inventory.py |
return False | md = self.pool.get('ir.model.data') res = md.get_object_reference(cr, uid, 'product', 'cat0') or False return res and res[1] or False | def _default_category(self, cr, uid, context={}): if 'categ_id' in context and context['categ_id']: return context['categ_id'] return False | 56e1d1784b52fe7d3eab8bf5db21901d2c53d53a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e1d1784b52fe7d3eab8bf5db21901d2c53d53a/product.py |
def _get_categ(self, cursor, user, context={}): md = self.pool.get('ir.model.data') return md._get_id(cr, uid, 'product', 'cat0') or False | def _get_categ(self, cursor, user, context={}): md = self.pool.get('ir.model.data') return md._get_id(cr, uid, 'product', 'cat0') or False | 56e1d1784b52fe7d3eab8bf5db21901d2c53d53a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e1d1784b52fe7d3eab8bf5db21901d2c53d53a/product.py | |
'categ_id': _get_categ, | def _get_categ(self, cursor, user, context={}): md = self.pool.get('ir.model.data') return md._get_id(cr, uid, 'product', 'cat0') or False | 56e1d1784b52fe7d3eab8bf5db21901d2c53d53a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e1d1784b52fe7d3eab8bf5db21901d2c53d53a/product.py | |
'order_policy': 'manual', | def _get_order(self, cr, uid, ids, context=None): if context is None: context = {} result = {} for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True return result.keys() | 5e624fba479eedb7c95e2592f8da862734d46e78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e624fba479eedb7c95e2592f8da862734d46e78/sale.py | |
for (tasks_id,) in res: task_obj.copy(cr, uid, tasks_id, default = { 'project_id': new_id, 'active':True}, context=context) child_ids = self.search(cr, uid, [('parent_id','=', proj.id)], context=context) | child_ids = self.search(cr, uid, [('parent_id','=', proj.category_id.id)], context=context) parent_id = self.read(cr, uid, new_id, ['category_id'])['category_id'][0] | def duplicate_template(self, cr, uid, ids, context={}): project_obj = self.pool.get('project.project') data_obj = self.pool.get('ir.model.data') task_obj = self.pool.get('project.task') result = [] for proj in self.browse(cr, uid, ids, context=context): parent_id = context.get('parent_id',False) # check me where to pas... | 36b13c4073fb3341599c7245cf8b38de3bc26f83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b13c4073fb3341599c7245cf8b38de3bc26f83/project.py |
self.duplicate_template(cr, uid, child_ids, context={'parent_id': new_id}) | self.duplicate_template(cr, uid, child_ids, context={'parent_id': parent_id}) | def duplicate_template(self, cr, uid, ids, context={}): project_obj = self.pool.get('project.project') data_obj = self.pool.get('ir.model.data') task_obj = self.pool.get('project.task') result = [] for proj in self.browse(cr, uid, ids, context=context): parent_id = context.get('parent_id',False) # check me where to pas... | 36b13c4073fb3341599c7245cf8b38de3bc26f83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b13c4073fb3341599c7245cf8b38de3bc26f83/project.py |
def setActive(self, cr, uid, ids, value=True, context={}): task_obj = self.pool.get('project.task') for proj in self.browse(cr, uid, ids, context): self.write(cr, uid, [proj.id], {'state': value and 'open' or 'template'}, context) cr.execute('select id from project_task where project_id=%s', (proj.id,)) tasks_id = [x[0... | 36b13c4073fb3341599c7245cf8b38de3bc26f83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b13c4073fb3341599c7245cf8b38de3bc26f83/project.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.