bugged
stringlengths 4
228k
| fixed
stringlengths 0
96.3M
| __index_level_0__
int64 0
481k
|
|---|---|---|
def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period, 'get_account': self._get_account, 'get_filter': self._get_filter, 'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date, 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_fiscalyear': self._get_fiscalyear, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, 'print_data':self._print_data,
|
def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period, 'get_account': self._get_account, 'get_filter': self._get_filter, 'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date, 'get_fiscalyear': self._get_fiscalyear, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, 'print_data':self._print_data,
| 470,800
|
def _set_get_account_currency_code(self, account_id): self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() if result: self.account_currency = result[0] else: self.account_currency = False
|
def _set_get_account_currency_code(self, account_id): self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() if result: self.account_currency = result[0] else: self.account_currency = False
| 470,801
|
def __pos_payment_date__total__(self,form): dt1 = form['date_start'] + ' 00:00:00' dt2 = form['date_end'] + ' 23:59:59' res=[] self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ ,(dt1,dt2,tuple(form['user_id']))) res=self.cr.fetchone()[0] return res
|
def __pos_payment_date__total__(self,form): dt1 = form['date_start'] + ' 00:00:00' dt2 = form['date_end'] + ' 23:59:59' res=[] self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ ,(dt1,dt2,tuple(form['user_id']))) res=self.cr.fetchone()[0] or 0.0 return res
| 470,802
|
def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None): warning = True model_obj = self.pool.get(model) if not context: context = {} if xml_id and ('.' in xml_id): assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id') % (xml_id) warning = False module, xml_id = xml_id.split('.') if (not xml_id) and (not self.doinit): return False action_id = False
|
def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None): warning = True model_obj = self.pool.get(model) if not context: context = {} if xml_id and ('.' in xml_id): assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % (xml_id) warning = False module, xml_id = xml_id.split('.') if (not xml_id) and (not self.doinit): return False action_id = False
| 470,803
|
def _make_invoice(self, cr, uid, reg, lines, context=None): """ Create Invoice from Invoice lines @param reg : Model of Event Registration @param lines: Ids of Invoice lines """ if context is None: context = {} inv_pool = self.pool.get('account.invoice') inv_lines_pool = self.pool.get('account.invoice.line')
|
def _make_invoice(self, cr, uid, reg, lines, context=None): """ Create Invoice from Invoice lines @param reg : Model of Event Registration @param lines: Ids of Invoice lines """ if context is None: context = {} inv_pool = self.pool.get('account.invoice') inv_lines_pool = self.pool.get('account.invoice.line')
| 470,804
|
def onchange_contact_id(self, cr, uid, ids, contact, partner):
|
def onchange_contact_id(self, cr, uid, ids, contact, partner):
| 470,805
|
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False): """This function returns value of Patner Invoice id, Unit Price, badget title based on partner and Event. @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 Registration IDs @param event_id: Event ID @param partner_invoice_id: Partner Invoice ID """ job_obj = self.pool.get('res.partner.job') res_obj = self.pool.get('res.partner')
|
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False): """This function returns value of Patner Invoice id, Unit Price, badget title based on partner and Event. @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 Registration IDs @param event_id: Event ID @param partner_invoice_id: Partner Invoice ID """ job_obj = self.pool.get('res.partner.job') res_obj = self.pool.get('res.partner')
| 470,806
|
def launch_wizard(self, cr, uid, ids, context=None): """ Search for a wizard to launch according to the type. If type is manual. just confirm the order. """ obj_payment_order = self.pool.get('payment.order')
|
def launch_wizard(self, cr, uid, ids, context=None): """ Search for a wizard to launch according to the type. If type is manual. just confirm the order. """ obj_payment_order = self.pool.get('payment.order')
| 470,807
|
def unlink(self, cr, uid, ids, context=None): """ Deletes records specified in ids. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: List of calendar event's id. @param context: A standard dictionary for contextual values @return: True """ res = False for event_id in ids: if isinstance(event_id, (int, long)): res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) continue event_id, date_new = event_id.split('-') event_id = [int(event_id)] for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): if record['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) res = self.write(cr, uid, event_id, {'exdate': date_new}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name) return res
|
def unlink(self, cr, uid, ids, context=None): """ Deletes records specified in ids. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: List of calendar event's id. @param context: A standard dictionary for contextual values @return: True """ res = False for event_id in ids: if isinstance(event_id, (int, long)): res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) continue event_id, date_new = event_id.split('-') event_id = [int(event_id)] for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): if record['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) exdate = (record['exdate'] and (record['exdate'] + ',') or '') + date_new res = self.write(cr, uid, event_id, {'exdate': exdate}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name) return res
| 470,808
|
def __init__(self, cr, uid, id, table, cache, context=None, list_class=None, fields_process=None): ''' table : the object (inherited from orm) context : dictionary with an optional context ''' if fields_process is None: domain = {} if context is None: context = {} self._list_class = list_class or browse_record_list self._cr = cr self._uid = uid self._id = id self._table = table self._table_name = self._table._name self.__logger = logging.getLogger( 'osv.browse_record.' + self._table_name) self._context = context self._fields_process = fields_process
|
def __init__(self, cr, uid, id, table, cache, context=None, list_class=None, fields_process=None): ''' table : the object (inherited from orm) context : dictionary with an optional context ''' if fields_process is None: fields_process = {} if context is None: context = {} self._list_class = list_class or browse_record_list self._cr = cr self._uid = uid self._id = id self._table = table self._table_name = self._table._name self.__logger = logging.getLogger( 'osv.browse_record.' + self._table_name) self._context = context self._fields_process = fields_process
| 470,809
|
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() picking_obj = self.browse(cr, uid, [id], context)[0] if ('name' not in default) or (picking_obj.name=='/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) default['origin'] = '' default['backorder_id'] = False return super(stock_picking, self).copy(cr, uid, id, default, context)
|
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() picking_obj = self.browse(cr, uid, [id], context)[0] if ('name' not in default) or (picking_obj.name=='/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) default['origin'] = '' default['backorder_id'] = False return super(stock_picking, self).copy(cr, uid, id, default, context)
| 470,810
|
def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True
|
def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True
| 470,811
|
def _user_allow(self, cr, uid, ids, statement, context={}): res = False uids = [] for user in statement.journal_id.journal_users: uids.append(user.id) if uid in uids: res = True return res
|
def _user_allow(self, cr, uid, ids, statement, context={}): res = False uids = [] for user in statement.journal_id.journal_users: uids.append(user.id) if uid in uids: res = True return res
| 470,812
|
def _email_get(self, cr, uid, ids, name, arg, context=None): return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context)))
|
def _email_get(self, cr, uid, ids, name, arg, context=None): return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context)))
| 470,813
|
def get_pg_type(f): ''' returns a tuple (type returned by postgres when the column was created, type expression to create the column) ''' type_dict = { fields.boolean: 'bool', fields.integer: 'int4', fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', fields.datetime: 'timestamp', fields.binary: 'bytea', fields.many2one: 'int4', } if type(f) in type_dict: f_type = (type_dict[type(f)], type_dict[type(f)]) elif isinstance(f, fields.float): if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, (fields.char, fields.reference)): f_type = ('varchar', 'VARCHAR(%d)' % (f.size,)) elif isinstance(f, fields.selection): if isinstance(f.selection, list) and isinstance(f.selection[0][0], (str, unicode)): f_size = reduce(lambda x, y: max(x, len(y[0])), f.selection, f.size or 16) elif isinstance(f.selection, list) and isinstance(f.selection[0][0], int): f_size = -1 else: f_size = getattr(f, 'size', 16) if f_size == -1: f_type = ('int4', 'INTEGER') else: f_type = ('varchar', 'VARCHAR(%d)' % f_size) elif isinstance(f, fields.function) and eval('fields.'+(f._type)) in type_dict: t = eval('fields.'+(f._type)) f_type = (type_dict[t], type_dict[t]) elif isinstance(f, fields.function) and f._type == 'float': if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, fields.function) and f._type == 'selection': f_type = ('text', 'text') elif isinstance(f, fields.function) and f._type == 'char': f_type = ('varchar', 'VARCHAR(%d)' % (f.size)) else: logger = netsvc.Logger() logger.notifyChannel("init", netsvc.LOG_WARNING, '%s type not supported!' % (type(f))) f_type = None return f_type
|
def get_pg_type(f): ''' returns a tuple (type returned by postgres when the column was created, type expression to create the column) ''' type_dict = { fields.boolean: 'bool', fields.integer: 'int4', fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', fields.datetime: 'timestamp', fields.binary: 'bytea', fields.many2one: 'int4', } if type(f) in type_dict: f_type = (type_dict[type(f)], type_dict[type(f)]) elif isinstance(f, fields.float): if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, (fields.char, fields.reference)): f_type = ('varchar', 'VARCHAR(%d)' % (f.size,)) elif isinstance(f, fields.selection): if isinstance(f.selection, list) and isinstance(f.selection[0][0], (str, unicode)): f_size = reduce(lambda x, y: max(x, len(y[0])), f.selection, f.size or 16) elif isinstance(f.selection, list) and isinstance(f.selection[0][0], int): f_size = -1 else: f_size = getattr(f, 'size', None) or 16 if f_size == -1: f_type = ('int4', 'INTEGER') else: f_type = ('varchar', 'VARCHAR(%d)' % f_size) elif isinstance(f, fields.function) and eval('fields.'+(f._type)) in type_dict: t = eval('fields.'+(f._type)) f_type = (type_dict[t], type_dict[t]) elif isinstance(f, fields.function) and f._type == 'float': if f.digits: f_type = ('numeric', 'NUMERIC(%d,%d)' % (f.digits[0], f.digits[1])) else: f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, fields.function) and f._type == 'selection': f_type = ('text', 'text') elif isinstance(f, fields.function) and f._type == 'char': f_type = ('varchar', 'VARCHAR(%d)' % (f.size)) else: logger = netsvc.Logger() logger.notifyChannel("init", netsvc.LOG_WARNING, '%s type not supported!' % (type(f))) f_type = None return f_type
| 470,814
|
def check_duplicate(self, cr, uid, ids):
|
def check_duplicate(self, cr, uid, ids):
| 470,815
|
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
|
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
| 470,816
|
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """
|
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """
| 470,817
|
def _add_header(self, rml_dom, header='internal'): if header=='internal': rml_head = self.rml_header2 else: rml_head = self.rml_header
|
def _add_header(self, rml_dom, header='internal'): if header=='internal': rml_head = self.rml_header2 else: rml_head = self.rml_header
| 470,818
|
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False)
|
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False)
| 470,819
|
def _get_data(self,o): data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) data = self.cr.dictfetchall() a_l=[] for r in data: a_l.append(r['id']) if len(a_l): sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),) self.cr.execute(sql2) data = self.cr.dictfetchall() for d in data: self.total += d['amt'] return data
|
def _get_data(self,o): data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) data = self.cr.dictfetchall() a_l=[] for r in data: a_l.append(r['id']) if len(a_l): sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id = %d and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit"""%(o.id) self.cr.execute(sql2) data = self.cr.dictfetchall() for d in data: self.total += d['amt'] return data
| 470,820
|
def get_name(self, cr, uid, ids, field_name, arg, context=None): res = {} for allocation in self.browse(cr, uid, ids, context=context): name = allocation.resource_id.name if allocation.user_id: name = '%s' %(allocation.user_id.name) name += ' (%s%%)' %(allocation.useability) res[allocation.id] = name return res
|
def get_name(self, cr, uid, ids, field_name, arg, context=None): res = {} for allocation in self.browse(cr, uid, ids, context=context): name = allocation.phase_id.name name += ' (%s%%)' %(allocation.useability) res[allocation.id] = name return res
| 470,821
|
def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context={}): ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context) return self.read(cr, uid, ids, ['res_id','name'], context=context)
|
def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context={}): ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context) return self.read(cr, uid, ids, ['res_id','name'], context=context)
| 470,822
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
| 470,823
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] domain.append(['period_id','in',[current_period]]) todel.append(arg) break elif arg[0] == 'period_id' and arg[2] == 'current_year': current_year = fiscalyear_obj.find(cr, uid) ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) todel.append(arg) for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
| 470,824
|
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False
|
def get_id(self, cr, uid, sequence_id, test='id', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False
| 470,825
|
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False
|
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: assert test in ('code','id') cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+'=%s AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: return self._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + self._process(res['suffix']) else: return self._process(res['prefix']) + self._process(res['suffix']) finally: cr.commit() return False
| 470,826
|
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
|
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
| 470,827
|
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
|
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
| 470,828
|
def _debit_calc(self, cr, uid, ids, name, arg, context={}):
|
defr = {} _debit_calc(self,r = {} cr,r = {} uid,r = {} ids,r = {} name,r = {} arg,r = {} context={}):
| 470,829
|
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
|
def action_production_end(self, cr, uid, ids): for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
| 470,830
|
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
|
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
| 470,831
|
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self.pool.get('stock.move').action_done(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
|
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.append(res.id) vals= {'state':'confirmed'} new_moves = [x.id for x in production.move_created_ids] self.pool.get('stock.move').write(cr, uid, new_moves, vals) if not production.date_finnished: self.write(cr, uid, [production.id], {'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) self.pool.get('stock.move').check_assign(cr, uid, new_moves) self._costs_generate(cr, uid, production) self.pool.get('stock.move').action_done(cr, uid, move_ids) self.write(cr, uid, ids, {'state': 'done'}) return True
| 470,832
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
| 470,833
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
| 470,834
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
| 470,835
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
| 470,836
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
|
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._name, self._description, self.__doc__, 'base')) else: model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.','_') cr.execute('select * from ir_model_data where name=%s and res_id=%s', (name_id,model_id)) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) )
| 470,837
|
def process_sql_file(cr, file): queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query)
|
def process_sql_file(cr, fp): queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query)
| 470,838
|
def _load_data(cr, module_name, id_map, mode, kind): noupdate = (kind == 'demo') for filename in package.data.get(kind, []): _, ext = os.path.splitext(filename) log.info("module %s: loading %s", module_name, filename) pathname = os.path.join(module_name, filename) file = tools.file_open(pathname) # TODO manage .csv file with noupdate == (kind == 'init') if ext == '.sql': process_sql_file(cr, fp) elif ext == '.csv': noupdate = (kind == 'init') tools.convert_csv_import(cr, module_name, pathname, file.read(), id_map, mode, noupdate) elif ext == '.yml': tools.convert_yaml_import(cr, module_name, file, id_map, mode, noupdate) else: tools.convert_xml_import(cr, module_name, file, id_map, mode, noupdate) file.close()
|
def _load_data(cr, module_name, id_map, mode, kind): noupdate = (kind == 'demo') for filename in package.data.get(kind, []): _, ext = os.path.splitext(filename) log.info("module %s: loading %s", module_name, filename) pathname = os.path.join(module_name, filename) file = tools.file_open(pathname) # TODO manage .csv file with noupdate == (kind == 'init') if ext == '.sql': process_sql_file(cr, file) elif ext == '.csv': noupdate = (kind == 'init') tools.convert_csv_import(cr, module_name, pathname, file.read(), id_map, mode, noupdate) elif ext == '.yml': tools.convert_yaml_import(cr, module_name, file, id_map, mode, noupdate) else: tools.convert_xml_import(cr, module_name, file, id_map, mode, noupdate) file.close()
| 470,839
|
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
|
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
| 470,840
|
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
|
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
| 470,841
|
def search_invoices(self, cr, uid, ids, context=None): if context is None: context = {} line_obj = self.pool.get('account.move.line') statement_obj = self.pool.get('account.bank.statement') journal_obj = self.pool.get('account.journal') mod_obj = self.pool.get('ir.model.data') statement_id = 'statement_id' in context and context['statement_id']
|
def search_invoices(self, cr, uid, ids, context=None): if context is None: context = {} line_obj = self.pool.get('account.move.line') statement_obj = self.pool.get('account.bank.statement') journal_obj = self.pool.get('account.journal') mod_obj = self.pool.get('ir.model.data') statement_id = 'statement_id' in context and context['statement_id']
| 470,842
|
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
|
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
| 470,843
|
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {}
|
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {}
| 470,844
|
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {}
|
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {}
| 470,845
|
def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 power = form['power'] allow_write_off = form['allow_write_off'] reconciled = unreconciled = 0 if not form['account_ids']: raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile')) for account_id in form['account_ids']: params = (account_id,) if not allow_write_off: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0""" else: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0""" params.append(max_amount) # reconcile automatically all transactions from partners whose balance is 0 cr.execute(query, params) partner_ids = [id for (id,) in cr.fetchall()] for partner_id in partner_ids: cr.execute( "SELECT id " \ "FROM account_move_line " \ "WHERE account_id=%s " \ "AND partner_id=%s " \ "AND state <> 'draft' " \ "AND reconcile_id IS NULL", (account_id, partner_id)) line_ids = [id for (id,) in cr.fetchall()] if len(line_ids): reconciled += len(line_ids) if allow_write_off: move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) else: move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
|
def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 power = form['power'] allow_write_off = form['allow_write_off'] reconciled = unreconciled = 0 if not form['account_ids']: raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile')) for account_id in form['account_ids']: params = (account_id,) if not allow_write_off: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0""" else: query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL AND state <> 'draft' GROUP BY partner_id HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0""" params += max_amount # reconcile automatically all transactions from partners whose balance is 0 cr.execute(query, params) partner_ids = [id for (id,) in cr.fetchall()] for partner_id in partner_ids: cr.execute( "SELECT id " \ "FROM account_move_line " \ "WHERE account_id=%s " \ "AND partner_id=%s " \ "AND state <> 'draft' " \ "AND reconcile_id IS NULL", (account_id, partner_id)) line_ids = [id for (id,) in cr.fetchall()] if len(line_ids): reconciled += len(line_ids) if allow_write_off: move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) else: move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
| 470,846
|
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft')
|
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft')
| 470,847
|
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft')
|
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft')
| 470,848
|
def schedule_tasks(self, cr, uid, ids, context=None): """ Schedule the tasks according to resource available and priority. """ task_pool = self.pool.get('project.task') resource_pool = self.pool.get('resource.resource') resources_list = self.generate_resources(cr, uid, ids, context=context) return_msg = {} for phase in self.browse(cr, uid, ids, context=context): start_date = phase.date_start if not start_date and phase.project_id.date_start: start_date = phase.project_id.date_start if not start_date: start_date = datetime.now().strftime("%Y-%m-%d") resources = resources_list.get(phase.id, []) calendar_id = phase.project_id.resource_calendar_id.id task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['open', 'draft', 'pending'] , phase.task_ids))) if task_ids: task_pool.generate_schedule(cr, uid, task_ids, resources, calendar_id, start_date, context=context)
|
def schedule_tasks(self, cr, uid, ids, context=None): """ Schedule the tasks according to resource available and priority. """ task_pool = self.pool.get('project.task') resource_pool = self.pool.get('resource.resource') resources_list = self.generate_resources(cr, uid, ids, context=context) return_msg = {} for phase in self.browse(cr, uid, ids, context=context): start_date = phase.date_start if not start_date and phase.project_id.date_start: start_date = phase.project_id.date_start if not start_date: start_date = datetime.now().strftime("%Y-%m-%d") resources = resources_list.get(phase.id, []) calendar_id = phase.project_id.resource_calendar_id.id task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['draft'] , phase.task_ids))) if task_ids: task_pool.generate_schedule(cr, uid, task_ids, resources, calendar_id, start_date, context=context)
| 470,849
|
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
|
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
| 470,850
|
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
|
defparents = ids lines(self,parents = ids form,parents = ids ids=[],parents = ids done=None):#,parents = ids level=1):parents = ids obj_accountparents = ids =parents = ids self.pool.get('account.account')parents = ids ifparents = ids notparents = ids ids:parents = ids idsparents = ids =parents = ids self.idsparents = ids ifparents = ids notparents = ids ids:parents = ids returnparents = ids []parents = ids ifparents = ids notparents = ids done:parents = ids done={}
| 470,851
|
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
|
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
| 470,852
|
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): """ Read IR Model @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 IR Model’s IDs. @param context: A standard dictionary for contextual values """
|
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): """ Read IR Model @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 IR Model’s IDs. @param context: A standard dictionary for contextual values """
| 470,853
|
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result
|
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) task_obj = self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result
| 470,854
|
def get_hrs_timesheet(self, cr, uid, ids, name,args,context): result = {} sum = 0.0 for record in self.browse(cr, uid, ids, context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 obj=self.pool.get('hr_timesheet_sheet.sheet.day') sheet_ids = obj.search(cr, uid, [('sheet_id.user_id','=',record.user_id.id),('name','>=',record.name),('name','<=',last_date.strftime('%Y-%m-%d'))]) data_days = obj.read(cr, uid, sheet_ids, ['name','sheet_id.user_id','total_attendance']) total = 0.0 for day_attendance in data_days: total += day_attendance['total_attendance'] result[record.id] = total return result
|
def get_hrs_timesheet(self, cr, uid, ids, name,args,context): result = {} sum = 0.0 for record in self.browse(cr, uid, ids, context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) obj = self.pool.get('hr_timesheet_sheet.sheet.day') sheet_ids = obj.search(cr, uid, [('sheet_id.user_id','=',record.user_id.id),('name','>=',record.name),('name','<=',last_date.strftime('%Y-%m-%d'))]) data_days = obj.read(cr, uid, sheet_ids, ['name','sheet_id.user_id','total_attendance']) total = 0.0 for day_attendance in data_days: total += day_attendance['total_attendance'] result[record.id] = total return result
| 470,855
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
| 470,856
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
| 470,857
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
| 470,858
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
| 470,859
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
|
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
| 470,860
|
def search_entries(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data')
|
defif context is None: context = {} search_entries(self,if context is None: context = {} cr,if context is None: context = {} uid,if context is None: context = {} ids,if context is None: context = {} context=None):if context is None: context = {} order_objif context is None: context = {} =if context is None: context = {} self.pool.get('payment.order')if context is None: context = {} line_objif context is None: context = {} =if context is None: context = {} self.pool.get('account.move.line')if context is None: context = {} mod_objif context is None: context = {} =if context is None: context = {} self.pool.get('ir.model.data')
| 470,861
|
def change_currency(self, cr, uid, ids, context=None): obj_inv = self.pool.get('account.invoice') obj_inv_line = self.pool.get('account.invoice.line') obj_currency = self.pool.get('res.currency') invoice_ids = [] if context is None: context = {} data = self.read(cr, uid, ids)[0] new_currency = data['currency_id']
|
def change_currency(self, cr, uid, ids, context=None): obj_inv = self.pool.get('account.invoice') obj_inv_line = self.pool.get('account.invoice.line') obj_currency = self.pool.get('res.currency') invoice_ids = [] if context is None: context = {} data = self.read(cr, uid, ids)[0] new_currency = data['currency_id']
| 470,862
|
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result
|
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) total = 0.0 for hrs in tsk_hrs: total += hrs['hours'] result[record.id] = total return result
| 470,863
|
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() default.update({'line_ids': []}) return super(account_tax_code, self).copy(cr, uid, id, default, context)
|
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() default.update({'line_ids': []}) return super(account_tax_code, self).copy(cr, uid, id, default, context)
| 470,864
|
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module')
|
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (either 'to install', 'to upgrade' or 'installed') and if it is, check it by default """ modules = self.pool.get('ir.module.module')
| 470,865
|
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module')
|
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module')
| 470,866
|
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\ toolbar=False, submenu=False): """ Overrides orm field_view_get. @return: Dictionary of Fields, arch and toolbar. """
|
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\ toolbar=False, submenu=False): """ Overrides orm field_view_get. @return: Dictionary of Fields, arch and toolbar. """
| 470,867
|
def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, context=context) default_val,replaces = self._get_defaults(obj, cr, uid, prop_name, context)
|
def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, context=context) default_val,replaces = self._get_defaults(obj, cr, uid, prop_name, context)
| 470,868
|
logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name))
|
logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name))
| 470,869
|
def fetch_mail(self, cr, uid, ids, context={}):
|
def fetch_mail(self, cr, uid, ids, context={}):
| 470,870
|
def action_ship_create(self, cr, uid, ids, *args): picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = False for line in order.order_line: proc_id = False date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) date_planned = (date_planned - relativedelta(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') if line.state == 'done': continue move_id = False if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'): location_id = order.shop_id.warehouse_id.lot_stock_id.id if not picking_id: loc_dest_id = order.partner_id.property_stock_customer.id pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') picking_id = self.pool.get('stock.picking').create(cr, uid, { 'name': pick_name, 'origin': order.name, 'type': 'out', 'state': 'auto', 'move_type': order.picking_policy, 'sale_id': order.id, 'address_id': order.partner_shipping_id.id, 'note': order.note, 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', 'company_id': order.company_id.id, }) move_id = self.pool.get('stock.move').create(cr, uid, { 'name': line.name[:64], 'picking_id': picking_id, 'product_id': line.product_id.id, 'date_planned': date_planned, 'date_expected': date_planned, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': line.product_uos_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'product_packaging': line.product_packaging.id, 'address_id': line.address_allotment_id.id or order.partner_shipping_id.id, 'location_id': location_id, 'location_dest_id': output_id, 'sale_line_id': line.id, 'tracking_id': False, 'state': 'draft', #'state': 'waiting', 'note': line.notes, 'company_id': order.company_id.id, }) if line.product_id: proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, 'origin': order.name, 'date_planned': date_planned, 'product_id': line.product_id.id, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': (line.product_uos and line.product_uos_qty)\ or line.product_uom_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'location_id': order.shop_id.warehouse_id.lot_stock_id.id, 'procure_method': line.type, 'move_id': move_id, 'property_ids': [(6, 0, [x.id for x in line.property_ids])], 'company_id': order.company_id.id, }) proc_ids.append(proc_id) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
|
def action_ship_create(self, cr, uid, ids, *args): picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = False for line in order.order_line: proc_id = False date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') if line.state == 'done': continue move_id = False if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'): location_id = order.shop_id.warehouse_id.lot_stock_id.id if not picking_id: loc_dest_id = order.partner_id.property_stock_customer.id pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') picking_id = self.pool.get('stock.picking').create(cr, uid, { 'name': pick_name, 'origin': order.name, 'type': 'out', 'state': 'auto', 'move_type': order.picking_policy, 'sale_id': order.id, 'address_id': order.partner_shipping_id.id, 'note': order.note, 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', 'company_id': order.company_id.id, }) move_id = self.pool.get('stock.move').create(cr, uid, { 'name': line.name[:64], 'picking_id': picking_id, 'product_id': line.product_id.id, 'date_planned': date_planned, 'date_expected': date_planned, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': line.product_uos_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'product_packaging': line.product_packaging.id, 'address_id': line.address_allotment_id.id or order.partner_shipping_id.id, 'location_id': location_id, 'location_dest_id': output_id, 'sale_line_id': line.id, 'tracking_id': False, 'state': 'draft', #'state': 'waiting', 'note': line.notes, 'company_id': order.company_id.id, }) if line.product_id: proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, 'origin': order.name, 'date_planned': date_planned, 'product_id': line.product_id.id, 'product_qty': line.product_uom_qty, 'product_uom': line.product_uom.id, 'product_uos_qty': (line.product_uos and line.product_uos_qty)\ or line.product_uom_qty, 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'location_id': order.shop_id.warehouse_id.lot_stock_id.id, 'procure_method': line.type, 'move_id': move_id, 'property_ids': [(6, 0, [x.id for x in line.property_ids])], 'company_id': order.company_id.id, }) proc_ids.append(proc_id) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
| 470,871
|
def _get_intial_balance(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
|
def _get_intial_balance(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
| 470,872
|
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
| 470,873
|
def log(lvl,msg): netsvc.Logger().notifyChannel("index",lvl,msg)
|
def log(lvl,msg): netsvc.Logger().notifyChannel("index",lvl,msg)
| 470,874
|
def init(self, cr): '''Create the view''' cr.execute("""
|
def init(self, cr): '''Create the view''' cr.execute("""
| 470,875
|
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): if not context: context = {} cr.execute('select c.id as id, crm_case.date as date, alarm.id as alarm_id, alarm.name as name,\ alarm.trigger_interval, alarm.trigger_duration, alarm.trigger_related, \ alarm.trigger_occurs from crm_meeting c \ join crm_case on c.inherit_case_id = crm_case.id \ join crm_caldav_alarm alarm on (alarm.id=c.alarm_id) \ where alarm_id is not null and alarm.active=True') case_with_alarm = cr.dictfetchall() case_obj = self.pool.get('crm.meeting') attendee_obj = self.pool.get('crm.caldav.attendee') mail_to = [] for alarmdata in case_with_alarm: dtstart = datetime.datetime.strptime(alarmdata['date'], "%Y-%m-%d %H:%M:%S") if alarmdata['trigger_interval'] == 'DAYS': delta = datetime.timedelta(days=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'HOURS': delta = datetime.timedelta(hours=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'MINUTES': delta = datetime.timedelta(minutes=alarmdata['trigger_duration']) alarm_time = dtstart + (alarmdata['trigger_occurs']== 'AFTER' and delta or -delta) if datetime.datetime.now() >= alarm_time: case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context)[0] for att in case_val.attendees: if att.cn.rsplit(': ')[-1]: mail_to.append(att.cn.rsplit(': ')[-1]) if mail_to: sub = 'Event Reminder for ' + case_val.name or '' body = (case_val.name or '')+ '\n\t' + (case_val.description or '') + '\n\nEvent time: ' \ +(case_val.date) + '\n\nLocation: ' + (case_val.location or '') + \ '\n\nMembers Details: ' + '\n'.join(mail_to) tools.email_send( case_val.user_id.address_id.email, mail_to, sub, body ) cr.execute('update crm_caldav_alarm set active=False\ where id = %s' % alarmdata['alarm_id']) cr.commit() return True
|
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): if not context: context = {} cr.execute('select c.id as id, crm_case.date as date, alarm.id as alarm_id, alarm.name as name,\ alarm.trigger_interval, alarm.trigger_duration, alarm.trigger_related, \ alarm.trigger_occurs from crm_meeting c \ join crm_case on c.inherit_case_id = crm_case.id \ join crm_caldav_alarm alarm on (alarm.id=c.alarm_id) \ where alarm_id is not null and alarm.active=True') case_with_alarm = cr.dictfetchall() case_obj = self.pool.get('crm.meeting') attendee_obj = self.pool.get('crm.caldav.attendee') mail_to = [] for alarmdata in case_with_alarm: dtstart = datetime.datetime.strptime(alarmdata['date'], "%Y-%m-%d %H:%M:%S") if alarmdata['trigger_interval'] == 'DAYS': delta = datetime.timedelta(days=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'HOURS': delta = datetime.timedelta(hours=alarmdata['trigger_duration']) if alarmdata['trigger_interval'] == 'MINUTES': delta = datetime.timedelta(minutes=alarmdata['trigger_duration']) alarm_time = dtstart + (alarmdata['trigger_occurs']== 'AFTER' and delta or -delta) if datetime.datetime.now() >= alarm_time: case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context) for att in case_val.attendee_ids: if att.cn.rsplit(': ')[-1]: mail_to.append(att.cn.rsplit(': ')[-1]) if mail_to: sub = 'Event Reminder for ' + case_val.name or '' body = (case_val.name or '')+ '\n\t' + (case_val.description or '') + '\n\nEvent time: ' \ +(case_val.date) + '\n\nLocation: ' + (case_val.location or '') + \ '\n\nMembers Details: ' + '\n'.join(mail_to) tools.email_send( case_val.user_id.address_id.email, mail_to, sub, body ) cr.execute('update crm_caldav_alarm set active=False\ where id = %s' % alarmdata['alarm_id']) cr.commit() return True
| 470,876
|
def unlink(self, cr, uid, ids, context=None): for id in ids: ls = common.caldav_id2real_id(caldav_id) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: date_new = ls[1] for record in self.read(cr, uid, [common.caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: exdate = (record['exdate'] and (record['exdate'] + ',') or '') + \ ''.join((re.compile('\d')).findall(date_new)) + 'Z' if record['date'] == date_new: self.write(cr, uid, [common.caldav_id2real_id(id)], {'exdate': exdate}) else: ids = map(lambda x: common.caldav_id2real_id(x), ids) return super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids)) else: return super(crm_meeting, self).unlink(cr, uid, ids)
|
def unlink(self, cr, uid, ids, context=None): for id in ids: ls = common.caldav_id2real_id(id) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: date_new = ls[1] for record in self.read(cr, uid, [common.caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: exdate = (record['exdate'] and (record['exdate'] + ',') or '') + \ ''.join((re.compile('\d')).findall(date_new)) + 'Z' if record['date'] == date_new: self.write(cr, uid, [common.caldav_id2real_id(id)], {'exdate': exdate}) else: ids = map(lambda x: common.caldav_id2real_id(x), ids) return super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids)) else: return super(crm_meeting, self).unlink(cr, uid, ids)
| 470,877
|
def _get_user_avail(self, cr, uid, ids, name, args, context=None): res={} if not context or not context.get('model'): return {} else: model = context.get('model') obj = self.pool.get(model) event_obj = obj.browse(cr, uid, context['active_id']) event_start = event_obj.date event_end = datetime.datetime.strptime(event_obj.date, "%Y-%m-%d %H:%M:%S") \ + datetime.timedelta(hours=event_obj.duration) for id in ids: datas = self.browse(cr, uid, id) cr.execute("""SELECT c.date as start, (c.date::timestamp \ + c.duration * interval '1 hour') as end \ from crm_meeting m \ join crm_case c on (c.id=m.inherit_case_id)\ where c.user_id = %s and m.id not in (""" % (datas['id']) + str(context['active_id']) +")") dates = cr.dictfetchall() overlaps = False # check event time for date in dates: start = date['start'] end = date['end'] cr.execute("SELECT (timestamp '%s', timestamp '%s') OVERLAPS\ (timestamp '%s', timestamp '%s')" % (event_start, event_end, start, end)) over = cr.fetchone()[0] if over: overlaps = True
|
def _get_user_avail(self, cr, uid, ids, name, args, context=None): res={} if not context or not context.get('model'): return {} else: model = context.get('model') obj = self.pool.get(model) event_obj = obj.browse(cr, uid, context['active_id']) event_start = event_obj.date event_end = datetime.datetime.strptime(event_obj.date, "%Y-%m-%d %H:%M:%S") \ + datetime.timedelta(hours=event_obj.duration) for id in ids: datas = self.browse(cr, uid, id) cr.execute("""SELECT c.date as start, (c.date::timestamp \ + c.duration * interval '1 hour') as end \ from crm_meeting m \ join crm_case c on (c.id=m.inherit_case_id)\ where c.user_id = %s and m.id not in (""" % (datas['id']) + str(context['active_id']) +")") dates = cr.dictfetchall() overlaps = False # check event time for date in dates: start = date['start'] end = date['end'] cr.execute("SELECT (timestamp '%s', timestamp '%s') OVERLAPS\ (timestamp '%s', timestamp '%s')" % (event_start, event_end, start, end)) over = cr.fetchone()[0] if over: overlaps = True
| 470,878
|
def do_invite(self, cr, uid, ids, context={}): #TODO: Add attendee return {}
|
defdatas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) do_invite(self,datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) cr,datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) uid,datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) ids,datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) context={}):datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) #TODO:datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) Adddatas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) attendeedatas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) returndatas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') for user_id in datas.get('users', []): user = user_obj.browse(cr, uid, user_id) if not user.address_id.email: raise osv.except_osv(_('Error!'), \ ("User does not have an email Address")) attendee_id = attendee_obj.create(cr, uid, {'user_id': user_id,\ 'cn': user.name + ':MAILTO:' + user.address_id.email}) obj.write(cr, uid, res_obj.id, {'attendee_ids': [(6, 0, [attendee_id])]}) {}
| 470,879
|
def on_change_parent(self, cr, uid, id, parent_id): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) numchild = len(childs) if parent['partner_id']: partner = parent['partner_id'][0] else: partner = False res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}} if partner: res['value']['partner_id'] = partner return res
|
def on_change_parent(self, cr, uid, id, parent_id): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) numchild = len(childs) if parent['partner_id']: partner = parent['partner_id'][0] else: partner = False res = {'value' : {}} if partner: res['value']['partner_id'] = partner return res
| 470,880
|
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
|
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
| 470,881
|
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
|
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
| 470,882
|
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): """Gives virtual event ids for recurring events based on value of Recurrence Rule This method gives ids of dates that comes between start date and end date of calendar views @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 base_start_date: Get Start Date @param base_until_date: Get End Date @param limit: The Number of Results to Return """
|
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): """Gives virtual event ids for recurring events based on value of Recurrence Rule This method gives ids of dates that comes between start date and end date of calendar views @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 base_start_date: Get Start Date @param base_until_date: Get End Date @param limit: The Number of Results to Return """
| 470,883
|
def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone()
|
def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone()
| 470,884
|
def _check_recursion(self, cr, uid, ids): return super(event_event, self)._check_recursion(self, cr, uid, ids)
|
def _check_recursion(self, cr, uid, ids): return super(event_event, self)._check_recursion(self, cr, uid, ids)
| 470,885
|
def check_date(self, cr, uid, vals, context=None, check=True): if not context: context = {} if 'date' in vals.keys(): if 'journal_id' in vals and 'journal_id' not in context: journal_id = vals['journal_id'] if 'period_id' in vals and 'period_id' not in context: period_id = vals['period_id'] elif 'journal_id' not in context and 'move_id' in vals: m = self.pool.get('account.move').browse(cr, uid, vals['move_id']) journal_id = m.journal_id.id period_id = m.period_id.id else: journal_id = context['journal_id'] period_id = context['period_id'] journal=self.pool.get('account.journal').browse(cr,uid,[journal_id])[0] if not journal.allow_date: period=self.pool.get('account.period').browse(cr,uid,[period_id])[0] if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'): raise osv.except_osv(_('Error'),_('The date of your Ledger Posting is not in the defined period !')) else: return True
|
def check_date(self, cr, uid, vals, context=None, check=True): if not context: context = {} if 'date' in vals.keys(): if 'journal_id' in vals and 'journal_id' not in context: journal_id = vals['journal_id'] if 'period_id' in vals and 'period_id' not in context: period_id = vals['period_id'] elif 'journal_id' not in context and 'move_id' in vals: m = self.pool.get('account.move').browse(cr, uid, vals['move_id']) journal_id = m.journal_id.id period_id = m.period_id.id else: journal_id = context['journal_id'] period_id = context['period_id'] journal=self.pool.get('account.journal').browse(cr,uid,[journal_id])[0] if not journal.allow_date: period=self.pool.get('account.period').browse(cr,uid,[period_id])[0] date = time.strptime(vals['date'], '%Y-%m-%d') if not (date >= time.strptime(period.date_start,'%Y-%m-%d') and date <= time.strptime(period.date_stop,'%Y-%m-%d') ): raise osv.except_osv(_('Error'),_('The date of your Ledger Posting is not in the defined period !')) else: return True
| 470,886
|
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id else: return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
|
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id else: return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
| 470,887
|
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress'
|
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): for line in order.order_line: if line.state == 'exception': self.pool.get('sale.order.line').write(cr, uid, [line.id], {'state': 'confirmed'}, context=context) if order.state == 'invoice_except': val['state'] = 'progress'
| 470,888
|
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress'
|
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress'
| 470,889
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': True, 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,890
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,891
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,892
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,893
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,894
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,895
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,896
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,897
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
|
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, }
| 470,898
|
def die(cond, msg): if cond: print msg sys.exit(1)
|
def die(cond, msg): if cond: print msg sys.exit(1)
| 470,899
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.