rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
master_line = move_line_pool.create(cr, uid, move_line) | if (debit == 0.0 or credit == 0.0 or debit+credit > 0) and (debit > 0.0 or credit > 0.0): master_line = move_line_pool.create(cr, uid, move_line) | 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 | 3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py |
if inv.tax_id: | if inv.tax_id and inv.type in ('sale', 'purchase'): | 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 | 3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.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 | 3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py | ||
if inv.journal_id.type in ('sale','sale_refund', 'cash','bank'): | if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'): | 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 | 3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py |
move_pool.post(cr, uid, [move_id], context={}) | 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 | 3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py | |
value = {} | value = dict.fromkeys(fields_list) | def default_get(self, cr, uid, fields_list, context=None): self.view_init(cr, uid, fields_list, context) if not context: context = {} value = {} # get the default values for the inherited fields for f in fields_list: if f in self._defaults: if callable(self._defaults[f]): value[f] = self._defaults[f](self, cr, uid, con... | c4da7a2c7c276cf373d20493cc6f7079d14252e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4da7a2c7c276cf373d20493cc6f7079d14252e1/orm.py |
if r['res_model'] not in res_dict: res_dict[r['res_model']] = True | t = (r['res_model'], r['res_id']) if t not in res_dict: res_dict[t] = True | def get(self, cr, uid, context=None): unread_log_ids = self.search(cr, uid, [('user_id','=',uid), ('read', '=', False)], context=context) res = self.read(cr, uid, unread_log_ids, ['name','res_model','res_id'], context=context) res.reverse() result = [] res_dict = {} for r in res: if r['res_model'] not in res_dict: res_... | 34976a6fcb023cfe2cb0e6f93b800edad0cc555b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34976a6fcb023cfe2cb0e6f93b800edad0cc555b/res_log.py |
def convert_to_period(self, cr, uid, context={}): period_obj = self.pool.get('account.period') #check if the period_id changed in the context from client side if context.get('period_id', False): period_id = context.get('period_id') if type(period_id) == str: ids = period_obj.search(cr, uid, [('name','ilike',period_id)... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def convert_to_period(self, cr, uid, context={}): period_obj = self.pool.get('account.period') #check if the period_id changed in the context from client side if context.get('period_id', False): period_id = context.get('period_id') if type(period_id) == str: ids = period_obj.search(cr, uid, [('name','ilike',period_id)... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def _invoice(self, cursor, user, ids, name, arg, context=None): invoice_obj = self.pool.get('account.invoice') res = {} for line_id in ids: res[line_id] = False cursor.execute('SELECT l.id, i.id ' \ 'FROM account_move_line l, account_invoice i ' \ 'WHERE l.move_id = i.move_id ' \ 'AND l.id IN %s', (tuple(ids),)) invoic... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False): val = {} val['date_maturity'] = False | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False): val = {} val['date_maturity'] = False | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False): val = {} val['date_maturity'] = False | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
result['toolbar']['action'] = [] | if result.get('toolbar', False): result['toolbar']['action'] = [] | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py |
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if view_type != 'tree': #Remove the toolbar... | 7b409568c140153319fd7867d4d38891793958c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b409568c140153319fd7867d4d38891793958c8/account_move_line.py | ||
if not os.path.exists(os.path.dirname(self.rcfile)): | rc_exists = os.path.exists(self.rcfile) if not rc_exists and not os.path.exists(os.path.dirname(self.rcfile)): | def save(self): p = ConfigParser.ConfigParser() loglevelnames = dict(zip(self._LOGLEVELS.values(), self._LOGLEVELS.keys())) p.add_section('options') for opt in self.options.keys(): if opt in ('version', 'language', 'translate_out', 'translate_in', 'init', 'update'): continue if opt in ('log_level', 'assert_exit_level')... | af817028c693ce1e500f9d3939c8bd7f688a3a68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af817028c693ce1e500f9d3939c8bd7f688a3a68/config.py |
os.chmod(self.rcfile, 0600) | if not rc_exists: os.chmod(self.rcfile, 0600) | def save(self): p = ConfigParser.ConfigParser() loglevelnames = dict(zip(self._LOGLEVELS.values(), self._LOGLEVELS.keys())) p.add_section('options') for opt in self.options.keys(): if opt in ('version', 'language', 'translate_out', 'translate_in', 'init', 'update'): continue if opt in ('log_level', 'assert_exit_level')... | af817028c693ce1e500f9d3939c8bd7f688a3a68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af817028c693ce1e500f9d3939c8bd7f688a3a68/config.py |
import random | def generate_phases(self, cr, uid, ids, *args): import random phase_obj = self.pool.get('document.change.process.phase') phase_type_obj = self.pool.get('document.change.process.phase.type') document_type_obj = self.pool.get('document.change.type') directory_obj = self.pool.get('document.directory') document_obj = self.... | adc7ead3129a777d96ed0e7e201e3519e14927d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/adc7ead3129a777d96ed0e7e201e3519e14927d3/document_change.py | |
Raises `LookupError`: if we couldn't find *any* previous todo `ValueError`: if no state is provided anything ir_actions_todo.write can throw | def _set_previous_todo(self, cr, uid, state, context=None): """ lookup the previous (which is still the next at this point) ir.actions.todo, set it to whatever state was provided. | 31346d6259e4e605f7abaa2b438a2c1fabbcc982 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/31346d6259e4e605f7abaa2b438a2c1fabbcc982/res_config.py | |
case_pool=pool.get('crm.case') | case_pool=pool.get(data['model']) | def _mass_mail_send(self, cr, uid, data, context): attach = filter(lambda x: x, [data['form']['doc1'], data['form']['doc2'], data['form']['doc3']]) attach = map(lambda x: x and ('Attachment'+str(attach.index(x)+1), base64.decodestring(x)), attach) pool = pooler.get_pool(cr.dbname) case_pool=pool.get('crm.case') cas... | 6ed7e4ca628406c9b1d6ea4d501012c632de12a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ed7e4ca628406c9b1d6ea4d501012c632de12a8/wizard_crm_new_send_email.py |
case = pool.get('crm.lead').browse(cr, uid, data['id']) | case = pool.get(data['model']).browse(cr, uid, data['id']) | def _get_info(self, cr, uid, data, context): if not data['id']: return {} pool = pooler.get_pool(cr.dbname) case = pool.get('crm.lead').browse(cr, uid, data['id']) if not case.user_id: raise wizard.except_wizard(_('Error'),_('You must define a responsible user for this case in order to use this action!')) return { '... | 6ed7e4ca628406c9b1d6ea4d501012c632de12a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ed7e4ca628406c9b1d6ea4d501012c632de12a8/wizard_crm_new_send_email.py |
def _equal_balance(self, cr, uid, ids, statement, context={}): if statement.balance_end != statement.balance_end_cash: return False else: return True def _user_allow(self, cr, uid, ids, statement, context={}): return True | def onchange_journal_id(self, cr, uid, statement_id, journal_id, context={}): """ Changes balance start and starting details if journal_id changes" @param statement_id: Changed statement_id @param journal_id: Changed journal_id @return: Dictionary of changed values """ cash_pool = self.pool.get('account.cashbox.line'... | 17af0113924d412540ea92b2ce6f471d43bd411b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17af0113924d412540ea92b2ce6f471d43bd411b/account_cash_statement.py | |
if st.balance_end != st.balance_end_cash: | if not self._equal_balance(cr, uid, ids, st, context): | def button_confirm(self, cr, uid, ids, context={}): """ Check the starting and ending detail of statement @return: True """ 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('acco... | 17af0113924d412540ea92b2ce6f471d43bd411b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17af0113924d412540ea92b2ce6f471d43bd411b/account_cash_statement.py |
msg_txt = email.message_from_string(message) | def parse_message(self, message): #TOCHECK: put this function in mailgateway module msg_txt = email.message_from_string(message) message_id = msg_txt.get('message-id', False) msg = {} msg_txt = email.message_from_string(message) fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = message_id | c5ef622acbb52c8289d110ea9d078c023d4089d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5ef622acbb52c8289d110ea9d078c023d4089d6/partner.py | |
def parse_message(self, message): #TOCHECK: put this function in mailgateway module msg_txt = email.message_from_string(message) message_id = msg_txt.get('message-id', False) msg = {} msg_txt = email.message_from_string(message) fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = message_id | c5ef622acbb52c8289d110ea9d078c023d4089d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5ef622acbb52c8289d110ea9d078c023d4089d6/partner.py | ||
msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id)]) | msg_ids = [] | 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 = ... | c5ef622acbb52c8289d110ea9d078c023d4089d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5ef622acbb52c8289d110ea9d078c023d4089d6/partner.py |
if msg_ids and len(msg_ids): return 0 | if message_id: msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id)]) if msg_ids and len(msg_ids): return 0 | 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 = ... | c5ef622acbb52c8289d110ea9d078c023d4089d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5ef622acbb52c8289d110ea9d078c023d4089d6/partner.py |
def allow_cancel(self, cr, uid, ids, context={}): for pick in self.browse(cr, uid, ids, context=context): if not pick.move_lines: return True for move in pick.move_lines: if move.state == 'done': return False return True | def test_cancel(self, cr, uid, ids, context=None): """ Test whether the move lines are canceled or not. @return: True or False """ for pick in self.browse(cr, uid, ids, context=context): if not pick.move_lines: return False for move in pick.move_lines: if move.state not in ('cancel',): return False return True | b792ea494ec867ed773e55d56ef347472410ca71 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b792ea494ec867ed773e55d56ef347472410ca71/stock.py | |
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context_initial_bal', {})) | ctx2 = data['form'].get('used_context',{}).copy() ctx2.update({'initial_bal': True}) self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2) | def set_context(self, objects, data, ids, report_type=None): obj_move = self.pool.get('account.move.line') self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context_i... | 5c07eacf45e06e17e8f8a51bfe94ed14e3745fb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c07eacf45e06e17e8f8a51bfe94ed14e3745fb9/account_partner_ledger.py |
html = html.replace('\n',' ') | def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s... | 59fe0a4d123be14ac56195e3636c52c0d4fe4c57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/59fe0a4d123be14ac56195e3636c52c0d4fe4c57/misc.py | |
def run_test(self, cr, uid, module_path): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) | 22278b6242afd032468d7c6f732f1cfc90f65253 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22278b6242afd032468d7c6f732f1cfc90f65253/speed_test.py | ||
pool.get(obj).read(cr, uid, [ids[0]]) cnt = cr.count pool.get(obj).read(cr, uid, [ids[0]]) code_base_complexity = cr.count - cnt | pool.get(obj).read(cr, uid, ids) | def run_test(self, cr, uid, module_path): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) | 22278b6242afd032468d7c6f732f1cfc90f65253 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22278b6242afd032468d7c6f732f1cfc90f65253/speed_test.py |
pool.get(obj).read(cr, uid, ids[:size/2]) cnt = cr.count pool.get(obj).read(cr, uid, ids[:size/2]) code_half_complexity = cr.count - cnt | ccr.reset() pool.get(obj).read(ccr, uid, [ids[0]]) code_base_complexity = ccr.count | def run_test(self, cr, uid, module_path): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) | 22278b6242afd032468d7c6f732f1cfc90f65253 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22278b6242afd032468d7c6f732f1cfc90f65253/speed_test.py |
pool.get(obj).read(cr, uid, ids) cnt = cr.count pool.get(obj).read(cr, uid, ids) code_size_complexity = cr.count - cnt | ccr.reset() pool.get(obj).read(ccr, uid, ids[:size/2]) code_half_complexity = ccr.count ccr.reset() pool.get(obj).read(ccr, uid, ids) code_size_complexity = ccr.count | def run_test(self, cr, uid, module_path): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) | 22278b6242afd032468d7c6f732f1cfc90f65253 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22278b6242afd032468d7c6f732f1cfc90f65253/speed_test.py |
datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()): | datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) | def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ if not type: r... | c36a3d33908bf17dd4ade84985a9c7d7ee213456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c36a3d33908bf17dd4ade84985a9c7d7ee213456/mrp_repair.py |
self.obj_pl = report_pl.report_pl_account_horizontal(cr, uid, name, context=context) | self.obj_pl = account_profit_loss.report_pl_account_horizontal(cr, uid, name, context=context) | def __init__(self, cr, uid, name, context=None): super(report_balancesheet_horizontal, self).__init__(cr, uid, name, context=context) self.obj_pl = report_pl.report_pl_account_horizontal(cr, uid, name, context=context) self.result_sum_dr = 0.0 self.result_sum_cr = 0.0 self.result = {} self.res_bl = {} self.result_temp ... | df3fd62fe5313aea54699dceb6d18e6a1c85abe6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/df3fd62fe5313aea54699dceb6d18e6a1c85abe6/account_balance_sheet.py |
ids = map(lambda x: base_calendar_id2real_id(x), ids) | ids = map(lambda x: base_calendar.base_calendar_id2real_id(x), ids) | def export_cal(self, cr, uid, ids, context={}): ids = map(lambda x: base_calendar_id2real_id(x), ids) event_data = self.read(cr, uid, ids) event_obj = self.pool.get('basic.calendar.event') ical = event_obj.export_cal(cr, uid, event_data, context={'model': self._name}) return ical.serialize() | 71beda7a3f69690a2351cc4100b38d7c893f8da3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/71beda7a3f69690a2351cc4100b38d7c893f8da3/crm_caldav.py |
period_date_start = period_obj.read(cr, uid, data['form']['period_from'], ['date_start'])[0]['date_start'] period_date_stop = period_obj.read(cr, uid, data['form']['period_to'], ['date_stop'])[0]['date_stop'] | period_date_start = period_obj.read(cr, uid, data['form']['period_from'], ['date_start'])['date_start'] period_date_stop = period_obj.read(cr, uid, data['form']['period_to'], ['date_stop'])['date_stop'] | def _build_context(self, cr, uid, ids, data, context = None): result = {} result['fiscalyear'] = data['form']['fiscalyear_id'] and data['form']['fiscalyear_id'] or False if data['form']['filter'] == 'filter_date': result['date_from'] = data['form']['date_from'] result['date_to'] = data['form']['date_to'] elif data['for... | bc752eeb6ba75ccffd13114288eb8a75ae2f78dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc752eeb6ba75ccffd13114288eb8a75ae2f78dd/account_common_report.py |
new_qty = data['form']['return%s' % move.id] returned_qty = move.product_qty for rec in move.move_stock_return_history: returned_qty -= rec.product_qty if returned_qty != new_qty: set_invoice_state_to_none = False | def _create_returns(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) move_obj = pool.get('stock.move') pick_obj = pool.get('stock.picking') uom_obj = pool.get('product.uom') pick=pick_obj.browse(cr, uid, [data['id']])[0] new_picking=None date_cur=time.strftime('%Y-%m-%d %H:%M:%S') for move in move_obj... | e811f5a9018bfce4110831c47726f587fd883754 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e811f5a9018bfce4110831c47726f587fd883754/wizard_return.py | |
'product_qty': data['form']['return%s' % move.id], | 'product_qty': new_qty, | def _create_returns(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) move_obj = pool.get('stock.move') pick_obj = pool.get('stock.picking') uom_obj = pool.get('product.uom') pick=pick_obj.browse(cr, uid, [data['id']])[0] new_picking=None date_cur=time.strftime('%Y-%m-%d %H:%M:%S') for move in move_obj... | e811f5a9018bfce4110831c47726f587fd883754 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e811f5a9018bfce4110831c47726f587fd883754/wizard_return.py |
data['form']['return%s' % move.id], move.product_uos.id), | new_qty, move.product_uos.id), | def _create_returns(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) move_obj = pool.get('stock.move') pick_obj = pool.get('stock.picking') uom_obj = pool.get('product.uom') pick=pick_obj.browse(cr, uid, [data['id']])[0] new_picking=None date_cur=time.strftime('%Y-%m-%d %H:%M:%S') for move in move_obj... | e811f5a9018bfce4110831c47726f587fd883754 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e811f5a9018bfce4110831c47726f587fd883754/wizard_return.py |
addr, port = self.request.getsockname() | if hasattr(self.request, 'getsockname'): addr, port = self.request.getsockname() | def setup(self): self.davpath = '/'+config.get_misc('webdav','vdir','webdav') addr, port = self.server.server_name, self.server.server_port server_proto = getattr(self.server,'proto', 'http').lower() try: addr, port = self.request.getsockname() except Exception, e: self.log_error("Cannot calculate own address:" , e) # ... | 8ce30bcea65ae55572506e2f8b895192fc944305 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ce30bcea65ae55572506e2f8b895192fc944305/webdav_server.py |
self.log_error("Cannot calculate own address:" , e) | self.log_error("Cannot calculate own address: %s" , e) | def setup(self): self.davpath = '/'+config.get_misc('webdav','vdir','webdav') addr, port = self.server.server_name, self.server.server_port server_proto = getattr(self.server,'proto', 'http').lower() try: addr, port = self.request.getsockname() except Exception, e: self.log_error("Cannot calculate own address:" , e) # ... | 8ce30bcea65ae55572506e2f8b895192fc944305 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ce30bcea65ae55572506e2f8b895192fc944305/webdav_server.py |
reference = obj_inv.reference or number or '' | reference = obj_inv.reference or '' | def action_number(self, cr, uid, ids, *args): #TODO: not correct fix but required a frech values before reading it. self.write(cr, uid, ids, {}) | 8add10403c5d9277ae93b84db9928f7a04035f35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8add10403c5d9277ae93b84db9928f7a04035f35/invoice.py |
ref = reference | if not reference: ref = self._convert_ref(cr, uid, number) else: ref = reference | def action_number(self, cr, uid, ids, *args): #TODO: not correct fix but required a frech values before reading it. self.write(cr, uid, ids, {}) | 8add10403c5d9277ae93b84db9928f7a04035f35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8add10403c5d9277ae93b84db9928f7a04035f35/invoice.py |
ttype = context.get('ttype', False) | ttype = context.get('type', False) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Returns a list of ids based on search domain {args} @param cr: A database cursor @param user: ID of the user currently logged in @param args: list of conditions to be applied in search opertion @param offset: default fro... | 57362a8ac0406ca29ecb3bb4f9b73d70de828639 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/57362a8ac0406ca29ecb3bb4f9b73d70de828639/voucher.py |
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'): | if (m.product_id.cost_method == 'average'): | def view_init(self, cr, uid, fields_list, context=None): res = super(stock_partial_move, self).view_init(cr, uid, fields_list, context=context) move_obj = self.pool.get('stock.move') if not context: context={} for m in move_obj.browse(cr, uid, context.get('active_ids', [])): if m.state in ('done', 'cancel'): raise osv.... | 8259566f5354c077fb1a8488e173546ed1031041 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8259566f5354c077fb1a8488e173546ed1031041/stock_partial_move.py |
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'): | if m.product_id.cost_method == 'average': | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): result = super(stock_partial_move, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu) move_obj = self.pool.get('stock.move') move_ids = context.get('active_ids', False) move_ids = mov... | 8259566f5354c077fb1a8488e173546ed1031041 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8259566f5354c077fb1a8488e173546ed1031041/stock_partial_move.py |
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'): | if m.product_id.cost_method == 'average': | def do_partial(self, cr, uid, ids, context): """ Makes partial moves and pickings done. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dictionary ... | 8259566f5354c077fb1a8488e173546ed1031041 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8259566f5354c077fb1a8488e173546ed1031041/stock_partial_move.py |
def get_recurrent_ids(self, cr, uid, ids, base_start_date, base_until_date, limit=100): | def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): | def get_recurrent_ids(self, cr, uid, ids, base_start_date, base_until_date, limit=100): if not limit: limit = 100 if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x:... | bfbc90b73e50e34661c5b23f22b2c1f805e5af72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bfbc90b73e50e34661c5b23f22b2c1f805e5af72/crm_meeting.py |
result = [] | def get_recurrent_ids(self, cr, uid, ids, base_start_date, base_until_date, limit=100): if not limit: limit = 100 if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x:... | bfbc90b73e50e34661c5b23f22b2c1f805e5af72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bfbc90b73e50e34661c5b23f22b2c1f805e5af72/crm_meeting.py | |
ids = result return ids | if isinstance(select, (str, int, long)): return result and result[0] or False return result | def get_recurrent_ids(self, cr, uid, ids, base_start_date, base_until_date, limit=100): if not limit: limit = 100 if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x:... | bfbc90b73e50e34661c5b23f22b2c1f805e5af72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bfbc90b73e50e34661c5b23f22b2c1f805e5af72/crm_meeting.py |
if not isinstance(res,list): res= [res] | def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): args_without_date = [] start_date = False until_date = False for arg in args: if arg[0] not in ('date', unicode('date')): args_without_date.append(arg) else: if arg[1] in ('>', '>='): start_date = arg[2] elif arg[1] in ('<', '<... | bfbc90b73e50e34661c5b23f22b2c1f805e5af72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bfbc90b73e50e34661c5b23f22b2c1f805e5af72/crm_meeting.py | |
'name': name, | 'name' : name, | def action_move_line_create(self, cr, uid, ids, *args): for inv in self.browse(cr, uid, ids): if inv.move_id: continue company_currency = inv.company_id.currency_id.id | b98827bb140df79b47070e2be2b2d4db059f050d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b98827bb140df79b47070e2be2b2d4db059f050d/voucher.py |
'voucher_type':inv.type, | 'type' : inv.type, | def action_move_line_create(self, cr, uid, ids, *args): for inv in self.browse(cr, uid, ids): if inv.move_id: continue company_currency = inv.company_id.currency_id.id | b98827bb140df79b47070e2be2b2d4db059f050d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b98827bb140df79b47070e2be2b2d4db059f050d/voucher.py |
def onchange_type(self, cr, uid, ids, type, currency): | def onchange_type(self, cr, uid, ids, type, currency, context=None): | def onchange_type(self, cr, uid, ids, type, currency): obj_data = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users') | 024bb524f6cda18b41563712e6c39a589dc0b963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/024bb524f6cda18b41563712e6c39a589dc0b963/account.py |
pricelist_version_ids = product_pricelist_version_obj.search(cr, uid, []) | pricelist_version_ids = self.pool.get('product.pricelist').search(cr, uid, []) | def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst | 29cf676c6573b43275e4b70f2849314af88dee36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/29cf676c6573b43275e4b70f2849314af88dee36/pricelist.py |
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst | 29cf676c6573b43275e4b70f2849314af88dee36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/29cf676c6573b43275e4b70f2849314af88dee36/pricelist.py | ||
obj = self.pool.get(template.object_name.model) | def unlink_action(self, cr, uid, ids, context): for template in self.browse(cr, uid, ids, context): obj = self.pool.get(template.object_name.model) try: if template.ref_ir_act_window: self.pool.get('ir.actions.act_window').unlink(cr, uid, template.ref_ir_act_window.id, context) if template.ref_ir_value: self.pool.get('... | dce4e7401055390d5d7eb1259553f9332ac6949d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dce4e7401055390d5d7eb1259553f9332ac6949d/email_template.py | |
if not ids: raise ValueError() prop = self.browse(cr, uid, ids[0]) type_ = prop.type | if ids: prop = self.browse(cr, uid, ids[0]) type_ = prop.type else: type_ = self._defaults['type'] | def _update_values(self, cr, uid, ids, values): value = values.pop('value', None) if not value: return values | 5158948630d9c45d78aa832550bcf6e9b7eb6d1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5158948630d9c45d78aa832550bcf6e9b7eb6d1b/ir_property.py |
def _sheet_search(self, cursor, user, obj, name, args, context): | def _sheet_search(self, cursor, user, obj, name, args, context=None): | def _sheet_search(self, cursor, user, obj, name, args, context): if not len(args): return [] sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') | e70dd4a5a43cb9ef4822f8f07fe967fafd058823 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e70dd4a5a43cb9ef4822f8f07fe967fafd058823/hr_timesheet_sheet.py |
def _sheet_search(self, cursor, user, obj, name, args, context={}): | def _sheet_search(self, cursor, user, obj, name, args, context=None): | def _sheet_search(self, cursor, user, obj, name, args, context={}): if not len(args): return [] sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') | e70dd4a5a43cb9ef4822f8f07fe967fafd058823 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e70dd4a5a43cb9ef4822f8f07fe967fafd058823/hr_timesheet_sheet.py |
super(Workflow, self).__init__(**kwargs) | super(ActWindow, self).__init__(**kwargs) | def __init__(self, model, action, **kwargs): self.model = model self.action = action super(Workflow, self).__init__(**kwargs) | 2b3611cb376cd49c57243e74387b0facedd4f537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b3611cb376cd49c57243e74387b0facedd4f537/yaml_test.py |
class Ref(YamlTag): def __init__(self, xmlid): self.xmlid = xmlid super(Ref, self).__init__() | class IrSet(YamlTag): def __init__(self): super(IrSet, self).__init__() | def __init__(self, expression): self.expression = expression super(Eval, self).__init__() | 2b3611cb376cd49c57243e74387b0facedd4f537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b3611cb376cd49c57243e74387b0facedd4f537/yaml_test.py |
def ref_constructor(loader, node): xmlid = loader.construct_scalar(node) return Ref(xmlid) | def ir_set_constructor(loader, node): kwargs = loader.construct_mapping(node) return IrSet(**kwargs) | def ref_constructor(loader, node): xmlid = loader.construct_scalar(node) return Ref(xmlid) | 2b3611cb376cd49c57243e74387b0facedd4f537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b3611cb376cd49c57243e74387b0facedd4f537/yaml_test.py |
yaml.add_constructor(u"!ref", ref_constructor) | yaml.add_constructor(u"!ir_set", ir_set_constructor) | def ref_constructor(loader, node): xmlid = loader.construct_scalar(node) return Ref(xmlid) | 2b3611cb376cd49c57243e74387b0facedd4f537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b3611cb376cd49c57243e74387b0facedd4f537/yaml_test.py |
def is_ref(node): return isinstance(node, Ref) | def is_ir_set(node): return _is_yaml_mapping(node, IrSet) | def is_ref(node): return isinstance(node, Ref) | 2b3611cb376cd49c57243e74387b0facedd4f537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b3611cb376cd49c57243e74387b0facedd4f537/yaml_test.py |
AND l2.id IN %%s AND """ + \ | AND l2.id IN %s AND """ + \ | def _balance(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} c = context.copy() c['initital_bal'] = True sql = """SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2 WHERE l2.account_id = l1.account_id AND l1.id <= l2.id AND l2.id IN %%s AND """ + \ self.... | d45fb357424216cbf31ee84d474f56249c16f383 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d45fb357424216cbf31ee84d474f56249c16f383/account_move_line.py |
def _inherit_apply(src, inherit): | def raise_view_error(error_msg, child_view_id): view, child_view = self.pool.get('ir.ui.view').browse(cr, user, [view_id, child_view_id], context) raise AttributeError(("View definition error for inherited view '%(xml_id)s' on '%(model)s' model: " + error_msg) % { 'xml_id': child_view.xml_id, 'parent_xml_id': view.xml... | def _inherit_apply(src, inherit): 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... | 5b67a3154e0e02212c6bd648ed6a5ebf91dc831e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b67a3154e0e02212c6bd648ed6a5ebf91dc831e/orm.py |
raise AttributeError(_('Unknown position in inherited view %s !') % pos) | raise_view_error("Invalid position value: '%s'" % pos, inherit_id) | def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True 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... | 5b67a3154e0e02212c6bd648ed6a5ebf91dc831e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b67a3154e0e02212c6bd648ed6a5ebf91dc831e/orm.py |
raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag) | raise_view_error("Element '%s' not found in parent view '%%(parent_xml_id)s'" % tag, inherit_id) | def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True 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... | 5b67a3154e0e02212c6bd648ed6a5ebf91dc831e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b67a3154e0e02212c6bd648ed6a5ebf91dc831e/orm.py |
result = _inherit_apply(result, inherit) | result = _inherit_apply(result, inherit, id) | 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... | 5b67a3154e0e02212c6bd648ed6a5ebf91dc831e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b67a3154e0e02212c6bd648ed6a5ebf91dc831e/orm.py |
openerp_site_packages = join('lib', 'python%s' % py_short_version, 'site-packages', 'openerp-server') | openerp_site_packages = join(get_python_lib(prefix=''), 'openerp-server') | def data_files(): '''Build list of data files to be installed''' files = [] if os.name == 'nt': for root, _, names in os.walk(join('bin','addons')): files.append((root, [join(root, name) for name in names])) for root, _, names in os.walk('doc'): files.append((root, [join(root, name) for name in names])) files.append(('... | 62c4eb806f9ddfd9e9bcb47c435213023d62f01a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62c4eb806f9ddfd9e9bcb47c435213023d62f01a/setup.py |
addon_path = join('lib', 'python%s' % py_short_version, 'site-packages', 'openerp-server','addons', addonname) | addon_path = join(get_python_lib(prefix=''), 'openerp-server','addons', addonname) | def data_files(): '''Build list of data files to be installed''' files = [] if os.name == 'nt': for root, _, names in os.walk(join('bin','addons')): files.append((root, [join(root, name) for name in names])) for root, _, names in os.walk('doc'): files.append((root, [join(root, name) for name in names])) files.append(('... | 62c4eb806f9ddfd9e9bcb47c435213023d62f01a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62c4eb806f9ddfd9e9bcb47c435213023d62f01a/setup.py |
res_id = False | def _process_email(self, cr, uid, server, message, context={}): history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) msg = {} if not message_id: return False fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = me... | b63dd0fd7aa5d8859a123c459bf30aed5091dab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b63dd0fd7aa5d8859a123c459bf30aed5091dab5/fetchmail.py | |
model_pool.message_update(cr, uid, [history.res_id], vals, msg, context=context) | if hasattr(model_pool, 'message_update'): model_pool.message_update(cr, uid, [history.res_id], vals, msg, context=context) else: logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name)) return False | def _process_email(self, cr, uid, server, message, context={}): history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) msg = {} if not message_id: return False fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = me... | b63dd0fd7aa5d8859a123c459bf30aed5091dab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b63dd0fd7aa5d8859a123c459bf30aed5091dab5/fetchmail.py |
res_id = model_pool.message_new(cr, uid, msg, context) | if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s' % (model_pool._name)) return False | def _process_email(self, cr, uid, server, message, context={}): history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) msg = {} if not message_id: return False fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = me... | b63dd0fd7aa5d8859a123c459bf30aed5091dab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b63dd0fd7aa5d8859a123c459bf30aed5091dab5/fetchmail.py |
self._process_email(cr, uid, server, data[0][1], context) imap_server.store(num, '+FLAGS', '\\Seen') count += 1 logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (count, server.name)) | if self._process_email(cr, uid, server, data[0][1], context): imap_server.store(num, '+FLAGS', '\\Seen') count += 1 logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch/process %s email(s) from %s' % (count, server.name)) | def fetch_mail(self, cr, uid, ids, context={}): fp = os.popen('ping www.google.com -c 1 -w 5',"r") if not fp.read(): logger.notifyChannel('imap', netsvc.LOG_WARNING, 'No address associated with hostname !') | b63dd0fd7aa5d8859a123c459bf30aed5091dab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b63dd0fd7aa5d8859a123c459bf30aed5091dab5/fetchmail.py |
'period': fields.selection([('month','Monthly'), ('3months','3 Monthly')], 'Periods', required=True), 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts',required=True), | 'period': fields.selection([('month','Monthly'), ('3months','3 Monthly')], 'Periods', required=True), 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts'), | def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') ids = modules.search(cr, uid, [('category_id','=','Account Charts')]) charts = list( sorted(((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids)), key=itemgetter(1))) charts.insert(0,('configurable','Generic Chart Of Accou... | 4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d/installer.py |
'date_start': time.strftime('%Y-01-01'), 'date_stop': time.strftime('%Y-12-31'), 'period': lambda *a: 'month', 'sale_tax': lambda *a: 0.0, 'purchase_tax': lambda *a: 0.0, | 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), 'period': 'month', 'sale_tax': 0.0, 'purchase_tax': 0.0, | def _get_default_charts(self, cr, uid, context=None): module_name = False company_id = self._default_company(cr, uid, context=context) company = self.pool.get('res.company').browse(cr, uid, company_id) address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id]) if address_id['default']: addr... | 4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d/installer.py |
'bank_account_id': fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True), | 'bank_account_id': fields.many2one('account.installer', 'Bank Account', required=True), | def modules_to_install(self, cr, uid, ids, context=None): modules = super(account_installer, self).modules_to_install( cr, uid, ids, context=context) chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] self.logger.notifyChannel( 'installer', netsvc.LOG_DEBUG, 'Installing chart of accounts %s'%char... | 4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d/installer.py |
def modules_to_install(self, cr, uid, ids, context=None): modules = super(account_installer, self).modules_to_install( cr, uid, ids, context=context) chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] self.logger.notifyChannel( 'installer', netsvc.LOG_DEBUG, 'Installing chart of accounts %s'%char... | 4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d/installer.py | ||
s.create_date as date, to_char(s.date_from,'YYYY/mm/dd') as date_from, to_char(s.date_to,'YYYY/mm/dd') as date_to, | date_trunc('seconds',s.create_date) as date, date_trunc('day',s.date_from) as date_from, date_trunc('day',s.date_to) as date_to, | def init(self, cr): tools.drop_view_if_exists(cr, 'hr_holidays_report') cr.execute(""" create or replace view hr_holidays_report as ( select min(s.id) as id, s.create_date as date, to_char(s.date_from,'YYYY/mm/dd') as date_from, to_char(s.date_to,'YYYY/mm/dd') as date_to, s.number_of_days_temp, s.employee_id, s.user_id... | 8ea773c793398546341f31360cde91a5f23fecef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ea773c793398546341f31360cde91a5f23fecef/hr_holidays_report.py |
self.cr.execute('SELECT period_id, journal_id ' 'FROM account_journal_period ' 'WHERE id IN %s', (tuple(ids),)) | if (data['model'] == 'account.journal.period'): self.cr.execute('SELECT period_id, journal_id ' 'FROM account_journal_period ' 'WHERE id IN %s', (tuple(ids),)) else: self.cr.execute('SELECT period_id, journal_id ' 'FROM account_journal_period ') | def set_context(self, objects, data, ids, report_type=None): super(journal_print, self).set_context(objects, data, ids, report_type) self.cr.execute('SELECT period_id, journal_id ' 'FROM account_journal_period ' 'WHERE id IN %s', (tuple(ids),)) res = self.cr.fetchall() self.period_ids, self.journal_ids = zip(*res) | c0253ef988b8e9a8d25016c56c4c7974f2f337cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0253ef988b8e9a8d25016c56c4c7974f2f337cc/general_journal.py |
def _compute_total(self, cr, uid, ids, name, args, context=None): position_pool = self.pool.get('account.fiscal.position') voucher_pool = self.pool.get('account.voucher') voucher_line_pool = self.pool.get('account.voucher.line') partner_pool = self.pool.get('res.partner') tax_pool = self.pool.get('account.tax') res = ... | def _compute_total(self, cr, uid, ids, name, args, context=None): position_pool = self.pool.get('account.fiscal.position') voucher_pool = self.pool.get('account.voucher') voucher_line_pool = self.pool.get('account.voucher.line') partner_pool = self.pool.get('res.partner') tax_pool = self.pool.get('account.tax') res = ... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py | |
def create(self, cr, uid, vals, context={}): """ Create a new record for a model account_voucher @param cr: A database cursor @param user: ID of the user currently logged in @param vals: provides data for new record @param context: context arguments, like lang, time zone @return: Returns an id of the new record """ | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py | ||
def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py | ||
ids = move_line_pool.search(cr, uid, [('reconcile_id','=', False), ('partner_id','=',partner_id)], context=context) | search_type = 'credit' account_type = False if ttype == 'receipt': search_type = 'debit' account_type = 'receivable' elif ttype == 'payment': search_type = 'credit' account_type = 'payable' ids = move_line_pool.search(cr, uid, [('account_id.type','=', account_type), ('reconcile_id','=', False), ('partner_id','=',partn... | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py |
'type':'dr', | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py | |
'type':'cr', | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py | |
res = {'payment_ids':res, 'account_id':account_id} | res = { 'payment_ids':res, 'account_id':account_id, 'amount':total } | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py |
if inv.type == 'sale': | if inv.type in ('sale', 'receipt'): | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | 5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.