rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def onchange_days(self, cr, uid, ids, project, context=None): result = {} for id in ids: project_id = self.browse(cr, uid, id, context=context) newdate = datetime.strptime(project_id.date_start, '%Y-%m-%d') + relativedelta(days=project_id.duration or 0.0) result['date_end'] = newdate.strftime('%Y-%m-%d') return {'value... | def onchange_days(self, cr, uid, ids, project, context=None): result = {} for id in ids: project_id = self.browse(cr, uid, id, context=context) newdate = datetime.strptime(project_id.date_start, '%Y-%m-%d') + relativedelta(days=project_id.duration or 0.0) result['date_end'] = newdate.strftime('%Y-%m-%d') return {'value... | 74287c78938cd17d1f2c79063450b879d2989ef5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/74287c78938cd17d1f2c79063450b879d2989ef5/project_long_term.py | |
'date_start': time.strftime('%Y-01-01'), 'date_stop': time.strftime('%Y-12-31'), | 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), | 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, context=context) address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id]) if address_id... | 945a1d16d8c0bff6689c18f0b4544bdbd6bf0269 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/945a1d16d8c0bff6689c18f0b4544bdbd6bf0269/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... | 945a1d16d8c0bff6689c18f0b4544bdbd6bf0269 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/945a1d16d8c0bff6689c18f0b4544bdbd6bf0269/installer.py | ||
def get(self, cr, obj, ids, name, user=None, context=None, values=None): context = context or {} values = values or {} | 8b28a3cb5e88d8a859ac2fa74f5a60ddbe3fc359 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8b28a3cb5e88d8a859ac2fa74f5a60ddbe3fc359/fields.py | ||
if id in records: res[id] = (id, records[id]) | if res[id] in records: res[id] = (res[id], records[res[id]]) | def get(self, cr, obj, ids, name, user=None, context=None, values=None): context = context or {} values = values or {} | 8b28a3cb5e88d8a859ac2fa74f5a60ddbe3fc359 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8b28a3cb5e88d8a859ac2fa74f5a60ddbe3fc359/fields.py |
def __init__(self, cr, uid, name, context=None): self.date_lst = [] self.date_lst_string = '' super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit_partner': self._sum_debit_partner, 'sum_credit_partner': self._sum_credit_partn... | def __init__(self, cr, uid, name, context=None): self.date_lst = [] self.date_lst_string = '' super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit_partner': self._sum_debit_partner, 'sum_credit_partner': self._sum_credit_partn... | def __init__(self, cr, uid, name, context=None): self.date_lst = [] self.date_lst_string = '' super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit_partner': self._sum_debit_partner, 'sum_credit_partner': self._sum_credit_partn... | 35085e84992f87b57198ecd1a74da6ef671c2bfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35085e84992f87b57198ecd1a74da6ef671c2bfd/third_party_ledger.py |
'get_journal': self._get_journal, }) def date_range(self, start, end): if not start or not end: return [] start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d"))) end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d"))) full_str_date = [] r = (end+datetime.timedelta(days... | 'get_journal': self._get_journal, }) def date_range(self, start, end): if not start or not end: return [] start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d"))) end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d"))) full_str_date = [] r = (end+datetime.timedelta(days... | def __init__(self, cr, uid, name, context=None): self.date_lst = [] self.date_lst_string = '' super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit_partner': self._sum_debit_partner, 'sum_credit_partner': self._sum_credit_partn... | 35085e84992f87b57198ecd1a74da6ef671c2bfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35085e84992f87b57198ecd1a74da6ef671c2bfd/third_party_ledger.py |
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger, header=False) | 'addons/account/report/third_party_ledger.rml',parser=third_party_ledger, header=False) | def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone() if self.account_curr... | 35085e84992f87b57198ecd1a74da6ef671c2bfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35085e84992f87b57198ecd1a74da6ef671c2bfd/third_party_ledger.py |
'addons/account/report/third_party_ledger_other.rml',parser=third_party_ledger, header=False) | 'addons/account/report/third_party_ledger_other.rml',parser=third_party_ledger, header=False) | def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone() if self.account_curr... | 35085e84992f87b57198ecd1a74da6ef671c2bfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35085e84992f87b57198ecd1a74da6ef671c2bfd/third_party_ledger.py |
' WHERE name in (%s)' % (','.join(['%s'] * len(self))), additional_data.keys() | ' WHERE name in %s',(tuple(additional_data),) | def update_from_db(self, cr): # update the graph with values from the database (if exist) ## First, we set the default values for each package in graph additional_data = dict.fromkeys(self.keys(), {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None}) ## Then we get the values from the database ... | f33171198680a04a1dc6a2802531abf41f054884 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f33171198680a04a1dc6a2802531abf41f054884/__init__.py |
cr.execute("SELECT name from ir_module_module WHERE state in (%s)" % ','.join(['%s']*len(STATES_TO_LOAD)), STATES_TO_LOAD) | cr.execute("SELECT name from ir_module_module WHERE state in %s" ,(tuple(STATES_TO_LOAD),)) | def check_module_name(cr, mods, state): for mod in mods: id = modobj.search(cr, 1, ['&', ('state', '=', state), ('name', '=', mod)]) if id: getattr(modobj, states[state])(cr, 1, id) elif mod != 'all': logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: invalid module name!' % (mod)) | f33171198680a04a1dc6a2802531abf41f054884 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f33171198680a04a1dc6a2802531abf41f054884/__init__.py |
'department_id': fields.related('employee_id','department_id', string="Department", readonly=True), | 'department_id': fields.related('employee_id','department_id', type='many2one', relation='hr.department', string="Department", readonly=True), | def _get_latest_contract(self, cr, uid, ids, field_name, args, context=None): res = {} obj_contract = self.pool.get('hr.contract') for emp in self.browse(cr, uid, ids, context=context): contract_ids = obj_contract.search(cr, uid, [('employee_id','=',emp.id),], order='date_start', context=context) if contract_ids: res[e... | 35c76a73c6f4f7d4d44ce02a9f5716738a1bc530 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35c76a73c6f4f7d4d44ce02a9f5716738a1bc530/hr_contract.py |
vals = {} | vals = [] | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
vals = {'ref': '%s,%s' % (model, base_calendar_id2real_id(context['active_id']))} | ref = {'ref': '%s,%s' % (model, base_calendar_id2real_id(context['active_id']))} | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
vals.update({'user_id': user_id, 'email': user.address_id.email}) | res = { 'user_id': user_id, 'email': user.address_id.email } res.update(ref) vals.append(res) | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
vals.update({'email': datas['email']}) | vals.append({'email': datas['email']}) | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
vals.update({ 'partner_address_id': contact.id, 'email': contact.email}) | res = { 'partner_address_id': contact.id, 'email': contact.email } res.update(ref) vals.append(res) | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
att_obj._send_mail(cr, uid, [att_id], mail_to, \ | att_obj._send_mail(cr, uid, attendees, mail_to, \ | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py |
att_id = att_obj.create(cr, uid, vals) if model_field: obj.write(cr, uid, res_obj.id, {model_field: [(4, att_id)]}) | def do_invite(self, cr, uid, ids, context={}): for att_id in ids: datas = self.read(cr, uid, att_id) model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.brow... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py | |
value = {} | def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, context={}): if not start_date: return {} start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S") value = {} if end_date and not duration: end = datetime.strptime(end_date, "%Y-%m-%d %H:%M:%S") diff = end - start duration = float(dif... | 4009482974533250261bd1f0321a448fb21804ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4009482974533250261bd1f0321a448fb21804ca/base_calendar.py | |
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')]) | def do_change_standard_price(self, cr, uid, ids, datas, context={}): """ Changes the Standard Price of Product and creates an account move accordingly. @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal @param context: A standard dictionary @return: """ ... | 8dfe66803b5d77156e76672674a251162c4650c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8dfe66803b5d77156e76672674a251162c4650c5/product.py | |
'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]), | 'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one'), | def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}): """ Finds the incoming and outgoing quantity of product. @return: Dictionary of values """ if not field_names: field_names = [] res = {} for id in ids: res[id] = {}.fromkeys(field_names, 0.0) for f in field_names: c = context.copy() if... | 8dfe66803b5d77156e76672674a251162c4650c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8dfe66803b5d77156e76672674a251162c4650c5/product.py |
def onchange_project(self, cr, uid, id, project_id): if not project_id: return {} data = self.pool.get('project.project').browse(cr, uid, [project_id]) partner_id=data and data[0].parent_id.partner_id if partner_id: return {'value':{'partner_id':partner_id.id}} return {} | def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0): return {'value':{'remaining_hours': planned - effective}} | 06c40ea9526e34a170d209dd4d8ce575d4e76ac0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06c40ea9526e34a170d209dd4d8ce575d4e76ac0/project.py | |
'name': product.partner_ref, | def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, address_id=False): if not prod_id: return {} lang = False if address_id: addr_rec = self.pool.get('res.partner.address').browse(cr, uid, address_id) if addr_rec: lang = addr_rec.partner_id and addr_rec.partner_id.lang or False c... | f3ebef015c99452d4c34de38fad31a4354bb6b76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f3ebef015c99452d4c34de38fad31a4354bb6b76/stock.py | |
if not ids: result['name'] = product.partner_ref | def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, address_id=False): if not prod_id: return {} lang = False if address_id: addr_rec = self.pool.get('res.partner.address').browse(cr, uid, address_id) if addr_rec: lang = addr_rec.partner_id and addr_rec.partner_id.lang or False c... | f3ebef015c99452d4c34de38fad31a4354bb6b76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f3ebef015c99452d4c34de38fad31a4354bb6b76/stock.py | |
wh = self.pool.get('stock.warehouse').browse(cr, uid, proc.id, context) | wh = self.pool.get('stock.warehouse').browse(cr, uid, proc.warehouse_id.id, context) | def make_procurement(self, cr, uid, ids, context=None): '''Create procurement''' for proc in self.browse(cr, uid, ids): wh = self.pool.get('stock.warehouse').browse(cr, uid, proc.id, context) user = self.pool.get('res.users').browse(cr, uid, uid, context) procure_id = self.pool.get('mrp.procurement').create(cr, uid, { ... | 27c588415eef0583c6a82e49f268006c511ae01a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/27c588415eef0583c6a82e49f268006c511ae01a/make_procurement_product.py |
'bank': fields.many2one('res.bank', 'Bank'), | 'bank': fields.many2one('res.bank', 'Bank', required=True), | def _default_value(self, cursor, user, field, context=None): if field in ('country_id', 'state_id'): value = False else: value = '' if not context.get('address', False): return value for ham, spam, address in context['address']: if address.get('type', False) == 'default': return address.get(field, value) elif not addre... | 05c30d29f42de9bf5fd27ba9beb576c419135a4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05c30d29f42de9bf5fd27ba9beb576c419135a4a/partner.py |
a = repair.partner_id.property_account_receivable.id | if not repair.partner_id.property_account_receivable: raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) account_id = repair.partner_id.property_account_receivable.id | def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('a... | 123cb46c6c36bc22eea1bbce33dc5fdf41dfa579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/123cb46c6c36bc22eea1bbce33dc5fdf41dfa579/mrp_repair.py |
'account_id': a, | 'account_id': account_id, | def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('a... | 123cb46c6c36bc22eea1bbce33dc5fdf41dfa579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/123cb46c6c36bc22eea1bbce33dc5fdf41dfa579/mrp_repair.py |
'account_id': operation.product_id and operation.product_id.property_account_income and operation.product_id.property_account_income.id, | 'account_id': account_id, | def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('a... | 123cb46c6c36bc22eea1bbce33dc5fdf41dfa579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/123cb46c6c36bc22eea1bbce33dc5fdf41dfa579/mrp_repair.py |
check = int(10 - math.ceil(total % 10.0)) | check = int(10 - math.ceil(total % 10.0)) %10 | def check_ean(eancode): if not eancode: return True if len(eancode) <> 13: return False try: int(eancode) except: return False oddsum=0 evensum=0 total=0 eanvalue=eancode reversevalue = eanvalue[::-1] finalean=reversevalue[1:] for i in range(len(finalean)): if is_pair(i): oddsum += int(finalean[i]) else: evensum += in... | 2646ac2706cd3dbd62968c52b7fb933978a786a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2646ac2706cd3dbd62968c52b7fb933978a786a4/product.py |
'id': product.id, 'name': s.product_name or product.name, 'default_code': s.product_code or product.default_code, | 'id': product.id, 'name': s.product_name or product.name, 'default_code': s.product_code or product.default_code, | def _name_get(d): name = d.get('name','') code = d.get('default_code',False) if code: name = '[%s] %s' % (code,name) if d.get('variants'): name = name + ' - %s' % (d['variants'],) return (d['id'], name) | 2646ac2706cd3dbd62968c52b7fb933978a786a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2646ac2706cd3dbd62968c52b7fb933978a786a4/product.py |
def _total(self, cr, uid, ids, field_names, arg, context): res={} for line in self.browse(cr, uid, ids, context): res[line.id] = line.emp_deduction + line.comp_deduction return res | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | ||
'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'), | 'base': fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'), | def _total(self, cr, uid, ids, field_names, arg, context): res={} for line in self.browse(cr, uid, ids, context): res[line.id] = line.emp_deduction + line.comp_deduction return res | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py |
if line.category_id.register_id: ctr = { 'register_id':line.category_id.register_id.id, 'name':line.name, 'code':line.code, 'employee_id':slip.employee_id.id, 'period_id':period_id, 'emp_deduction':amount, } if line.category_id.contribute: ctr['comp_deduction'] = amount company = 0.0 employee = 0.0 if line.category_id... | def verify_sheet(self, cr, uid, ids, context={}): move_pool = self.pool.get('account.move') movel_pool = self.pool.get('account.move.line') exp_pool = self.pool.get('hr.expense.expense') for slip in self.browse(cr,uid,ids): total_deduct = 0.0 line_ids = [] partner = False partner_id = False if not slip.employee_id.... | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | |
def _get_leaves(self, cr, user, slip, employee, context={}): """ Compute leaves for an employee @param cr: cursor to database @param user: id of current user @param slip: object of the hr.payroll.slip model @param employee: object of the hr.employee model @param context: context arguments, like lang, time zone @retur... | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | ||
def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | ||
for cline in line.category_id.contribute_ids: print 'XXXXXXXXXXXXXXX : ', cline.name | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | |
if line.amount_type in ('fix', 'per'): value = line.amount elif line.amount_type == 'func': | if line.amount_type == 'func': | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py |
def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 7406420996dd681d6caa3a8ae0c3c42e5a7d6619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7406420996dd681d6caa3a8ae0c3c42e5a7d6619/hr_payroll.py | ||
def check_duplicate(self, cr, uid, ids): | e55bd7051cdfcc53b81f73e0797722510c9ccc01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e55bd7051cdfcc53b81f73e0797722510c9ccc01/fetchmail.py | ||
count = 0 | def button_confirm_login(self, cr, uid, ids, context={}): for server in self.browse(cr, uid, ids, context): logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name)) context.update({'server_id': server.id, 'server_type': server.type}) count = 0 try: if server.type ==... | e55bd7051cdfcc53b81f73e0797722510c9ccc01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e55bd7051cdfcc53b81f73e0797722510c9ccc01/fetchmail.py | |
"http://calendarserver.org/ns/" : ('getctag',), | "DAV:": ('principal-collection-set'), "http://cal.me.com/_namespace/" : ('user-state'), "http://calendarserver.org/ns/" : ( 'dropbox-home-URL', 'notification-URL', 'getctag',), | def _get_dav_getctag(self, cr): result = self.get_etag(cr) return str(result) | e067fa17a8ef9c2c74072f59edea4f78e688ae35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e067fa17a8ef9c2c74072f59edea4f78e688ae35/caldav_node.py |
def _get_caldav_calendar_data(self, cr): return self.get_data(cr) def _get_caldav_calendar_description(self, cr): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') ctx = self.context.context.copy() ctx.update(self.dctx) calendar = calendar_obj.browse(cr, uid, self.calendar_id, con... | def _get_ttag(self,cr): res = False if self.model and self.res_id: res = '%s_%d' % (self.model, self.res_id) elif self.calendar_id: res = '%d' % (self.calendar_id) return res | e067fa17a8ef9c2c74072f59edea4f78e688ae35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e067fa17a8ef9c2c74072f59edea4f78e688ae35/caldav_node.py | |
def _get_caldav_schedule_outbox_URL(self, cr): return self._get_caldav_schedule_inbox_URL(cr) | def _get_caldav_schedule_outbox_URL(self, cr): return self._get_caldav_schedule_inbox_URL(cr) | e067fa17a8ef9c2c74072f59edea4f78e688ae35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e067fa17a8ef9c2c74072f59edea4f78e688ae35/caldav_node.py | |
order_obj = self.pool.get('payment.order') | def search_entries(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data') if context is None: context = {} data = self.read(cr, uid, ids, [], context=context)[0] search_due_date = data['duedate'] | 3de826e235d514fd83aaf67fb7785922f1a34de9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3de826e235d514fd83aaf67fb7785922f1a34de9/account_payment_order.py | |
self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context) | self.create_move_from_st_line(cr, uid, st_line, company_currency_id, st_line_number, context) | def button_confirm_bank(self, cr, uid, ids, context=None): done = [] obj_seq = self.pool.get('ir.sequence') if context is None: context = {} | e87753d2e9f4f526e292610f3469b5e9db18ec34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e87753d2e9f4f526e292610f3469b5e9db18ec34/account_bank_statement.py |
p.sale_id,sum(m.product_qty), m.state | p.sale_id,sum(m.product_qty), mp.state as mp_state | def _picked_rate(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} if not ids: return {} res = {} for id in ids: res[id] = [0.0, 0.0] cr.execute('''SELECT p.sale_id,sum(m.product_qty), m.state FROM stock_move m LEFT JOIN stock_picking p on (p.id=m.picking_id) WHERE p.sale_id = ANY(%s) GROUP... | 7a2cc710fef49fdec6ec3a9f0a896f563619db8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a2cc710fef49fdec6ec3a9f0a896f563619db8f/sale.py |
p.sale_id = ANY(%s) GROUP BY m.state, p.sale_id''',(ids,)) for oid, nbr, state in cr.fetchall(): if state == 'cancel': | p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''') for oid, nbr, mp_state in cr.fetchall(): if mp_state == 'cancel': | def _picked_rate(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} if not ids: return {} res = {} for id in ids: res[id] = [0.0, 0.0] cr.execute('''SELECT p.sale_id,sum(m.product_qty), m.state FROM stock_move m LEFT JOIN stock_picking p on (p.id=m.picking_id) WHERE p.sale_id = ANY(%s) GROUP... | 7a2cc710fef49fdec6ec3a9f0a896f563619db8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a2cc710fef49fdec6ec3a9f0a896f563619db8f/sale.py |
if state == 'done': | if mp_state == 'done': | def _picked_rate(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} if not ids: return {} res = {} for id in ids: res[id] = [0.0, 0.0] cr.execute('''SELECT p.sale_id,sum(m.product_qty), m.state FROM stock_move m LEFT JOIN stock_picking p on (p.id=m.picking_id) WHERE p.sale_id = ANY(%s) GROUP... | 7a2cc710fef49fdec6ec3a9f0a896f563619db8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7a2cc710fef49fdec6ec3a9f0a896f563619db8f/sale.py |
'user_id':fields.many2one('res.users', 'Responsible', readonly=True), | def init(self, cr): tools.sql.drop_view_if_exists(cr, 'purchase_report') cr.execute(""" create or replace view purchase_report as ( select min(l.id) as id, s.date_order as date, to_char(s.date_order, 'YYYY') as name, to_char(s.date_order, 'MM') as month, s.state, s.warehouse_id as warehouse_id, s.partner_id as partner_... | 9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f/purchase_report.py | |
create_uid as user_id, | def init(self, cr): tools.sql.drop_view_if_exists(cr, 'purchase_order_qty_amount') cr.execute(""" create or replace view purchase_order_qty_amount as ( select min(id) as id, to_char(create_date, 'MM') as month, sum(product_qty) as total_qty, create_uid as user_id, sum(price_unit*product_qty) as total_amount from purcha... | 9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f/purchase_report.py | |
to_char(create_date, 'MM'), create_uid | to_char(create_date, 'MM') | def init(self, cr): tools.sql.drop_view_if_exists(cr, 'purchase_order_qty_amount') cr.execute(""" create or replace view purchase_order_qty_amount as ( select min(id) as id, to_char(create_date, 'MM') as month, sum(product_qty) as total_qty, create_uid as user_id, sum(price_unit*product_qty) as total_amount from purcha... | 9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9da45d3b15595e5a0b0fa6b9a76f8c8f7c0b8e1f/purchase_report.py |
for slip in self.browse(cr, uid, ids, context=context): | for slip in self.browse(cr, uid, ids, context=context): | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py |
if not slip.employee_id.contract_id: | update = {} ttyme = datetime.fromtimestamp(time.mktime(time.strptime(slip.date,"%Y-%m-%d"))) contracts = self.get_contract(cr, uid, slip.employee_id, date, context) if contracts.get('id', False) == False: update.update({ 'basic': round(0.0), 'basic_before_leaves': round(0.0), 'name':'Salary Slip of %s for %s' % (slip.e... | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py |
update = {} | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py | |
def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py | ||
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(slip.date,"%Y-%m-%d"))) | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py | |
if not slip.employee_id.contract_id: | if not slip.contract_id: | def get_days(start, end, month, year, calc_day): count = 0 import datetime for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | 9860aa21c1fe5c45980f9f219fe454f393bf69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9860aa21c1fe5c45980f9f219fe454f393bf69ed/hr_payroll.py |
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._query_get(cr, uid, obj='l1', context=c), """ GROUP BY l2.id""", ] cr.execute('\n'.join(sql), [t... | 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._query_get(cr, uid, obj='l1', context=c) + \ " GROUP BY l2.id" cr.execute(sql, [tuple(ids)]) | 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"... | bffc2487968be0e77241d5d40d353901e4ce3aed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bffc2487968be0e77241d5d40d353901e4ce3aed/account_move_line.py |
import pdb pdb.set_trace() | def get_memory(self, cr, obj, ids, name, user=None, context=None, values=None): if not context: context = {} if not values: values = [] res = {} for i in ids: val = None for v in values: if v['id'] == i: val = v[name] break | 53d3e74d66dfdcbe7706b83d0cf65098ac369f64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/53d3e74d66dfdcbe7706b83d0cf65098ac369f64/fields.py | |
def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py | ||
return unsafe_eval(a_eval, idref2) | return unsafe_eval(a_eval, idref2) | def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
logger = logging.getLogger('init') logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True) return "" | logger = logging.getLogger('init') logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True) return "" | def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
if data_node_context: context = unsafe_eval(data_node_context, eval_dict) else: context = {} | def get_context(self, data_node, node, eval_dict): data_node_context = (len(data_node) and data_node.get('context','').encode('utf8')) if data_node_context: context = unsafe_eval(data_node_context, eval_dict) else: context = {} | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py | |
if node_context: context.update(unsafe_eval(node_context, eval_dict)) | context = {} for ctx in (data_node_context, node_context): if ctx: try: ctx_res = unsafe_eval(ctx, eval_dict) if isinstance(context, dict): context.update(ctx_res) else: context = ctx_res except NameError: context = ctx logging.getLogger("init").debug('Context value (%s) for element with id "%s" or its data node doe... | def get_context(self, data_node, node, eval_dict): data_node_context = (len(data_node) and data_node.get('context','').encode('utf8')) if data_node_context: context = unsafe_eval(data_node_context, eval_dict) else: context = {} | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
context = rec.get('context','').encode('utf-8') or '{}' | 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... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py | |
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... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py | ||
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... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py | ||
context = unsafe_eval(context) | eval_context = { 'name': name, 'xml_id': xml_id, 'type': type, 'view_id': view_id, 'domain': domain, 'res_model': res_model, 'src_model': src_model, 'view_type': view_type, 'view_mode': view_mode, 'usage': usage, 'limit': limit, 'auto_refresh': auto_refresh, 'uid' : uid, 'active_id': active_id, 'ref' : ref, } context... | def ref(str_id): return self.id_get(cr, None, str_id) | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
f_ref = field.get("ref",'').encode('ascii') | f_ref = field.get("ref",'').encode('utf-8') | def _tag_record(self, cr, rec, data_node=None): rec_model = rec.get("model").encode('ascii') model = self.pool.get(rec_model) assert model, "The model %s does not exist !" % (rec_model,) rec_id = rec.get("id",'').encode('ascii') rec_context = rec.get("context", None) if rec_context: rec_context = unsafe_eval(rec_contex... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
f_model = field.get("model",'').encode('ascii') | f_model = field.get("model",'').encode('utf-8') | def _tag_record(self, cr, rec, data_node=None): rec_model = rec.get("model").encode('ascii') model = self.pool.get(rec_model) assert model, "The model %s does not exist !" % (rec_model,) rec_id = rec.get("id",'').encode('ascii') rec_context = rec.get("context", None) if rec_context: rec_context = unsafe_eval(rec_contex... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
f_use = field.get("use",'').encode('ascii') or 'id' | f_use = field.get("use",'').encode('utf-8') or 'id' | def _tag_record(self, cr, rec, data_node=None): rec_model = rec.get("model").encode('ascii') model = self.pool.get(rec_model) assert model, "The model %s does not exist !" % (rec_model,) rec_id = rec.get("id",'').encode('ascii') rec_context = rec.get("context", None) if rec_context: rec_context = unsafe_eval(rec_contex... | fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fdabe0f0dbaca61e1dcb395b5df9ce609b1cc6e2/convert.py |
'title': fields.many2one('res.partner.title','Title'), | 'title': fields.many2one('res.partner.title','Legal Status'), | def _lang_get(self, cr, uid, context={}): obj = self.pool.get('res.lang') ids = obj.search(cr, uid, [], context=context) res = obj.read(cr, uid, ids, ['code', 'name'], context) return [(r['code'], r['name']) for r in res] + [('','')] | 487c36486ca1f5a47369933920e0ceeaff82ac29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/487c36486ca1f5a47369933920e0ceeaff82ac29/partner.py |
help="Check this box if you want to print all entries when printing the General Ledger, "\ "otherwise it will only print its balance."), | def _get_level(self, cr, uid, ids, field_name, arg, context={}): res={} accounts = self.browse(cr, uid, ids) for account in accounts: level = 0 if account.parent_id : obj = self.browse(cr, uid, account.parent_id.id) level = obj.level + 1 res[account.id] = level return res | ca13e53e506133164be6f12f46785a6fb44e3920 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca13e53e506133164be6f12f46785a6fb44e3920/account.py | |
raise except_orm(_('Error'), _("You can not remove the field '%s' !") %(field.name,)) | raise except_orm(_('Error'), _("You cannot remove the field '%s' !") %(field.name,)) | def unlink(self, cr, user, ids, context=None): for field in self.browse(cr, user, ids, context): if field.state <> 'manual': raise except_orm(_('Error'), _("You can not remove the field '%s' !") %(field.name,)) # # MAY BE ADD A ALTER TABLE DROP ? # return super(ir_model_fields, self).unlink(cr, user, ids, context) | abc44a50cbffdab7372e598f4a2f1fcf71b5e4f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/abc44a50cbffdab7372e598f4a2f1fcf71b5e4f1/ir_model.py |
'name': reg.invoice_label + '-' + reg.name, | 'name': reg.invoice_label + '-' + c_name, | def _makeInvoices(self, cr, uid, context={}): invoices = {} invoice_ids = [] create_ids=[] tax_ids=[] inv_create = 0 inv_reject = 0 inv_rej_reason = "" list_inv = [] obj_event_reg = self.pool.get('event.registration') obj_lines = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') data_even... | 3a1c5f23a48563fde0caf761db91b27c4c7d222b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a1c5f23a48563fde0caf761db91b27c4c7d222b/event_make_invoice.py |
acc_id = obj_task.project_id.analytic_account_id.id vals_line['account_id'] = acc_id res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id) if res.get('value'): vals_line.update(res['value']) vals_line['general_account_id'] = result['general_account_id'] vals_line['journal_id'] = result['journal_id'] vals_lin... | acc_id = obj_task.project_id and obj_task.project_id.analytic_account_id.id or False if acc_id: vals_line['account_id'] = acc_id res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id) if res.get('value'): vals_line.update(res['value']) vals_line['general_account_id'] = result['general_account_id'] vals_line['... | def create(self, cr, uid, vals, *args, **kwargs): obj_timesheet = self.pool.get('hr.analytic.timesheet') project_obj = self.pool.get('project.project') task_obj = self.pool.get('project.task') uom_obj = self.pool.get('product.uom') vals_line = {} context = kwargs.get('context', {}) #TOFIX: after loading project_timesh... | 467edb6094f68da432d982a5660ff190c4e43538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/467edb6094f68da432d982a5660ff190c4e43538/project_timesheet.py |
WHERE (period_id = %s) AND (warehouse_id = %s)", (f.period_id2.id, f.warehouse_id2.id)) | WHERE (period_id = %s) AND (warehouse_id = %s)", (f.period_id.id, f.warehouse_id.id)) | def create_planning(self,cr, uid, ids, context=None): if context is None: context = {} product_obj = self.pool.get('product.product') planning_obj = self.pool.get('stock.planning') mod_obj = self.pool.get('ir.model.data') prod_categ_obj = self.pool.get('product.category') template_obj = self.pool.get('product.template'... | ee06bf43d117c2cb365f4af7d9e63b7c8696a094 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee06bf43d117c2cb365f4af7d9e63b7c8696a094/stock_planning_createlines.py |
def _amount_all(self, cr, uid, ids, field_name, arg, context): | def _amount_all(self, cr, uid, ids, field_name, arg, context=None): | def _amount_all(self, cr, uid, ids, field_name, arg, context): res = {} cur_obj=self.pool.get('res.currency') for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_untaxed': 0.0, 'amount_tax': 0.0, 'amount_total': 0.0, } val = val1 = 0.0 cur=order.pricelist_id.currency_id for line in order.order_line: for c... | 18d91e942da0a835a4d6b528115c091175aaaaaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18d91e942da0a835a4d6b528115c091175aaaaaa/purchase.py |
} | } | def _amount_all(self, cr, uid, ids, field_name, arg, context): res = {} cur_obj=self.pool.get('res.currency') for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_untaxed': 0.0, 'amount_tax': 0.0, 'amount_total': 0.0, } val = val1 = 0.0 cur=order.pricelist_id.currency_id for line in order.order_line: for c... | 18d91e942da0a835a4d6b528115c091175aaaaaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18d91e942da0a835a4d6b528115c091175aaaaaa/purchase.py |
cur=order.pricelist_id.currency_id | cur = order.pricelist_id.currency_id | def _amount_all(self, cr, uid, ids, field_name, arg, context): res = {} cur_obj=self.pool.get('res.currency') for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_untaxed': 0.0, 'amount_tax': 0.0, 'amount_total': 0.0, } val = val1 = 0.0 cur=order.pricelist_id.currency_id for line in order.order_line: for c... | 18d91e942da0a835a4d6b528115c091175aaaaaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18d91e942da0a835a4d6b528115c091175aaaaaa/purchase.py |
val+= c['amount'] val1 += line.price_subtotal | val += c['amount'] | def _amount_all(self, cr, uid, ids, field_name, arg, context): res = {} cur_obj=self.pool.get('res.currency') for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_untaxed': 0.0, 'amount_tax': 0.0, 'amount_total': 0.0, } val = val1 = 0.0 cur=order.pricelist_id.currency_id for line in order.order_line: for c... | 18d91e942da0a835a4d6b528115c091175aaaaaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18d91e942da0a835a4d6b528115c091175aaaaaa/purchase.py |
refs = msg.get('references') references = refs.split() | refs = msg.get('references',False) references = False if refs: references = refs.split() | def search_message(self, cr, uid, message, context=None): #@param message: string of mail which is read from EML File #@return model,res_id references = [] dictcreate = dict(message) msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) message_id = msg.get('message-id') refs = m... | c1b6bb712dbb5a9e60f1d928f22a7b797b098a48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c1b6bb712dbb5a9e60f1d928f22a7b797b098a48/partner.py |
msg = msg_pool.browse(cr, uid, msg_ids[0]) model = msg.model res_id = msg.res_id | if msg_ids and len(msg_ids): msg = msg_pool.browse(cr, uid, msg_ids[0]) model = msg.model res_id = msg.res_id | def search_message(self, cr, uid, message, context=None): #@param message: string of mail which is read from EML File #@return model,res_id references = [] dictcreate = dict(message) msg = dictcreate.get('message') msg = self.pool.get('email.server.tools').parse_message(msg) message_id = msg.get('message-id') refs = m... | c1b6bb712dbb5a9e60f1d928f22a7b797b098a48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c1b6bb712dbb5a9e60f1d928f22a7b797b098a48/partner.py |
CASE WHEN l.amount > 0 THEN l.amount ELSE 0.0 END ) as debit, sum( CASE WHEN l.amount < 0 THEN -l.amount ELSE 0.0 END ) as credit, | CASE WHEN l.amount > 0 THEN l.amount ELSE 0.0 END ) as debit, sum( CASE WHEN l.amount < 0 THEN -l.amount ELSE 0.0 END ) as credit, | def _debit_credit_bal_qtty(self, cr, uid, ids, name, arg, context=None): res = {} if context is None: context = {} child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) for i in child_ids: res[i] = {} for n in name: res[i][n] = 0.0 | 5a377aaa6fb102d846891b9e87e14ac4ba687b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5a377aaa6fb102d846891b9e87e14ac4ba687b52/analytic.py |
bname,ext = os.path.splitext(filename) | try: bname,ext = os.path.splitext(filename or 'test.tmp') except Exception: bname, ext = filename, 'tmp' | def doIndex(self, content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fob... | 6d64f88d5536ae14026556729433ea27b5eece61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6d64f88d5536ae14026556729433ea27b5eece61/content_index.py |
can_compute = True for child in current.child_id: if child.id not in sums: can_compute = False try: brs.insert(0, brs.pop(brs.index(child))) except ValueError: brs.insert(0, child) if can_compute: brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) if curren... | brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) if current.child_id: sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id) | def __compute(self, cr, uid, ids, field_names, arg=None, context=None, query='', query_params=()): """ compute the balance, debit and/or credit for the provided account ids Arguments: `ids`: account ids `field_names`: the fields to compute (a list of any of 'balance', 'debit' and 'credit') `arg`: unused fields.function... | 0846b6491e09f04b63f730f270a0f5d207f3b3b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0846b6491e09f04b63f730f270a0f5d207f3b3b1/account.py |
"sale_tax": fields.many2one("account.tax.template", "Sale Tax"), "purchase_tax": fields.many2one("account.tax.template", "Purchase Tax"), | "sale_tax": fields.many2one("account.tax.template", "Default Sale Tax"), "purchase_tax": fields.many2one("account.tax.template", "Default Purchase Tax"), | def _default_company(self, cr, uid, context={}): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] | 199387f4c6ac4b8f45974104acb7984471964ccc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/199387f4c6ac4b8f45974104acb7984471964ccc/account.py |
ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" , "=", chart_template_id)], order="sequence") if len(ids) > 0: id=ids[0] res['value']["sale_tax"] = id res['value']["purchase_tax"] = id | sale_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence") purchase_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" , "=", chart_template_id), ('type_tax_use', 'in'... | def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): res = {} res['value'] = {} res['value']["sale_tax"] = False res['value']["purchase_tax"] = False if chart_template_id: ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" , "=", chart_template_id)], ... | 199387f4c6ac4b8f45974104acb7984471964ccc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/199387f4c6ac4b8f45974104acb7984471964ccc/account.py |
return sequence + str(self.checksum(sequence)) | try: return sequence + str(self.checksum(sequence)) except Exception, e: return sequence | def make_sscc(self, cr, uid, context=None): sequence = self.pool.get('ir.sequence').get(cr, uid, 'stock.lot.tracking') return sequence + str(self.checksum(sequence)) | 89c06b09feff4e0b779370a03925fec729a11b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89c06b09feff4e0b779370a03925fec729a11b32/stock.py |
method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed. Will be set to date of actual processing if not specified."), | method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"), | 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) new_id = super(stock_picking, self).create(cr, user, vals, context) return new_id | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
users_obj = self.pool.get('res.users') | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py | |
prodlot_id = partial_data.get('prodlot_id',False) | prodlot_id = partial_data.get('prodlot_id') prodlot_ids[move.id] = prodlot_id | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py | ||
user = users_obj.browse(cr, uid, uid) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py | |
pricetype ='standard_price' if pricetype and qty > 0: | if qty > 0: | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
amount_unit = product.price_get(pricetype, context)[product.id] | amount_unit = product.price_get('standard_price', context)[product.id] | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
product_obj.write(cr, uid, [product.id], {pricetype.field: new_std_price}) | product_obj.write(cr, uid, [product.id], {'standard_price': new_std_price}) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is ... | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.