rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x... | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py | ||
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name) | d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name, 'read', context=context) | def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py |
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent... | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py |
'AND month_id IN %s ',(parent_ids, month_ids,)) | 'AND month_id IN %s ',(parent_ids, tuple(month_ids),)) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent... | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py |
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name) | d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name) | def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py |
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | c5d41a033c771d541bb8180ab97ee58fb5b17bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5d41a033c771d541bb8180ab97ee58fb5b17bb5/account_analytic_analysis.py | ||
if field._properties: | if field._properties and ((not field.store) or field._fnct_search): | 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) | 9148fc2662f99d7578a9688919567b94ee89e42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9148fc2662f99d7578a9688919567b94ee89e42d/expression.py |
if not field.store: if not field._fnct_search: self.__exp[i] = self.__DUMMY_LEAF else: subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context) self.__exp[i] = '&' self.__exp.insert(i + 1, self.__DUMMY_LEAF) for j, se in enumerate(subexp): self.__exp.insert(i + 2 + j, se) | if not field._fnct_search: self.__exp[i] = self.__DUMMY_LEAF else: subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context) self.__exp[i] = '&' self.__exp.insert(i + 1, self.__DUMMY_LEAF) for j, se in enumerate(subexp): self.__exp.insert(i + 2 + j, se) | 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) | 9148fc2662f99d7578a9688919567b94ee89e42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9148fc2662f99d7578a9688919567b94ee89e42d/expression.py |
picking_obj = self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for pick_id in picking_ids: wf_service.trg_write(uid, 'stock.picking', pick_id, cr) | def action_done(self, cr, uid, ids, context={}): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ track_flag = False picking_ids = [] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product'... | a9c2f1f7c5b98414aa911bbe5c47d05abea8a277 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a9c2f1f7c5b98414aa911bbe5c47d05abea8a277/stock.py | |
datas.append(str(value[1])) else: datas.append(str(value)) | datas.append(ustr(value[1])) else: datas.append(ustr(value)) | def export_data(self, cr, uid, ids, fields_to_export, context=None): if not context: context = {} data_l = self.read(cr, uid, ids, ['sql_query'], context) final_datas = [] #start Loop for i in data_l: datas = [] for key, value in i.items(): if key not in fields_to_export: continue if isinstance(value, tuple): datas.ap... | e2ba8cb627c6a1a16183009042159112ac671260 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e2ba8cb627c6a1a16183009042159112ac671260/base_report_creator.py |
def _amount_total(self, cr, uid, ids, field_name, arg, context): """ Calculates total amount. @param field_name: Name of field. @param arg: Argument @return: Dictionary of values. """ res = {} untax = self._amount_untaxed(cr, uid, ids, field_name, arg, context) tax = self._amount_tax(cr, uid, ids, field_name, arg, cont... | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py | ||
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('a... | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py | ||
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('a... | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py | ||
self.write(cr, uid, ids, {'state': 'ready'}) | for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'ready'}) | def action_repair_ready(self, cr, uid, ids, context=None): """ Writes repair order state to 'Ready' @return: True """ self.write(cr, uid, ids, {'state': 'ready'}) return True | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py |
self.write(cr, uid, ids, {'state': 'under_repair'}) | for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'under_repair'}) | def action_repair_start(self, cr, uid, ids, context=None): """ Writes repair order state to 'Under Repair' @return: True """ self.write(cr, uid, ids, {'state': 'under_repair'}) return True | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py |
repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id}) | repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id, 'state': 'done'}) | def action_repair_done(self, cr, uid, ids, context=None): """ Creates stock move and picking for repair order. @return: Picking ids. """ res = {} move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") repair_line_obj = self.pool.get('mrp.repair.line') seq_obj = self.pool.get('ir.sequence') ... | d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py |
key = operator.itemgetter(0) | def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} | 737db203a65bc75bdfb2cde7d1b55ec5496b147d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/737db203a65bc75bdfb2cde7d1b55ec5496b147d/mrp.py | |
def widget_add(self, cr, uid, ids, context=None): | def add_res_widget(self, cr, uid, ids, context=None): | def widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {} | a578d8a6bfd93daacb709ff48e0665bb901e7d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a578d8a6bfd93daacb709ff48e0665bb901e7d20/res_widget.py |
return {} | return {'type': 'ir.actions.act_window_close'} | def widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {} | a578d8a6bfd93daacb709ff48e0665bb901e7d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a578d8a6bfd93daacb709ff48e0665bb901e7d20/res_widget.py |
raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) | def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%s and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit, id) in sql_inherit: result = _inherit_apply(result, inh... | eef29eefb2f48eda988c6d93b2a91be7931548a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eef29eefb2f48eda988c6d93b2a91be7931548a2/orm.py | |
logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) | logger.notifyChannel('ERROR', netsvc.LOG_TEST, e) | def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) pass else: raise Exception finally: if tools... | 0fb50cd625e30eee277d16b4c4a4413c7a79049a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fb50cd625e30eee277d16b4c4a4413c7a79049a/__init__.py |
raise Exception | raise | def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) pass else: raise Exception finally: if tools... | 0fb50cd625e30eee277d16b4c4a4413c7a79049a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fb50cd625e30eee277d16b4c4a4413c7a79049a/__init__.py |
done = [] | 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 | 602815a5adcdd7d92cfe88ee9efad5b97a89e1ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/602815a5adcdd7d92cfe88ee9efad5b97a89e1ef/orm.py | |
break | if [x for x in fields2 if x]: break | 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 | 602815a5adcdd7d92cfe88ee9efad5b97a89e1ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/602815a5adcdd7d92cfe88ee9efad5b97a89e1ef/orm.py |
def sort_result(self, accounts, context={}): # On boucle sur notre rapport result_accounts = [] ind=0 old_level=0 while ind<len(accounts): # account_elem = accounts[ind] # | 416220ea9040ed5dcc762b7b67b8baa0756981a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/416220ea9040ed5dcc762b7b67b8baa0756981a9/tax_report.py | ||
def sort_result(self, accounts, context={}): # On boucle sur notre rapport result_accounts = [] ind=0 old_level=0 while ind<len(accounts): # account_elem = accounts[ind] # | 416220ea9040ed5dcc762b7b67b8baa0756981a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/416220ea9040ed5dcc762b7b67b8baa0756981a9/tax_report.py | ||
exval = map(lambda x: x.strftime('%Y%m%dT%H%M%S'), exdates) self.ical_set(cal_data.name.lower(), ','.join(exval), 'value') | exvals = [] for exdate in exdates: exvals.append(datetime.fromtimestamp(time.mktime(exdate.utctimetuple())).strftime('%Y%m%dT%H%M%S')) self.ical_set(cal_data.name.lower(), ','.join(exvals), '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 ... | 8058b7ff54c722c9aa3b735cb437d7f9d352139b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8058b7ff54c722c9aa3b735cb437d7f9d352139b/calendar.py |
for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] | for invoice in self.browse(cr, uid, ids, context=context): id = invoice.id res[id] = [] if not invoice.move_id: | def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where ... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = [] | data_lines = invoice.move_id.line_id partial_ids = [] | def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where ... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) | def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list t... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py | |
for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = [] if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in line... | if invoice.move_id: for m in invoice.move_id.line_id: temp_lines = [] if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id) | def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list t... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
res = [] | print '** la' if not ids: return [] result = self.move_line_id_payment_gets(cr, uid, ids, *args) return result.get(ids[0], []) def move_line_id_payment_gets(self, cr, uid, ids, *args): print '** ICI' res = {} | def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
cr.execute('SELECT l.id '\ | cr.execute('SELECT i.id, l.id '\ | def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
res = map(itemgetter(0), cr.fetchall()) | for r in cr.fetchall(): res.setdefault(r[0], []) res[r[0]].append( r[1] ) | def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re... | 3af18d7dc239849f8930c42babb62cbecd933bd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3af18d7dc239849f8930c42babb62cbecd933bd2/invoice.py |
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...... | e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f/base_contact.py | |
'name': fields.related('address_id','partner_id', type='many2one',\ | 'name': fields.related('address_id', 'partner_id', type='many2one',\ | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @... | e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f/base_contact.py |
'address_id': fields.many2one('res.partner.address','Address', \ | 'address_id': fields.many2one('res.partner.address', 'Address', domain=[('partner_id', '=', name)], \ | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @... | e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f/base_contact.py |
def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ retu... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @... | e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5cc5d6fa28a7e31dce2ad954b2bac8353b09e8f/base_contact.py | |
def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, '... | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py | ||
'ressource_id': lambda *a: 0, | 'ressource_id': lambda *a: 0, | def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, '... | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py |
def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')') ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py | ||
def get_object(self, cr, uid, uri, context=None): """ Return a node object for the given uri. This fn merely passes the call to node_context """ if not context: context = {} return nodes.get_node_context(cr, uid, context).get_uri(cr, uri) | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py | ||
def get_dir_permissions(self, cr, uid, ids ): """Check what permission user 'uid' has on directory 'id' """ assert len(ids) == 1 id = ids[0] cr.execute( "SELECT count(dg.item_id) AS needs, count(ug.uid) AS has " \ " FROM document_directory_group_rel dg " \ " LEFT OUTER JOIN res_groups_users_rel ug " \ " ON (dg.gro... | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py | ||
def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ return (nodes.node_database(context=ncontext), uri) | 2c71620b6faa9d1b680b0a333dfaf7ec5a93abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c71620b6faa9d1b680b0a333dfaf7ec5a93abad/document_directory.py | ||
if currency.company_id != company_id: | if currency.company_id.id != company_id: | def onchange_currency_id(self, cr, uid, ids, curr_id, company_id): if curr_id: currency = self.pool.get('res.currency').browse(cr, uid, curr_id) if currency.company_id != company_id: raise osv.except_osv(_('Configration Error !'), _('Can not select currency that is not related to current company.\nPlease select accordi... | d5cd014da19401dc1aebed1284a2491d20545462 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5cd014da19401dc1aebed1284a2491d20545462/invoice.py |
mod_names.remove('all') | if 'all' in mod_names: mod_names.remove('all') | def _check_module_names(cr, module_names): mod_names = set(module_names) if 'base' in mod_names: # ignore dummy 'all' module mod_names.remove('all') if mod_names: cr.execute("SELECT count(id) AS count FROM ir_module_module WHERE name in %s", (tuple(mod_names),)) if cr.dictfetchone()['count'] != len(mod_names): # find o... | ba4f8ad2233f5657461663e5d5a710a1f8a43f31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ba4f8ad2233f5657461663e5d5a710a1f8a43f31/__init__.py |
'value': { 'warning' : _("Please keep in mind that data currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close the forms before switching to a different company (you can click on Cancel now)"), } | 'warning' : { 'title': _("Company Switch Warning"), 'message': _("Please keep in mind that documents currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close all forms before switching to a different company. (You can click on Cancel in ... | def on_change_company_id(self, cr, uid, ids, company_id): return { 'value': { 'warning' : _("Please keep in mind that data currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close the forms before switching to a different company (you ca... | da52ec057996edb84c2e351fdf3bb62e5a51dbe1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da52ec057996edb84c2e351fdf3bb62e5a51dbe1/res_user.py |
if method not in ['execute','exec_workflow','obj_list']: raise KeyError("Method not supported %s" % method) | if method == 'obj_list': raise NameError("obj_list has been discontinued via RPC as of 6.0, please query ir.model directly!") if method not in ['execute','exec_workflow']: raise NameError("Method not available %s" % method) | def dispatch(self, method, auth, params): (db, uid, passwd ) = params[0:3] params = params[3:] if method not in ['execute','exec_workflow','obj_list']: raise KeyError("Method not supported %s" % method) security.check(db,uid,passwd) ls = netsvc.LocalService('object_proxy') fn = getattr(ls, method) res = fn(db, uid, *pa... | 14b7e37bf5d01391a34b09baff483528ea4cbf66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/14b7e37bf5d01391a34b09baff483528ea4cbf66/web_services.py |
if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id' in line: line['uos_id'] = line.get('uos_id', False) and line['uos_id'][0] | for field in ('company_id', 'partner_id', 'account_id', 'product_id', 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id'): line[field] = line.get(field, False) and line[field][0] | def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id... | 39adf6db6d2474d1715ad3dbfdcf600dc74a36d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39adf6db6d2474d1715ad3dbfdcf600dc74a36d4/invoice.py |
if 'account_analytic_id' in line: line['account_analytic_id'] = line.get('account_analytic_id', False) and line['account_analytic_id'][0] if 'tax_code_id' in line : if isinstance(line['tax_code_id'],tuple) and len(line['tax_code_id']) >0 : line['tax_code_id'] = line['tax_code_id'][0] if 'base_code_id' in line : if isi... | def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id... | 39adf6db6d2474d1715ad3dbfdcf600dc74a36d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39adf6db6d2474d1715ad3dbfdcf600dc74a36d4/invoice.py | |
logger.info('Email successfully send to: %s', address) | logger.info('Email successfully sent to: %s', address) | def run(self, cr, uid, ids, context=None): logger = logging.getLogger(self._name) if context is None: context = {} for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context': dict(context), # c... | 03f310034619ef65b3597dd4ef6531b677ef090c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03f310034619ef65b3597dd4ef6531b677ef090c/ir_actions.py |
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\ | help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Available\'.\n When the picking is done the state is \'Done\'.\ | def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru... | 164e463c97d9110ef08efa5f1bf8319ad62188ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/164e463c97d9110ef08efa5f1bf8319ad62188ec/stock.py |
def _check_percent(self, cr, uid, ids, context={}): obj = self.browse(cr, uid, ids[0]) if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0): return False return True | 2eb60e24babd20c86f98b3b6c66f9a79a742b4c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eb60e24babd20c86f98b3b6c66f9a79a742b4c3/account.py | ||
cr.execute("update account_account set active='f' where id=%s" % (account_id)) | cr.execute("update account_account set active='f' where id in " + str(tuple(acc_ids))) | def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) 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.templ... | 2eb60e24babd20c86f98b3b6c66f9a79a742b4c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eb60e24babd20c86f98b3b6c66f9a79a742b4c3/account.py |
_rec_name = "date_time" | _rec_name = "summary" | def write(self, cr, uid, ids, vals, context=None): | b6a3f0eda07bcba4287b3bd94781ace592c98e44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6a3f0eda07bcba4287b3bd94781ace592c98e44/wiki.py |
line1 = text1.splitlines(1) line2 = text2.splitlines(1) | line1 = line2 = '' if text1: line1 = text1.splitlines(1) if text2: line2 = text2.splitlines(1) if (not line1 and not line2) or (line1 == line2): raise osv.except_osv(_('Warning !'), _('There are no chnages in revisions')) | def getDiff(self, cr, uid, v1, v2, context={}): | b6a3f0eda07bcba4287b3bd94781ace592c98e44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6a3f0eda07bcba4287b3bd94781ace592c98e44/wiki.py |
t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8') f_name = node.get("name",'').encode('utf-8') q = unsafe_eval(f_search, idref) ids = pool.get(f_model).search(cr, uid, q) if f_u... | t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8') f_name = node.get("name",'').encode('utf-8') idref2 = {} if f_search: idref2 = _get_idref(self, cr, uid, f_model, context, idre... | def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8... | 1dde0f53daa37992cefe2ea79d4fd07111e0d96e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1dde0f53daa37992cefe2ea79d4fd07111e0d96e/convert.py |
d_search = rec.get("search",'') | d_search = rec.get("search",'').encode('utf-8') | def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'') d_id = rec.get("id",'') ids = [] if d_search: ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. do... | 1dde0f53daa37992cefe2ea79d4fd07111e0d96e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1dde0f53daa37992cefe2ea79d4fd07111e0d96e/convert.py |
ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) | idref = _get_idref(self, cr, self.uid, d_model, context={}, idref={}) ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search, idref)) | def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'') d_id = rec.get("id",'') ids = [] if d_search: ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. do... | 1dde0f53daa37992cefe2ea79d4fd07111e0d96e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1dde0f53daa37992cefe2ea79d4fd07111e0d96e/convert.py |
if not trans and ('base_model_name' in context): | if trans == node.get('string') and ('base_model_name' in context): | 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... | d3e84488759a02974cbd72ae0306268a63fea158 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3e84488759a02974cbd72ae0306268a63fea158/orm.py |
query = "SELECT arch,name,field_parent,id,type,inherit_id FROM ir_ui_view WHERE id=%s" | query = "SELECT arch,name,field_parent,id,type,inherit_id,model FROM ir_ui_view WHERE id=%s" | def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel express... | d3e84488759a02974cbd72ae0306268a63fea158 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3e84488759a02974cbd72ae0306268a63fea158/orm.py |
arch,name,field_parent,id,type,inherit_id | arch,name,field_parent,id,type,inherit_id,model | def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel express... | d3e84488759a02974cbd72ae0306268a63fea158 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3e84488759a02974cbd72ae0306268a63fea158/orm.py |
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=context) | if parent_view_model != self._name: ctx = context.copy() ctx['base_model_name'] = parent_view_model else: ctx = context xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx) | def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%s and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit, id) in sql_inherit: result = _inherit_apply(result, inh... | d3e84488759a02974cbd72ae0306268a63fea158 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3e84488759a02974cbd72ae0306268a63fea158/orm.py |
res[purchase.id] = False | res[purchase.id] = time.strftime('%Y-%m-%d %H:%M:%S') | def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None): res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: res[purchase.id] = False if purchase.order_line: min_date=purchase.order_line[0].date_planned for line in purchase.order_line: if line.date_planned <... | 50ee734cae98a03e89c883507d3434a6d8f38c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50ee734cae98a03e89c883507d3434a6d8f38c58/purchase.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] = [] if offset: warnings.warn("Specifying offset at a many2many.get() may produce unpredictable results.", DeprecationWarning,... | 38092d24bfffa416ecf15943b691da4b98c71fd8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/38092d24bfffa416ecf15943b691da4b98c71fd8/fields.py | ||
res[prop.res_id.id][prop.fields_id.name] = value or False | avil_id = obj.pool.get(value._name).search(cr, uid, [('id','=',value.id)], context=context) res[prop.res_id.id][prop.fields_id.name] = (avil_id and value) and value or False | def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, conte... | 38092d24bfffa416ecf15943b691da4b98c71fd8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/38092d24bfffa416ecf15943b691da4b98c71fd8/fields.py |
period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) | period_start = datetime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) | def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=per... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=per... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py | ||
while ds.strftime('%Y-%m-%d') < p.date_stop: | while ds.strftime('%Y-%m-%d') <= p.date_stop: | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
de = ds + relativedelta(days=interval, minutes =-1) | de = ds + relativedelta(days=(interval + 1), seconds =-1) | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
ds = ds + relativedelta(days=interval) + 1 | ds = ds + relativedelta(days=(interval + 1)) | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') | de = ds + relativedelta(days=(interval + 1), seconds =-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(days=(interval + 1), seconds =-1) start_week = ds.strftime('%W') start_year = ds.strftime('%Y') end_week = de.strftime('%W') end_year = de.strftime('%Y') if start_year ... | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
ds = ds + relativedelta(days=interval) + 1 | ds = ds + relativedelta(days=(interval + 1)) | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
de = ds + relativedelta(months=interval, minutes=-1) | de = ds + relativedelta(months=interval, seconds=-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(months=interval, seconds=-1) | def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft... | 754c921bd02858cd0a09ecc9a5cfbcf1146071ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754c921bd02858cd0a09ecc9a5cfbcf1146071ab/stock_planning_create_periods.py |
invoices = self.read(cr, uid, ids, ['move_id']) | invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids']) | def action_cancel(self, cr, uid, ids, *args): account_move_obj = self.pool.get('account.move') invoices = self.read(cr, uid, ids, ['move_id']) for i in invoices: if i['move_id']: account_move_obj.button_cancel(cr, uid, [i['move_id'][0]]) # delete the move this invoice was pointing to # Note that the corresponding move_... | 4678c890a665b399e06491741c3eddc8527f9e6f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4678c890a665b399e06491741c3eddc8527f9e6f/invoice.py |
self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, dst_basename, dst_basedir) | self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, datacr[2], datacr[1]) | def rename(self, src, datacr): """ Renaming operation, the effect depends on the src: * A file: read, create and remove * A directory: change the parent and reassign childs to ressource """ cr = datacr[0] try: nname = _to_unicode(datacr[2]) ret = src.move_to(cr, datacr[1], new_name=nname) # API shouldn't wait for us to... | 796ed8e5987aa04cb2f4aa2cc950254363e29195 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/796ed8e5987aa04cb2f4aa2cc950254363e29195/abstracted_fs.py |
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) | if previous_partial: account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) else: account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) | def button_confirm(self, cr, uid, ids, context={}): done = [] res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = \ self.pool.get('account... | d3f70e05fe7a19eaad75ecc398febd6d4527aa2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3f70e05fe7a19eaad75ecc398febd6d4527aa2a/account_bank_statement.py |
icon = tools.file_open(icon_path,'rb').read() return base64.encodestring(icon) | if icon_path: icon = tools.file_open(icon_path,'rb').read() icon_image = base64.encodestring(icon) return icon_image | def read_image(self, path): path_info = path.split(',') icon_path = addons.get_module_resource(path_info[0],path_info[1]) icon = tools.file_open(icon_path,'rb').read() return base64.encodestring(icon) | d4b2226607975d4b91dd044bb33375062ed4f19b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4b2226607975d4b91dd044bb33375062ed4f19b/ir_ui_menu.py |
if picking_id: wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) | def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False move_obj = self.pool.get('stock.move') proc_obj = self.pool.get('procurement.order') company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}):... | 54ae65bc49e1ca211bfd02d70f537690d203f0e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/54ae65bc49e1ca211bfd02d70f537690d203f0e1/sale.py | |
if ok: list_ids = [] for tmp in move.line_id: list_ids.append(tmp.id) self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context) | if ok: list_ids = [] for tmp in move.line_id: list_ids.append(tmp.id) self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context) | def validate(self, cr, uid, ids, context={}): if context and ('__last_update' in context): del context['__last_update'] ok = True for move in self.browse(cr, uid, ids, context): #unlink analytic lines on move_lines for obj_line in move.line_id: for obj in obj_line.analytic_lines: self.pool.get('account.analytic.line').... | 047be686745c2903a886a3417584640a076ce7a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/047be686745c2903a886a3417584640a076ce7a6/account.py |
reference = obj_inv.reference | reference = obj_inv.reference or '' | def action_number(self, cr, uid, ids, *args): for obj_inv in self.browse(cr, uid, ids): id = obj_inv.id invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False reference = obj_inv.reference if not number: tmp_context = { 'fiscalyear_id': obj_inv.period_id.fiscalyear_id.i... | 95f5f1f0c8b337738d3504ea57d5284feea036e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95f5f1f0c8b337738d3504ea57d5284feea036e9/invoice.py |
perc_state = (state_cases / float(case.nbr_cases) ) * 100 | perc_state = (state_cases / float(case.nbr) ) * 100 | def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)... | 30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c/report_crm.py |
avg_ans = logs / case.nbr_cases | avg_ans = logs / case.nbr | def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)... | 30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c/report_crm.py |
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True), | 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True), | def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)... | 30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/30c239414fe282ec5d6bf5c7c50dc9a3f64ada6c/report_crm.py |
model_pool._history(cr, uid, [case], _('Send'), history=True, email=False) model_pool.write(cr, uid, [case.id], { 'som': False, 'canal_id': False, }) | model_pool._history(cr, uid, [case], _('Send'), history=True, email=False) | def _mass_mail_send(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0] model = hist_obj.log_id.model_id.model model_pool = pool.get(model) case = model_pool.browse(cr, uid, hist_obj.log_id.res_id) model_pool._history(cr, uid, [case], _... | 56244b68f7af69f77db9c2bd5cb62a0ef00ee903 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56244b68f7af69f77db9c2bd5cb62a0ef00ee903/wizard_crm_send_email.py |
value = elements[0] | value = self._get_first_result(elements) | def _eval_field(self, model, field_name, expression): column = model._columns[field_name] if is_ref(expression): if expression.model: other_model_name = expression.model else: other_model_name = column._obj other_model = self.get_model(other_model_name) if expression.search: q = eval(expression.search, self.eval_contex... | 7043023dd859943a2cf5fa3e3e86652ad427f6e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7043023dd859943a2cf5fa3e3e86652ad427f6e5/yaml_import.py |
flist = groupby | group_by = groupby if fget[groupby]['type'] in ('date','datetime'): flist = "to_char(%s,'yyyy-mm') as %s "%(groupby,groupby) groupby = "to_char(%s,'yyyy-mm')"%(groupby) else: flist = groupby | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | 27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7/orm.py |
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | 27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7/orm.py | ||
if fget[groupby]['type'] == 'many2one': d[groupby] = d[groupby] and d[groupby][1] or '' | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | 27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7/orm.py | |
today = datetime.date.today() if d[groupby][:10] == str(today): d[groupby] = 'Today' | dt = datetime.datetime.strptime(alldata[d['id']][groupby][:7],'%Y-%m') days = calendar.monthrange(dt.year, dt.month)[1] if d[groupby][:7] == today.strftime('%Y-%m'): d[groupby] = 'This Month' | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | 27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7/orm.py |
d['__domain'] = [(groupby,'=',alldata[d['id']][groupby] or False)] + domain | d['__domain'] = [(groupby,'>=',alldata[d['id']][groupby] and datetime.datetime.strptime(alldata[d['id']][groupby][:7] + '-01','%Y-%m-%d').strftime('%Y-%m-%d') or False),\ (groupby,'<=',alldata[d['id']][groupby] and datetime.datetime.strptime(alldata[d['id']][groupby][:7] + '-' + str(days),'%Y-%m-%d').strftime('%Y-%m-%... | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys() | 27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27dbc19d1f7a0ba675a91c3ae1c88699c1d30ad7/orm.py |
data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: | uom_obj = self.pool.get('product.uom') for picking in self.browse(cr, uid, ids, context): | def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_... | d9c5b69c4166abc4e565909bc3c724dd057dc00f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d9c5b69c4166abc4e565909bc3c724dd057dc00f/stock.py |
if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_id.weight) total_weight += weight | for move in picking.move_lines: total_weight += move.weight | def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_... | d9c5b69c4166abc4e565909bc3c724dd057dc00f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d9c5b69c4166abc4e565909bc3c724dd057dc00f/stock.py |
'weight': fields.function(_cal_weight, method=True, type='float', string='Weight',digits_compute= dp.get_precision('Stock Weight'), | 'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), | def _get_picking_line(self, cr, uid, ids, context=None): result = {} for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys() | d9c5b69c4166abc4e565909bc3c724dd057dc00f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d9c5b69c4166abc4e565909bc3c724dd057dc00f/stock.py |
print "========", bom.product_id.name | def _compute_price(bom): print bom.product_id price = 0 | c537d51792837a370cd94ef7eb7067d7965565f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c537d51792837a370cd94ef7eb7067d7965565f0/product.py | |
print "XXXXXXXXXXXXX", p, test_obj.child_ids | def _compute_price(bom): print bom.product_id price = 0 | c537d51792837a370cd94ef7eb7067d7965565f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c537d51792837a370cd94ef7eb7067d7965565f0/product.py | |
result += txt | result += unicode(txt) | def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate to_translate = tools.ustr(sps.pop(0)) result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate)) if sps: try: txt ... | f886f8f43b6d627dcd6c6900e61bee3bc2c59648 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f886f8f43b6d627dcd6c6900e61bee3bc2c59648/utils.py |
limit = datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty) | limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty) | def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False): """ On change of move id sets values of guarantee limit, source location, destination location, partner and partner address. @param prod_id: Id of product in current record. @param move_id: Changed move. @return: Dictionary of values. """ data = {}... | ded4526a934a1096b93f3bcbf733055defd0bb7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ded4526a934a1096b93f3bcbf733055defd0bb7d/mrp_repair.py |
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): | def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): | def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] | cbea6a2d9a37b768b84716ca85849f17c7ebc827 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cbea6a2d9a37b768b84716ca85849f17c7ebc827/account_tax_include.py |
new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) | new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description, journal_id=journal_id) | def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] | cbea6a2d9a37b768b84716ca85849f17c7ebc827 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cbea6a2d9a37b768b84716ca85849f17c7ebc827/account_tax_include.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.