bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
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 | 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 | 467,700 |
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) | def create(self, cr, uid, vals, context=None): seq = 0 if 'line_ids' in vals: 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) | 467,701 |
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... | 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... | 467,702 |
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... | 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... | 467,703 |
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, []) | 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, []) | 467,704 |
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' ... | 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) for child in ical_data.getChildren(): if child.name.lower() == 'trigger': seconds = child.value.seconds days = child.valu... | 467,705 |
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)... | 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)... | 467,706 |
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... | 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... | 467,707 |
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... | 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',operator,name)]+ args, limit=limit, context=context) if not len(ids): ids = self.search(cr, user, [('ean13','=',name)]+ ar... | 467,708 |
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... | 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... | 467,709 |
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... | 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... | 467,710 |
def add_product(self, cr, uid, order_id, product_id, qty, context=None): | def add_product(self, cr, uid, order_id, product_id, qty, context=None): | 467,711 |
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 | 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(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 | 467,712 |
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... | 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... | 467,713 |
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... | 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... | 467,714 |
def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | 467,715 |
def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} | 467,716 |
def price_by_product_NEW(self, cr, uid, ids, context=None): if context is None: context = {} | def price_by_product_NEW(self, cr, uid, ids, context=None): if context is None: context = {} | 467,717 |
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... | 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... | 467,718 |
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}... | def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): price = self.price_by_product(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}} | 467,719 |
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... | 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(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 disc=0... | 467,720 |
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 | 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 | 467,721 |
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 | 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((0,0,dct)) return res | 467,722 |
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... | 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... | 467,723 |
def _get_logo(self, cr, uid, ids): file_data = open('../pixmaps/openerp-header.png','rb').read() return base64.encodestring(file_data) | def _get_logo(self, cr, uid, ids): file_data = open('../pixmaps/openerp-header.png','rb').read() return base64.encodestring(file_data) | 467,724 |
def _make_invoice(self, cr, uid, order, lines, context=None): journal_obj = self.pool.get('account.journal') inv_obj = self.pool.get('account.invoice') | def _make_invoice(self, cr, uid, order, lines, context=None): journal_obj = self.pool.get('account.journal') inv_obj = self.pool.get('account.invoice') | 467,725 |
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... | defaction_invoice_create(self,cr,uid,ids,grouped=False,states=['confirmed','done','exception'],date_inv=False,context=None):res=Falseinvoices={}invoice_ids=[]picking_obj=self.pool.get('stock.picking')invoice=self.pool.get('account.invoice')ifcontextisNone:context={}#Ifdatewasspecified,useitasdateinvoiced,usefullwheninv... | 467,726 |
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... | 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... | 467,727 |
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_... | 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']) return super(v... | 467,728 |
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 | 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 | 467,729 |
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 | 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 | 467,730 |
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 | 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 | 467,731 |
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 | 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 | 467,732 |
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... | 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... | 467,733 |
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... | 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... | 467,734 |
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 | 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 | 467,735 |
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))... | 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))... | 467,736 |
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 | 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 | 467,737 |
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... | 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... | 467,738 |
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 { '... | def _get_info(self, cr, uid, data, context): if not data['id']: return {} pool = pooler.get_pool(cr.dbname) case = pool.get(data.get('model')).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!')) ret... | 467,739 |
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... | 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... | 467,740 |
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... | 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... | 467,741 |
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',... | defimport_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=[]forchildinparsedCal.getChildren():ifchild.name.lower()in('vevent','vtodo'):vals=self.parse_ics(cr,... | 467,742 |
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',... | 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',... | 467,743 |
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)... | def export_cal(self, cr, uid, ids, vobj='vevent', context={}): cal = self.browse(cr, uid, ids[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) dat... | 467,744 |
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... | defimport_cal(self,cr,uid,content,data_id=None,context=None):ical_data=base64.decodestring(content)parsedCal=vobject.readOne(ical_data)ifnotdata_id:data_id=self.search(cr,uid,[])[0]cal=self.browse(cr,uid,data_id)cal_children={}count=0forlineincal.line_ids:cal_children[line.name]=line.object_id.modelforchildinparsedCal.... | 467,745 |
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... | 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... | 467,746 |
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... | 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... | 467,747 |
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... | 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... | 467,748 |
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... | 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... | 467,749 |
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'} | def res_widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] for wiz_id in wizard['widget_id']: self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wiz_id}) return {'type': 'ir.actions.act_window_close'} | 467,750 |
def __getitem__(self, name): if name == 'id': return self._id | def __getitem__(self, name): if name == 'id': return self._id | 467,751 |
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values | def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values | 467,752 |
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 | 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 | 467,753 |
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 | 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 | 467,754 |
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'])... | 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'])... | 467,755 |
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... | 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... | 467,756 |
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) | 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) | 467,757 |
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... | def _get_source(self, cr, uid, name, tt, lang, source=None): if not lang: return u'' 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), ... | 467,758 |
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... | 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), sou... | 467,759 |
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... | 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... | 467,760 |
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... | 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... | 467,761 |
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)... | def dumpstacks(signum, frame): # code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696 thread_map = dict(threading._active, **threading._limbo) id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()]) code = [] for thre... | 467,762 |
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)... | defdumpstacks(signum,frame):#codefromhttp://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696id2name=dict([(th.ident,th.name)forthinthreading.enumerate()])code=[]forthreadId,stackinsys._current_frames().items():code.append("\n#Thread:%s(%d)"%(id2name[threadId],threa... | 467,763 |
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) | 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) | 467,764 |
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... | 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... | 467,765 |
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 | 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 | 467,766 |
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 | 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 | 467,767 |
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {} | def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {} | 467,768 |
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 [] | 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 [] | 467,769 |
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.... | 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.... | 467,770 |
def _default_get(self, cr, uid, fields, context={}): | def if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') _default_get(self, if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_d... | 467,771 |
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... | 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... | 467,772 |
def coda_parsing(self, cr, uid, ids, context=None): | def coda_parsing(self, cr, uid, ids, context=None): | 467,773 |
def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | def convert_to_period(self, cr, uid, context={}): period_obj = self.pool.get('account.period') | 467,774 |
def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | def _default_get(self, cr, uid, fields, context={}): period_obj = self.pool.get('account.period') | 467,775 |
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... | defref = {} do_invite(self,ref = {} cr,ref = {} uid,ref = {} ids,ref = {} context={}):ref = {} forref = {} att_idref = {} inref = {} ids:ref = {} datasref = {} =ref = {} self.read(cr,ref = {} uid,ref = {} att_id)ref = {} modelref = {} =ref = {} Falseref = {} model_fieldref = {} =ref = {} Falseref = ... | 467,776 |
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... | 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... | 467,777 |
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... | 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... | 467,778 |
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... | 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... | 467,779 |
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... | 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... | 467,780 |
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... | 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: if ref.user_id.id != user[0]: defaults = {'user_id': user[0]} new_event = model_obj.copy(cr, uid, event, default=defaults... | 467,781 |
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 | def create(self, cr, uid, vals, context=None): if not context: 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, ... | 467,782 |
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... | 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,)) 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... | 467,783 |
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... | 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... | 467,784 |
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... | 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... | 467,785 |
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): ... | def _check_concurrency(self, cr, ids, context): if not context: return if not (context.get(self.CONCURRENCY_CHECK_FIELD) and 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):... | 467,786 |
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] | 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)forlanginlangs] | 467,787 |
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... | 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... | 467,788 |
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('... | 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('... | 467,789 |
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 {} | def invoice_confirm(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} 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... | 467,790 |
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 {} | 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 {} | 467,791 |
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 {} | def invoice_cancel(self, cr, uid, ids, context=None): if context is None: context = {} for id in context['active_ids']: wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) return {} | 467,792 |
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 {} | def invoice_cancel(self, cr, uid, ids, context=None): wf_service = netsvc.LocalService('workflow') if context is None: context = {} 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=contex... | 467,793 |
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. | 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. | 467,794 |
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. | 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. | 467,795 |
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']), ('... | 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']), ('... | 467,796 |
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... | 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... | 467,797 |
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... | 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... | 467,798 |
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... | 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... | 467,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.