rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if self.date_lst_string: self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id=%s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")", (partner.id, tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line AS l " \ "WHERE partner_id=%s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (partner.id, tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | def _sum_credit_partner(self, partner, data): result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id=%s " \ "AND account_id IN %s" \ "AND reconcile_id IS NULL " \ "AND date < %s " , (partner.id, tuple(self.account_ids), self.date_lst[0],)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
if self.date_lst_string: self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")",(tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line AS l " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | def _sum_debit(self, data): if not self.ids: return 0.0 result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ "AND reconcile_id IS NULL " \ "AND date < %s " , (tuple(self.partner_ids), tuple(self.account_ids), self.date_lst[0],)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
if self.date_lst_string: self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")",(tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line AS l " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | def _sum_credit(self, data): if not self.ids: return 0.0 result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ "AND reconcile_id IS NULL " \ "AND date < %s " , (tuple(self.partner_ids), tuple(self.account_ids), self.date_lst[0],)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp = result_tmp + 0.0 | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
if data['form']['result_selection']=='customer': | if data['form']['result_selection'] == 'customer': | def _get_partners(self, data): if data['form']['result_selection']=='customer': return 'Receivable Accounts' elif data['form']['result_selection']=='supplier': return 'Payable Accounts' elif data['form']['result_selection']=='customer_supplier': return 'Receivable and Payable Accounts' return '' | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
elif data['form']['result_selection']=='supplier': | elif data['form']['result_selection'] == 'supplier': | def _get_partners(self, data): if data['form']['result_selection']=='customer': return 'Receivable Accounts' elif data['form']['result_selection']=='supplier': return 'Payable Accounts' elif data['form']['result_selection']=='customer_supplier': return 'Receivable and Payable Accounts' return '' | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
elif data['form']['result_selection']=='customer_supplier': | elif data['form']['result_selection'] == 'customer_supplier': | def _get_partners(self, data): if data['form']['result_selection']=='customer': return 'Receivable Accounts' elif data['form']['result_selection']=='supplier': return 'Payable Accounts' elif data['form']['result_selection']=='customer_supplier': return 'Receivable and Payable Accounts' return '' | fbadca8d34f0137a629f314b5e51a2ecd4c769b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbadca8d34f0137a629f314b5e51a2ecd4c769b8/third_party_ledger.py |
else: | elif k in cols: | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.', '_') cr.execute('select * from ir_model_data where name=%s and res_id=%s and module=%s', (name_id, model_id, context['module'])) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) ) | d429b331e067d9e8f81a8499812ca60052ec75d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d429b331e067d9e8f81a8499812ca60052ec75d5/orm.py |
cr.execute(""" create or replace view report_timesheet_task_user as ( | tools.drop_view_if_exists(cr, 'report_timesheet_task_user') cr.execute(""" create or replace view report_timesheet_task_user as ( | def init(self, cr): cr.execute(""" create or replace view report_timesheet_task_user as ( select ((r.id*12)+to_number(months.m_id,'99'))::integer as id, months.name as name, r.id as user_id, to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') as year, to_char(to_date(months.name, 'YYYY/MM/DD'),'MM') as month from res_users r, (select to_char(p.date,'YYYY-MM-01') as name, to_char(p.date,'MM') as m_id from project_task_work p | e3eb2af6141616c807376c8ba2e8a0a817a561bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e3eb2af6141616c807376c8ba2e8a0a817a561bf/task_report.py |
data.update({'date': context['date']}) | def do_print(self, cr, uid, ids, context=None): if context is None: context = {} data = self.read(cr, uid, ids, [])[0] res = self._get_partners_followp(cr, uid, ids, context)['to_update'] to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and context['date'] or data['date'] for id in to_update.keys(): if to_update[id]['partner_id'] in data['partner_ids']: cr.execute( "UPDATE account_move_line "\ "SET followup_line_id=%s, followup_date=%s "\ "WHERE id=%s", (to_update[id]['level'], date, int(id),)) | 2081b75988f7709a77000b809e19922d9c490990 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2081b75988f7709a77000b809e19922d9c490990/account_followup_print.py |
|
def do_print(self, cr, uid, ids, context=None): if context is None: context = {} data = self.read(cr, uid, ids, [])[0] res = self._get_partners_followp(cr, uid, ids, context)['to_update'] to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and context['date'] or data['date'] for id in to_update.keys(): if to_update[id]['partner_id'] in data['partner_ids']: cr.execute( "UPDATE account_move_line "\ "SET followup_line_id=%s, followup_date=%s "\ "WHERE id=%s", (to_update[id]['level'], date, int(id),)) | 2081b75988f7709a77000b809e19922d9c490990 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2081b75988f7709a77000b809e19922d9c490990/account_followup_print.py |
||
return user.context_project_id | return user.context_project_id.id | def _get_project(self, cr, uid, context): user = self.pool.get('res.users').browse(cr,uid,uid, context=context) if user.context_project_id: return user.context_project_id return False | cc31ffeb59f320330590fa0d3b97fca2bc8f80e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cc31ffeb59f320330590fa0d3b97fca2bc8f80e9/project_issue.py |
uid = self.uid | def _tag_act_window(self, cr, rec, data_node=None): name = rec.get('name','').encode('utf-8') xml_id = rec.get('id','').encode('utf8') self._test_xml_id(xml_id) type = rec.get('type','').encode('utf-8') or 'ir.actions.act_window' view_id = False if rec.get('view'): view_id = self.id_get(cr, 'ir.actions.act_window', rec.get('view','').encode('utf-8')) domain = rec.get('domain','').encode('utf-8') or '{}' context = rec.get('context','').encode('utf-8') or '{}' res_model = rec.get('res_model','').encode('utf-8') src_model = rec.get('src_model','').encode('utf-8') view_type = rec.get('view_type','').encode('utf-8') or 'form' view_mode = rec.get('view_mode','').encode('utf-8') or 'tree,form' usage = rec.get('usage','').encode('utf-8') limit = rec.get('limit','').encode('utf-8') auto_refresh = rec.get('auto_refresh','').encode('utf-8') | b6c87a04bf14a60ef09ec42b14dc87054a221084 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6c87a04bf14a60ef09ec42b14dc87054a221084/convert.py |
|
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context) | def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context) | def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}): domain = [] if product_id: domain += ['|',('product_id','=',product_id)] domain += [('product_id','=',False)] if partner_id: domain += ['|',('partner_id','=',partner_id)] domain += [('partner_id','=',False)] if user_id: domain += ['|',('user_id','=',uid)] domain += [('user_id','=',False)] if date: domain += ['|',('date_start','<=',date),('date_start','=',False)] domain += ['|',('date_stop','>=',date),('date_stop','=',False)] best_index = -1 res = False for rec in self.browse(cr, uid, self.search(cr, uid, domain, context=context), context=context): index = 0 if rec.product_id: index+=1 if rec.partner_id: index+=1 if rec.user_id: index+=1 if rec.date_start: index+=1 if rec.date_stop: index+=1 if index>best_index: res = rec best_index = index return res | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
res_prod['value'].update({'account_analytic_id':False}) | res_prod['value'].update({'account_analytic_id':False}) | def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context) rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context) if rec: res_prod['value'].update({'account_analytic_id':rec.analytic_id.id}) else: res_prod['value'].update({'account_analytic_id':False}) return res_prod | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context) rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context) if rec: res_prod['value'].update({'account_analytic_id':rec.analytic_id.id}) else: res_prod['value'].update({'account_analytic_id':False}) return res_prod | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def _get_account_analytic_invoice(self, cursor, user, picking, move_line): partner_id = picking.address_id and picking.address_id.partner_id or False rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id and partner_id.id, user, time.strftime('%Y-%m-%d'), context={}) if rec: return rec.analytic_id.id return super(stock_picking, self)._get_account_analytic_invoice(cursor, user, picking, move_line) | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def _get_account_analytic_invoice(self, cursor, user, picking, move_line): partner_id = picking.address_id and picking.address_id.partner_id or False rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id and partner_id.id, user, time.strftime('%Y-%m-%d'), context={}) if rec: return rec.analytic_id.id return super(stock_picking, self)._get_account_analytic_invoice(cursor, user, picking, move_line) | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def _get_account_analytic_invoice(self, cursor, user, picking, move_line): partner_id = picking.address_id and picking.address_id.partner_id or False rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id and partner_id.id, user, time.strftime('%Y-%m-%d'), context={}) if rec: return rec.analytic_id.id return super(stock_picking, self)._get_account_analytic_invoice(cursor, user, picking, move_line) | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def _get_account_analytic_invoice(self, cursor, user, picking, move_line): partner_id = picking.address_id and picking.address_id.partner_id or False rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id and partner_id.id, user, time.strftime('%Y-%m-%d'), context={}) if rec: return rec.analytic_id.id return super(stock_picking, self)._get_account_analytic_invoice(cursor, user, picking, move_line) | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') for line in pool_inv_line.browse(cr, uid, create_ids, context): rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) if rec: pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context) return create_ids | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') for line in pool_inv_line.browse(cr, uid, create_ids, context): rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) if rec: pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context) return create_ids | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
||
sale_order_line() | sale_order_line() | def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') for line in pool_inv_line.browse(cr, uid, create_ids, context): rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) if rec: pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context) return create_ids | c4a5925fb0ea6191531b93530d7f14b03542b013 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4a5925fb0ea6191531b93530d7f14b03542b013/account_analytic_default.py |
cr.execute(qry, val) | cr.execute(qry % val) | def _set_rrulestring(self, cr, uid, id, name, value, arg, context=None): """ Sets values of fields that defines event recurrence from the value of rrule string @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ if not context: context = {} cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\ mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\ day=0,select1='date',month_list=Null ,byday=Null where id=%%s" % (self._table), (id,)) | 2694e39ff16cc0831fc72b6aab2a0f4341add804 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2694e39ff16cc0831fc72b6aab2a0f4341add804/base_calendar.py |
lines = move.line_id if lines: ref_line = lines[0] ref_chart_account = _get_chart_account(cursor, user, ref_line.account_id) parent_left = ref_chart_account.parent_left parent_right = ref_chart_account.parent_right result = True for line in lines[1:]: if not (line.account_id.parent_left > parent_left and line.account_id.parent_left < parent_right): raise osv.except_osv(_('Error !'), _('You cannot validate a move unless accounts in its entry lines are in same Chart Of Accounts !')) | top = None for line in move.line_id: account = line.account_id while account: account2 = account account = account.parent_id if not top: top = account2.id elif top<>account2.id: raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !')) | def _get_chart_account(cursor, user, account): if account.parent_id: chart_account = _get_chart_account(cursor, user, account.parent_id) else: chart_account = account return chart_account | 590184a89ce9177c2a43982684fdca629a93402a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/590184a89ce9177c2a43982684fdca629a93402a/account.py |
if move.picking_id and move.picking_id.type=="internal": return True | def _check_tracking(self, cr, uid, ids): """ Checks if production lot is assigned to stock move or not. @return: True or False """ for move in self.browse(cr, uid, ids): if move.picking_id and move.picking_id.type=="internal": return True if not move.prodlot_id and \ (move.state == 'done' and \ ( \ (move.product_id.track_production and move.location_id.usage=='production') or \ (move.product_id.track_production and move.location_dest_id.usage=='production') or \ (move.product_id.track_incoming and move.location_id.usage in ('supplier','internal')) or \ (move.product_id.track_outgoing and move.location_dest_id.usage in ('customer','internal')) \ )): return False return True | 3a8208a76d3812ec0e7d01db1efd2bbaac01f666 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a8208a76d3812ec0e7d01db1efd2bbaac01f666/stock.py |
|
(move.product_id.track_production and move.location_id.usage=='production') or \ (move.product_id.track_production and move.location_dest_id.usage=='production') or \ (move.product_id.track_incoming and move.location_id.usage in ('supplier','internal')) or \ (move.product_id.track_outgoing and move.location_dest_id.usage in ('customer','internal')) \ | (move.product_id.track_production and move.location_id.usage == 'production') or \ (move.product_id.track_production and move.location_dest_id.usage == 'production') or \ (move.product_id.track_incoming and move.location_id.usage == 'supplier') or \ (move.product_id.track_outgoing and move.location_dest_id.usage == 'customer') \ | def _check_tracking(self, cr, uid, ids): """ Checks if production lot is assigned to stock move or not. @return: True or False """ for move in self.browse(cr, uid, ids): if move.picking_id and move.picking_id.type=="internal": return True if not move.prodlot_id and \ (move.state == 'done' and \ ( \ (move.product_id.track_production and move.location_id.usage=='production') or \ (move.product_id.track_production and move.location_dest_id.usage=='production') or \ (move.product_id.track_incoming and move.location_id.usage in ('supplier','internal')) or \ (move.product_id.track_outgoing and move.location_dest_id.usage in ('customer','internal')) \ )): return False return True | 3a8208a76d3812ec0e7d01db1efd2bbaac01f666 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a8208a76d3812ec0e7d01db1efd2bbaac01f666/stock.py |
except Exception: logging.getLogger('report').exception() | except Exception, e: logging.getLogger('report').exception(e) | def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception: logging.getLogger('report').exception() yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception: logging.getLogger('report').exception() pass if (tagname is None) or (n.tag==tagname): yield n | 063875402e2bf43ec79f5860513c2958f13d1c3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/063875402e2bf43ec79f5860513c2958f13d1c3a/utils.py |
except Exception: logging.getLogger('report').exception() | except Exception, e: logging.getLogger('report').exception(e) | def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception: logging.getLogger('report').exception() yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception: logging.getLogger('report').exception() pass if (tagname is None) or (n.tag==tagname): yield n | 063875402e2bf43ec79f5860513c2958f13d1c3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/063875402e2bf43ec79f5860513c2958f13d1c3a/utils.py |
except Exception: logging.getLogger('report').exception() | except Exception, e: logging.getLogger('report').exception(e) | def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception: logging.getLogger('report').exception() yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception: logging.getLogger('report').exception() pass if (tagname is None) or (n.tag==tagname): yield n | 063875402e2bf43ec79f5860513c2958f13d1c3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/063875402e2bf43ec79f5860513c2958f13d1c3a/utils.py |
except Exception: logging.getLogger('report').exception() | except Exception, e: logging.getLogger('report').exception(e) | def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception: logging.getLogger('report').exception() yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception: logging.getLogger('report').exception() continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception: logging.getLogger('report').exception() pass if (tagname is None) or (n.tag==tagname): yield n | 063875402e2bf43ec79f5860513c2958f13d1c3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/063875402e2bf43ec79f5860513c2958f13d1c3a/utils.py |
'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), | 'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), | def _col_get(self, cr, user, context={}): result = [] cols = self.pool.get('account.move.line')._columns for col in cols: if col in ('period_id', 'journal_id'): continue | d0e2178de09bc5dedb8debc80944ff21c49be0d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0e2178de09bc5dedb8debc80944ff21c49be0d5/account.py |
def _lang_data_get(self, cr, uid, lang_id): | def _lang_data_get(self, cr, uid, lang_id, monetary=False): | def _lang_data_get(self, cr, uid, lang_id): conv = localeconv() lang_obj=self.browse(cr,uid,lang_id) thousands_sep = lang_obj.thousands_sep or conv[monetary and 'mon_thousands_sep' or 'thousands_sep'] decimal_point = lang_obj.decimal_point grouping = lang_obj.grouping return (grouping, thousands_sep, decimal_point) | 5e969614cac600338e9f0bef6a52ebed5ee719d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e969614cac600338e9f0bef6a52ebed5ee719d3/res_lang.py |
lang_grouping, thousands_sep, decimal_point = self._lang_data_get(cr, uid, ids[0]) | lang_grouping, thousands_sep, decimal_point = self._lang_data_get(cr, uid, ids[0], monetary) | def format(self, cr, uid, ids, percent, value, grouping=False, monetary=False): """ Format() will return the language-specific output for float values""" | 5e969614cac600338e9f0bef6a52ebed5ee719d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e969614cac600338e9f0bef6a52ebed5ee719d3/res_lang.py |
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, help="Link to the automatically generated Journal Items."), | 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', help="Link to the automatically generated Journal Items."), | def _get_invoice_from_reconcile(self, cr, uid, ids, context=None): move = {} for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context): for line in r.line_partial_ids: move[line.move_id.id] = True for line in r.line_id: move[line.move_id.id] = True | 2d16e982e9e45785355dbd35c7741b0d94b3b95d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2d16e982e9e45785355dbd35c7741b0d94b3b95d/invoice.py |
res = super(event_make_invoice, self).default_get(cr, uid, fields_list, context) return res | return super(event_make_invoice, self).default_get(cr, uid, fields_list, context) | def default_get(self, cr, uid, fields_list, context=None): res = super(event_make_invoice, self).default_get(cr, uid, fields_list, context) return res | 697153f8bd23680bcb9f68e6c366e77e85834f40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/697153f8bd23680bcb9f68e6c366e77e85834f40/event_make_invoice.py |
def make_invoice(self, cr, uid, ids, context={}): | def make_invoice(self, cr, uid, ids, context=None): | def make_invoice(self, cr, uid, ids, context={}): | 697153f8bd23680bcb9f68e6c366e77e85834f40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/697153f8bd23680bcb9f68e6c366e77e85834f40/event_make_invoice.py |
mod_obj =self.pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter') id = mod_obj.read(cr, uid, result, ['res_id']) | form_id = mod_obj._get_id(cr, uid, 'account', 'invoice_form') form_res = mod_obj.browse(cr, uid, form_id, context=context).res_id tree_id = mod_obj._get_id(cr, uid, 'account', 'invoice_tree') tree_res = mod_obj.browse(cr, uid, tree_id, context=context).res_id | def make_invoice(self, cr, uid, ids, context={}): | 697153f8bd23680bcb9f68e6c366e77e85834f40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/697153f8bd23680bcb9f68e6c366e77e85834f40/event_make_invoice.py |
'search_view_id': id['id'] | def make_invoice(self, cr, uid, ids, context={}): | 697153f8bd23680bcb9f68e6c366e77e85834f40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/697153f8bd23680bcb9f68e6c366e77e85834f40/event_make_invoice.py |
|
def make_invoice(self, cr, uid, ids, context={}): | 697153f8bd23680bcb9f68e6c366e77e85834f40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/697153f8bd23680bcb9f68e6c366e77e85834f40/event_make_invoice.py |
||
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), | 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), | def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}): result = {} for record in self.browse(cr, uid, ids, context): if record.child_parent_ids: result[record.id] = [x.id for x in record.child_parent_ids] else: result[record.id] = [] | f3b050a4a7b03d5b210f1902787a0d6dc6a85fd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f3b050a4a7b03d5b210f1902787a0d6dc6a85fd3/account.py |
d = getattr(obj._columns[f], 'digits', lambda x: ((16,DEFAULT_DIGITS)))(self.cr)[1] | res_digits = getattr(obj._columns[f], 'digits', lambda x: ((16,DEFAULT_DIGITS))) if isinstance(res_digits, tuple): d = res_digits[1] else: d = res_digits(self.cr)[1] | def get_digits(self, obj=None, f=None, dp=None): d = DEFAULT_DIGITS = 2 if dp: decimal_precision_obj = self.pool.get('decimal.precision') ids = decimal_precision_obj.search(self.cr, self.uid, [('name', '=', dp)]) if ids: d = decimal_precision_obj.browse(self.cr, self.uid, ids)[0].digits elif obj and f: d = getattr(obj._columns[f], 'digits', lambda x: ((16,DEFAULT_DIGITS)))(self.cr)[1] elif (hasattr(obj, '_field') and\ isinstance(obj._field, (float_class, function_class)) and\ obj._field.digits): d = obj._field.digits[1] or DEFAULT_DIGITS return d | 5fce56cab36c661c2ed579cc56af64f74746eb83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fce56cab36c661c2ed579cc56af64f74746eb83/report_sxw.py |
if self._debug: self._doclog.debug("Trying to read \"%s\".."% fpath) | def get_file(self, cr, uid, id, file_node, mode, context=None): if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise RuntimeError('media offline') ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context) if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) raise IOError(errno.ENOENT, 'No file can be located') fpath = os.path.join(boo.path, ira.store_fname) if self._debug: self._doclog.debug("Trying to read \"%s\".."% fpath) return nodefd_file(file_node, path=fpath, mode=mode) | 1927431e0bf256503fbdcf282008a7b45f449559 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1927431e0bf256503fbdcf282008a7b45f449559/document_storage.py |
|
if self._debug: self._doclog.debug("Trying to obtain db_datas for ir.attachment[%d]", ira.id) | def get_file(self, cr, uid, id, file_node, mode, context=None): if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise RuntimeError('media offline') ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context) if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) raise IOError(errno.ENOENT, 'No file can be located') fpath = os.path.join(boo.path, ira.store_fname) if self._debug: self._doclog.debug("Trying to read \"%s\".."% fpath) return nodefd_file(file_node, path=fpath, mode=mode) | 1927431e0bf256503fbdcf282008a7b45f449559 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1927431e0bf256503fbdcf282008a7b45f449559/document_storage.py |
|
keys = ['language', 'translate_out', 'translate_in', 'debug_mode', 'smtp_ssl' | keys = ['language', 'translate_out', 'translate_in', 'debug_mode', 'smtp_ssl', | def die(cond, msg): if cond: print msg sys.exit(1) | cce93ad1ca89bd837042544ae5c932663a243598 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cce93ad1ca89bd837042544ae5c932663a243598/config.py |
data['badge_title'] = contact_id.title | data['badge_title'] = contact_id.title.name | def onchange_contact_id(self, cr, uid, ids, contact, partner): data ={} if not contact: return data | 2128bb753a14157a7afaa7976e7e28ed3268f9d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2128bb753a14157a7afaa7976e7e28ed3268f9d5/event.py |
if data_event.user_id.id: return {'value': {'user_id':data_event.user_id.id}} | def onchange_event(self, cr, uid, ids, event_id, partner_invoice_id): context={} if not event_id: return {'value': {'unit_price': False, 'event_product': False}} data_event = self.pool.get('event.event').browse(cr, uid, event_id) context['currency_id'] = data_event.currency_id.id if data_event.product_id: if not partner_invoice_id: unit_price=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id] return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}} data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id) context.update({'partner_id': data_partner}) unit_price = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id] return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}} return {'value': {'unit_price': False, 'event_product': False}} | 2128bb753a14157a7afaa7976e7e28ed3268f9d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2128bb753a14157a7afaa7976e7e28ed3268f9d5/event.py |
|
tracking = context.get('tracking', False) last_track = [line.tracking_id.id for line in self.browse(cr, uid, ids)[0].picking_id.move_lines if line.tracking_id] if not last_track: last_track = tracking_obj.create(cr, uid, {}, context=context) else: last_track.sort() last_track = last_track[-1] self.write(cr, uid, ids, {'tracking_id': last_track}) | for line in self.browse(cr, uid, ids, context=context): last_track = None if line.picking_id: tracking_ids = [l.tracking_id.id for l in line.picking_id.move_lines if l.tracking_id] if tracking_ids: last_track = max(tracking_ids) if not last_track: last_track = tracking_obj.create(cr, uid, {}, context=context) self.write(cr, uid, line.id, {'tracking_id': last_track}, context=context) | def setlast_tracking(self, cr, uid, ids, context=None): tracking_obj = self.pool.get('stock.tracking') tracking = context.get('tracking', False) last_track = [line.tracking_id.id for line in self.browse(cr, uid, ids)[0].picking_id.move_lines if line.tracking_id] if not last_track: last_track = tracking_obj.create(cr, uid, {}, context=context) else: last_track.sort() last_track = last_track[-1] self.write(cr, uid, ids, {'tracking_id': last_track}) return True | c49acd82987c65e7abe032842c7119b7db5e0d77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c49acd82987c65e7abe032842c7119b7db5e0d77/stock.py |
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False | 4da1c7e3209b7d7084e5eab3697168c54f8aafdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4da1c7e3209b7d7084e5eab3697168c54f8aafdb/account_voucher.py |
||
self.__logger.exception("bad query: %s", self._obj.query) | self.__logger.exception("bad query: %s", self._obj.query or query) | def execute(self, query, params=None): if '%d' in query or '%f' in query: self.__logger.warn(query) self.__logger.warn("SQL queries cannot contain %d or %f anymore. " "Use only %s") if params: query = query.replace('%d', '%s').replace('%f', '%s') | ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2/sql_db.py |
self._debug('Free leaked connection to %r', cnx.dsn) | self.__logger.warn('%r: Free leaked connection to %r', self, cnx.dsn) | def borrow(self, dsn): self._debug('Borrow connection to %r', dsn) | ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2/sql_db.py |
self._debug('Close all connections to %r', dsn) | self.__logger.info('%r: Close all connections to %r', self, dsn) | def close_all(self, dsn): self._debug('Close all connections to %r', dsn) for i, (cnx, used) in tools.reverse_enumerate(self._connections): if dsn_are_equals(cnx.dsn, dsn): cnx.close() self._connections.pop(i) | ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef4151fcb970178d51ac9b9e6a9e02be9f5d48c2/sql_db.py |
part_ids.append(res['id']) | if res: part_ids.append(res['id']) | def assign_partner(self, cr, uid, ids, context=None): ok = False for part in self.browse(cr, uid, ids, context=context): if not part.country_id: continue addr = ', '.join(filter(None, [part.street, (part.zip or '')+' '+(part.city or ''), part.state_id and part.state_id.name, part.country_id and part.country_id.name])) result = geo_find(addr.encode('utf8')) if result: self.write(cr, uid, [part.id], { 'partner_latitude': result[0], 'partner_longitude': result[1] }, context=context) | 0aa7ad9d0b1023af9a0145551be2c85233a148a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0aa7ad9d0b1023af9a0145551be2c85233a148a8/partner_geo_assign.py |
WHERE journal_id = %s \ ORDER BY date DESC,id DESC LIMIT 1', (journal_id,)) | WHERE journal_id = %s AND NOT state = %s \ ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft')) | def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): if not journal_id: return {'value': {'currency': False}} | 17d6bbf3c9a2520fe058676d82f64dc13d015c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17d6bbf3c9a2520fe058676d82f64dc13d015c58/account_bank_statement.py |
if uid == 1 or count: | if uid == 1: | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | f886032d5bcc61c125d601644139a6f60078ffa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f886032d5bcc61c125d601644139a6f60078ffa5/ir_ui_menu.py |
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): | f886032d5bcc61c125d601644139a6f60078ffa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f886032d5bcc61c125d601644139a6f60078ffa5/ir_ui_menu.py |
||
original = [header, sender, to, sentdate, desc] | if case.user_id.signature: signature = '--\n' + case.user_id.signature original = [header, sender, to, sentdate, desc, signature] | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] | 41ef3a09e8e9fb1b18449678c601928d086ff851 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41ef3a09e8e9fb1b18449678c601928d086ff851/crm_send_email.py |
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s view = self.fields_view_get(cr, uid, False, 'form', context=context) root = etree.fromstring(encode(view['arch'])) res = etree.XML("""<search string="%s"></search>""" % root.get("string", "")) node = etree.Element("group") res.append(node) fields = root.xpath("//field[@select=1]") | form_view = self.fields_view_get(cr, uid, False, 'form', context=context) tree_view = self.fields_view_get(cr, uid, False, 'tree', context=context) fields_to_search = set() fields = self.fields_get(cr, uid, context=context) | def __get_default_search_view(self, cr, uid, context=None): | 4226a3adb2b2399221dd425cec1a3bc929d37605 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4226a3adb2b2399221dd425cec1a3bc929d37605/orm.py |
node.append(field) return etree.tostring(res, encoding="utf-8").replace('\t', '') | if fields[field].get('select'): fields_to_search.add(field) for view in (form_view, tree_view): view_root = etree.fromstring(view['arch']) fields_to_search = fields_to_search.union(view_root.xpath("//field[@select=1]/@name")) tree_view_root = view_root search_view = etree.Element("search", attrib={'string': tree_view_root.get("string", "")}) field_group = etree.Element("group") search_view.append(field_group) for field_name in fields_to_search: field_group.append(etree.Element("field", attrib={'name': field_name})) return etree.tostring(search_view, encoding="utf-8").replace('\t', '') | def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s | 4226a3adb2b2399221dd425cec1a3bc929d37605 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4226a3adb2b2399221dd425cec1a3bc929d37605/orm.py |
cr, uid, ids, tax, vals={'account_paid_id': account}) | cr, uid, id, tax, vals={'account_paid_id': account}) | def on_change_paid(self, cr, uid, id, tax, account): return self._on_change( cr, uid, ids, tax, vals={'account_paid_id': account}) | 33152c6e692e0a9d0ce1b5f917cabad74167064d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33152c6e692e0a9d0ce1b5f917cabad74167064d/config.py |
cr, uid, context=context) % user)) | cr, uid, context=context) % user) | def send_welcome_email(self, cr, uid, id, context=None): logger= netsvc.Logger() user = self.pool.get('res.users').read(cr, uid, id, context=context) if not tools.config.get('smtp_server'): logger.notifyChannel('mails', netsvc.LOG_WARNING, _('"smtp_server" needs to be set to send mails to users')) return False if not tools.config.get('email_from'): logger.notifyChannel("mails", netsvc.LOG_WARNING, _('"email_from" needs to be set to send welcome mails ' 'to users')) return False if not user.get('email'): return False | ce5acb2c5e93dec5a517c03cb735f96704598274 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ce5acb2c5e93dec5a517c03cb735f96704598274/res_user.py |
'date_expected': fields.datetime('Scheduled Date', required=True, help="Scheduled date for the processing of this move"), | 'date_expected': fields.datetime('Scheduled Date', states={'done': [('readonly', True)]},required=True, help="Scheduled date for the processing of this move"), | 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 True | cad42f4ea53e563101c1911ec056d1ac381990fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad42f4ea53e563101c1911ec056d1ac381990fb/stock.py |
tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), '/tmp/output.pdf', result) self.obj = external_pdf(file('/tmp/output.pdf').read()) | tmp_file = tempfile.mkstemp(".pdf")[1] try: tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) with open(tmp_file, "r") as ofile: self.obj = external_pdf(ofile.read()) finally: try: os.remove(tmp_file) except: pass | def create(self, cr, uid, ids, datas, context=None): | 2ec51bc9bdc5b2faf449287e292be588c2693e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2ec51bc9bdc5b2faf449287e292be588c2693e80/print_vat.py |
except Exception, e: | except Exception: | def create(self, cr, uid, ids, datas, context=None): | 2ec51bc9bdc5b2faf449287e292be588c2693e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2ec51bc9bdc5b2faf449287e292be588c2693e80/print_vat.py |
recs = obj_move_line.read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) | recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id','reconcile_partial_id']) | def trans_unrec(self, cr, uid, ids, context=None): obj_move_line = self.pool.get('account.move.line') obj_move_reconcile = self.pool.get('account.move.reconcile') if context is None: context = {} recs = obj_move_line.read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) unlink_ids = [] full_recs = filter(lambda x: x['reconcile_id'], recs) rec_ids = [rec['reconcile_id'][0] for rec in full_recs] part_recs = filter(lambda x: x['reconcile_partial_id'], recs) part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs] unlink_ids += rec_ids unlink_ids += part_rec_ids | ccf2df5a2c17b7c1ffa199f53616ab7fffa65a98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ccf2df5a2c17b7c1ffa199f53616ab7fffa65a98/account_unreconcile.py |
def _calc_amount(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = {} for order in self.browse(cr, uid, ids): res[order.id] = 0 for oline in order.order_line: res[order.id] += oline.price_unit * oline.product_qty return res | 73d818f71aa6f8f3fbebe6c96e3162cbe554820e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/73d818f71aa6f8f3fbebe6c96e3162cbe554820e/purchase.py |
||
'fiscal_position': o.partner_id.property_account_position.id, | 'fiscal_position': o.fiscal_position.id or o.partner_id.property_account_position.id, | def action_invoice_create(self, cr, uid, ids, *args): res = False | 73d818f71aa6f8f3fbebe6c96e3162cbe554820e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/73d818f71aa6f8f3fbebe6c96e3162cbe554820e/purchase.py |
return format_body(body % data) | return self.format_body(body % data) | def format_mail(self, obj, body): data = { 'object_id': obj.id, 'object_subject': hasattr(obj, 'name') and obj.name or False, 'object_date': hasattr(obj, 'date') and obj.date or False, 'object_description': hasattr(obj, 'description') and obj.description or False, 'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/', 'object_user_email': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.address_id and obj.user_id.address_id.email) or '/', 'object_user_phone': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.address_id and obj.user_id.address_id.phone) or '/', 'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/', 'partner_email': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and obj.partner_address_id.email) or '/', } return format_body(body % data) | cd17ce51cded499d816c0163d2b6bf42805e485c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd17ce51cded499d816c0163d2b6bf42805e485c/base_action_rule.py |
parent_ids = [x[0] for x in cr.fetchall()] | parent_ids = [x[0] for x in cr.fetchall() if x[0]] | def _parent_compute(self, cr, uid, ids, name, args, context=None): if context is None: context = {} result = {} obj_dept = self.pool.get('hr.department') for user_id in ids: emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', user_id)]) cr.execute('SELECT emp.department_id FROM hr_employee AS emp \ JOIN resource_resource AS res ON res.id = emp.resource_id \ JOIN hr_department as dept ON dept.id = emp.department_id \ WHERE res.user_id = %s AND emp.department_id IS NOT NULL AND dept.manager_id IS NOT NULL', (user_id,)) ids_dept = [x[0] for x in cr.fetchall()] parent_ids = [] if ids_dept: data_dept = obj_dept.read(cr, uid, ids_dept, ['manager_id'], context=context) parent_ids = map(lambda x: x['manager_id'][0], data_dept) cr.execute('SELECT res.user_id FROM hr_employee AS emp JOIN resource_resource AS res ON res.id=emp.resource_id \ WHERE emp.id IN %s', (tuple(parent_ids),)) parent_ids = [x[0] for x in cr.fetchall()] result[user_id] = parent_ids return result | 111b48b5c65fb1ebe8d7f7352051954c8081f92d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/111b48b5c65fb1ebe8d7f7352051954c8081f92d/hr_department.py |
signature = '' if case.user_id.signature: signature = '--\n' + case.user_id.signature | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] | c00448168e4375de7ebc0ec1f8f0b588dd1bea58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c00448168e4375de7ebc0ec1f8f0b588dd1bea58/crm_send_email.py |
|
original = '\n'.join(original) res['text']=original | res['text']= '\n'.join(original) | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] | c00448168e4375de7ebc0ec1f8f0b588dd1bea58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c00448168e4375de7ebc0ec1f8f0b588dd1bea58/crm_send_email.py |
obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) | if not hasattr(obj_pool, 'base_action_ruled'): obj_pool.create = self._create(obj_pool.create, model, context=context) obj_pool.write = self._write(obj_pool.write, model, context=context) obj_pool.base_action_ruled = True | def _register_hook(self, cr, uid, ids, context=None): if not context: context = {} for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.model_id.model obj_pool = self.pool.get(model) obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) return True | 2a1754ff217b001546aca30b2ad479a030f574d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a1754ff217b001546aca30b2ad479a030f574d0/base_action_rule.py |
def _register_hook(self, cr, uid, ids, context=None): if not context: context = {} for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.model_id.model obj_pool = self.pool.get(model) obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) return True | 2a1754ff217b001546aca30b2ad479a030f574d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a1754ff217b001546aca30b2ad479a030f574d0/base_action_rule.py |
||
price = price_obj.price_get(self.cr, self.uid, [lines[id].pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].pricelist_id.id] | price = price_obj.price_get(self.cr, self.uid, [lines[id].account_id.pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].account_id.pricelist_id.id] | def _lines_a(self, general_account_id, account_id, date1, date2): self.cr.execute("SELECT aal.id AS id, aal.name AS name, aal.code AS code, aal.amount AS balance, aal.date AS date, aaj.code AS cj, aal.unit_amount AS quantity \ FROM account_analytic_line AS aal, account_analytic_journal AS aaj \ WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) AND (aal.date>=%s) AND (aal.date<=%s) \ AND (aal.journal_id=aaj.id) \ ORDER BY aal.date, aaj.code, aal.code", (general_account_id, account_id, date1, date2)) res = self.cr.dictfetchall() | 05a76846f26e4915bba1ef2cd9bd51a1647e158d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05a76846f26e4915bba1ef2cd9bd51a1647e158d/cost_ledger.py |
assert(mode in ('debit', 'credit'), 'Invalid Mode') | assert mode in ('debit', 'credit'), 'Invalid Mode' | def _centralise(self, cr, uid, move, mode, context=None): assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection if context is None: context = {} | 39402113ac61b6449773007c9ffa9267132d20fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39402113ac61b6449773007c9ffa9267132d20fb/account.py |
mid = objid._get_id(cr, uid, 'caldav', 'document_directory_calendars0') | mid = objid._get_id(cr, uid, 'document', 'dir_calendars') | def _get_root_calendar_directory(self, cr, uid, context=None): objid = self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'caldav', 'document_directory_calendars0') if not mid: return False root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] root_cal_dir = self.browse(cr,uid, root_id, context=context) return root_cal_dir.name except Exception: logger = logging.getLogger('document') logger.warning('Cannot set root directory for Calendars:', exc_info=True) return False return False | cd505149076d236501533007879f8e6c7188038e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd505149076d236501533007879f8e6c7188038e/calendar_collection.py |
try: names = dict(obj.name_get(cr, user, filter(None, res.values()), context)) except except_orm: names = {} iids = filter(None, res.values()) for iiid in iids: names[iiid] = '// Access Denied //' | names = {} for record in list(set(filter(None, res.values()))): try: record_name = dict(obj.name_get(cr, user, [record], context)) except except_orm: record_name = {} record_name[record] = '// Access Denied //' names.update(record_name) | def get(self, cr, obj, ids, name, user=None, context=None, values=None): if not context: context = {} if not values: values = {} res = {} for r in values: res[r['id']] = r[name] for id in ids: res.setdefault(id, '') obj = obj.pool.get(self._obj) # build a dictionary of the form {'id_of_distant_resource': name_of_distant_resource} from orm import except_orm try: names = dict(obj.name_get(cr, user, filter(None, res.values()), context)) except except_orm: names = {} iids = filter(None, res.values()) for iiid in iids: names[iiid] = '// Access Denied //' | 5a3cca40c9c9b6ef7546092be35d81f864279177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a3cca40c9c9b6ef7546092be35d81f864279177/fields.py |
} | } val=0.0 cur_obj = self.pool.get('res.currency') cur = order.pricelist_id.currency_id | def _amount_all(self, cr, uid, ids, name, args, context=None): tax_obj = self.pool.get('account.tax') res={} for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_paid': 0.0, 'amount_return':0.0, 'amount_tax':0.0, } for payment in order.statement_ids: res[order.id]['amount_paid'] += payment.amount for payment in order.payments: res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0) for line in order.lines: if order.price_type!='tax_excluded': res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2), tax_obj.compute_inv(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) else: res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] return res | 263091c0e454f4de86de49310a8b50d565969fc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/263091c0e454f4de86de49310a8b50d565969fc7/pos.py |
res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] | for c in self.pool.get('account.tax').compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']: val += c['amount'] res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val) | def _amount_all(self, cr, uid, ids, name, args, context=None): tax_obj = self.pool.get('account.tax') res={} for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_paid': 0.0, 'amount_return':0.0, 'amount_tax':0.0, } for payment in order.statement_ids: res[order.id]['amount_paid'] += payment.amount for payment in order.payments: res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0) for line in order.lines: if order.price_type!='tax_excluded': res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2), tax_obj.compute_inv(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) else: res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] return res | 263091c0e454f4de86de49310a8b50d565969fc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/263091c0e454f4de86de49310a8b50d565969fc7/pos.py |
name, | production.name, | def action_confirm(self, cr, uid, ids): """ Confirms production order. @return: Newly generated picking Id. """ picking_id = False proc_ids = [] seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') move_obj = self.pool.get('stock.move') proc_obj = self.pool.get('procurement.order') wf_service = netsvc.LocalService("workflow") for production in self.browse(cr, uid, ids): if not production.product_lines: self.action_compute(cr, uid, [production.id]) production = self.browse(cr, uid, [production.id])[0] routing_loc = None pick_type = 'internal' address_id = False if production.bom_id.routing_id and production.bom_id.routing_id.location_id: routing_loc = production.bom_id.routing_id.location_id if routing_loc.usage <> 'internal': pick_type = 'out' address_id = routing_loc.address_id and routing_loc.address_id.id or False routing_loc = routing_loc.id pick_name = seq_obj.get(cr, uid, 'stock.picking.' + pick_type) picking_id = pick_obj.create(cr, uid, { 'name': pick_name, 'origin': (production.origin or '').split(':')[0] + ':' + production.name, 'type': pick_type, 'move_type': 'one', 'state': 'auto', 'address_id': address_id, 'auto_picking': self._get_auto_picking(cr, uid, production), 'company_id': production.company_id.id, }) | e9db4d2e591c899628415b97c52b3460a4b9d4e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e9db4d2e591c899628415b97c52b3460a4b9d4e7/mrp.py |
('picking', 'Invoice from Picking'), | ('picking', 'Invoice from Delivery'), | 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() | b9dd925c8f83d7bee5db5a9dcab5414174601872 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b9dd925c8f83d7bee5db5a9dcab5414174601872/sale.py |
res[event.id]['register_current'] = len(reg_ids) | res[event.id]['register_current'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context=context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | dca7bdf46921f80c8f5a44c3042447d4b495ddec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dca7bdf46921f80c8f5a44c3042447d4b495ddec/event.py |
res[event.id]['register_prospect'] = len(reg_ids) | res[event.id]['register_prospect'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context=context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | dca7bdf46921f80c8f5a44c3042447d4b495ddec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dca7bdf46921f80c8f5a44c3042447d4b495ddec/event.py |
for name,node in g.result.items(): | result = g.result_get() node_res = {} for node in nodes: node_res[node] = result[node] for name,node in node_res.items(): | def result_get(self): return self.result | 64fb43920c0a78d65263aa37b7d6c2d5460cc5fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64fb43920c0a78d65263aa37b7d6c2d5460cc5fe/graph.py |
for nodefrom in g.transitions: for nodeto in g.transitions[nodefrom]: draw.line( (int(g.result[nodefrom]['y']), int(g.result[nodefrom]['x']),int(g.result[nodeto]['y']),int(g.result[nodeto]['x'])),(128,128,128) ) | for t in transitions: draw.line( (int(node_res[t[0]]['y']), int(node_res[t[0]]['x']),int(node_res[t[1]]['y']),int(node_res[t[1]]['x'])),(128,128,128) ) | def result_get(self): return self.result | 64fb43920c0a78d65263aa37b7d6c2d5460cc5fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64fb43920c0a78d65263aa37b7d6c2d5460cc5fe/graph.py |
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.") | message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.") | def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): seq_obj_name = 'stock.picking.' + vals['type'] vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) type_list = { 'out':_('Packing List'), 'in':_('Reception'), 'internal': _('Internal picking'), 'delivery': _('Delivery order') } new_id = super(stock_picking, self).create(cr, user, vals, context) if not vals.get('auto_picking', False): message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.") self.log(cr, user, new_id, message) return new_id | d07e43933180eddde1232c133425bb7c49a094de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d07e43933180eddde1232c133425bb7c49a094de/stock.py |
for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to']): | for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to', 'type']): | def _check_date(self, cr, uid, ids): for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to']): if rec['number_of_days_temp'] < 0: return False date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S') date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S') if date_from > date_to: return False return True | 174162b34489cb256d1564b615be6dd14c427d81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/174162b34489cb256d1564b615be6dd14c427d81/hr_holidays.py |
files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()] | files = [opj(a,'/'.join(f.split('/')[1:])) for f in zip.namelist()] if res in files: return res | def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) if zipfile.is_zipfile( a +'.zip') : zip = zipfile.ZipFile( a + ".zip") files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()] else: files = tools.osutil.listdir(a, True) for ar in args: if ar not in files: return False res = a and opj(a, *args) or False return res | 3d6b88c87e888fd1219c75a0ead7397f1bf7bcd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3d6b88c87e888fd1219c75a0ead7397f1bf7bcd0/__init__.py |
files = tools.osutil.listdir(a, True) for ar in args: if ar not in files: return False res = a and opj(a, *args) or False return res | if os.path.isfile(res): return res return False | def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) if zipfile.is_zipfile( a +'.zip') : zip = zipfile.ZipFile( a + ".zip") files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()] else: files = tools.osutil.listdir(a, True) for ar in args: if ar not in files: return False res = a and opj(a, *args) or False return res | 3d6b88c87e888fd1219c75a0ead7397f1bf7bcd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3d6b88c87e888fd1219c75a0ead7397f1bf7bcd0/__init__.py |
'progress': fields.related('task_id', 'progress', string='Progress (%)',group_operator="avg", store=True), | 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', group_operator="avg", help="Computed as: Time Spent / Total Time.", store = { 'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['task_id'], 10), 'project.task': (_get_issue_task, ['progress'], 10), 'project.task.work': (_get_issue_work, ['hours'], 10), }), | def _compute_day(self, cr, uid, ids, fields, args, context=None): if context is None: context = {} """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual values """ cal_obj = self.pool.get('resource.calendar') res_obj = self.pool.get('resource.resource') | aac1861009d4fcf3c867b1807949dd79ae784f93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aac1861009d4fcf3c867b1807949dd79ae784f93/project_issue.py |
request_pool = self.pool.get('res.request') | request = self.pool.get('res.request') | def do_close(self, cr, uid, ids, context=None): """ Close Task """ if context is None: context = {} request_pool = self.pool.get('res.request') for task in self.browse(cr, uid, ids, context=context): project = task.project_id if project: # Send request to project manager if project.warn_manager and project.user_id and (project.user_id.id != uid): request.create(cr, uid, { 'name': _("Task '%s' closed") % task.name, 'state': 'waiting', 'act_from': uid, 'act_to': project.user_id.id, 'ref_partner_id': task.partner_id.id, 'ref_doc1': 'project.task,%d'% (task.id,), 'ref_doc2': 'project.project,%d'% (project.id,), }) for parent_id in task.parent_ids: if parent_id.state in ('pending','draft'): reopen = True for child in parent_id.child_ids: if child.id != task.id and child.state not in ('done','cancelled'): reopen = False if reopen: self.do_reopen(cr, uid, [parent_id.id]) self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0}) message = _('Task ') + " '" + task.name + "' "+ _("is Done.") self.log(cr, uid, task.id, message) return True | 710cfd96b03f796692fbecff956125f13ab767a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/710cfd96b03f796692fbecff956125f13ab767a8/project.py |
'date_deadline': fields.datetime('Deadline', help="Deadline Date is automatically computed from Start Date + Duration"), | def _set_attendee_data(self, cr, uid, id, name, value, arg, context): if not value: return eventdata = self.browse(cr, uid, id, context=context) att_len = len(eventdata.attendee_ids) if att_len == len(value.split(',')): return if att_len > len(value.split(',')): for attendee in eventdata.attendee_ids[len(value.split(',')):]: self.write(cr, uid, id, {'attendee_ids': [(3, attendee.id)]}) return attendee_obj = self.pool.get('calendar.attendee') for val in value.split(',')[att_len:]: attendee_id = attendee_obj.create(cr, uid, {'cn': val.strip()}) self.write(cr, uid, id, {'attendee_ids': [(4, attendee_id)]}) return | da65f9b1a1b7693bc6a3291d08204ae2f3763ab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da65f9b1a1b7693bc6a3291d08204ae2f3763ab5/crm_meeting.py |
|
self.do_alarm_create(cr, uid, ids) | self.do_alarm_create(cr, uid, new_ids) | def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids new_ids = [] for id in select: id = common.caldav_id2real_id(id) if not id in new_ids: new_ids.append(id) if 'case_id' in vals: vals['case_id'] = common.caldav_id2real_id(vals['case_id']) res = super(crm_meeting, self).write(cr, uid, new_ids, vals, context=context) self.do_alarm_create(cr, uid, ids) return res | da65f9b1a1b7693bc6a3291d08204ae2f3763ab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da65f9b1a1b7693bc6a3291d08204ae2f3763ab5/crm_meeting.py |
date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): | date_invoice=False, payment_term=False, partner_bank=False, company_id=False): | def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): """ Function that is call when the partner of the invoice is changed it will retriev and set the good bank partner bank""" res = super(account_invoice, self).onchange_partner_id( cr, uid, ids, type, partner_id, date_invoice, payment_term ) bank_id = False if partner_id: p = self.pool.get('res.partner').browse(cr, uid, partner_id) if p.bank_ids: bank_id = p.bank_ids[0].id | f056f20e61c188cf4fad565ff01eab22d9aadf81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f056f20e61c188cf4fad565ff01eab22d9aadf81/invoice.py |
if partner_bank_id != bank_id: | if partner_bank != bank_id: | def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): """ Function that is call when the partner of the invoice is changed it will retriev and set the good bank partner bank""" res = super(account_invoice, self).onchange_partner_id( cr, uid, ids, type, partner_id, date_invoice, payment_term ) bank_id = False if partner_id: p = self.pool.get('res.partner').browse(cr, uid, partner_id) if p.bank_ids: bank_id = p.bank_ids[0].id | f056f20e61c188cf4fad565ff01eab22d9aadf81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f056f20e61c188cf4fad565ff01eab22d9aadf81/invoice.py |
sub = 'NO SBUJECT' | sub = 'NO SBUJECT' | def history_message(self, cr, uid, vals): dictcreate = dict(vals) ref_ids = str(dictcreate.get('ref_ids')).split(';') msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) server_tools_pool = self.pool.get('email.server.tools') message_id = msg.get('message-id', False) msg_pool = self.pool.get('mailgate.message') msg_ids = [] res = {} res_ids = [] obj_list= ['crm.lead','project.issue','hr.applicant','res.partner'] for ref_id in ref_ids: msg_new = dictcreate.get('message') ref = ref_id.split(',') model = ref[0] res_id = int(ref[1]) if message_id: msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) if msg_ids and len(msg_ids): continue if model not in obj_list: res={} obj_attch = self.pool.get('ir.attachment') ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n',':','~'] sub = msg.get('subject','NO-SUBJECT').replace(' ','') if sub.strip() == '': sub = 'NO SBUJECT' fn = sub for c in ls: fn = fn.replace(c,'') if len(fn) > 64: l = 64 - len(fn) f = fn.split('-') fn = '-'.join(f[1:]) if len(fn) > 64: l = 64 - len(fn) f = fn.split('.') fn = f[0][0:l] + '.' + f[-1] fn = fn[:-4]+'.txt' res['res_model'] = model res['name'] = msg.get('subject','NO-SUBJECT') res['datas_fname'] = fn res['datas'] = base64.b64encode(msg.get('body')) res['res_id'] = res_id obj_attch.create(cr, uid, res) server_tools_pool.history_message(cr, uid, model, res_id, msg_new) res_ids.append(res_id) return len(res_ids) | 0d01943d34a568506d00adfad97ab5c29c5af67f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d01943d34a568506d00adfad97ab5c29c5af67f/partner.py |
fn = fn.replace(c,'') | fn = fn.replace(c,'') | def history_message(self, cr, uid, vals): dictcreate = dict(vals) ref_ids = str(dictcreate.get('ref_ids')).split(';') msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) server_tools_pool = self.pool.get('email.server.tools') message_id = msg.get('message-id', False) msg_pool = self.pool.get('mailgate.message') msg_ids = [] res = {} res_ids = [] obj_list= ['crm.lead','project.issue','hr.applicant','res.partner'] for ref_id in ref_ids: msg_new = dictcreate.get('message') ref = ref_id.split(',') model = ref[0] res_id = int(ref[1]) if message_id: msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) if msg_ids and len(msg_ids): continue if model not in obj_list: res={} obj_attch = self.pool.get('ir.attachment') ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n',':','~'] sub = msg.get('subject','NO-SUBJECT').replace(' ','') if sub.strip() == '': sub = 'NO SBUJECT' fn = sub for c in ls: fn = fn.replace(c,'') if len(fn) > 64: l = 64 - len(fn) f = fn.split('-') fn = '-'.join(f[1:]) if len(fn) > 64: l = 64 - len(fn) f = fn.split('.') fn = f[0][0:l] + '.' + f[-1] fn = fn[:-4]+'.txt' res['res_model'] = model res['name'] = msg.get('subject','NO-SUBJECT') res['datas_fname'] = fn res['datas'] = base64.b64encode(msg.get('body')) res['res_id'] = res_id obj_attch.create(cr, uid, res) server_tools_pool.history_message(cr, uid, model, res_id, msg_new) res_ids.append(res_id) return len(res_ids) | 0d01943d34a568506d00adfad97ab5c29c5af67f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d01943d34a568506d00adfad97ab5c29c5af67f/partner.py |
l = 64 - len(fn) f = fn.split('-') fn = '-'.join(f[1:]) if len(fn) > 64: l = 64 - len(fn) f = fn.split('.') fn = f[0][0:l] + '.' + f[-1] | l = 64 - len(fn) f = fn.split('-') fn = '-'.join(f[1:]) if len(fn) > 64: l = 64 - len(fn) f = fn.split('.') fn = f[0][0:l] + '.' + f[-1] | def history_message(self, cr, uid, vals): dictcreate = dict(vals) ref_ids = str(dictcreate.get('ref_ids')).split(';') msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) server_tools_pool = self.pool.get('email.server.tools') message_id = msg.get('message-id', False) msg_pool = self.pool.get('mailgate.message') msg_ids = [] res = {} res_ids = [] obj_list= ['crm.lead','project.issue','hr.applicant','res.partner'] for ref_id in ref_ids: msg_new = dictcreate.get('message') ref = ref_id.split(',') model = ref[0] res_id = int(ref[1]) if message_id: msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) if msg_ids and len(msg_ids): continue if model not in obj_list: res={} obj_attch = self.pool.get('ir.attachment') ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n',':','~'] sub = msg.get('subject','NO-SUBJECT').replace(' ','') if sub.strip() == '': sub = 'NO SBUJECT' fn = sub for c in ls: fn = fn.replace(c,'') if len(fn) > 64: l = 64 - len(fn) f = fn.split('-') fn = '-'.join(f[1:]) if len(fn) > 64: l = 64 - len(fn) f = fn.split('.') fn = f[0][0:l] + '.' + f[-1] fn = fn[:-4]+'.txt' res['res_model'] = model res['name'] = msg.get('subject','NO-SUBJECT') res['datas_fname'] = fn res['datas'] = base64.b64encode(msg.get('body')) res['res_id'] = res_id obj_attch.create(cr, uid, res) server_tools_pool.history_message(cr, uid, model, res_id, msg_new) res_ids.append(res_id) return len(res_ids) | 0d01943d34a568506d00adfad97ab5c29c5af67f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d01943d34a568506d00adfad97ab5c29c5af67f/partner.py |
base = cur_obj.compute(cr, uid, currency_id, company_currency, base, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | base = cur_obj.compute(cr, uid, currency_id, company_currency, base*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: base = cur_obj.compute(cr, uid, currency_id, company_currency, base, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) return {'value': {'base_amount':base}} | f76c611d865dccbabe5295564296e8672a5cace7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f76c611d865dccbabe5295564296e8672a5cace7/invoice.py |
tax_sign = 1 | factor = 1 | def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False tax_sign = 1 if ids: tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0: tax_sign = -1 elif tax_amount == 0: tax_sign = 0 if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*tax_sign, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) return {'value': {'tax_amount': amount}} | f76c611d865dccbabe5295564296e8672a5cace7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f76c611d865dccbabe5295564296e8672a5cace7/invoice.py |
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0: tax_sign = -1 elif tax_amount == 0: tax_sign = 0 | factor = self.read(cr, uid, ids[0], ['factor_tax'])['factor_tax'] | def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False tax_sign = 1 if ids: tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0: tax_sign = -1 elif tax_amount == 0: tax_sign = 0 if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*tax_sign, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) return {'value': {'tax_amount': amount}} | f76c611d865dccbabe5295564296e8672a5cace7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f76c611d865dccbabe5295564296e8672a5cace7/invoice.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.