rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
<separator colspan="4"> | <separator colspan="4"/> | 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... | 89eb07e8b4b6d3b713d2047315ab903032f822b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89eb07e8b4b6d3b713d2047315ab903032f822b0/stock_partial_move.py |
'section_id' : case.section_id and case.section_id.id or False, | def _default_values(self, cr, uid, data, context): | cb8e0195a0d14d6dd43506d35753ee9421a321f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb8e0195a0d14d6dd43506d35753ee9421a321f6/hr_recruitment_wizard.py | |
'section_id' : form['section_id'], | 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... | cb8e0195a0d14d6dd43506d35753ee9421a321f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb8e0195a0d14d6dd43506d35753ee9421a321f6/hr_recruitment_wizard.py | |
def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): | def check_creds(db, uid, passwd): if security._uid_cache.get(db, {}).get(uid) and security._uid_cache.get(db, {}).get(uid) == passwd: | 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]... | 6846791c64da3d42cdf1a976059df8ebf42ef855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6846791c64da3d42cdf1a976059df8ebf42ef855/crypt.py |
raise Exception('AccessDenied') | raise security.ExceptionNoTb('AccessDenied') | 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]... | 6846791c64da3d42cdf1a976059df8ebf42ef855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6846791c64da3d42cdf1a976059df8ebf42ef855/crypt.py |
raise Exception('Bad username or password') | raise security.ExceptionNoTb('Bad username or password') | 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] | 6846791c64da3d42cdf1a976059df8ebf42ef855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6846791c64da3d42cdf1a976059df8ebf42ef855/crypt.py |
security.check=check | security.check_creds=check_creds | 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] | 6846791c64da3d42cdf1a976059df8ebf42ef855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6846791c64da3d42cdf1a976059df8ebf42ef855/crypt.py |
self.write(cr, uid, [res_id], {}) | 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')) | edf6dbd439286c1f5d0d33a4ea8dd3526415c476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/edf6dbd439286c1f5d0d33a4ea8dd3526415c476/account_cash_statement.py | |
if os.path.exists(res, f, '__init__.py') and \ os.path.exists(res, f, '__terp__.py'): | modpath = os.path.join(res, f) if os.path.isdir(modpath) and os.path.exists(os.path.join(modpath, '__init__.py')) and \ os.path.exists(os.path.join(modpath, '__terp__.py')): | 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)) | 877cf0e75549f8dd6b75c4cf157aed7eeb550008 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/877cf0e75549f8dd6b75c4cf157aed7eeb550008/config.py |
self.localcontext = localcontext.copy | self.localcontext = localcontext.copy() | 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 | 48598ea002c85eb4b6c4ec9715a1ee47a962a9d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/48598ea002c85eb4b6c4ec9715a1ee47a962a9d8/trml2pdf.py |
term_id = False | 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... | 4ff1c93a9cfcd2758de653f0950f1d60a860ca7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ff1c93a9cfcd2758de653f0950f1d60a860ca7b/voucher.py | |
default['value'].update({ 'account_id':account_id, 'term_id':term_id }) | default['value']['account_id'] = account_id | 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... | 4ff1c93a9cfcd2758de653f0950f1d60a860ca7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ff1c93a9cfcd2758de653f0950f1d60a860ca7b/voucher.py |
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... | 4ff1c93a9cfcd2758de653f0950f1d60a860ca7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ff1c93a9cfcd2758de653f0950f1d60a860ca7b/voucher.py | ||
case_obj = pooler.get_pool(cr.dbname).get('hr.applicant') categ_id=pooler.get_pool(cr.dbname).get('crm.case.categ').search(cr, uid, [('name','=','Outbound')]) case = case_obj.browse(cr, uid, data['id']) return { 'user_id' : case.user_id and case.user_id.id, 'category_id' : categ_id and categ_id[0] or case.categ_id and ... | def _get_note(self, cr, uid, context=None): case_obj = self.pool.get('hr.applicant') case = case_obj.browse(cr, uid, context['active_id']) return case.description or '' | def _default_values(self, cr, uid, data, context): | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
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') | _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... | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.get('hr.applicant') | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py | |
data_obj = pool.get('ir.model.data') id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_tree_view') id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_form_view') | id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view') id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view') | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
for job in job_case_obj.browse(cr, uid, data['ids']): | for job in job_case_obj.browse(cr, uid, context['active_ids']): | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
'section_id' : form['section_id'], | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py | |
if not job.case_id: vals.update({'phonecall_id' : new_phonecall.id}) | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py | |
'res_model': 'hr.phonecall', | 'res_model': 'crm.phonecall', | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
states = { 'init': { 'actions': [_default_values], 'result': {'type': 'form', 'arch': case_form, 'fields': case_fields, 'state' : [('end', 'Cancel','gtk-cancel'),('order', 'Schedule Phone Call','gtk-go-forward')]} }, 'order': { 'actions': [], 'result': {'type': 'action', 'action': _doIt, 'state': 'end'} } } | job2phonecall() | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py |
job2phonecall('hr.applicant.reschedule_phone_call') class job2meeting(wizard.interface): def _makeMeeting(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) job_case_obj = pool.get('hr.applicant') meeting_case_obj = pool.get('hr.meeting') for job in job_case_obj.browse(cr, uid, data['ids']): new_meeting... | 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... | 567b6069ac51ee03f2b7252d505366880abd77b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/567b6069ac51ee03f2b7252d505366880abd77b3/hr_recruitment_wizard.py | |
if order_field in self._columns: | if order_field == 'id': order_by_clause = '"%s"."%s"' % (self._table, order_field) elif order_field in self._columns: | 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. | 1e1830cd00a62908128a9d09005d86c0cffd54ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1e1830cd00a62908128a9d09005d86c0cffd54ec/orm.py |
import pdb pdb.set_trace() | 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... | 8f99c6ebcd536a72f1404a50f9664bed4b257141 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8f99c6ebcd536a72f1404a50f9664bed4b257141/ir_actions.py | |
:param context(optional, highly recommended): context arguments, like lang, time zone | :param context: (optional) context arguments, like lang, time zone | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:param context(optional, highly recommended): context arguments, like lang, time zone | :param context: (optional) context arguments, like lang, time zone | def unlink(self, cr, uid, ids, context=None): """ Delete records with given ids | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:type user: integer (example 1) :param ids: id or list of ids :param vals: dictionary of field values to update :type vals: dictionary (example {'field_name': 'value', ...}) :param context(optional, highly recommended): context arguments, like lang, time zone | :type user: integer :param ids: object id or list of object ids to update according to **vals** :param vals: field values to update, e.g {'field_name': new_field_value, ...} :type vals: dictionary :param context: (optional) context arguments, e.g. {'lang': 'en_us', 'tz': 'UTC', ...} :type context: dictionary | def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:raise UserError: if recurssion is found vals format for relational field type. + many2many field : For write operation on a many2many fields a list of tuple is expected. The folowing tuples are accepted: (0, 0, { fields }) create (1, ID, { fields }) update (write fields to ID) (2, ID) remove (... | :raise UserError: if a loop would be created in a hierarchy of objects a result of the operation (such as setting an object as its own parent) **Note**: The type of field values to pass in ``vals`` for relationship fields is specific: + For a many2many field, a list of tuples is expected. Here is the list of tuple th... | def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:type user: integer (example 1) :param vals: dictionary for new record {'field_name': field_value, ...} :type vals: dictionary (example {'field_name': field_value, ...}) :param context(optional, highly recommended): context arguments, like lang, time zone :type context: dictionary (example {'lang': 'en_us', ...}) | :type user: integer :param vals: field values for new record, e.g {'field_name': field_value, ...} :type vals: dictionary :param context: optional context arguments, e.g. {'lang': 'en_us', 'tz': 'UTC', ...} :type context: dictionary | def create(self, cr, user, vals, context=None): """ Create new record with specified value | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
vals format for relational field type. + many2many field : [(6, 0, list of ids)] (example: [(6, 0, [8, 5, 6, 4])]) + one2many field : [(0, 0, dictionary of values)] (example: [(0, 0, {'field_name':field_value, ...})]) + many2one field : ID of related record + reference field : model name, id (example: 'product.produ... | :raise UserError: if a loop would be created in a hierarchy of objects a result of the operation (such as setting an object as its own parent) **Note**: The type of field values to pass in ``vals`` for relationship fields is specific. Please see the description of the :py:meth:`~osv.osv.osv.write` method for details a... | def create(self, cr, user, vals, context=None): """ Create new record with specified value | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
Search for record/s with or without domain | Search for record/s based on a search domain. | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:param args: list of tuples specifying search criteria [('field_name', 'operator', 'value'), ...] :param offset: optional number from search starts :param limit: optional max number of records to return | :param args: list of tuples specifying the search domain [('field_name', 'operator', value), ...]. Pass an empty list to match all records. :param offset: optional number of results to skip in the returned values (default: 0) :param limit: optional max number of records to return (default: **None**) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:param context(optional, highly recommended): context arguments, like lang, time zone :param count: if True, returns only the number of records matching the criteria, not their ids | :param context: optional context arguments, like lang, time zone :type context: dictionary :param count: optional (default: **False**), if **True**, returns only the number of records matching the criteria, not their ids | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
Operators: * =, !=, >, >=, <, <=, like, ilike, in, not in, child_of, parent_left, parent_right Prefix operators: * '&' (default), '|', '!' | **Expressing a search domain (args)** Each tuple in the search domain needs to have 3 elements, in the form: **('field_name', 'operator', value)**, where: * **field_name** must be a valid name of field of the object model, possibly following many-to-one relationships using dot-notation, e.g 'street' or 'partner_id.co... | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:type user: integer (example 1) | :type user: integer | def name_get(self, cr, user, ids, context=None): """ | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
This method is equivalent of search() on name + name_get() | This method is equivalent of :py:meth:`~osv.osv.osv.search` on **name** + :py:meth:`~osv.osv.osv.name_get` on the result. See :py:meth:`~osv.osv.osv.search` for an explanation of the possible values for the search domain specified in **args**. | def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): """ | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:param ids: id of the record to copy :param default: dictionary of field values to update before saving the duplicate object | :param id: id of the record to copy :param default: field values to override in the original values of the copied record :type default: dictionary | def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py | ||
:param default: dictionary of field values to update before saving the duplicate object :type default: dictionary (example {'field_name': field_value, ...}) | :param default: dictionary of field values to override in the original values of the copied record, e.g: ``{'field_name': overriden_value, ...}`` :type default: dictionary | def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record with given id updating it with default values | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
Check recursion in records | Verifies that there is no loop in a hierarchical structure of records, by following the parent relationship using the **parent** field until a loop is detected or until a top-level record is found. | def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
:param ids: list of ids of records :param parent: parent field name :return: True or False based on recursion detection | :param ids: list of ids of records to check :param parent: optional parent field name (default: ``self._parent_name = parent_id``) :return: **True** if the operation can proceed safely, or **False** if an infinite loop is detected. | def check_recursion(self, cr, uid, ids, parent=None): """ Check recursion in records | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
model object easily, referencing it as 'osv.osv.get_xml_id'. get_xml_id(cr, uid, ids) -> { 'id': 'module.xml_id' } | model object easily, referencing it as ``osv.osv.get_xml_id``. **Synopsis**: ``get_xml_id(cr, uid, ids) -> { 'id': 'module.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'. | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
defaulting to an empty string when there's none. | defaulting to an empty string when there's none (to be usable as a function field). | 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'. | f682ecd4f9242bef1a709bacbd1a362bc76e21ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f682ecd4f9242bef1a709bacbd1a362bc76e21ce/orm.py |
assert not groupby or groupby in fields, "Fields in 'groupby' must appear in the list of fields to read (perhaps it's missing in the list view?)" | if groupby: assert not groupby or groupby in fields, "Fields in 'groupby' must appear in the list of fields to read (perhaps it's missing in the list view?)" groupby_def = self._columns.get(groupby) or (self._inherit_fields.get(groupby) and self._inherit_fields.get(groupby)[2]) assert groupby_def and groupby_def._class... | 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 | 0da4773e14e417c3987718152813ee3cee0ff1ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0da4773e14e417c3987718152813ee3cee0ff1ec/orm.py |
def is_eval(node): return isinstance(node, yaml_tag.Eval) | cd3692125ffad6bed23131b0890a8affcda9e44e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd3692125ffad6bed23131b0890a8affcda9e44e/yaml_import.py | ||
def is_ref(node): return isinstance(node, yaml_tag.Ref) \ or _is_yaml_mapping(node, yaml_tag.Ref) | cd3692125ffad6bed23131b0890a8affcda9e44e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd3692125ffad6bed23131b0890a8affcda9e44e/yaml_import.py | ||
elif column._type == "date": | elif column._type == "date" and is_string(expression): | 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 ... | cd3692125ffad6bed23131b0890a8affcda9e44e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd3692125ffad6bed23131b0890a8affcda9e44e/yaml_import.py |
elif column._type == "datetime": | elif column._type == "datetime" and is_string(expression): | 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 ... | cd3692125ffad6bed23131b0890a8affcda9e44e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd3692125ffad6bed23131b0890a8affcda9e44e/yaml_import.py |
'product_id': fields.many2one('product.product', 'Product', required=True), | 'product_id': fields.many2one('product.product', 'Product', required=True, states={'draft':[('readonly',False)]}, readonly=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 | ca24db4e13e2ebba3bd84d2f59c54163fa196171 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca24db4e13e2ebba3bd84d2f59c54163fa196171/mrp.py |
'location_id': fields.many2one('stock.location', 'Location', required=True), | 'location_id': fields.many2one('stock.location', 'Location', required=True, states={'draft':[('readonly',False)]}, readonly=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 | ca24db4e13e2ebba3bd84d2f59c54163fa196171 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca24db4e13e2ebba3bd84d2f59c54163fa196171/mrp.py |
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, [('account_invoice_line', 'in', [ l.id for l in invoice.invoice_... | 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, [('account_invoice_line', 'in', [ l.id for l in invoice.invoice_... | 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, [('... | 793d723cb3a50fdfb338348c77c02af785a224f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/793d723cb3a50fdfb338348c77c02af785a224f5/membership.py |
self.pool.get('purchase.requisition').write(cr, uid, [po.requisition_id.id], {'state':'close','date_end':time.strftime('%Y-%m-%d %H:%M:%S')}) | self.pool.get('purchase.requisition').write(cr, uid, [po.requisition_id.id], {'state':'done','date_end':time.strftime('%Y-%m-%d %H:%M:%S')}) | 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... | f10e9aeca26fb5a74c233bcd6b5c6d4ec889fe53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f10e9aeca26fb5a74c233bcd6b5c6d4ec889fe53/purchase_requisition.py |
elif os.path.isfile(res): | elif os.path.exists(res): | 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... | 312e62c10a681aae2ef7dbf9cc76a831f25be8d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/312e62c10a681aae2ef7dbf9cc76a831f25be8d0/__init__.py |
new_header['debit'] = tot_debit new_header['credit'] = tot_credit | new_header['debit'] = r['credit'] new_header['credit'] = r['debit'] | 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: ... | b8aa067869c928438a40e369cb5aa647768428e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b8aa067869c928438a40e369cb5aa647768428e1/partner_balance.py |
def add_res_widget(self, cr, uid, ids, context=None): | def res_widget_add(self, cr, uid, ids, context=None): | 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'} | 4716280311236df7c099d3651538fc7032cfaaac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4716280311236df7c099d3651538fc7032cfaaac/res_widget.py |
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(cr,... | 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) | 56c5c2ca4bc54347697183c2bf80cf7fc2dc13e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56c5c2ca4bc54347697183c2bf80cf7fc2dc13e9/mrp_operations.py | |
'name': 'Customer Invoices', | 'name': _('Customer Invoices'), | 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 = {} | cb1a4a4b8384a5812da14d47ae1ce8e75b4b5239 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb1a4a4b8384a5812da14d47ae1ce8e75b4b5239/event_make_invoice.py |
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 = {} | cb1a4a4b8384a5812da14d47ae1ce8e75b4b5239 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cb1a4a4b8384a5812da14d47ae1ce8e75b4b5239/event_make_invoice.py | ||
'location_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, ... | a835bb2545345df541162da29a46ee07b1142f05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a835bb2545345df541162da29a46ee07b1142f05/stock.py | |
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 = production.product_uos and production.produ... | 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 = sub_product.product_qty qty2 = producti... | 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... | cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33/mrp_subproduct.py |
data = { | data = { | 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... | cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33/mrp_subproduct.py |
} sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data) return picking_id | } sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data) return picking_id | 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... | cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33/mrp_subproduct.py |
if right: | if right is not False: | 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) | 12f5aa0a1874e765f927b2fab293c2c5f0ad2652 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/12f5aa0a1874e765f927b2fab293c2c5f0ad2652/expression.py |
if right: | if right is not False: | 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) | 12f5aa0a1874e765f927b2fab293c2c5f0ad2652 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/12f5aa0a1874e765f927b2fab293c2c5f0ad2652/expression.py |
if context.get('invoice_type') in ('out_invoice','out_refund'): | if context.get('invoice_type') in ('out_invoice','out_refund'): | 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... | b797146a8aead43acb556b86f07a8ed58526f0e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b797146a8aead43acb556b86f07a8ed58526f0e9/account_voucher.py |
self.pool.get('account.voucher').unlink(cr, uid, voucher_ids, context) | 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'... | b797146a8aead43acb556b86f07a8ed58526f0e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b797146a8aead43acb556b86f07a8ed58526f0e9/account_voucher.py | |
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) | b797146a8aead43acb556b86f07a8ed58526f0e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b797146a8aead43acb556b86f07a8ed58526f0e9/account_voucher.py | ||
else: partner_id = partner_obj.create(cr, uid, { 'name': case.partner_name or case.name, 'user_id': case.user_id.id, 'comment': case.description, }) | partner_id = partner_obj.create(cr, uid, { 'name': case.partner_name or case.name, 'user_id': case.user_id.id, 'comment': case.description, }) | 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') | 75b16d1f702c6f201d0871a10b68712d1fd54997 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75b16d1f702c6f201d0871a10b68712d1fd54997/hr_recruitment_create_partner_job.py |
case_obj.write(cr, uid, context['active_ids'], { 'partner_id': partner_id, 'partner_address_id': contact_id }) | case_obj.write(cr, uid, case.id, { 'partner_id': partner_id, 'partner_address_id': contact_id }) | 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') | 75b16d1f702c6f201d0871a10b68712d1fd54997 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75b16d1f702c6f201d0871a10b68712d1fd54997/hr_recruitment_create_partner_job.py |
pricelist_version_ids = pricelist_ids | plversions_search_ids = pricelist_ids | 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 | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
pricelist_version_ids = product_pricelist_version_obj.search(cr, uid, []) pricelist_version_ids = list(set(pricelist_version_ids)) | plversions_search_ids = product_pricelist_version_obj.search(cr, uid, []) plversions_search_ids = list(set(plversions_search_ids)) | 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 | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
('pricelist_id', 'in', pricelist_version_ids), | ('pricelist_id', 'in', plversions_search_ids), | 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 | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
plversion_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args) if len(pricelist_version_ids) != len(plversion_ids): | pricelist_version_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args) if len(plversions_search_ids) != len(pricelist_version_ids): | 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 | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
for pricelist_id in pricelist_version_ids: | for pricelist_id in plversions_search_ids: | 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 | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
(tmpl_id, product_id, plversion_ids[0], qty)) | (tmpl_id, product_id, pricelist_version_ids[0], qty)) | def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst | c0771e85542a7a8e52b069316bdceff2d8bd96c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0771e85542a7a8e52b069316bdceff2d8bd96c6/pricelist.py |
if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg)) | logger = logging.getLogger(title) if logger.isEnabledFor(logging.DEBUG_RPC): for line in pformat(msg).split('\n'): logger.log(logging.DEBUG_RPC, line) | def log(self, title, msg): if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg)) | 69cd88bf108c827e73ca463d6520c0fa885ad4ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69cd88bf108c827e73ca463d6520c0fa885ad4ff/netsvc.py |
if new_qty <= 0.0: return {} | def _change_prod_qty(self, cr, uid, ids, new_qty, context={}): move_obj = self.pool.get('stock.move') | 2f3e7e70a7560ba054d51d39cbfbabf5030e4168 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f3e7e70a7560ba054d51d39cbfbabf5030e4168/mrp.py | |
move_obj.unlink(cr, uid, moves[product_id][0]) | move_obj.unlink(cr, uid, moves[product_id]) | 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,... | 2f3e7e70a7560ba054d51d39cbfbabf5030e4168 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f3e7e70a7560ba054d51d39cbfbabf5030e4168/mrp.py |
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""", """l2.id IN %s""", """AND""", self._query_get(cr, uid, obj='l1', context=c), """ GROUP BY l2.id""", ] cr.execute('\n'.join(sql), [t... | 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 l2.id IN %%s AND """ + \ self._query_get(cr, uid, obj='l1', context=c) + \ " GROUP BY l2.id" cr.execute(sql, [tuple(ids)]) | 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"... | 0fb8ef7e70942821a9697fbff40604186556cd90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fb8ef7e70942821a9697fbff40604186556cd90/account_move_line.py |
name = getattr(cls, '_name', cls._inherit) | 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... | 3a023ca1e4a2e6704841756d807b80c04d01b5f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a023ca1e4a2e6704841756d807b80c04d01b5f3/osv.py | |
name = getattr(cls, '_name', cls._inherit) | name = cls._name or cls._inherit | 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... | 3a023ca1e4a2e6704841756d807b80c04d01b5f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a023ca1e4a2e6704841756d807b80c04d01b5f3/osv.py |
nattr[s] = new name = hasattr(cls, '_name') and cls._name or cls._inherit | nattr[s] = new name = cls._name or cls._inherit | 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... | 3a023ca1e4a2e6704841756d807b80c04d01b5f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3a023ca1e4a2e6704841756d807b80c04d01b5f3/osv.py |
'function_id': fields.related('job_ids','function_id',type='many2one', \ relation='res.partner.function', string='Main Function'), | 'function': fields.related('job_ids', 'function', type='char', \ string='Main Function'), | 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... | f1a7cf722b621ba83ffc5aa65e3ea20a5f692363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f1a7cf722b621ba83ffc5aa65e3ea20a5f692363/base_contact.py |
funct = r.function_id and (", " + r.function_id.name) or "" | funct = r.function and (", " + r.function) or "" | 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 """ | f1a7cf722b621ba83ffc5aa65e3ea20a5f692363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f1a7cf722b621ba83ffc5aa65e3ea20a5f692363/base_contact.py |
'function_id': fields.many2one('res.partner.function','Partner Function', \ help="Function of this contact with this partner"), | 'function': fields.char('Partner Function', size=34, help="Function of this contact with this partner"), | 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), ...]. @... | f1a7cf722b621ba83ffc5aa65e3ea20a5f692363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f1a7cf722b621ba83ffc5aa65e3ea20a5f692363/base_contact.py |
for tax in tax_obj.compute(cr, uid, [tax_id], total, 1.00): | for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00).get('taxes'): | 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... | b621b0d86fb33c0225f051948b083a75f8ef8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b621b0d86fb33c0225f051948b083a75f8ef8cc1/account_move_line.py |
self.user = uid | self.user = uid | 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, }) | 892045e51b0ff83aa1eed88b106274f4f80c0fdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/892045e51b0ff83aa1eed88b106274f4f80c0fdc/account_voucher_print.py |
user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] | user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] | 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) | 892045e51b0ff83aa1eed88b106274f4f80c0fdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/892045e51b0ff83aa1eed88b106274f4f80c0fdc/account_voucher_print.py |
if type(ids) == int: | if isinstance(ids, (int, long)): | 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,... | ac56c74c8cbb3293ac937849c7f6b905b69fbd30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac56c74c8cbb3293ac937849c7f6b905b69fbd30/project_long_term.py |
class HttpSDaemon(threading.Thread, netsvc.Server): | class HttpSDaemon(BaseHttpDaemon): | def __init__(self, interface, port): super(HttpDaemon, self).__init__(interface, port, handler=MultiHandler2) | f99cf9a615d8a4ebb2857440acecd4fac0ab9543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f99cf9a615d8a4ebb2857440acecd4fac0ab9543/http_server.py |
super(HttpDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) | super(HttpSDaemon, self).__init__(interface, port, handler=SecureMultiHandler2) | 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 | f99cf9a615d8a4ebb2857440acecd4fac0ab9543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f99cf9a615d8a4ebb2857440acecd4fac0ab9543/http_server.py |
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() | 38ba65c24bf94581a4abd05792f36a7f90a06fb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/38ba65c24bf94581a4abd05792f36a7f90a06fb9/orm.py | ||
if tasks2[i][0][:10]<=current_date: | if tasks2[i][0] and tasks2[i][0][:10]<=current_date: | 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... | ecc6a05aa092f76d0c94ae4c9dae607d6b643b89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ecc6a05aa092f76d0c94ae4c9dae607d6b643b89/_burndown.py |
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.model', context=c), | 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 | 8ce6226a06259c933dc7c8f67d4b63ba4652a0ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ce6226a06259c933dc7c8f67d4b63ba4652a0ef/account.py | |
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 = {} | e4e5d506933145958ca3389d19069d3ccfc0b833 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e4e5d506933145958ca3389d19069d3ccfc0b833/hr_attendance.py | ||
raise RuntimeError('media offline') | raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly and mode not in ('r', 'rb'): raise IOError(errno.EPERM, "Readonly medium") | 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.... | 26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py |
if not boo.online: raise RuntimeError('media offline') | 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 ... | 26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py | |
raise IOError("File not found: %s" % fpath) | raise IOError(errno.ENOENT, "File not found: %s" % fpath) | 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 ... | 26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py |
raise RuntimeError('media offline') | raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly: raise IOError(errno.EPERM, "Readonly medium") | 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... | 26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.