rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
'price_version_id': fields.many2one('product.pricelist.version', 'Price List Version', required=True, select=True), | 'price_version_id': fields.many2one('product.pricelist.version', 'Price List Version', required=True, select=True, ondelete='cascade'), | def _check_recursion(self, cr, uid, ids): for obj_list in self.browse(cr, uid, ids): if obj_list.base == -1: main_pricelist = obj_list.price_version_id.pricelist_id.id other_pricelist = obj_list.base_pricelist_id.id if main_pricelist == other_pricelist: return False return True | b67c51749708ea411a780f062aae8e5e0032f2f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b67c51749708ea411a780f062aae8e5e0032f2f1/pricelist.py |
for line in vals['line_ids']: seq += 1 line[2]['sequence'] = seq vals[seq - 1] = line | if 'line_ids' in vals: for line in vals['line_ids']: seq += 1 line[2]['sequence'] = seq vals[seq - 1] = line | def create(self, cr, uid, vals, context=None): seq = 0 for line in vals['line_ids']: seq += 1 line[2]['sequence'] = seq vals[seq - 1] = line return super(account_bank_statement, self).create(cr, uid, vals, context=context) | b602119abdbf3d629f88499ec8d60de3ff94b66d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b602119abdbf3d629f88499ec8d60de3ff94b66d/account_bank_statement.py |
vals = alarm.import_cal(cr, uid, cal_data) | ctx = context.copy() if cal_children: ctx.update({'model': cal_children[cal_data.name.lower()]}) vals = alarm.import_cal(cr, uid, cal_data, context=ctx) | def parse_ics(self, cr, uid, child, cal_children=None, context=None): att_data = [] for cal_data in child.getChildren(): if cal_data.name.lower() == 'attendee': ctx = context.copy() if cal_children: ctx.update({'model': cal_children[cal_data.name.lower()]}) attendee = self.pool.get('basic.calendar.attendee') att_data.a... | 9aa55b69a29ccf6d0c7f34376aced8f65306d482 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9aa55b69a29ccf6d0c7f34376aced8f65306d482/base_calendar.py |
data[map_field][0], vevent, context=context) | data[map_field][0], vevent, context=ctx) | def create_ics(self, cr, uid, datas, name, ical, context=None): if not datas: return for data in datas: vevent = ical.add(name) for field in self.__attribute__.keys(): map_field = self.ical_get(field, 'field') map_type = self.ical_get(field, 'type') if map_field in data.keys(): if field == 'uid': model = context.get('m... | 9aa55b69a29ccf6d0c7f34376aced8f65306d482 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9aa55b69a29ccf6d0c7f34376aced8f65306d482/base_calendar.py |
valarm.add('DESCRIPTION').value = alarm_data['name'] | valarm.add('DESCRIPTION').value = alarm_data['name'] or 'OpenERP' | def export_cal(self, cr, uid, model, alarm_id, vevent, context={}): valarm = vevent.add('valarm') alarm_object = self.pool.get(model) alarm_data = alarm_object.read(cr, uid, alarm_id, []) | 9aa55b69a29ccf6d0c7f34376aced8f65306d482 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9aa55b69a29ccf6d0c7f34376aced8f65306d482/base_calendar.py |
def import_cal(self, cr, uid, ical_data): | def import_cal(self, cr, uid, ical_data, context=None): ctx = context.copy() ctx.update({'model': context.get('model', None)}) self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx) | def import_cal(self, cr, uid, ical_data): for child in ical_data.getChildren(): if child.name.lower() == 'trigger': seconds = child.value.seconds days = child.value.days diff = (days * 86400) + seconds interval = 'days' related = 'before' if not seconds: duration = abs(days) related = days > 0 and 'after' or 'before' ... | 9aa55b69a29ccf6d0c7f34376aced8f65306d482 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9aa55b69a29ccf6d0c7f34376aced8f65306d482/base_calendar.py |
except Exception, e: | except Exception: | def tr(src, ttype): # We try to do the same as the _(), but without the frame # inspection, since we aready are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: if args and isinstance(args[-1], dict): ctx = args[-1] else: ctx = {} elif isinstance(kwargs, dict)... | ac2c09908a50ae8c7b57157466effd35ec23ab9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2c09908a50ae8c7b57157466effd35ec23ab9e/osv.py |
self._classic_read = True | if self._type != 'many2one': self._classic_read = True | def __init__(self, fnct, arg=None, fnct_inv=None, fnct_inv_arg=None, type='float', fnct_search=None, obj=None, method=False, store=False, multi=False, **args): _column.__init__(self, **args) self._obj = obj self._method = method self._fnct = fnct self._fnct_inv = fnct_inv self._arg = arg self._multi = multi if 'relatio... | 3e858f1da598a178711111bf5180384b23f2f0ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e858f1da598a178711111bf5180384b23f2f0ad/fields.py |
ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context) | ids = self.search(cr, user, [('default_code',operator,name)]+ args, limit=limit, context=context) | def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: context={} if name: ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context) if not len(ids): ids = self.search(cr, user, [('ean13','=',name)]+ args, l... | 58407193d73a068e94529c49bc684019ad0b6835 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58407193d73a068e94529c49bc684019ad0b6835/product.py |
partner_id = lines[0].partner_id.id if context and context.get('stop_reconcile', False): | partner_id = lines[0].partner_id and lines[0].partner_id.id or False if partner_id and context and context.get('stop_reconcile', False): | def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None): lines = self.browse(cr, uid, ids, context=context) unrec_lines = filter(lambda x: not x['reconcile_id'], lines) credit = debit = 0.0 currency = 0.0 account_id = False partner_id = Fa... | 5fc2cfcb0d34682b4ce14b1bdb435c61230aad27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fc2cfcb0d34682b4ce14b1bdb435c61230aad27/account_move_line.py |
'fa_IR': u'Persian / Iran, Islamic Republic of', | 'fa_IR': u'Persian / فارس', | def get_languages(): languages={ 'ab_RU': u'Abkhazian (RU)', 'ar_AR': u'Arabic / الْعَرَبيّة', 'bg_BG': u'Bulgarian / български', 'bs_BS': u'Bosnian / bosanski jezik', 'ca_ES': u'Catalan / Català', 'cs_CZ': u'Czech / Čeština', 'da_DK': u'Danish / Dansk', 'de_DE': u'German / Deutsch', 'el_GR': u'Greek / Ελληνικά', 'en_C... | 2c0cb2169a5dbf2605462258d961efb39f7568ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2c0cb2169a5dbf2605462258d961efb39f7568ec/misc.py |
price = line_obj.price_by_product_OLD(cr, uid, [], | price = line_obj.price_by_product(cr, uid, [], | def add_product(self, cr, uid, order_id, product_id, qty, context=None): | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
price = self.price_by_product_OLD(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) | price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) | def _get_amount(self, cr, uid, ids, field_name, arg, context): res = {} for line in self.browse(cr, uid, ids): price = self.price_by_product_OLD(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) res[line.id]=price return res | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
if line.qty == 0.0: continue | if line.qty == 0.0: continue | def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context): res = dict.fromkeys(ids, 0.0) account_tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] if line.qty == 0.0: continue computed_taxes = account_tax_obj.compute_all... | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
price = self.price_by_product_OLD(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) | price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) | def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context): res = dict.fromkeys(ids, 0.0) account_tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] if line.qty == 0.0: continue computed_taxes = account_tax_obj.compute_all... | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
prices = self.price_by_product_NEW(cr, uid, ids) | def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py | |
price = prices[line.id] | price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) | def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
def price_by_product_NEW(self, cr, uid, ids, context=None): if context is None: context = {} res = {}.fromkeys(ids, 0.0) return res for line in self.browse(cr, uid, ids): pricelist = line.order_id.pricelist_id.id product_id = line.product_id qty = line.qty or 0 partner_id = line.order_id.partner_id.id or False if no... | def price_by_product(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): | def price_by_product_NEW(self, cr, uid, ids, context=None): if context is None: context = {} | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
uom_id = p_obj.uom_po_id.id | uom_id=p_obj.uom_po_id.id | def price_by_product_OLD(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): if not product_id: return 0.0 if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\n' \ 'Please set one before choosing a product.')) p_obj = self.pool.get('product.p... | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
price = self.price_by_product_OLD(cr, uid, ids, pricelist, product_id, qty, partner_id) | price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id) | def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): price = self.price_by_product_OLD(cr, uid, ids, pricelist, product_id, qty, partner_id) self.write(cr,uid,ids,{'price_unit':price}) pos_stot = (price * qty) return {'value': {'price_unit': price,'price_subtotal_incl': pos_stot}... | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
price_f = self.price_by_product_OLD(cr, uid, ids, pricelist, product_id, qty, partner_id) | price_f = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id) | def onchange_subtotal(self, cr, uid, ids, discount, price, pricelist,qty,partner_id, product_id,*a): prod_obj = self.pool.get('product.product') price_f = self.price_by_product_OLD(cr, uid, ids, pricelist, product_id, qty, partner_id) prod_id='' if product_id: prod_id=prod_obj.browse(cr,uid,product_id).disc_controle di... | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
price = self.price_by_product_OLD(cr, uid, 0, pricelist_id[0]['pricelist_id'][0], product_id[0], 1) | price = self.price_by_product(cr, uid, 0, pricelist_id[0]['pricelist_id'][0], product_id[0], 1) | def _scan_product(self, cr, uid, ean, qty, order): # search pricelist_id product_obj=self.pool.get('product.product') pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] ) if not pricelist_id: return False | cf44617d4b4a5eb6212740174011fdb0d3ae48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf44617d4b4a5eb6212740174011fdb0d3ae48aa/pos.py |
res.append(dct) | res.append((0,0,dct)) | def _get_cash_box_lines(self, cr, uid, ids, context={}): res = [] curr = [1, 2, 5, 10, 20, 50, 100, 500] for rs in curr: dct = { 'pieces':rs, 'number':0 } res.append(dct) return res | 05fe1a6098bce79c517fa92162b0d3acbe4ccd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05fe1a6098bce79c517fa92162b0d3acbe4ccd18/account_cash_statement.py |
account_id = operation.product_id.property_account_income | account_id = operation.product_id.property_account_income.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... | b1f66324b0ed9683d4f8ef027560458ec7509f45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1f66324b0ed9683d4f8ef027560458ec7509f45/mrp_repair.py |
file_data = open('../pixmaps/openerp-header.png','rb').read() return base64.encodestring(file_data) | return open(os.path.join( tools.config['root_path'], '..', 'pixmaps', 'openerp-header.png'), 'rb') .read().encode('base64') | def _get_logo(self, cr, uid, ids): file_data = open('../pixmaps/openerp-header.png','rb').read() return base64.encodestring(file_data) | 989d67fba7ca3c488fbd628cc7cc7d79b0c21cae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/989d67fba7ca3c488fbd628cc7cc7d79b0c21cae/res_company.py |
if preinv.state not in ('cancel',): | if preinv.state not in ('cancel',) and preinv.id not in from_line_invoice_ids: | def _make_invoice(self, cr, uid, order, lines, context=None): journal_obj = self.pool.get('account.journal') inv_obj = self.pool.get('account.invoice') | fb5d961dddd11118b73a90ad577fdbde483b2fb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fb5d961dddd11118b73a90ad577fdbde483b2fb1/sale.py |
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): res = False invoices = {} invoice_ids = [] picking_obj = self.pool.get('stock.picking') invoice = self.pool.get('account.invoice') if context is None: context = {} # If date was speci... | fb5d961dddd11118b73a90ad577fdbde483b2fb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fb5d961dddd11118b73a90ad577fdbde483b2fb1/sale.py | ||
account_id = fee.product_id.property_account_income | account_id = fee.product_id.property_account_income.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... | a15e21270b32440b50dfa0b048757bc8b284dc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a15e21270b32440b50dfa0b048757bc8b284dc1d/mrp_repair.py |
datas['id'] = caldav_id2real_id(datas['id']) super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, datas, context) | datas['id'] = caldav_id2real_id(datas['id']) | def exp_report(self, db, uid, object, ids, datas=None, context=None): if object == 'printscreen.list': return super(virtual_report_spool, self).exp_report(db, uid, \ object, ids, datas, context) new_ids = [] for id in ids: new_ids.append(caldav_id2real_id(id)) datas['id'] = caldav_id2real_id(datas['id']) super(virtual_... | da5c8f95840f8ac57584b55edfa727ae4e4bef1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da5c8f95840f8ac57584b55edfa727ae4e4bef1a/caldav.py |
'partner_account': fields.boolean('Partner account'), | def _check_percent(self, cr, uid, ids, context={}): obj = self.browse(cr, uid, ids[0]) if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0): return False return True | 2572e7d06258324b4821c9e2c8ce190dfa6e48e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2572e7d06258324b4821c9e2c8ce190dfa6e48e8/account.py | |
('view', 'View'), | 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 | 2572e7d06258324b4821c9e2c8ce190dfa6e48e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2572e7d06258324b4821c9e2c8ce190dfa6e48e8/account.py | |
('other', 'Others'), | 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 | 2572e7d06258324b4821c9e2c8ce190dfa6e48e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2572e7d06258324b4821c9e2c8ce190dfa6e48e8/account.py | |
data[n] = browse_record(self._cr, self._uid, ids2, obj, self._cache, context=self._context, list_class=self._list_class, fields_process=self._fields_process) | if not isinstance(ids2, browse_record): data[n] = browse_record(self._cr, self._uid, ids2, obj, self._cache, context=self._context, list_class=self._list_class, fields_process=self._fields_process) | def __getitem__(self, name): if name == 'id': return self._id if name not in self._data[self._id]: # build the list of fields we will fetch | fff40de35d2be86b30e254d08b253999299422ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fff40de35d2be86b30e254d08b253999299422ee/orm.py |
order_by = self._parent_order or self._order | order_by = self._parent_order or self._order | def convert_field(f): if f in ('create_date', 'write_date'): return "date_trunc('second', %s) as %s" % (f, f) if f == self.CONCURRENCY_CHECK_FIELD: if self._log_access: return "COALESCE(write_date, create_date, now())::timestamp AS %s" % (f,) return "now()::timestamp AS %s" % (f,) if isinstance(self._columns[f], fields... | fff40de35d2be86b30e254d08b253999299422ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fff40de35d2be86b30e254d08b253999299422ee/orm.py |
order_by = order or self._order | o = order.split(' ')[0] if (o in self._columns) and getattr(self._columns[o], '_classic_write'): order_by = order | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if not context: context = {} # compute the where, order by, limit and offset clauses (qu1, qu2, tables) = self._where_calc(cr, user, args, context=context) dom = self.pool.get('ir.rule').domain_get(cr, user, self._name, conte... | d02865ea9de6ac58524ba0935bda5eb8f52ad532 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d02865ea9de6ac58524ba0935bda5eb8f52ad532/orm.py |
(tmpl_id, product_id, pricelist_id, qty)) | (tmpl_id, product_id, plversion_ids[0], qty)) | def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst | 8198dc0d099dacfa3eafe244c76acc6bc09bf99a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8198dc0d099dacfa3eafe244c76acc6bc09bf99a/pricelist.py |
vals = map_data(cr, uid, self) if vals: res.append(vals) self.ical_reset('value') | if child.name.lower() in ('vevent', 'vtodo'): vals = map_data(cr, uid, self) else: vals = {} continue if vals: res.append(vals) self.ical_reset('value') | def import_ical(self, cr, uid, ical_data): parsedCal = vobject.readOne(ical_data) att_data = [] res = [] for child in parsedCal.getChildren(): for cal_data in child.getChildren(): if cal_data.name.lower() == 'attendee': attendee = self.pool.get('caldav.attendee') att_data.append(attendee.import_ical(cr, uid, cal_data))... | 057cee7bcb4457aaa19cd2dc5bccc08329f58200 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/057cee7bcb4457aaa19cd2dc5bccc08329f58200/calendar.py |
'invoice_ids': fields.many2many('account.invoice', 'purchase_invoice_rel', 'purchase_id', 'invoice_id', 'Taxes', help="Invoices generated for a purchase order"), | 'invoice_ids': fields.many2many('account.invoice', 'purchase_invoice_rel', 'purchase_id', 'invoice_id', 'Invoices', help="Invoices generated for a purchase order"), | def _invoiced(self, cursor, user, ids, name, arg, context=None): res = {} for purchase in self.browse(cursor, user, ids, context=context): invoiced = False if purchase.invoiced_rate == 100.00: invoiced = True res[purchase.id] = invoiced return res | 7ff1ae996ef02185b73fdfbecd656ef212d5bd85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ff1ae996ef02185b73fdfbecd656ef212d5bd85/purchase.py |
where += safe_eval(self.domain, self.dctx) | app = safe_eval(self.domain, self.dctx) if not app: pass elif isinstance(app, list): where.extend(app) elif isinstance(app, tuple): where.append(app) else: raise RuntimeError("incorrect domain expr: %s" % self.domain) | def _child_get(self, cr, name = None, domain=None): """ return virtual children of resource, based on the foreign object. Note that many objects use NULL for a name, so we should better call the name_search(),name_get() set of methods """ obj = self.context._dirobj.pool.get(self.res_model) if not obj: return [] dirobj... | 4fd7b06c3007b84fdbe743d42af91468df9a3ed8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4fd7b06c3007b84fdbe743d42af91468df9a3ed8/nodes.py |
case = pool.get('crm.lead').browse(cr, uid, data['id']) | case = pool.get(data.get('model')).browse(cr, uid, data['id']) | def _get_info(self, cr, uid, data, context): if not data['id']: return {} pool = pooler.get_pool(cr.dbname) case = pool.get('crm.lead').browse(cr, uid, data['id']) if not case.user_id: raise wizard.except_wizard(_('Error'),_('You must define a responsible user for this case in order to use this action!')) return { '... | 1f6470dfb37cd72f07025a973bc93a4c3a2584d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f6470dfb37cd72f07025a973bc93a4c3a2584d5/wizard_crm_new_send_email.py |
cr.execute(qry) | cr.execute(qry) | def uid2openobjectid(cr, uidval, oomodel, rdate): __rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$') wematch = __rege.match(uidval.encode('utf8')) if not wematch: return (False, None) else: model, id, dbname = wematch.groups() model_obj = pooler.get_pool(cr.dbname).get(model) if (not model == oomodel) or (no... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py |
return False | return (False, None) | def uid2openobjectid(cr, uidval, oomodel, rdate): __rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$') wematch = __rege.match(uidval.encode('utf8')) if not wematch: return (False, None) else: model, id, dbname = wematch.groups() model_obj = pooler.get_pool(cr.dbname).get(model) if (not model == oomodel) or (no... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py |
def import_cal(self, cr, uid, content, data_id=None, context=None): ical_data = base64.decodestring(content) self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context) parsedCal = vobject.readOne(ical_data) att_data = [] res = [] for child in parsedCal.getChildren(): if child.name.lower() in ('vevent',... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py | ||
'active': fields.boolean('Active'), | 'active': fields.boolean('Active'), 'create_date': fields.datetime('Created Date'), 'write_date': fields.datetime('Modifided Date'), | def import_cal(self, cr, uid, content, data_id=None, context=None): ical_data = base64.decodestring(content) self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context) parsedCal = vobject.readOne(ical_data) att_data = [] res = [] for child in parsedCal.getChildren(): if child.name.lower() in ('vevent',... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py |
def export_cal(self, cr, uid, datas, vobj='vevent', context={}): cal = self.browse(cr, uid, datas[0]) ical = vobject.iCalendar() | def export_cal(self, cr, uid, ids, vobj='vevent', context={}): cal = self.browse(cr, uid, ids[0]) ical = vobject.iCalendar() | def export_cal(self, cr, uid, datas, vobj='vevent', context={}): cal = self.browse(cr, uid, datas[0]) ical = vobject.iCalendar() for line in cal.line_ids: if line.name in ('valarm', 'attendee'): continue mod_obj = self.pool.get(line.object_id.model) data_ids = mod_obj.search(cr, uid, eval(line.domain), context=context)... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py |
def import_cal(self, cr, uid, content, data_id=None, context=None): ical_data = base64.decodestring(content) parsedCal = vobject.readOne(ical_data) if not data_id: data_id = self.search(cr, uid, [])[0] cal = self.browse(cr, uid, data_id) cal_children = {} count = 0 for line in cal.line_ids: cal_children[line.name] = li... | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py | ||
raise osv.except_osv(_('Configuration Error !'), _('Can not find account journal for this company in invoice, Please Create journal.')) | raise osv.except_osv(_('Configuration Error !'), _('Can\'t find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Financial Accounting\Accounts\Journals.' % (journal_type))) | def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): val = {} dom = {} obj_journal = self.pool.get('account.journal') if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable... | 195ac98256e35e49c13c668ec5ff8378f65a0527 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/195ac98256e35e49c13c668ec5ff8378f65a0527/invoice.py |
if currency.company_id.id != company_id: | if currency.company_id and currency.company_id.id != company_id: | def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): val = {} dom = {} obj_journal = self.pool.get('account.journal') if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable... | 195ac98256e35e49c13c668ec5ff8378f65a0527 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/195ac98256e35e49c13c668ec5ff8378f65a0527/invoice.py |
if company.currency_id.company_id.id != company_id: | if company.currency_id.company_id and company.currency_id.company_id.id != company_id: | def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): val = {} dom = {} obj_journal = self.pool.get('account.journal') if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable... | 195ac98256e35e49c13c668ec5ff8378f65a0527 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/195ac98256e35e49c13c668ec5ff8378f65a0527/invoice.py |
if not currency.company_id.id == company.id: raise osv.except_osv(_('Configuration Error !'), _('Can not select currency that is not related to any company.\nPlease select accordingly !.')) | 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) if not partner_id: raise osv.excep... | 195ac98256e35e49c13c668ec5ff8378f65a0527 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/195ac98256e35e49c13c668ec5ff8378f65a0527/invoice.py | |
self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) | for wiz_id in wizard['widget_id']: self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wiz_id}) | def res_widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {'type': 'ir.actions.act_window_close'} | 097340e9a7388846128bdbb0442c2b7619abf8d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/097340e9a7388846128bdbb0442c2b7619abf8d5/res_widget.py |
obj = self._table.pool.get(ref_obj) new_data[field_name] = browse_record(self._cr, self._uid, ref_id, obj, self._cache, context=self._context, list_class=self._list_class, fields_process=self._fields_process) | if ref_id: obj = self._table.pool.get(ref_obj) new_data[field_name] = browse_record(self._cr, self._uid, ref_id, obj, self._cache, context=self._context, list_class=self._list_class, fields_process=self._fields_process) else: new_data[field_name] = browse_null() | def __getitem__(self, name): if name == 'id': return self._id | afed2d47fe33aa6f3f0aa1c3de500e26f8bf40da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/afed2d47fe33aa6f3f0aa1c3de500e26f8bf40da/orm.py |
if self._columns[field]._type == 'reference': val = vals[field].split(',')[0] else: val = vals[field] if isinstance(self._columns[field].selection, (tuple, list)): if val not in dict(self._columns[field].selection): raise except_orm(_('ValidateError'), _('The value "%s" for the field "%s" is not in the selection') \ % ... | self._check_selection_field_value(cr, user, field, vals[field], context=context) | def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values | afed2d47fe33aa6f3f0aa1c3de500e26f8bf40da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/afed2d47fe33aa6f3f0aa1c3de500e26f8bf40da/orm.py |
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, ttyme.strftime('%B-%Y')), | 'name':'Salary Slip of %s for %s' % (slip.employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))), | def get_days(start, end, month, year, calc_day): import datetime count = 0 for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | f078fe580a81097bc7a96e50359e341b5a94f435 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f078fe580a81097bc7a96e50359e341b5a94f435/hr_payroll.py |
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, ttyme.strftime('%B-%Y')), | 'name':'Salary Slip of %s for %s' % (slip.employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))), | def get_days(start, end, month, year, calc_day): import datetime count = 0 for day in range(start, end): if datetime.date(year, month, day).weekday() == calc_day: count += 1 return count | f078fe580a81097bc7a96e50359e341b5a94f435 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f078fe580a81097bc7a96e50359e341b5a94f435/hr_payroll.py |
default['name'] = self.browse(cr, uid, id, context=context).name + _(' (copy)') | default['name'] = self.browse(cr, uid, id, context=context).name | def copy_data(self, cr, uid, id, default={}, context=None): default = default or {} default.update({'work_ids':[], 'date_start': False, 'date_end': False, 'date_deadline': False}) if not default.get('remaining_hours', False): default['remaining_hours'] = float(self.read(cr, uid, id, ['planned_hours'])['planned_hours'])... | 8ea6ce89df9d702afd5a9fbaabf8121736add2d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ea6ce89df9d702afd5a9fbaabf8121736add2d9/project.py |
return True | return res | def case_reset(self, cr, uid, ids, *args): """Overrides reset as draft in order to set the stage field as empty @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 ids: List of case Ids @param *args: Tuple Value for addition... | 4d38257ab8aec5b69d44e0e2fa8e818c374b280f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d38257ab8aec5b69d44e0e2fa8e818c374b280f/crm_opportunity.py |
return self.baseuri+ '/'.join(ajoin) | return self.parent.get_baseuri(self) + '/'.join(ajoin) | def urijoin(self,*ajoin): """ Return the base URI of this request, or even join it with the ajoin path elements """ return self.baseuri+ '/'.join(ajoin) | 9a4c99980315d80e2da5a3af9a1d870bde4cf734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9a4c99980315d80e2da5a3af9a1d870bde4cf734/dav_fs.py |
return '' | return u'' | def _get_source(self, cr, uid, name, tt, lang, source=None): if not lang: return '' if source: #if isinstance(source, unicode): # source = source.encode('utf8') cr.execute('select value ' \ 'from ir_translation ' \ 'where lang=%s ' \ 'and type=%s ' \ 'and name=%s ' \ 'and src=%s', (lang or '', tt, tools.ustr(name), s... | ac2ea17fab7be0117439baceb41aec56dd602678 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2ea17fab7be0117439baceb41aec56dd602678/ir_translation.py |
def _get_source(self, cr, uid, name, tt, lang, source=None): if not lang: return '' if source: #if isinstance(source, unicode): # source = source.encode('utf8') cr.execute('select value ' \ 'from ir_translation ' \ 'where lang=%s ' \ 'and type=%s ' \ 'and name=%s ' \ 'and src=%s', (lang or '', tt, tools.ustr(name), s... | ac2ea17fab7be0117439baceb41aec56dd602678 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2ea17fab7be0117439baceb41aec56dd602678/ir_translation.py | ||
trad = res and res[0] or '' | trad = res and res[0] or u'' | def _get_source(self, cr, uid, name, tt, lang, source=None): if not lang: return '' if source: #if isinstance(source, unicode): # source = source.encode('utf8') cr.execute('select value ' \ 'from ir_translation ' \ 'where lang=%s ' \ 'and type=%s ' \ 'and name=%s ' \ 'and src=%s', (lang or '', tt, tools.ustr(name), s... | ac2ea17fab7be0117439baceb41aec56dd602678 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2ea17fab7be0117439baceb41aec56dd602678/ir_translation.py |
return source | return tools.ustr(source) | def _get_source(self, cr, uid, name, tt, lang, source=None): if not lang: return '' if source: #if isinstance(source, unicode): # source = source.encode('utf8') cr.execute('select value ' \ 'from ir_translation ' \ 'where lang=%s ' \ 'and type=%s ' \ 'and name=%s ' \ 'and src=%s', (lang or '', tt, tools.ustr(name), s... | ac2ea17fab7be0117439baceb41aec56dd602678 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2ea17fab7be0117439baceb41aec56dd602678/ir_translation.py |
id2name = dict([(th.ident, th.name) for th in threading.enumerate()]) | thread_map = dict(threading._active, **threading._limbo) id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()]) | def dumpstacks(signum, frame): # code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696 id2name = dict([(th.ident, th.name) for th in threading.enumerate()]) code = [] for threadId, stack in sys._current_frames().items(): code.append("\n# Thread: %s(%d)... | f49b3ea7224d27a387f8a3833625b0b0a47d937c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f49b3ea7224d27a387f8a3833625b0b0a47d937c/openerp-server.py |
def dumpstacks(signum, frame): # code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696 id2name = dict([(th.ident, th.name) for th in threading.enumerate()]) code = [] for threadId, stack in sys._current_frames().items(): code.append("\n# Thread: %s(%d)... | f49b3ea7224d27a387f8a3833625b0b0a47d937c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f49b3ea7224d27a387f8a3833625b0b0a47d937c/openerp-server.py | ||
return pooler.get_db_only(dbname) | return pooler.get_db_only(db_name) | def _get_db(self): # find current DB based on thread/worker db name (see netsvc) db_name = getattr(threading.currentThread(), 'dbname', None) if db_name: return pooler.get_db_only(dbname) | 263b4524fbf33189d7bed85757863b8c80e3685c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/263b4524fbf33189d7bed85757863b8c80e3685c/translate.py |
cr.commit() | def _set_ids(self, cr, uid, name, tt, lang, ids, value, src=None): # clear the caches tr = self._get_ids(cr, uid, name, tt, lang, ids) for res_id in tr: if tr[res_id]: self._get_source.clear_cache(cr.dbname, uid, name, tt, lang, tr[res_id]) self._get_source.clear_cache(cr.dbname, uid, name, tt, lang) self._get_ids.clea... | ae98302b3053ec0db73201bca1ab82bbabf759a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ae98302b3053ec0db73201bca1ab82bbabf759a2/ir_translation.py | |
def _calc_amount(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = {} for order in self.browse(cr, uid, ids): res[order.id] = 0 for oline in order.order_line: res[order.id] += oline.price_unit * oline.product_qty return res | 70d2b044c4085582ad1d36be45b347914255a3c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/70d2b044c4085582ad1d36be45b347914255a3c7/purchase.py | ||
"From Picking: a draft invoice will be pre-generated based on validated receptions.\n" \ | "From Picking: you manually have to generate the invoices based on the receptions.\n" \ | def _invoiced(self, cursor, user, ids, name, arg, context=None): res = {} for purchase in self.browse(cursor, user, ids, context=context): if purchase.invoice_id.reconciled: res[purchase.id] = purchase.invoice_id.reconciled else: res[purchase.id] = False return res | 70d2b044c4085582ad1d36be45b347914255a3c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/70d2b044c4085582ad1d36be45b347914255a3c7/purchase.py |
res.update({'reply_to': case.section_id and case.section_id.reply_to or False}) | if hasattr(case, 'section_id'): res.update({'reply_to': case.section_id and case.section_id.reply_to or False}) | def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {} | 8439e0be293f52e5cd8a53795017009f521c525d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8439e0be293f52e5cd8a53795017009f521c525d/crm_send_email.py |
res.update({'reply_to': case.section_id.reply_to}) | if hasattr(case, 'section_id'): res.update({'reply_to': case.section_id.reply_to}) | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('mailgate.message') res_ids = context and context.get('active_ids', []) or [] | 8439e0be293f52e5cd8a53795017009f521c525d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8439e0be293f52e5cd8a53795017009f521c525d/crm_send_email.py |
'relation_field': f._type=='one2many' and f._fields_id or '', | 'relation_field': (f._type=='one2many' and isinstance(f,fields.one2many)) and f._fields_id or '', | def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self.... | 372673aeba35ba4df17501f69b8b8522f083a4cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/372673aeba35ba4df17501f69b8b8522f083a4cf/orm.py |
if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') | def _default_get(self, cr, uid, fields, context={}): | 3efbdcbd09af33152a4eb96d381dac29dccc26cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3efbdcbd09af33152a4eb96d381dac29dccc26cb/account_move_line.py | |
apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context), parent_model=inherited_model, child_object=self) | kwargs = dict(parent_model=inherited_model, child_object=self) apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context), **kwargs) | def apply_rule(added_clause, added_params, added_tables, parent_model=None, child_object=None): if added_clause: if parent_model and child_object: # as inherited rules are being applied, we need to add the missing JOIN # to reach the parent table (if it was not JOINed yet in the query) child_object._inherits_join_add(p... | 39d514218fa63ac51bd7fa46f7f61e4af1de1035 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39d514218fa63ac51bd7fa46f7f61e4af1de1035/orm.py |
if mv.partner_id: line['partner_id'] = mv.partner_id.id if line['amount'] < 0 : line['account_id'] = mv.partner_id.property_account_payable.id else : line['account_id'] = mv.partner_id.property_account_receivable.id | mv = pool.get('account.move.line').browse(cr, uid, rec_id[0], context=context) if mv.partner_id: line['partner_id'] = mv.partner_id.id if line['amount'] < 0 : line['account_id'] = mv.partner_id.property_account_payable.id else : line['account_id'] = mv.partner_id.property_account_receivable.id | def coda_parsing(self, cr, uid, ids, context=None): | e9e34d9f99c0cba8bb8c94105e2d2b01ef639a64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e9e34d9f99c0cba8bb8c94105e2d2b01ef639a64/account_coda_import.py |
def _default_get(self, cr, uid, fields, context={}): | def convert_to_period(self, cr, uid, context={}): | def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | c14544fe29fb71bfd66cbc9d484c9af4689f9b35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c14544fe29fb71bfd66cbc9d484c9af4689f9b35/account_move_line.py |
def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | c14544fe29fb71bfd66cbc9d484c9af4689f9b35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c14544fe29fb71bfd66cbc9d484c9af4689f9b35/account_move_line.py | ||
ref = {} | 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... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py | |
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... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py | ||
vals.append({'email': datas['email']}) | res = {'email': datas['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... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py |
if model == 'calendar.attendee': att = att_obj.browse(cr, uid, context['active_id']) vals.update({ 'parent_ids' : [(4, att.id)], 'ref': att.ref }) | att = att_obj.browse(cr, uid, 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... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py |
attendees.append(int(att_obj.create(cr, uid, att_val, context=context))) | if model == 'calendar.attendee': att_val.update({ 'parent_ids' : [(4, att.id)], 'ref': att.ref._name + ',' + str(att.ref.id) }) attendees.append(att_obj.create(cr, uid, att_val)) | 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... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py |
event_ref = ref if event_ref.user_id.id != user[0]: | if ref.user_id.id != user[0]: | def do_accept(self, cr, uid, ids, context=None, *args): for invite in ids: vals = self.read(cr, uid, invite, context=context) user = vals.get('user_id') if user: ref = vals.get('ref', None) if ref: event_ref = ref if event_ref.user_id.id != user[0]: defaults = {'user_id': user[0]} new_event = model_obj.copy(cr, uid, e... | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py |
def create(self, cr, uid, vals, context={}): | def create(self, cr, uid, vals, context=None): if not context: context = {} | def create(self, cr, uid, vals, context={}): if not vals.get("email") and vals.get("cn"): cnval = vals.get("cn").split(':') email = filter(lambda x:x.__contains__('@'), cnval) vals['email'] = email[0] vals['cn'] = vals.get("cn") res = super(calendar_attendee, self).create(cr, uid, vals, context) return res | f47c0ee32b5f49894fd2345460d0154fa448dc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f47c0ee32b5f49894fd2345460d0154fa448dc5d/base_calendar.py |
def get_id(self, cr, uid, sequence_id, test='id=%s', context={}): cr.execute('select id from ir_sequence where '+test+' and active=%s', (sequence_id, True,)) | def get_id(self, cr, uid, sequence_id, test='id', context={}): cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,)) | def get_id(self, cr, uid, sequence_id, test='id=%s', context={}): cr.execute('select id from ir_sequence where '+test+' and active=%s', (sequence_id, True,)) res = cr.dictfetchone() if res: for line in self.browse(cr, uid, res['id'], context=context).fiscal_ids: if line.fiscalyear_id.id==context.get('fiscalyear_id', Fa... | 9955c50c144cd7ea193daf6404069cf5c83ad483 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9955c50c144cd7ea193daf6404069cf5c83ad483/sequence.py |
return super(ir_sequence, self).get_id(cr, uid, line.sequence_id.id, test="id=%s", context=context) | return super(ir_sequence, self).get_id(cr, uid, line.sequence_id.id, test="id", context=context) | def get_id(self, cr, uid, sequence_id, test='id=%s', context={}): cr.execute('select id from ir_sequence where '+test+' and active=%s', (sequence_id, True,)) res = cr.dictfetchone() if res: for line in self.browse(cr, uid, res['id'], context=context).fiscal_ids: if line.fiscalyear_id.id==context.get('fiscalyear_id', Fa... | 9955c50c144cd7ea193daf6404069cf5c83ad483 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9955c50c144cd7ea193daf6404069cf5c83ad483/sequence.py |
'create_date': fields.datetime('Date Created', readonly=True), | def init(self, cr): tools.drop_view_if_exists(cr, 'report_document_user') cr.execute(""" CREATE OR REPLACE VIEW report_document_user as ( SELECT min(f.id) as id, to_char(f.create_date, 'YYYY') as name, to_char(f.create_date, 'MM') as month, f.user_id as user_id, u.name as user, count(*) as nbr, d.name as directory, f.c... | d6c2fcefe7d62ea57c1bd7c4690760762012680f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6c2fcefe7d62ea57c1bd7c4690760762012680f/document_report.py | |
if not (context.get(self.CONCURRENCY_CHECK_FIELD) or self._log_access): | if not (context.get(self.CONCURRENCY_CHECK_FIELD) and self._log_access): | def _check_concurrency(self, cr, ids, context): if not context: return if not (context.get(self.CONCURRENCY_CHECK_FIELD) or self._log_access): return 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): ... | dee82b3ce7615bd06233d70653f2074099046673 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dee82b3ce7615bd06233d70653f2074099046673/orm.py |
def _get_languages(self, cr, uid, context): lang_obj=pooler.get_pool(cr.dbname).get('res.lang') ids=lang_obj.search(cr, uid, ['&', ('active', '=', True), ('translatable', '=', True),]) langs=lang_obj.browse(cr, uid, ids) return [(lang.code, lang.name) for lang in langs] | 37237e134567d6bfa8fef486a3a595af648b8877 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/37237e134567d6bfa8fef486a3a595af648b8877/wizard_export_lang.py | ||
this.name = "%s.%s" % (this.lang or filename, this.format) | if this.lang: filename = get_iso_codes(this.lang) this.name = "%s.%s" % (filename, this.format) | def act_getfile(self, cr, uid, ids, context=None): this = self.browse(cr, uid, ids)[0] mods = map(lambda m: m.name, this.modules) or ['all'] mods.sort() buf=cStringIO.StringIO() tools.trans_export(this.lang, mods, buf, this.format, dbname=cr.dbname) if this.format == 'csv': this.advice = _("Save this document to a .CSV... | 37237e134567d6bfa8fef486a3a595af648b8877 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/37237e134567d6bfa8fef486a3a595af648b8877/wizard_export_lang.py |
cr.execute("SELECT user_id FROM hr_department_user_rel WHERE (department_id IN %s)" %(tuple(dept_ids_set),)) | cr.execute("SELECT user_id FROM hr_department_user_rel WHERE (department_id IN (%s))" %(dept_ids_set,)) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | de589d0d73f81d5d116b04d50148c0ccfdbbbbd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/de589d0d73f81d5d116b04d50148c0ccfdbbbbd7/stock_planning.py |
for id in context['active_ids']: | pool_obj = pooler.get_pool(cr.dbname) data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) for record in data_inv: if record['state'] not in ('draft','proforma','proforma2'): raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are... | def invoice_confirm(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr) return {} | ab6963608096e97183a5dad898084c3051a53372 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab6963608096e97183a5dad898084c3051a53372/account_invoice_state.py |
_description = "Cancel the selected invoices" | _description = "Cancel the Selected Invoices" | def invoice_confirm(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr) return {} | ab6963608096e97183a5dad898084c3051a53372 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab6963608096e97183a5dad898084c3051a53372/account_invoice_state.py |
wf_service = netsvc.LocalService('workflow') | def invoice_cancel(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) return {} | ab6963608096e97183a5dad898084c3051a53372 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab6963608096e97183a5dad898084c3051a53372/account_invoice_state.py | |
for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) | wf_service = netsvc.LocalService('workflow') pool_obj = pooler.get_pool(cr.dbname) data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) for record in data_inv: if record['state'] in ('cancel','paid'): raise osv.except_osv(_('Warning'), _("Selected Invoice(s) canno... | def invoice_cancel(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) return {} | ab6963608096e97183a5dad898084c3051a53372 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab6963608096e97183a5dad898084c3051a53372/account_invoice_state.py |
if (o in self._columns) and getattr(self._columns[o], '_classic_write'): order_by = order | if (o in self._columns): if getattr(self._columns[o], '_classic_read'): order_by = order | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. | fe313162b689e316bd603f138627e3ca0852dfa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe313162b689e316bd603f138627e3ca0852dfa1/orm.py |
inherited_tables, inherit_join = self._inherits_join_calc(o,[],[]) inherited_sort_table = inherited_tables[0] order_by = inherited_sort_table + '.' + order if inherited_sort_table not in tables: self._inherits_join_calc(o, tables, where_clause) | parent_obj = self.pool.get(self._inherit_fields[o][0]) if getattr(parent_obj._columns[o], '_classic_read'): inherited_tables, inherit_join = self._inherits_join_calc(o,[],[]) if inherited_tables: inherited_sort_table = inherited_tables[0] order_by = inherited_sort_table + '.' + order if inherited_sort_table not in tab... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. | fe313162b689e316bd603f138627e3ca0852dfa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe313162b689e316bd603f138627e3ca0852dfa1/orm.py |
if len(ids) > 0: | if len(ids) > 1: | def _check_queue(self, cr, uid, ids=False): queue = self.pool.get('email.smtpclient.queue') sids = [] if not ids: sids = queue.search(cr, uid, [('state','not in',['send','sending']), ('type','=','system')], order="priority", limit=30) ids =[] else: sids = queue.search(cr, uid, [('state','not in',['send','sending']), ('... | 5824c4d627c02bb031f706fd1513d01549325537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5824c4d627c02bb031f706fd1513d01549325537/smtpclient.py |
except YamlImportAbortion, e: | except Exception, e: | def process(self, yaml_string): """ Processes a Yaml string. Custom tags are interpreted by 'process_' instance methods. """ is_preceded_by_comment = False for node in yaml.load(yaml_string): is_preceded_by_comment = self._log(node, is_preceded_by_comment) try: self._process_node(node) except YamlImportException, e: se... | be6c3b80e61e75524601ed709c0f69a532739133 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be6c3b80e61e75524601ed709c0f69a532739133/yaml_import.py |
self.cr.rollback() return except Exception, e: self.cr.rollback() | def process(self, yaml_string): """ Processes a Yaml string. Custom tags are interpreted by 'process_' instance methods. """ is_preceded_by_comment = False for node in yaml.load(yaml_string): is_preceded_by_comment = self._log(node, is_preceded_by_comment) try: self._process_node(node) except YamlImportException, e: se... | be6c3b80e61e75524601ed709c0f69a532739133 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be6c3b80e61e75524601ed709c0f69a532739133/yaml_import.py | |
account_sum += l['debit'] - l['credit'] | account_sum += l['credit']-l['debit'] | def lines(self, period_id, journal_id=False): if not journal_id: journal_id = self.journal_ids else: journal_id = [journal_id] obj_mline = self.pool.get('account.move.line') self.cr.execute('update account_journal_period set state=%s where journal_id IN %s and period_id=%s and state=%s', ('printed', self.journal_ids, p... | 1785b797a4ca1357ca3c8a0aa9912dd6b6146cf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1785b797a4ca1357ca3c8a0aa9912dd6b6146cf1/account_journal.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.