bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): result = super(stock_partial_move, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu) move_obj = self.pool.get('stock.move') move_ids = context.get('active_ids', False) move_ids = mov...
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): result = super(stock_partial_move, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu) move_obj = self.pool.get('stock.move') move_ids = context.get('active_ids', False) move_ids = mov...
467,000
def _default_values(self, cr, uid, data, context):
def _default_values(self, cr, uid, data, context):
467,001
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('crm.phonecall') job_case_obj = poo...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('crm.phonecall') job_case_obj = poo...
467,002
def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_login: stored_login = stored_login[0]...
def check_creds(db, uid, passwd): if security._uid_cache.get(db, {}).get(uid) and security._uid_cache.get(db, {}).get(uid) == passwd: return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_login: st...
467,003
def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_login: stored_login = stored_login[0]...
def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_login: stored_login = stored_login[0]...
467,004
def access(db, uid, passwd, sec_level, ids): cr = pooler.get_db(db).cursor() salt = _salt_cache[passwd] cr.execute('select id from res_users where id=%s and password=%s', (uid, encrypt_md5( passwd, salt )) ) res = cr.fetchone() cr.close() if not res: raise Exception('Bad username or password') return res[0]
def access(db, uid, passwd, sec_level, ids): cr = pooler.get_db(db).cursor() salt = _salt_cache[passwd] cr.execute('select id from res_users where id=%s and password=%s', (uid, encrypt_md5( passwd, salt )) ) res = cr.fetchone() cr.close() if not res: raise security.ExceptionNoTb('Bad username or password') return res[0...
467,005
def access(db, uid, passwd, sec_level, ids): cr = pooler.get_db(db).cursor() salt = _salt_cache[passwd] cr.execute('select id from res_users where id=%s and password=%s', (uid, encrypt_md5( passwd, salt )) ) res = cr.fetchone() cr.close() if not res: raise Exception('Bad username or password') return res[0]
def access(db, uid, passwd, sec_level, ids): cr = pooler.get_db(db).cursor() salt = _salt_cache[passwd] cr.execute('select id from res_users where id=%s and password=%s', (uid, encrypt_md5( passwd, salt )) ) res = cr.fetchone() cr.close() if not res: raise Exception('Bad username or password') return res[0]
467,006
def create(self, cr, uid, vals, context=None): sql = [ ('journal_id', '=', vals['journal_id']), ('state', '=', 'open') ] open_jrnl = self.search(cr, uid, sql) if open_jrnl: raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
defself.write(cr, uid, [res_id], {}) create(self,self.write(cr, uid, [res_id], {}) cr,self.write(cr, uid, [res_id], {}) uid,self.write(cr, uid, [res_id], {}) vals,self.write(cr, uid, [res_id], {}) context=None):self.write(cr, uid, [res_id], {}) sqlself.write(cr, uid, [res_id], {}) =self.write(cr, uid, [res_id], {}) [se...
467,007
def _check_addons_path(self, option, opt, value, parser): res = os.path.abspath(os.path.expanduser(value)) if not os.path.exists(res): raise optparse.OptionValueError("option %s: no such directory: %r" % (opt, value))
def _check_addons_path(self, option, opt, value, parser): res = os.path.abspath(os.path.expanduser(value)) if not os.path.exists(res): raise optparse.OptionValueError("option %s: no such directory: %r" % (opt, value))
467,008
def __init__(self, node, localcontext, styles, self2): self.localcontext = localcontext.copy self.node = node self.styles = styles self.width = utils.unit_get(node.get('width')) self.height = utils.unit_get(node.get('height')) self.self2 = self2
def __init__(self, node, localcontext, styles, self2): self.localcontext = localcontext.copy() self.node = node self.styles = styles self.width = utils.unit_get(node.get('width')) self.height = utils.unit_get(node.get('height')) self.self2 = self2
467,009
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context argume...
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context argume...
467,010
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context argume...
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context argume...
467,011
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context argume...
defonchange_partner_id(self,cr,uid,ids,partner_id,journal_id=False,price=0.0,currency_id=False,ttype=False,context={}):"""priceReturnsadictthatcontainsnewvaluesandcontext@parampartner_id:latestvaluefromuserinputforfieldpartner_id@paramargs:otherarguments@paramcontext:contextarguments,likelang,timezone@return:Returnsadi...
467,012
def _default_values(self, cr, uid, data, context):
def _default_values(self, cr, uid, data, context):
467,013
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
_defaults = { 'user_id': _date_user, 'category_id': _date_category, 'note': _get_note } def make_phonecall(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') job_case_obj = self.pool.get('hr.applicant') data_obj = self.pool.get('ir.model.data') phonecall_case_obj = self.pool.get('crm.phonecall...
467,014
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) # Select the view
467,015
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,016
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,017
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,018
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,019
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,020
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,021
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
467,022
def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction.
def _generate_order_by(self, order_spec, query): """ Attempt to consruct an appropriate ORDER BY clause based on order_spec, which must be a comma-separated list of valid field names, optionally followed by an ASC or DESC direction.
467,023
def register_all(self, cr): """Report registration handler that may be overridden by subclasses to add their own kinds of report services. Loads all reports with no manual loaders (auto==True) and registers the appropriate services to implement them. """ opj = os.path.join cr.execute("SELECT * FROM ir_act_report_xml WH...
def register_all(self, cr): """Report registration handler that may be overridden by subclasses to add their own kinds of report services. Loads all reports with no manual loaders (auto==True) and registers the appropriate services to implement them. """ opj = os.path.join cr.execute("SELECT * FROM ir_act_report_xml WH...
467,024
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields
467,025
def unlink(self, cr, uid, ids, context=None): """ Delete records with given ids
def unlink(self, cr, uid, ids, context=None): """ Delete records with given ids
467,026
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
467,027
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
467,028
def create(self, cr, user, vals, context=None): """ Create new record with specified value
def create(self, cr, user, vals, context=None): """ Create new record with specified value
467,029
def create(self, cr, user, vals, context=None): """ Create new record with specified value
def create(self, cr, user, vals, context=None): """ Create new record with specified value
467,030
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
467,031
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
467,032
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
467,033
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
467,034
def name_get(self, cr, user, ids, context=None): """
def name_get(self, cr, user, ids, context=None): """
467,035
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): """
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): """
467,036
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
467,037
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
467,038
def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record with given id updating it with default values
def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record with given id updating it with default values
467,039
def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records
def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records
467,040
def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records
def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records
467,041
def get_xml_id(self, cr, uid, ids, *args, **kwargs): """Find out the XML ID of any database record, if there is one. This method works as a possible implementation for a function field, to be able to add it to any model object easily, referencing it as 'osv.osv.get_xml_id'.
def get_xml_id(self, cr, uid, ids, *args, **kwargs): """Find out the XML ID of any database record, if there is one. This method works as a possible implementation for a function field, to be able to add it to any model object easily, referencing it as 'osv.osv.get_xml_id'.
467,042
def get_xml_id(self, cr, uid, ids, *args, **kwargs): """Find out the XML ID of any database record, if there is one. This method works as a possible implementation for a function field, to be able to add it to any model object easily, referencing it as 'osv.osv.get_xml_id'.
def get_xml_id(self, cr, uid, ids, *args, **kwargs): """Find out the XML ID of any database record, if there is one. This method works as a possible implementation for a function field, to be able to add it to any model object easily, referencing it as 'osv.osv.get_xml_id'.
467,043
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): """ Get the list of records in list view grouped by the given ``groupby`` fields
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): """ Get the list of records in list view grouped by the given ``groupby`` fields
467,044
def is_eval(node): return isinstance(node, yaml_tag.Eval)
def is_eval(node): return isinstance(node, yaml_tag.Eval)
467,045
def is_ref(node): return isinstance(node, yaml_tag.Ref) \ or _is_yaml_mapping(node, yaml_tag.Ref)
def is_ref(node): return isinstance(node, yaml_tag.Ref) \ or _is_yaml_mapping(node, yaml_tag.Ref)
467,046
def _eval_field(self, model, field_name, expression): # TODO this should be refactored as something like model.get_field() in bin/osv if field_name in model._columns: column = model._columns[field_name] elif field_name in model._inherit_fields: column = model._inherit_fields[field_name][2] else: raise KeyError("Object ...
def _eval_field(self, model, field_name, expression): # TODO this should be refactored as something like model.get_field() in bin/osv if field_name in model._columns: column = model._columns[field_name] elif field_name in model._inherit_fields: column = model._inherit_fields[field_name][2] else: raise KeyError("Object ...
467,047
def _eval_field(self, model, field_name, expression): # TODO this should be refactored as something like model.get_field() in bin/osv if field_name in model._columns: column = model._columns[field_name] elif field_name in model._inherit_fields: column = model._inherit_fields[field_name][2] else: raise KeyError("Object ...
def _eval_field(self, model, field_name, expression): # TODO this should be refactored as something like model.get_field() in bin/osv if field_name in model._columns: column = model._columns[field_name] elif field_name in model._inherit_fields: column = model._inherit_fields[field_name][2] else: raise KeyError("Object ...
467,048
def force_production(self, cr, uid, ids, *args): pick_obj = self.pool.get('stock.picking') pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)]) return True
def force_production(self, cr, uid, ids, *args): pick_obj = self.pool.get('stock.picking') pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)]) return True
467,049
def force_production(self, cr, uid, ids, *args): pick_obj = self.pool.get('stock.picking') pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)]) return True
def force_production(self, cr, uid, ids, *args): pick_obj = self.pool.get('stock.picking') pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)]) return True
467,050
def _get_membership_lines(self, cr, uid, ids, context=None): list_membership_line = [] member_line_obj = self.pool.get('membership.membership_line') for invoice in self.pool.get('account.invoice').browse(cr, uid, ids, context=context): if invoice.invoice_line: list_membership_line += member_line_obj.search(cr, uid, [('...
def _get_membership_lines(self, cr, uid, ids, context=None): list_membership_line = [] member_line_obj = self.pool.get('membership.membership_line') for invoice in self.pool.get('account.invoice').browse(cr, uid, ids, context=context): if invoice.invoice_line: list_membership_line += member_line_obj.search(cr, uid, [('...
467,051
def wkf_confirm_order(self, cr, uid, ids, context={}): res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context) for po in self.browse(cr, uid, ids, context): if po.requisition_id and (po.requisition_id.exclusive=='exclusive'): for order in po.requisition_id.purchase_ids: if order.id<>po.id: wf_service...
def wkf_confirm_order(self, cr, uid, ids, context={}): res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context) for po in self.browse(cr, uid, ids, context): if po.requisition_id and (po.requisition_id.exclusive=='exclusive'): for order in po.requisition_id.purchase_ids: if order.id<>po.id: wf_service...
467,052
def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) res = a and opj(a, *args) or False if zipfile.is_zipfile( a +'.zip') : zip = zip...
def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) res = a and opj(a, *args) or False if zipfile.is_zipfile( a +'.zip') : zip = zip...
467,053
def _add_subtotal(self, cleanarray): i = 0 completearray = [] tot_debit = 0.0 tot_credit = 0.0 tot_scredit = 0.0 tot_sdebit = 0.0 tot_enlitige = 0.0 for r in cleanarray: # For the first element we always add the line # type = 1 is the line is the first of the account # type = 2 is an other line of the account if i==0: ...
def _add_subtotal(self, cleanarray): i = 0 completearray = [] tot_debit = 0.0 tot_credit = 0.0 tot_scredit = 0.0 tot_sdebit = 0.0 tot_enlitige = 0.0 for r in cleanarray: # For the first element we always add the line # type = 1 is the line is the first of the account # type = 2 is an other line of the account if i==0: ...
467,054
def add_res_widget(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {'type': 'ir.actions.act_window_close'}
def res_widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {'type': 'ir.actions.act_window_close'}
467,055
def action_production_end(self, cr, uid, ids): obj=self.browse(cr,uid,ids)[0] for workcenter_line in obj.workcenter_lines: tmp=self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,[workcenter_line.id]) return super(mrp_production,self).action_production_end(cr,uid,ids)
def def action_in_production(self, cr, uid, ids): """ Changes state to In Production and writes starting date. @return: True """ obj = self.browse(cr, uid, ids)[0] workcenter_line_obj = self.pool.get('mrp.production.workcenter.line') for workcenter_line in obj.workcenter_lines: workcenter_line_obj.action_start_working(...
467,056
def make_invoice(self, cr, uid, ids, context=None): reg_obj = self.pool.get('event.registration') mod_obj = self.pool.get('ir.model.data') newinv = [] if context is None: context = {}
def make_invoice(self, cr, uid, ids, context=None): reg_obj = self.pool.get('event.registration') mod_obj = self.pool.get('ir.model.data') newinv = [] if context is None: context = {}
467,057
def make_invoice(self, cr, uid, ids, context=None): reg_obj = self.pool.get('event.registration') mod_obj = self.pool.get('ir.model.data') newinv = [] if context is None: context = {}
def make_invoice(self, cr, uid, ids, context=None): reg_obj = self.pool.get('event.registration') mod_obj = self.pool.get('ir.model.data') newinv = [] if context is None: context = {}
467,058
valdef = { 'picking_id': move.picking_id.id, 'product_id': line['product_id'], 'product_uom': line['product_uom'], 'product_qty': line['product_qty'], 'product_uos': line['product_uos'], 'product_uos_qty': line['product_uos_qty'], 'move_dest_id': move.id, 'state': state, 'name': line['name'], 'location_dest_id': dest, ...
valdef = { 'picking_id': move.picking_id.id, 'product_id': line['product_id'], 'product_uom': line['product_uom'], 'product_qty': line['product_qty'], 'product_uos': line['product_uos'], 'product_uos_qty': line['product_uos_qty'], 'move_dest_id': move.id, 'state': state, 'name': line['name'], 'location_dest_id': dest, ...
467,059
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id for sub_product in production.bom_id.sub_products: qty1 = sub_product.product_qty qty2 = pro...
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id if not production.bom_id: continue for sub_product in production.bom_id.sub_products: qty1 =...
467,060
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id for sub_product in production.bom_id.sub_products: qty1 = sub_product.product_qty qty2 = pro...
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id for sub_product in production.bom_id.sub_products: qty1 = sub_product.product_qty qty2 = pro...
467,061
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id for sub_product in production.bom_id.sub_products: qty1 = sub_product.product_qty qty2 = pro...
def action_confirm(self, cr, uid, ids): picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) for production in self.browse(cr, uid, ids): source = production.product_id.product_tmpl_id.property_stock_production.id for sub_product in production.bom_id.sub_products: qty1 = sub_product.product_qty qty2 = pro...
467,062
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
467,063
def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type)
def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type)
467,064
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): if not view_id and context.get('invoice_type',False): mod_obj = self.pool.get('ir.model.data') act_obj = self.pool.get('ir.actions.act_window') if context.get('invoice_type') in ('out_invoice','out_refund'): r...
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): if not view_id and context.get('invoice_type',False): mod_obj = self.pool.get('ir.model.data') act_obj = self.pool.get('ir.actions.act_window') if context.get('invoice_type') in ('out_invoice','out_refund'): r...
467,065
def button_cancel(self, cr, uid, ids, context=None): done = [] for st in self.browse(cr, uid, ids, context): voucher_ids = [] for line in st.line_ids: if line.voucher_id: voucher_ids.append(line.voucher_id.id) self.pool.get('account.voucher').cancel_voucher(cr, uid, voucher_ids, context) self.pool.get('account.voucher'...
def button_cancel(self, cr, uid, ids, context=None): done = [] for st in self.browse(cr, uid, ids, context): voucher_ids = [] for line in st.line_ids: if line.voucher_id: voucher_ids.append(line.voucher_id.id) self.pool.get('account.voucher').cancel_voucher(cr, uid, voucher_ids, context) return super(account_bank_state...
467,066
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None): voucher_obj = self.pool.get('account.voucher') wf_service = netsvc.LocalService("workflow") st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line_id, context=context)
defcreate_move_from_st_line(self,cr,uid,st_line_id,company_currency_id,next_number,context=None):voucher_obj=self.pool.get('account.voucher')wf_service=netsvc.LocalService("workflow")st_line=self.pool.get('account.bank.statement.line').browse(cr,uid,st_line_id,context=context)
467,067
def make_order(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') partner_obj = self.pool.get('res.partner') contact_obj = self.pool.get('res.partner.address') case_obj = self.pool.get('hr.applicant')
def make_order(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') partner_obj = self.pool.get('res.partner') contact_obj = self.pool.get('res.partner.address') case_obj = self.pool.get('hr.applicant')
467,068
def make_order(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') partner_obj = self.pool.get('res.partner') contact_obj = self.pool.get('res.partner.address') case_obj = self.pool.get('hr.applicant')
def make_order(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') partner_obj = self.pool.get('res.partner') contact_obj = self.pool.get('res.partner.address') case_obj = self.pool.get('hr.applicant')
467,069
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,070
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,071
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,072
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,073
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,074
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
467,075
def log(self, title, msg): if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
def log(self, title, msg): if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
467,076
def _change_prod_qty(self, cr, uid, ids, new_qty, context={}): move_obj = self.pool.get('stock.move')
defif new_qty <= 0.0: return {} _change_prod_qty(self,if new_qty <= 0.0: return {} cr,if new_qty <= 0.0: return {} uid,if new_qty <= 0.0: return {} ids,if new_qty <= 0.0: return {} new_qty,if new_qty <= 0.0: return {} context={}):if new_qty <= 0.0: return {} move_objif new_qty <= 0.0: return {} =if new_qty <= 0.0: retu...
467,077
def change(product_id, product_qty, qty_vals, qty_vals_done, moves, moves_done, field): if not moves.get(product_id) and moves_done.get(product_id): new_qty = (product_qty - qty_vals_done.get(product_id, 0.0)) new_move = move_obj.copy(cr, uid, moves_done.get(product_id), default={'product_qty': new_qty}) self.write(cr,...
def change(product_id, product_qty, qty_vals, qty_vals_done, moves, moves_done, field): if not moves.get(product_id) and moves_done.get(product_id): new_qty = (product_qty - qty_vals_done.get(product_id, 0.0)) new_move = move_obj.copy(cr, uid, moves_done.get(product_id), default={'product_qty': new_qty}) self.write(cr,...
467,078
def _balance(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} c = context.copy() c['initital_bal'] = True sql = [ """SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2""", """WHERE l2.account_id = l1.account_id""", """AND""", """l1.id <= l2.id""", """AND"...
def _balance(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} c = context.copy() c['initital_bal'] = True sql = [ """SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2""", """WHERE l2.account_id = l1.account_id""", """AND""", """l1.id <= l2.id""", """AND"...
467,079
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: name = getattr(cls, '_name', cls._inherit) for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent cl...
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent class %s does not exist in module %s !" % (pa...
467,080
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: name = getattr(cls, '_name', cls._inherit) for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent cl...
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: name = cls._name or cls._inherit for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent class %s doe...
467,081
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent class %s does not exist in module %s !" % (pa...
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent class %s does not exist in module %s !" % (pa...
467,082
def _main_job(self, cr, uid, ids, fields, arg, context=None): """ @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 partner contact’s IDs @fields: Get Fields @param context: A standard dictionary for contextua...
def _main_job(self, cr, uid, ids, fields, arg, context=None): """ @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 partner contact’s IDs @fields: Get Fields @param context: A standard dictionary for contextua...
467,083
def name_get(self, cr, uid, ids, context={}): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user, @param ids: List of partner address’s IDs @param context: A standard dictionary for contextual values """
def name_get(self, cr, uid, ids, context={}): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user, @param ids: List of partner address’s IDs @param context: A standard dictionary for contextual values """
467,084
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @...
467,085
def create(self, cr, uid, vals, context=None, check=True): account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') if context is None: context = {} self._check_date(cr, uid, vals, context, check) if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['act...
def create(self, cr, uid, vals, context=None, check=True): account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') if context is None: context = {} self._check_date(cr, uid, vals, context, check) if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['act...
467,086
def __init__(self, cr, uid, name, context=None): super(report_voucher_move, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'convert':self.convert, 'get_title': self.get_title, 'debit':self.debit, 'credit':self.credit, })
def __init__(self, cr, uid, name, context=None): super(report_voucher_move, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'convert':self.convert, 'get_title': self.get_title, 'debit':self.debit, 'credit':self.credit, })
467,087
def convert(self, amount): user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] return amount_to_text_en.amount_to_text(amount, 'en', user_id.company_id.currency_id.name)
def convert(self, amount): user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] return amount_to_text_en.amount_to_text(amount, 'en', user_id.company_id.currency_id.name)
467,088
def write(self, cr, uid, ids, vals, context=None): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') uom_obj = self.pool.get('product.uom') if context is None: context = {} if context.get('scheduler',False): return super(project_phase, self).write(cr, uid, ids,...
def write(self, cr, uid, ids, vals, context=None): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') uom_obj = self.pool.get('product.uom') if context is None: context = {} if context.get('scheduler',False): return super(project_phase, self).write(cr, uid, ids,...
467,089
def __init__(self, interface, port): super(HttpDaemon, self).__init__(interface, port, handler=MultiHandler2)
def __init__(self, interface, port): super(HttpDaemon, self).__init__(interface, port, handler=MultiHandler2)
467,090
def __init__(self, interface, port): try: super(HttpDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) except SSLError, e: netsvc.Logger().notifyChannel( 'httpd-ssl', netsvc.LOG_CRITICAL, "Can not load the certificate and/or the private key files") raise
def __init__(self, interface, port): try: super(HttpSDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) except SSLError, e: netsvc.Logger().notifyChannel( 'httpd-ssl', netsvc.LOG_CRITICAL, "Can not load the certificate and/or the private key files") raise
467,091
def _read_flat(self, cr, user, ids, fields_to_read, context=None, load='_classic_read'): if not context: context = {} #ids = map(lambda x:int(x), ids) if not ids: return [] if fields_to_read == None: fields_to_read = self._columns.keys()
def _read_flat(self, cr, user, ids, fields_to_read, context=None, load='_classic_read'): if not context: context = {} #ids = map(lambda x:int(x), ids) if not ids: return [] if fields_to_read == None: fields_to_read = self._columns.keys()
467,092
def compute_burndown(cr, uid, tasks_id, date_start, date_stop): latest = False if len(tasks_id): cr.execute('select id,create_date,state,planned_hours from project_task where id = ANY(%s) order by create_date',(tasks_id,)) tasks = cr.fetchall() cr.execute('select w.date,w.hours from project_task_work w left join proje...
def compute_burndown(cr, uid, tasks_id, date_start, date_stop): latest = False if len(tasks_id): cr.execute('select id,create_date,state,planned_hours from project_task where id = ANY(%s) order by create_date',(tasks_id,)) tasks = cr.fetchall() cr.execute('select w.date,w.hours from project_task_work w left join proje...
467,093
def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): """ Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. Price Unit is a VAT included price
def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): """ Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. Price Unit is a VAT included price
467,094
def attendance_action_change(self, cr, uid, ids, type='action', context=None, dt=False, *args): obj_attendance = self.pool.get('hr.attendance') if context is None: context = {} id = False warning_sign = 'sign' res = {}
def attendance_action_change(self, cr, uid, ids, type='action', context=None, dt=False, *args): obj_attendance = self.pool.get('hr.attendance') if context is None: context = {} id = False warning_sign = 'sign' res = {}
467,095
def get_file(self, cr, uid, id, file_node, mode, context=None): """ Return a file-like object for the contents of some node """ if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise RuntimeError('media offline') ira = self.pool.get('ir.attachment').browse(cr, uid, file_node....
def get_file(self, cr, uid, id, file_node, mode, context=None): """ Return a file-like object for the contents of some node """ if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly and mode not in ('r', 'rb'): raise I...
467,096
def __get_data_3(self, cr, uid, boo, ira, context): if not boo.online: raise RuntimeError('media offline') if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not ...
def __get_data_3(self, cr, uid, boo, ira, context): if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id...
467,097
def __get_data_3(self, cr, uid, boo, ira, context): if not boo.online: raise RuntimeError('media offline') if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not ...
def __get_data_3(self, cr, uid, boo, ira, context): if not boo.online: raise RuntimeError('media offline') if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not ...
467,098
def set_data(self, cr, uid, id, file_node, data, context=None, fil_obj=None): """ store the data. This function MUST be used from an ir.attachment. It wouldn't make sense to store things persistently for other types (dynamic). """ if not context: context = {} boo = self.browse(cr, uid, id, context) if fil_obj: ira = fi...
def set_data(self, cr, uid, id, file_node, data, context=None, fil_obj=None): """ store the data. This function MUST be used from an ir.attachment. It wouldn't make sense to store things persistently for other types (dynamic). """ if not context: context = {} boo = self.browse(cr, uid, id, context) if fil_obj: ira = fi...
467,099