rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
if os.path.exists(f): | if f: | def update_translations(self, cr, uid, ids, filter_lang=None, context={}): logger = logging.getLogger('i18n') if not filter_lang: pool = pooler.get_pool(cr.dbname) lang_obj = pool.get('res.lang') lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)]) filter_lang = [lang.code for lang in lang_obj.browse(cr, ... | e037e96f6db49f670a99ddd2c76a2516923d018c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e037e96f6db49f670a99ddd2c76a2516923d018c/module.py |
c.priority,c.type_action,c.date_deadline,c.date_closed | c.priority,c.type_action,c.date_deadline,c.date_closed,c.id | def init(self, cr): | b4e84192bb541f0d5a652fdb5c2650c60c50ca3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e84192bb541f0d5a652fdb5c2650c60c50ca3a/crm_claim_report.py |
categ_ids = categ_obj.search(cr, uid, [('name','ilike','Part%')]) | categ_ids = categ_obj.search(cr, uid, [('object_id.model','=','crm.lead')]) | def make_opportunity(self, cr, uid, ids, context): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ | 07a3bdfce2dbd4f80a2a236e0b72ed8159572b53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/07a3bdfce2dbd4f80a2a236e0b72ed8159572b53/crm_partner_to_opportunity.py |
'categ_id' : categ_ids[0], | 'categ_id' : categ_ids and categ_ids[0] or '', | def make_opportunity(self, cr, uid, ids, context): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ | 07a3bdfce2dbd4f80a2a236e0b72ed8159572b53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/07a3bdfce2dbd4f80a2a236e0b72ed8159572b53/crm_partner_to_opportunity.py |
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) tax_obj = self.pool.get('account.t... | 1d2295bbed2123449dc42500702eb2d64cde05a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d2295bbed2123449dc42500702eb2d64cde05a9/invoice.py | ||
tax_ids = tax_obj.search(cr, uid, [('company_id', '=', company_id)]) | def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) tax_obj = self.pool.get('account.t... | 1d2295bbed2123449dc42500702eb2d64cde05a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d2295bbed2123449dc42500702eb2d64cde05a9/invoice.py | |
sale_taxes_def = map(lambda x: x.id, res.taxes_id) sale_tax_ids = [tax for tax in tax_ids if tax in sale_taxes_def] sale_taxes = tax_obj.browse(cr, uid, sale_tax_ids) sale_taxes_all = sale_taxes and sale_taxes or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id = fpos_obj.map_tax(cr, ... | taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) | sale_taxes_def = map(lambda x: x.id, res.taxes_id) | 1d2295bbed2123449dc42500702eb2d64cde05a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d2295bbed2123449dc42500702eb2d64cde05a9/invoice.py |
pur_taxes_def = map(lambda x: x.id, res.supplier_taxes_id) pur_tax_ids = [tax for tax in tax_ids if tax in pur_taxes_def] pur_taxes = tax_obj.browse(cr, uid, pur_tax_ids) pur_taxes_all = pur_taxes and pur_taxes or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id = fpos_obj.map_tax(cr,... | taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) | pur_taxes_def = map(lambda x: x.id, res.supplier_taxes_id) | 1d2295bbed2123449dc42500702eb2d64cde05a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d2295bbed2123449dc42500702eb2d64cde05a9/invoice.py |
pur_taxes_def = map(lambda x: x.id, res.supplier_taxes_id) | 1d2295bbed2123449dc42500702eb2d64cde05a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d2295bbed2123449dc42500702eb2d64cde05a9/invoice.py | ||
result = False | def login(self, db, login, password): if not password: return False cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where login=%s and password=%s and active', (tools.ustr(login), tools.ustr(password))) res = cr.fetchone() | 31680ea2589481693e348636b572841de95bd871 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/31680ea2589481693e348636b572841de95bd871/res_user.py | |
return res[0] else: return False | result = res[0] | def login(self, db, login, password): if not password: return False cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where login=%s and password=%s and active', (tools.ustr(login), tools.ustr(password))) res = cr.fetchone() | 31680ea2589481693e348636b572841de95bd871 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/31680ea2589481693e348636b572841de95bd871/res_user.py |
sum(l.product_qty*l.price_unit) as price_total, | l.price_unit*l.product_qty*u.factor as price_total, | 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, to_char(s.date_order, 'YYYY-MM-DD') as day, s.state, s.date_appro... | c63d4327a72cc5c9b0da3e75d2ab1c1ae35d4fd2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c63d4327a72cc5c9b0da3e75d2ab1c1ae35d4fd2/purchase_report.py |
'type': fields.selection([('product','Stockable Product'),('rima','Rima'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way requisitions are processed. Consumables are stockable products with infinite stock, or for use when you have no inventory management in the s... | 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way requisitions are processed. Consumables are stockable products with infinite stock, or for use when you have no inventory management in the system."), | def _calc_seller_delay(self, cr, uid, ids, name, arg, context={}): result = {} for product in self.browse(cr, uid, ids, context): if product.seller_ids: result[product.id] = product.seller_ids[0].delay else: result[product.id] = 1 return result | 8d466990b0de0e5d5f1c220934883cf41df0c842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8d466990b0de0e5d5f1c220934883cf41df0c842/product.py |
new_id = cashmove_ref.createcr, uid, {'name': order.product.name+' order', | new_id = cashmove_ref.create(cr, uid, {'name': order.product.name+' order', | def confirm(self,cr,uid,ids,box,context): | 764b7685a1c77b67b6de3ad6af78b16de3a619ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/764b7685a1c77b67b6de3ad6af78b16de3a619ea/lunch.py |
} | }) | def confirm(self,cr,uid,ids,box,context): | 764b7685a1c77b67b6de3ad6af78b16de3a619ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/764b7685a1c77b67b6de3ad6af78b16de3a619ea/lunch.py |
self.pool.get('lunch.cashmove').unlink(cr, uid, [order.cashmove.id]) | if order.cashmove.id: self.pool.get('lunch.cashmove').unlink(cr, uid, [order.cashmove.id]) | def lunch_order_cancel(self, cr, uid, ids, context): | 764b7685a1c77b67b6de3ad6af78b16de3a619ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/764b7685a1c77b67b6de3ad6af78b16de3a619ea/lunch.py |
self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) | self.action_assign(cr, uid, [move.move_dest_id.id]) | def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ partial_datas='' picking_ids = [] move_ids = [] partial_obj=self.pool.get('stock.partial.picking') wf_service = netsvc.LocalService("workflow") partial_id=partial_obj.search(cr,... | 953a15d2a7391370414462402198780b06d45243 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/953a15d2a7391370414462402198780b06d45243/stock.py |
for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_lead where \ section_id =%s and state='%s'"%(case.section_id.id, state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr)) * 100 res[case.id] = perc_sta... | def _get_data(self, cr, uid, ids, field_name, arg, context={}): | 301349a23b39b38ba5ecd6d962bc0228b140ff4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/301349a23b39b38ba5ecd6d962bc0228b140ff4b/hr_recruitment_report.py | |
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), 'day': fields.char('Day', size=128, readonly=True), | def _get_data(self, cr, uid, ids, field_name, arg, context={}): | 301349a23b39b38ba5ecd6d962bc0228b140ff4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/301349a23b39b38ba5ecd6d962bc0228b140ff4b/hr_recruitment_report.py | |
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"), | 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('object_id.model', '=', 'hr.applicant')]"), | def _get_data(self, cr, uid, ids, field_name, arg, context={}): | 301349a23b39b38ba5ecd6d962bc0228b140ff4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/301349a23b39b38ba5ecd6d962bc0228b140ff4b/hr_recruitment_report.py |
taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity) | taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, address_id=line.invoice_id.address_invoice_id, partner=line.invoice_id.partner_id) | def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = {} tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') for line in self.browse(cr, uid, ids): price = line.price_unit * (1-(line.discount or 0.0)/100.0) taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, p... | bdc73535d94c5382c860477b0a0fd5c653c6b7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdc73535d94c5382c860477b0a0fd5c653c6b7c3/invoice.py |
'project_id': procurement.project_id and procurement.project_id.id or False, | 'project_id': procurement.product_id.project_id and procurement.product_id.project_id.id or False, | def action_produce_assign_service(self, cr, uid, ids, context=None): if context is None: context = {} for procurement in self.browse(cr, uid, ids): self.write(cr, uid, [procurement.id], {'state': 'running'}) planned_hours = procurement.product_qty task_id = self.pool.get('project.task').create(cr, uid, { 'name': '%s:%s... | 1a4bad6acce9a9660034a460ede5b3bf4398827c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a4bad6acce9a9660034a460ede5b3bf4398827c/project_procurement.py |
res['fiscalyear'] = data['form']['fiscalyear_id'] | res['fiscalyear'] = data['form'].get('fiscalyear_id', False) | def set_context(self, objects, data, ids, report_type=None): new_ids = ids res = {} self.period_ids = [] period_obj = self.pool.get('account.period') res['periods'] = '' res['fiscalyear'] = data['form']['fiscalyear_id'] | 19f63661b2e1a9caba96a1620bd15760e590608e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/19f63661b2e1a9caba96a1620bd15760e590608e/account_tax_report.py |
qu1 = ' where ' qu1 += ' and '.join(qu1) | qu1 = ' where ' + ' and '.join(qu1) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain | b29d4306c030b240e5f25df3b758e00dafdabe26 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b29d4306c030b240e5f25df3b758e00dafdabe26/orm.py |
elif arg[0] == 'name': | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): job_ids = [] for arg in args: if arg[0] == 'address_id': self._order = 'sequence_partner' elif arg[0] == 'contact_id': self._order = 'sequence_contact' elif arg[0] == 'name': contact_obj = self.pool.get('res.partner.contact')... | c7b588ec599e824e7809e5290b34e3236d9bc60d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7b588ec599e824e7809e5290b34e3236d9bc60d/base_contact.py | |
cr.execute('SELECT emp.department_id FROM hr_employee AS emp JOIN resource_resource AS res ON res.id = emp.resource_id \ WHERE res.user_id = %s AND emp.department_id IS NOT NULL', (user_id,)) | cr.execute('SELECT emp.department_id FROM hr_employee AS emp \ JOIN resource_resource AS res ON res.id = emp.resource_id \ JOIN hr_department as dept ON dept.id = emp.department_id \ WHERE res.user_id = %s AND emp.department_id IS NOT NULL AND dept.manager_id IS NOT NULL', (user_id,)) | def _parent_compute(self, cr, uid, ids, name, args, context=None): if context is None: context = {} result = {} obj_dept = self.pool.get('hr.department') for user_id in ids: emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', user_id)]) cr.execute('SELECT emp.department_id FROM hr_employee AS emp J... | cf50bdfc74fafcc06f2ea2cd9c160601f8750897 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf50bdfc74fafcc06f2ea2cd9c160601f8750897/hr_department.py |
'incoterm': fields.selection(_incoterm_get, 'Incoterm', size=3, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction"), | 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction"), | def _get_order(self, cr, uid, ids, context=None): if context is None: context = {} result = {} for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True return result.keys() | 380f403d0e88553024b2a0665b28cd8b4fe2f489 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/380f403d0e88553024b2a0665b28cd8b4fe2f489/sale.py |
v = view_obj.browse(cr,uid,data_id.res_id) aa = v.inherit_id and '* INHERIT ' or '' res[mnames[data_id.module]]['views_by_module'] += aa + v.name + ' ('+v.type+')\n' | try: v = view_obj.browse(cr,uid,data_id.res_id) aa = v.inherit_id and '* INHERIT ' or '' res[mnames[data_id.module]]['views_by_module'] += aa + v.name + ' ('+v.type+')\n' except: pass | def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): res = {} model_data_obj = self.pool.get('ir.model.data') view_obj = self.pool.get('ir.ui.view') report_obj = self.pool.get('ir.actions.report.xml') menu_obj = self.pool.get('ir.ui.menu') mlist = self.browse(cr, uid, ids, context=context) mnames ... | 3777b403b5e30163c82ce114e0b2d7f2e3dded3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3777b403b5e30163c82ce114e0b2d7f2e3dded3b/module.py |
interface.register_all(db) | self.pool.get('ir.actions.report.xml').register_all(cr = db.cursor()) | def upload_report(self, cr, uid, report_id, file_sxw, file_type, context): ''' Untested function ''' pool = pooler.get_pool(cr.dbname) sxwval = StringIO(base64.decodestring(file_sxw)) if file_type=='sxw': fp = open(addons.get_module_resource('base_report_designer','openerp_sxw2rml', 'normalized_oo2rml.xsl'),'rb') if fi... | 548e60b23f82ab6a69690b082b38efc752033284 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/548e60b23f82ab6a69690b082b38efc752033284/base_report_designer.py |
hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) | if uparts[0] and uparts[1]: hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) else: hurl = '%s%s' % (davpath, urllib.quote(fileloc)) | def _prop_elem_child(pnode, pns, v, pns_prefix): | b275fc4601263e58def6d8ff29088e18a6a6b09d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b275fc4601263e58def6d8ff29088e18a6a6b09d/webdav.py |
hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) | if uparts[0] and uparts[1]: hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) else: hurl = '%s%s' % (davpath, urllib.quote(fileloc)) | def mk_propname_response(self,uri,propnames,doc): """ make a new <prop> result element for a PROPNAME request This will simply format the propnames list. propnames should have the format {NS1 : [prop1, prop2, ...], NS2: ...} """ re=doc.createElement("D:response") # write href information uparts=urlparse.urlparse(uri... | b275fc4601263e58def6d8ff29088e18a6a6b09d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b275fc4601263e58def6d8ff29088e18a6a6b09d/webdav.py |
res[voucher.id] = abs(voucher.amount - abs(credit - debit)) | res[voucher.id] = abs(voucher.amount - abs(credit - debit)) | def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} res = {} debit = credit = 0.0 for voucher in self.browse(cr, uid, ids, context=context): for l in voucher.line_dr_ids: debit += l.amount for l in voucher.line_cr_ids: credit += l.amount res[voucher.id] = abs(voucher.amount - ... | b78aba3d9c3c2b373b7e58d62e64d76a6ae35325 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b78aba3d9c3c2b373b7e58d62e64d76a6ae35325/account_voucher.py |
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount) | amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount) | 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 | b78aba3d9c3c2b373b7e58d62e64d76a6ae35325 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b78aba3d9c3c2b373b7e58d62e64d76a6ae35325/account_voucher.py |
def _construct_constraint_msg(self, cr, uid, ids): | def _construct_constraint_msg(self, cr, uid, ids, context=None): | def _construct_constraint_msg(self, cr, uid, ids): def default_vat_check(cn, vn): # by default, a VAT number is valid if: # it starts with 2 letters # has more than 3 characters return cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase vat_country, vat_number = self._split_vat(self.browse(cr, uid, id... | 3f84e8778c4189c1b352a6443e447b12e9bf2fbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f84e8778c4189c1b352a6443e447b12e9bf2fbb/base_vat.py |
if move.analytic_account_id: anal_val = {} amt = (val['credit'] or 0.0) - (val['debit'] or 0.0) anal_val = { 'name': val['name'], 'ref': val['ref'], 'date': val['date'], 'amount': amt, 'account_id': val['analytic_account_id'], 'currency_id': val['currency_id'], 'general_account_id': val['account_id'], 'journal_id': st... | def button_confirm_cash(self, cr, uid, ids, context={}): | fbccb0d6d521d233caf19e956553f7dcda1f42ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fbccb0d6d521d233caf19e956553f7dcda1f42ff/account_cash_statement.py | |
sources.append((get_win32_tz(),"Windows Registry")) | sources.append((get_win32_timezone(),"Windows Registry")) | def detect_server_timezone(): """Attempt to detect the timezone to use on the server side. Defaults to UTC if no working timezone can be found. @return: the timezone identifier as expected by pytz.timezone. """ import time import netsvc try: import pytz except: netsvc.Logger().notifyChannel("detect_server_timezone", ne... | ccf51984ba651df3af5aca0aed1d2c859888afcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ccf51984ba651df3af5aca0aed1d2c859888afcc/misc.py |
if not turi.startswith('/'): uparts=urlparse.urlparse(turi) turi=uparts[2] | def get_childs(self, uri, filters=None): """ return the child objects as self.baseuris for the given URI """ self.parent.log_message('get childs: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) | 5dcc42aa37fe6d883d05c56aca6ccd872771e57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5dcc42aa37fe6d883d05c56aca6ccd872771e57d/dav_fs.py | |
self.parent.log_error("ignore href %s because it is not under request path", turi) | self.parent.log_error("ignore href %s because it is not under request path %s", turi, ul) | def get_childs(self, uri, filters=None): """ return the child objects as self.baseuris for the given URI """ self.parent.log_message('get childs: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) | 5dcc42aa37fe6d883d05c56aca6ccd872771e57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5dcc42aa37fe6d883d05c56aca6ccd872771e57d/dav_fs.py |
elif ext == '.yaml': | elif ext == '.yml': | def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status = {} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) migrations = MigrationManager(cr, graph) has_updates = False modobj = Non... | b8b60d44363c0062e0588178dc02d641baacb5e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b8b60d44363c0062e0588178dc02d641baacb5e3/__init__.py |
fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) period_query_cond=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear'])]) | fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear_id']) period_ids=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear_id'])]) | def _load(self, name, form): fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) period_query_cond=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear'])]) | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
self.cr.execute("SELECT MIN(date_start) AS date_start, MAX(date_stop) AS date_stop FROM account_period WHERE id IN %s", (tuple(period_query_cond),)) dates = self.cr.dictfetchall() self._set_variable('date_start', dates[0]['date_start']) self._set_variable('date_stop', dates[0]['date_stop']) | if period_ids: self.cr.execute("SELECT MIN(date_start) AS date_start, MAX(date_stop) AS date_stop FROM account_period WHERE id = ANY(%s)", (period_ids,)) dates = self.cr.dictfetchall() else: dates = False if dates: self._set_variable('date_start', dates[0]['date_start']) self._set_variable('date_stop', dates[0]['date_s... | def _load(self, name, form): fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) period_query_cond=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear'])]) | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
self._load_accounts(form,line['code'],eval(line['definition']),fiscalyear,period_query_cond) | self._load_accounts(form,line['code'],eval(line['definition']),fiscalyear,period_ids) | def _load(self, name, form): fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) period_query_cond=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear'])]) | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): | def _load_accounts(self, form, code, definition, fiscalyear, period_ids): | def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): query_cond = "(" for account in accounts: query_cond += "aa.code LIKE '" + accou... | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
query_cond += "aa.code LIKE '" + account + "%' OR " | query_cond += "aa.code LIKE '" + account + "%%' OR " | def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): query_cond = "(" for account in accounts: query_cond += "aa.code LIKE '" + accou... | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
query_cond += "aa.code NOT LIKE '"+account+"%' AND " | query_cond += "aa.code NOT LIKE '"+account+"%%' AND " | def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): query_cond = "(" for account in accounts: query_cond += "aa.code LIKE '" + accou... | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
closed_cond=" AND (aml.move_id NOT IN (SELECT account_move.id as move_id FROM account_move WHERE period_id IN "+str(tuple(period_query_cond))+" AND journal_id=(SELECT res_id FROM ir_model_data WHERE name='closing_journal' AND module='l10n_fr')) OR (aa.type != 'income' AND aa.type !='expense'))" | closed_cond=" AND (aml.move_id NOT IN (SELECT account_move.id as move_id FROM account_move WHERE period_id = ANY(%s) AND journal_id=(SELECT res_id FROM ir_model_data WHERE name='closing_journal' AND module='l10n_fr')) OR (aa.type != 'income' AND aa.type !='expense'))" query_params.append(list(period_ids)) | def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): query_cond = "(" for account in accounts: query_cond += "aa.code LIKE '" + accou... | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
query = "SELECT aa.code AS code, SUM(debit) as debit, SUM(credit) as credit FROM account_move_line aml LEFT JOIN account_account aa ON aa.id=aml.account_id WHERE "+query_cond+closed_cond+" AND aml.state='valid' AND aml.period_id IN "+str(tuple(period_query_cond))+" GROUP BY code" self.cr.execute(query) | query = "SELECT aa.code AS code, SUM(debit) as debit, SUM(credit) as credit " \ " FROM account_move_line aml LEFT JOIN account_account aa ON aa.id=aml.account_id "\ " WHERE "+query_cond+closed_cond+" AND aml.state='valid' AND aml.period_id = ANY(%s) GROUP BY code" query_params.append(list(period_ids)) self.cr.execute(q... | def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): query_cond = "(" for account in accounts: query_cond += "aa.code LIKE '" + accou... | 5bebd204b83275adc470cfe0c2a616ca7b2f64fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bebd204b83275adc470cfe0c2a616ca7b2f64fd/base_report.py |
def key(oid): return "%s,%s" % (self._name, oid) santa = "(id = %s AND %s < COALESCE(write_date, create_date, now())::timestamp)" for i in range(0, len(ids), cr.IN_MAX): sub_ids = tools.flatten(((oid, context[self.CONCURRENCY_CHECK_FIELD][key(oid)]) for oid in ids[i:i+cr.IN_MAX] if key(oid) in context[self.CONCURRENCY_... | check_clause = "(id = %s AND %s < COALESCE(write_date, create_date, now())::timestamp)" for sub_ids in cr.split_for_in_conditions(ids): ids_to_check = [] for id in sub_ids: id_ref = "%s,%s" % (self._name, id) update_date = context[self.CONCURRENCY_CHECK_FIELD].pop(id_ref, None) if update_date: ids_to_check.extend([id, ... | def key(oid): return "%s,%s" % (self._name, oid) | 0d2c8796b4aabd97ec8ab1376e27813630a8b324 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d2c8796b4aabd97ec8ab1376e27813630a8b324/orm.py |
cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) | self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]}) | def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ partial_datas='' picking_ids = [] partial_obj=self.pool.get('stock.partial.picking') partial_id=partial_obj.search(cr,uid,[]) if partial_id: partial_datas=partial_obj.read(cr,ui... | 516dc572c4e8daaa51ff9fd0cf59018683f83079 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/516dc572c4e8daaa51ff9fd0cf59018683f83079/stock.py |
'domain': fields.char('Domain Value', size=250), 'context': fields.char('Context Value', size=250), 'res_model': fields.char('Object', size=64), 'src_model': fields.char('Source Object', size=64), | 'domain': fields.char('Domain Value', size=250, help="Optional domain filtering of the destination data, as a Python expression"), 'context': fields.char('Context Value', size=250, required=True, help="Context dictionary as Python expression, empty by default (Default: {})"), 'res_model': fields.char('Object', size=64,... | def process_child(node, new_node, doc): for child in node.childNodes: if child.localName=='field' and child.hasAttribute('select') and child.getAttribute('select')=='1': if child.childNodes: fld = doc.createElement('field') for attr in child.attributes.keys(): fld.setAttribute(attr, child.getAttribute(attr)) new_node.a... | 5b6fa2e4ac9e62c03b557068d414e55766a5ae38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6fa2e4ac9e62c03b557068d414e55766a5ae38/ir_actions.py |
'view_type': fields.selection((('tree','Tree'),('form','Form')),string='View Type'), 'view_mode': fields.char('View Mode', size=250), | 'view_type': fields.selection((('tree','Tree'),('form','Form')), string='View Type', required=True, help="View type: set to 'tree' for a hierarchical tree view, or 'form' for other views"), 'view_mode': fields.char('View Mode', size=250, required=True, help="Comma-separated list of allowed view modes, such as 'form', '... | def process_child(node, new_node, doc): for child in node.childNodes: if child.localName=='field' and child.hasAttribute('select') and child.getAttribute('select')=='1': if child.childNodes: fld = doc.createElement('field') for attr in child.attributes.keys(): fld.setAttribute(attr, child.getAttribute(attr)) new_node.a... | 5b6fa2e4ac9e62c03b557068d414e55766a5ae38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6fa2e4ac9e62c03b557068d414e55766a5ae38/ir_actions.py |
'help': fields.text('Action description') | 'help': fields.text('Action description', help='Optional help text for the users with a description of the target view, such as its usage and purpose.') | def process_child(node, new_node, doc): for child in node.childNodes: if child.localName=='field' and child.hasAttribute('select') and child.getAttribute('select')=='1': if child.childNodes: fld = doc.createElement('field') for attr in child.attributes.keys(): fld.setAttribute(attr, child.getAttribute(attr)) new_node.a... | 5b6fa2e4ac9e62c03b557068d414e55766a5ae38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6fa2e4ac9e62c03b557068d414e55766a5ae38/ir_actions.py |
return self.model_id_get(cr, model, id_str)[1] | res = self.model_id_get(cr, model, id_str) if res and len(res)>1: res = res[1] return res | def id_get(self, cr, model, id_str): if id_str in self.idref: return self.idref[id_str] return self.model_id_get(cr, model, id_str)[1] | cf86268416b193b755dcb63f3e07c130e0e1bf9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf86268416b193b755dcb63f3e07c130e0e1bf9c/convert.py |
ids = self.search(cr, user, [('code', '=', name)] + args, limit=limit, | ids = self.search(cr, user, [('code', 'ilike', name)] + args, limit=limit, | def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: context = {} ids = self.search(cr, user, [('code', '=', name)] + args, limit=limit, context=context) if not ids: ids = self.search(cr, user, [('name', operator, name)] + args, limit=lim... | e6768813860a3a62dcc44c1f66bebf698cd7c4fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e6768813860a3a62dcc44c1f66bebf698cd7c4fd/country.py |
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)'), 'category_holiday_id': fields.many2one('hr.holidays', 'Holiday', help='For allocation By Employee Category... | 'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)') | def _employee_get(obj, cr, uid, context=None): ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context) if ids: return ids[0] return False | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py |
def _get_category_leave_ids(self, cr, uid, ids): """Returns the leaves taken by the employees of the category if holiday type is 'category'.""" leave_ids = [] for record in self.browse(cr, uid, ids): if record.holiday_type == 'category' and record.type == 'remove': leave_ids += self.search(cr, uid, [('category_holiday... | def _employee_get(obj, cr, uid, context=None): ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context) if ids: return ids[0] return False | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
ids += self._get_category_leave_ids(cr, uid, ids) | def unlink(self, cr, uid, ids, context=None): self._update_user_holidays(cr, uid, ids) ids += self._get_category_leave_ids(cr, uid, ids) self._remove_resouce_leave(cr, uid, ids, context=context) return super(hr_holidays, self).unlink(cr, uid, ids, context) | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
elif record.holiday_type == 'category' and record.type == 'remove': | elif record.holiday_type == 'category': | def holidays_validate(self, cr, uid, ids, *args): obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) vals = {'state':'validate'} ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)]) if ids2: if data_holiday[0]... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py |
'name': record.name, 'date_from': record.date_from, 'date_to': record.date_to, 'calendar_id': emp.calendar_id.id, 'company_id': emp.company_id.id, 'resource_id': emp.resource_id.id, 'holiday_id':record.id } for leave_id in self.search(cr, uid, [('category_holiday_id', '=', record.id)]): wf_service.trg_validate(uid, '... | 'name': record.name, 'type': record.type, 'holiday_type': 'employee', 'holiday_status_id': record.holiday_status_id.id, 'date_from': record.date_from, 'date_to': record.date_to, 'notes': record.notes, 'number_of_days_temp': record.number_of_days_temp, 'parent_id': record.id, 'employee_id': emp.id } leave_ids.append(sel... | def holidays_validate(self, cr, uid, ids, *args): obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) vals = {'state':'validate'} ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)]) if ids2: if data_holiday[0]... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py |
obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") | def holidays_confirm(self, cr, uid, ids, *args): obj_hr_holiday_status = self.pool.get('hr.holidays.status') obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") for record in self.browse(cr, uid, ids): user_id = False leave_asked = record.number_of_days_temp leave_ids = [] if record.holi... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
leave_ids = [] | def holidays_confirm(self, cr, uid, ids, *args): obj_hr_holiday_status = self.pool.get('hr.holidays.status') obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") for record in self.browse(cr, uid, ids): user_id = False leave_asked = record.number_of_days_temp leave_ids = [] if record.holi... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)]) for emp in obj_emp.browse(cr, uid, emp_ids): vals = { 'name': record.name, 'holiday_status_id': record.holiday_status_id.id, 'date_from': record.date_from, 'date_to': record.date_to, 'notes': record.notes, 'number_of_days_temp': record.n... | def holidays_confirm(self, cr, uid, ids, *args): obj_hr_holiday_status = self.pool.get('hr.holidays.status') obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") for record in self.browse(cr, uid, ids): user_id = False leave_asked = record.number_of_days_temp leave_ids = [] if record.holi... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
self.write(cr, uid, ids, {'state': 'cancel'}) leave_ids = self._get_category_leave_ids(cr, uid, ids) if leave_ids: self.unlink(cr, uid, leave_ids) | def holidays_cancel(self, cr, uid, ids, *args): self._update_user_holidays(cr, uid, ids) self._remove_resouce_leave(cr, uid, ids) self.write(cr, uid, ids, {'state': 'cancel'}) leave_ids = self._get_category_leave_ids(cr, uid, ids) if leave_ids: self.unlink(cr, uid, leave_ids) # unlink all the leave requests of the cate... | d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py | |
'account_id': line.account_id.id, | 'account_id': result.get('account_id', statement.journal_id.default_credit_account_id.id), | def populate_statement(self, cr, uid, ids, context=None): | b1b120c7e443eca77a8c82569d3a88b5b793f0a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1b120c7e443eca77a8c82569d3a88b5b793f0a1/account_statement_from_invoice.py |
context.update({'move_line_ids': [line.id]}) result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context) | def populate_statement(self, cr, uid, ids, context=None): | b1b120c7e443eca77a8c82569d3a88b5b793f0a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1b120c7e443eca77a8c82569d3a88b5b793f0a1/account_statement_from_invoice.py | |
data = obj_pool.browse(cr, uid, data_id[0]) | data = obj_data.browse(cr, uid, data_id[0]) | def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.templ... | ea26c97f35a214d1c291c0ae03c097776a60310a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ea26c97f35a214d1c291c0ae03c097776a60310a/account.py |
self.write(cr, uid, [inv.id], {'state':'done'}, context=context) | self.write(cr, uid, [inv.id], {'state':'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) | def action_done(self, cr, uid, ids, context=None): move_obj = self.pool.get('stock.move') for inv in self.browse(cr, uid, ids, context=context): move_obj.action_done(cr, uid, [x.id for x in inv.move_ids], context=context) self.write(cr, uid, [inv.id], {'state':'done'}, context=context) return True | 7ad238b5f054f1afce7c5a5b6b43209fd671d850 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ad238b5f054f1afce7c5a5b6b43209fd671d850/stock.py |
self.write(cr, uid, [inv.id], {'state': 'confirm', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]}) | self.write(cr, uid, [inv.id], {'state': 'confirm', 'move_ids': [(6, 0, move_ids)]}) | def action_confirm(self, cr, uid, ids, context=None): """ Finishes the inventory and writes its finished date @return: True """ if context is None: context = {} | 7ad238b5f054f1afce7c5a5b6b43209fd671d850 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ad238b5f054f1afce7c5a5b6b43209fd671d850/stock.py |
ids = param_model.search(cr, uid, q) | ids = param_model.search(self.cr, self.uid, q) | def _eval_params(self, model, params): args = [] for i, param in enumerate(params): if isinstance(param, types.ListType): value = self._eval_params(model, param) elif is_ref(param): value = self.process_ref(param) elif is_eval(param): value = self.process_eval(param) elif isinstance(param, types.DictionaryType): # supp... | 269acb4ad6091640126b1c707066a97b330c08b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/269acb4ad6091640126b1c707066a97b330c08b4/yaml_import.py |
local_context = {'obj': lambda x: param_model.browse(self.cr, self.uid, x, context)} | local_context = {'obj': lambda x: param_model.browse(self.cr, self.uid, x, self.context)} | def _eval_params(self, model, params): args = [] for i, param in enumerate(params): if isinstance(param, types.ListType): value = self._eval_params(model, param) elif is_ref(param): value = self.process_ref(param) elif is_eval(param): value = self.process_eval(param) elif isinstance(param, types.DictionaryType): # supp... | 269acb4ad6091640126b1c707066a97b330c08b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/269acb4ad6091640126b1c707066a97b330c08b4/yaml_import.py |
'product_qty': fields.float('Date End', digits=(16,2)), | 'product_qty': fields.float('Quantity', digits=(16,2)), | def tender_done(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'done'}, context=context) return True | a76738e8b6701722d4594494e8350f9437e6c78f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a76738e8b6701722d4594494e8350f9437e6c78f/purchase_tender.py |
'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + '' | 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' ' | def lines(self, period_id): if not self.journal_ids: return [] self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id , ' 'SUM(l.debit) AS debit, SUM(l.credit) AS credit ' 'FROM account_move_line l ' 'LEFT JOIN account_journal j ON (l.journal_id=j.id) ' 'LEFT JOIN res_currency c... | 3f9135bdd2284487a3ee00a176511281b6003f3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f9135bdd2284487a3ee00a176511281b6003f3e/account_general_journal.py |
cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to-install', 'to upgrade') ") | cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to install', 'to upgrade') ") | def db_list(self): """Get the list of available databases, with FTPd support """ s = netsvc.ExportService.getService('db') result = s.exp_list(document=True) self.db_name_list = [] for db_name in result: db, cr = None, None try: try: db = pooler.get_db_only(db_name) cr = db.cursor() cr.execute("SELECT 1 FROM pg_class W... | 7098bbcae1027208a5e997ead75c441deba7dcd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7098bbcae1027208a5e997ead75c441deba7dcd0/abstracted_fs.py |
if values and field_name: self._field_get2(cr, uid, obj, context) relation = obj._name res = {} if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id = None t_data = data relation = obj._name for i in range(len(self.arg)): field_detail = self._relations[i] relation = field_detai... | self._field_get2(cr, uid, obj, context) if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id = data.id t_data = data for i in range(len(self.arg)): if not t_data: break field_detail = self._relations[i] if not t_data[self.arg[i]]: if self._type not in ('one2many', 'many2many'):... | def _fnct_write(self,obj,cr, uid, ids, field_name, values, args, context=None): if values and field_name: self._field_get2(cr, uid, obj, context) relation = obj._name res = {} if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id = None t_data = data relation = obj._name for i i... | 1a4ef0313f7c15ac4cc2e8528b92fad3b6eb021f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a4ef0313f7c15ac4cc2e8528b92fad3b6eb021f/fields.py |
break if field_detail['type'] in ('one2many', 'many2many'): if self._type != "many2one": t_id = t_data.id t_data = t_data[self.arg[i]][0] else: t_data = False break else: t_id = t_data['id'] t_data = t_data[self.arg[i]] if t_id and t_data: obj.pool.get(field_detail['object']).write(cr,uid,[t_id],{args[-1]:values}, con... | else: t_id = t_data['id'] t_data = t_data[self.arg[i]] else: model = obj.pool.get(self._relations[-1]['object']) model.write(cr, uid, [t_id], {args[-1]: values}, context=context) | def _fnct_write(self,obj,cr, uid, ids, field_name, values, args, context=None): if values and field_name: self._field_get2(cr, uid, obj, context) relation = obj._name res = {} if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id = None t_data = data relation = obj._name for i i... | 1a4ef0313f7c15ac4cc2e8528b92fad3b6eb021f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a4ef0313f7c15ac4cc2e8528b92fad3b6eb021f/fields.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) | e123d4cbe32723245353ec12fe578b4379b27788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e123d4cbe32723245353ec12fe578b4379b27788/product.py |
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'product.supplierinfo', context=c) | 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'product.supplierinfo', context=c), 'product_uom': _get_uom_id, | def _get_uom_id(self, cr, uid, *args): cr.execute('select id from product_uom order by id limit 1') res = cr.fetchone() return res and res[0] or False | e123d4cbe32723245353ec12fe578b4379b27788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e123d4cbe32723245353ec12fe578b4379b27788/product.py |
subject = self.merge_message(cr, uid, str(action.subject), action, context) body = self.merge_message(cr, uid, str(action.message), action, context) | subject = self.merge_message(cr, uid, action.subject, action, context) body = self.merge_message(cr, uid, action.message, action, context) | def run(self, cr, uid, ids, context={}): logger = netsvc.Logger() for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context':context, 'object': obj, 'time':time, 'cr': cr, 'pool' : self.pool, ... | 3055b72703c431e3f9f6f6b9e3f847b2e4e216b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3055b72703c431e3f9f6f6b9e3f847b2e4e216b6/ir_actions.py |
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Variant account on category of this product is same.')) | raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Variant account on category of this product are same.')) | def _get_accounting_data_for_valuation(self, cr, uid, move, context=None): """ Return the accounts and journal to use to post Journal Entries for the real-time valuation of the move. | f8d9f98f342cde826c20ddb03f3a861ff792ba29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f8d9f98f342cde826c20ddb03f3a861ff792ba29/stock.py |
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Variant account on category of this product is same.')) | raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Variant account on category of this product are same.')) | def _get_accounting_data_for_valuation(self, cr, uid, move, context=None): """ Return the accounts and journal to use to post Journal Entries for the real-time valuation of the move. | f8d9f98f342cde826c20ddb03f3a861ff792ba29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f8d9f98f342cde826c20ddb03f3a861ff792ba29/stock.py |
""" Finished the inventory | """ Finish the inventory | def action_done(self, cr, uid, ids, context=None): """ Finished the inventory @return: True """ | f8d9f98f342cde826c20ddb03f3a861ff792ba29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f8d9f98f342cde826c20ddb03f3a861ff792ba29/stock.py |
emp=emp_obj.browse(cr, uid, emp_id[0], context=context) | emp = emp_obj.browse(cr, uid, emp_id[0], context=context) | def _getEmployeeProduct(self, cr, uid, context=None): if context is None: context = {} emp_obj = self.pool.get('hr.employee') emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if emp_id: emp=emp_obj.browse(cr, uid, emp_id[0], context=context) if emp.product_id: return em... | 64a2c35fac8d1acdf2c7b30c7413175f33210211 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64a2c35fac8d1acdf2c7b30c7413175f33210211/hr_timesheet.py |
emp=emp_obj.browse(cr, uid, emp_id[0], context=context) | emp = emp_obj.browse(cr, uid, emp_id[0], context=context) | def _getEmployeeUnit(self, cr, uid, context=None): emp_obj = self.pool.get('hr.employee') if context is None: context = {} emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if emp_id: emp=emp_obj.browse(cr, uid, emp_id[0], context=context) if emp.product_id: return emp.p... | 64a2c35fac8d1acdf2c7b30c7413175f33210211 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64a2c35fac8d1acdf2c7b30c7413175f33210211/hr_timesheet.py |
a = emp.product_id.product_tmpl_id.property_account_expense.id | a = emp.product_id.product_tmpl_id.property_account_expense.id | def _getGeneralAccount(self, cr, uid, context=None): emp_obj = self.pool.get('hr.employee') if context is None: context = {} emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if emp_id: emp = emp_obj.browse(cr, uid, emp_id[0], context=context) if bool(emp.product_id): a ... | 64a2c35fac8d1acdf2c7b30c7413175f33210211 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64a2c35fac8d1acdf2c7b30c7413175f33210211/hr_timesheet.py |
'product_id' : self._getEmployeeProduct(cr,user_id, context= {}), 'product_uom_id' : self._getEmployeeUnit(cr, user_id, context= {}), 'general_account_id' :self. _getGeneralAccount(cr, user_id, context= {}), 'journal_id' : self._getAnalyticJournal(cr, user_id, context= {}), | 'product_id' : self._getEmployeeProduct(cr, uid, context), 'product_uom_id' : self._getEmployeeUnit(cr, uid, context), 'general_account_id' :self._getGeneralAccount(cr, uid, context), 'journal_id' : self._getAnalyticJournal(cr, uid, context), | def on_change_user_id(self, cr, uid, ids, user_id): if not user_id: return {} return {'value' : { 'product_id' : self._getEmployeeProduct(cr,user_id, context= {}), 'product_uom_id' : self._getEmployeeUnit(cr, user_id, context= {}), 'general_account_id' :self. _getGeneralAccount(cr, user_id, context= {}), 'journal_id' :... | 64a2c35fac8d1acdf2c7b30c7413175f33210211 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64a2c35fac8d1acdf2c7b30c7413175f33210211/hr_timesheet.py |
if case.type == 'lead': | if case.type == 'lead' or context.get('stage_type',False)=='lead': | def write(self, cr, uid, ids, vals, context=None): if 'date_closed' in vals: return super(crm_lead,self).write(cr, uid, ids, vals, context=context) if 'stage_id' in vals and vals['stage_id']: stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context) self.history(cr, uid, ids, _('St... | 69cadabda6ba99cef703a123323acb4afce6be0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69cadabda6ba99cef703a123323acb4afce6be0a/crm_lead.py |
self.log(cr, uid, case.id, message) | def write(self, cr, uid, ids, vals, context=None): if 'date_closed' in vals: return super(crm_lead,self).write(cr, uid, ids, vals, context=context) if 'stage_id' in vals and vals['stage_id']: stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context) self.history(cr, uid, ids, _('St... | 69cadabda6ba99cef703a123323acb4afce6be0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69cadabda6ba99cef703a123323acb4afce6be0a/crm_lead.py | |
message = _('Purchase order ') + " '" + purchase.name + "' "+ _("is cancelled") self.log(cr, uid, id, message) | for (id,name) in self.name_get(cr, uid, ids): message = _('Purchase order ') + " '" + purchase.name + "' "+ _("is cancelled") self.log(cr, uid, id, message) | def action_cancel(self, cr, uid, ids, context={}): ok = True purchase_order_line_obj = self.pool.get('purchase.order.line') for purchase in self.browse(cr, uid, ids): for pick in purchase.picking_ids: if pick.state not in ('draft','cancel'): raise osv.except_osv( _('Could not cancel purchase order !'), _('You must firs... | ce4b580b5c0ae0b4956229b53e97c3318cb0708b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ce4b580b5c0ae0b4956229b53e97c3318cb0708b/purchase.py |
result += tools.ustr(txt2) | result1 = tools.ustr(txt2) result = result + str(result1) | def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcontext) exc... | 28f42a58ec7337e5ac2506faf25bb518db30846d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/28f42a58ec7337e5ac2506faf25bb518db30846d/utils.py |
uos = False result.update({'type': product_obj.procure_method}) | uos = False | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You have to select ... | 0d1448310c5c8d7547f88744d1f32d7c976e580e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d1448310c5c8d7547f88744d1f32d7c976e580e/sale.py |
order_obj=self.pool.get('pos.order') record_id=context.get('record_id') | order_obj = self.pool.get('pos.order') active_ids = context.get('active_ids') | def default_get(self, cr, uid, fields, context=None): """ To get default values for the object. @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 d... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
for order in order_obj.browse(cr, uid,[record_id]): | for order in order_obj.browse(cr, uid, active_ids): | def default_get(self, cr, uid, fields, context=None): """ To get default values for the object. @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 d... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
context={} record_id=context.get('record_id') for order in order_obj.browse(cr, uid,[record_id]): | context={} active_ids=context.get('active_ids') for order in order_obj.browse(cr, uid, active_ids): | def view_init(self, cr, uid, fields_list, context=None): res = super(pos_return, self).view_init(cr, uid, fields_list, context=context) order_obj=self.pool.get('pos.order') if not context: context={} record_id=context.get('record_id') for order in order_obj.browse(cr, uid,[record_id]): for line in order.lines: if 'retu... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
order_obj=self.pool.get('pos.order') record_id = context.get('record_id', False) if record_id: | active_model = context.get('active_model') if not active_model and active_model != 'pos.order': return result order_obj = self.pool.get('pos.order') active_id = context.get('active_id', False) if active_id: | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu) if not context: context={} order_obj=self.pool.get('pos.order') record_id = context.get('record_id', Fals... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
order=order_obj.browse(cr, uid, record_id) | order=order_obj.browse(cr, uid, active_id) | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu) if not context: context={} order_obj=self.pool.get('pos.order') record_id = context.get('record_id', Fals... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
record_id = context.get('record_id', False) | active_id = context.get('active_id', False) | def create_returns2(self, cr, uid, ids, context): record_id = context.get('record_id', False) order_obj =self.pool.get('pos.order') line_obj = self.pool.get('pos.order.line') picking_obj = self.pool.get('stock.picking') stock_move_obj = self.pool.get('stock.move') property_obj= self.pool.get("ir.property") uom_obj =sel... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
if record_id: picking_ids = picking_obj.search(cr, uid, [('pos_order', 'in',[record_id]), ('state', '=', 'done')]) | if active_id: picking_ids = picking_obj.search(cr, uid, [('pos_order', 'in',[active_id]), ('state', '=', 'done')]) | def create_returns2(self, cr, uid, ids, context): record_id = context.get('record_id', False) order_obj =self.pool.get('pos.order') line_obj = self.pool.get('pos.order.line') picking_obj = self.pool.get('stock.picking') stock_move_obj = self.pool.get('stock.move') property_obj= self.pool.get("ir.property") uom_obj =sel... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
for order_id in order_obj.browse(cr, uid, [record_id], context=context): | for order_id in order_obj.browse(cr, uid, [active_id], context=context): | def create_returns2(self, cr, uid, ids, context): record_id = context.get('record_id', False) order_obj =self.pool.get('pos.order') line_obj = self.pool.get('pos.order.line') picking_obj = self.pool.get('stock.picking') stock_move_obj = self.pool.get('stock.move') property_obj= self.pool.get("ir.property") uom_obj =sel... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
if not context.get('record_id', False): | if not context.get('active_id', False): | def select_product(self, cr, uid, ids, context): """ To get the product and quantity and add in order . @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return : Retrun the add product form again for adding more product "... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
record_id=context.get('record_id', False) | active_id=context.get('active_id', False) | def select_product(self, cr, uid, ids, context): """ To get the product and quantity and add in order . @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return : Retrun the add product form again for adding more product "... | 1ec225ce8c6444f7d03770574c22a04544d34f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ec225ce8c6444f7d03770574c22a04544d34f5f/pos_return.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.