rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
{'name': 'Email sent through mass mailing',
{'name': 'Email(s) sent through mass mailing',
def mass_mail_send(self, cr, uid, ids, context): """ Send Email
eec37bdb7786b497ba7f7af9f35e91fabf80bc51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eec37bdb7786b497ba7f7af9f35e91fabf80bc51/partner_wizard_spam.py
@param pricelist_ids: @param products_by_qty: @param partner:
@param pricelist_ids: @param products_by_qty: @param partner:
def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None): """multi products 'price_get'. @param pricelist_ids: @param products_by_qty: @param partner: @param context: { 'date': Date of the pricelist (%Y-%m-%d),} @return: a dict of dict with product_id as key and a dict 'price by price...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
qty)[res['base_pricelist_id']]
qty, context=context)[res['base_pricelist_id']]
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
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.po...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
break
break
def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.po...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.po...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
break
break
def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.po...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
result['item_id'] = {id: item_id}
result['item_id'] = {id: item_id}
def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.po...
94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py
keys_to_del = [key for key in self.cache if key[0][1] == dbname]
keys_to_del = [key for key in self.cache.keys() if key[0][1] == dbname]
def clear(self, dbname, *args, **kwargs): """clear the cache for database dbname if *args and **kwargs are both empty, clear all the keys related to this database """ if not args and not kwargs: keys_to_del = [key for key in self.cache if key[0][1] == dbname] else: kwargs2 = self._unify_args(*args, **kwargs) keys_to_de...
5303dc2e92e3ad7b057d8856c732c08884e8b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303dc2e92e3ad7b057d8856c732c08884e8b9d1/misc.py
keys_to_del = [key for key, _ in self._generate_keys(dbname, kwargs2) if key in self.cache]
keys_to_del = [key for key, _ in self._generate_keys(dbname, kwargs2) if key in self.cache.keys()]
def clear(self, dbname, *args, **kwargs): """clear the cache for database dbname if *args and **kwargs are both empty, clear all the keys related to this database """ if not args and not kwargs: keys_to_del = [key for key in self.cache if key[0][1] == dbname] else: kwargs2 = self._unify_args(*args, **kwargs) keys_to_de...
5303dc2e92e3ad7b057d8856c732c08884e8b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303dc2e92e3ad7b057d8856c732c08884e8b9d1/misc.py
del self.cache[key]
self.cache.pop(key)
def clear(self, dbname, *args, **kwargs): """clear the cache for database dbname if *args and **kwargs are both empty, clear all the keys related to this database """ if not args and not kwargs: keys_to_del = [key for key in self.cache if key[0][1] == dbname] else: kwargs2 = self._unify_args(*args, **kwargs) keys_to_de...
5303dc2e92e3ad7b057d8856c732c08884e8b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303dc2e92e3ad7b057d8856c732c08884e8b9d1/misc.py
t = time.time()-int(self.timeout) old_keys = [key for key in self.cache if self.cache[key][1] < t]
t = time.time()-int(self.timeout) old_keys = [key for key in self.cache.keys() if self.cache[key][1] < t]
def cached_result(self2, cr, *args, **kwargs): if time.time()-int(self.timeout) > self.lasttime: self.lasttime = time.time() t = time.time()-int(self.timeout) old_keys = [key for key in self.cache if self.cache[key][1] < t] for key in old_keys: del self.cache[key]
5303dc2e92e3ad7b057d8856c732c08884e8b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303dc2e92e3ad7b057d8856c732c08884e8b9d1/misc.py
del self.cache[key]
self.cache.pop(key)
def cached_result(self2, cr, *args, **kwargs): if time.time()-int(self.timeout) > self.lasttime: self.lasttime = time.time() t = time.time()-int(self.timeout) old_keys = [key for key in self.cache if self.cache[key][1] < t] for key in old_keys: del self.cache[key]
5303dc2e92e3ad7b057d8856c732c08884e8b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303dc2e92e3ad7b057d8856c732c08884e8b9d1/misc.py
'model_id': fields.selection(_list_all_models, 'Object', required=True),
'model_id': fields.selection(_list_all_models, 'Object', size=64, required=True),
def _auto_init(self, cr, context={}): super(ir_filters, self)._auto_init(cr, context) # Use unique index to implement unique constraint on the lowercase name (not possible using a constraint) cr.execute("SELECT indexname FROM pg_indexes WHERE indexname = 'ir_filters_name_model_uid_unique_index'") if not cr.fetchone(): ...
b70095df947faf43b4e5d207cab35f1b25e139ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b70095df947faf43b4e5d207cab35f1b25e139ff/ir_filters.py
journal_data = obj_journal.browse(cr, uid, context['journal'])
journal_data = journal_obj.browse(cr, uid, context['journal'])
def _default_get(self, cr, uid, fields, context={}): if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') account_obj = self.pool.get('account.account') period_obj = self.pool.get('account.period') journal_obj = sel...
9e7d695c3f403dacf09d6f105ffeae69552d1f5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e7d695c3f403dacf09d6f105ffeae69552d1f5e/account_move_line.py
to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month,
to_char(date_end, 'YYYY') as name, to_char(date_end, 'MM') as month,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task_user') cr.execute(""" create or replace view report_project_task_user as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.user_id, t.project_id, sum(planned...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task_user') cr.execute(""" create or replace view report_project_task_user as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.user_id, t.project_id, sum(planned...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
to_char(date_close, 'YYYY'),to_char(date_close, 'MM'),t.user_id,project_id
to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),t.user_id,project_id
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task_user') cr.execute(""" create or replace view report_project_task_user as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.user_id, t.project_id, sum(planned...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month,
to_char(date_end, 'YYYY') as name, to_char(date_end, 'MM') as month,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task') cr.execute(""" create or replace view report_project_task as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.project_id, sum(planned_hours) as hours_plan...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days,
to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task') cr.execute(""" create or replace view report_project_task as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.project_id, sum(planned_hours) as hours_plan...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
to_char(date_close, 'YYYY'),to_char(date_close, 'MM'),project_id
to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),project_id
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task') cr.execute(""" create or replace view report_project_task as ( select min(t.id) as id, to_char(date_close, 'YYYY') as name, to_char(date_close, 'MM') as month, count(distinct t.id) as task_closed, t.project_id, sum(planned_hours) as hours_plan...
f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0e09d4726d6c45c7f6b8fa71f02e5bde763be9f/report_project.py
if model == 'ir.actions.act_window' \ and 'search_view_id' in datas \ and datas['search_view_id']: datas['search_view_id'] = datas['search_view_id'][0]
def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') # FIXME: It might be a good idea to opt-in that kind of stuff # FIXME: instead of arbitrarily removing random fields fields = [ field for field in self.pool.get(model).fields_get_keys(cr, uid) if field not in E...
9b25bd6eb49bd02c5f6a3d8e3f6e0a0bee2da17f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9b25bd6eb49bd02c5f6a3d8e3f6e0a0bee2da17f/ir_values.py
factor = production.product_qty * production.product_uom.factor / bom_point.product_uom.factor
factor = production.product_qty * production.product_uom.factor_inv / bom_point.product_uom.factor
def action_compute(self, cr, uid, ids, properties=[]): """ Computes bills of material of a product. @param properties: List containing dictionaries of properties. @return: No. of products. """ results = [] bom_obj = self.pool.get('mrp.bom') prod_line_obj = self.pool.get('mrp.production.product.line') workcenter_line_ob...
e1fb0f9f66656cb99076ee43065fddf457486b97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1fb0f9f66656cb99076ee43065fddf457486b97/mrp.py
self.pool.get('stock.move').action_done(cr, uid, new_moves)
def action_production_end(self, cr, uid, ids):
ed1d414dd71ad585b19f7db691cea90799953329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ed1d414dd71ad585b19f7db691cea90799953329/mrp.py
self.pool.get('stock.move').action_done(cr, uid, move_ids)
def action_production_end(self, cr, uid, ids):
ed1d414dd71ad585b19f7db691cea90799953329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ed1d414dd71ad585b19f7db691cea90799953329/mrp.py
self.log('params', params, depth=(logger.isEnabledFor(logging.DEBUG_RPC_ANSWER) and 3 or 1))
self.log('params', replace_request_password(params), depth=(logger.isEnabledFor(logging.DEBUG_RPC_ANSWER) and 3 or 1))
def dispatch(self, service_name, method, params): try: logger = logging.getLogger('result') self.log('service', service_name) self.log('method', method) self.log('params', params, depth=(logger.isEnabledFor(logging.DEBUG_RPC_ANSWER) and 3 or 1)) auth = getattr(self, 'auth_provider', None) result = ExportService.getServ...
cd5659e4a6053bfa39accdebacbbd3cb5cf7e436 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cd5659e4a6053bfa39accdebacbbd3cb5cf7e436/netsvc.py
if not default.get('name',False): default['name'] = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking')
picking_obj = self.browse(cr, uid, [id], context)[0] if ('name' not in default) or (picking_obj.get('name')=='/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
def copy(self, cr, uid, id, default=None, context={}): if default is None: default = {} default = default.copy() if not default.get('name',False): default['name'] = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking') return super(stock_picking, self).copy(cr, uid, id, default, context)
eb13ea9ea3f0eb52dca20eea4796376f89df321f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eb13ea9ea3f0eb52dca20eea4796376f89df321f/stock.py
oldctx = dict(self.localcontext)
def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): oldctx = dict(self.localcontext) for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(...
9f74749726b709621092bee198e71b720bcf15d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f74749726b709621092bee198e71b720bcf15d2/utils.py
self.localcontext = oldctx
def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): oldctx = dict(self.localcontext) for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(...
9f74749726b709621092bee198e71b720bcf15d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f74749726b709621092bee198e71b720bcf15d2/utils.py
return_false = False
for id in ids: res[id] = {}.fromkeys(name, 0)
def _user_left_days(self, cr, uid, ids, name, args, context={}): res = {} return_false = False if context and context.has_key('employee_id'): if not context['employee_id']: return_false = True employee_id = context['employee_id'] else: employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)]) i...
8896febf114a569b7d76c29d0219dc03934131cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8896febf114a569b7d76c29d0219dc03934131cf/hr_holidays.py
'<a href="
'''<a href=" style="position: absolute; top: 3px; right: 44px; line-height: 13px;" >${_("Pad")}</a>\n''' + \
def insert_pad_link(self, output): # Insert the link on the line right after the link to open the # attachment form form_opener_insertion = output.index( '\n', output.index(self.ADD_ATTACHMENT_BUTTON)) + 1 output = output[:form_opener_insertion] + \ '<a href="#" id="add-pad" class="button-a">${_("Pad")}</a>\n' + \ outp...
fae0a9ccd4c10d38489403911598fe875b1e8b77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fae0a9ccd4c10d38489403911598fe875b1e8b77/editors.py
tocreate[v] = {self._inherits[v]:vals[self._inherits[v]]}
tocreate[v] = {'id' : vals[self._inherits[v]]}
def create(self, cr, user, vals, context=None): """ create(cr, user, vals, context) -> int cr = database cursor user = user id vals = dictionary of the form {'field_name':field_value, ...} """ if not context: context = {} self.pool.get('ir.model.access').check(cr, user, self._name, 'create')
b9dce4ea818e0fc6b5df524968a1c5a481f538a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b9dce4ea818e0fc6b5df524968a1c5a481f538a5/orm.py
id = self.pool.get(table).create(cr, user, tocreate[table])
record_id = tocreate[table].pop('id', None) if record_id is None: record_id = self.pool.get(table).create(cr, user, tocreate[table], context=context) else: self.pool.get(table).write(cr, user, [record_id], tocreate[table], context=context)
def create(self, cr, user, vals, context=None): """ create(cr, user, vals, context) -> int cr = database cursor user = user id vals = dictionary of the form {'field_name':field_value, ...} """ if not context: context = {} self.pool.get('ir.model.access').check(cr, user, self._name, 'create')
b9dce4ea818e0fc6b5df524968a1c5a481f538a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b9dce4ea818e0fc6b5df524968a1c5a481f538a5/orm.py
upd2.append(id)
upd2.append(record_id)
def create(self, cr, user, vals, context=None): """ create(cr, user, vals, context) -> int cr = database cursor user = user id vals = dictionary of the form {'field_name':field_value, ...} """ if not context: context = {} self.pool.get('ir.model.access').check(cr, user, self._name, 'create')
b9dce4ea818e0fc6b5df524968a1c5a481f538a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b9dce4ea818e0fc6b5df524968a1c5a481f538a5/orm.py
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.project.bug')]"),
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]"),
def _compute_day(self, cr, uid, ids, fields, args, context={}): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual va...
3949aba44483d940803ec52fca0acd86539b82ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3949aba44483d940803ec52fca0acd86539b82ed/crm_lead.py
'state': lambda self,cr,uid,ctx={}: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
def _search_osv_memory(self, cr, uid, model, name, domain, context=None): if not domain: return [] field, operator, value = domain[0] if operator not in ['=', '!=']: raise osv.except_osv('Invalid search criterions','The osv_memory field can only be compared with = and != operator.') value = bool(value) if operator == '...
a62f0bede48c62c3ecb89e16cb0e7449302c6621 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a62f0bede48c62c3ecb89e16cb0e7449302c6621/ir_model.py
print "<<<<<<<<<<<<<<s<<<<<<<<"
def action_done(self, cr, uid, ids, context={}): track_flag = False picking_ids = [] lines=[] sale=[] purchase=[] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product') move_obj = self.pool.get('account.move') for move in self.bro...
e382e9fa0eb0a2adc899f128665097471c6d7ad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e382e9fa0eb0a2adc899f128665097471c6d7ad8/stock.py
lines=sale[0] +purchase[0]
def action_done(self, cr, uid, ids, context={}): track_flag = False picking_ids = [] lines=[] sale=[] purchase=[] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product') move_obj = self.pool.get('account.move') for move in self.bro...
e382e9fa0eb0a2adc899f128665097471c6d7ad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e382e9fa0eb0a2adc899f128665097471c6d7ad8/stock.py
'line_id':lines,
'line_id':(purchase and purchase[0]) or( sale and sale[0]),
def action_done(self, cr, uid, ids, context={}): track_flag = False picking_ids = [] lines=[] sale=[] purchase=[] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product') move_obj = self.pool.get('account.move') for move in self.bro...
e382e9fa0eb0a2adc899f128665097471c6d7ad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e382e9fa0eb0a2adc899f128665097471c6d7ad8/stock.py
cr.execute("select count(id) from email_server where user='%s' and password='%s'", (vals['user'], vals['password']))
cr.execute("select count(id) from email_server where user=%s and password=%s", (vals['user'], vals['password']))
def check_duplicate(self, cr, uid, ids):
c85cbf6db2cf2ce2dbabf0cb3b1194727278c143 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c85cbf6db2cf2ce2dbabf0cb3b1194727278c143/fetchmail.py
res = super(crm_send_new_email, self).default_get(cr, uid, fields, context=context)
res = super(crm_send_new_email2, self).default_get(cr, uid, fields, context=context)
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {}
c7f7dbe404dc0523ad5b21a0fbc0d440f87ffbcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7f7dbe404dc0523ad5b21a0fbc0d440f87ffbcf/crm_send_email.py
group_ids = [x[0] for x in cr.fetchall()]
group_ids = [x[0] for x in cr.fetchall() if x[0]]
def _disable_workflow_buttons(self, cr, user, node): if user == 1: # admin user can always activate workflow buttons return node
74f144f813baa660234e70a337d549601782d3ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/74f144f813baa660234e70a337d549601782d3ff/orm.py
amount = currency_obj.compute(cr, uid, line.currency_id.id,
amount = currency_obj.compute(cursor, user, line.currency_id.id,
def populate_statement(self, cr, uid, ids, context=None):
91bf62ce7c50c1caee1e2e88fe7cc5449cf83428 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91bf62ce7c50c1caee1e2e88fe7cc5449cf83428/account_statement_from_invoice.py
else: if line.debit > 0: amount=line.debit elif line.credit > 0: amount=-line.credit
elif (line.invoice and line.invoice.currency_id.id <> statement.currency.id): amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id, statement.currency.id, amount, context=ctx)
def populate_statement(self, cr, uid, ids, context=None):
91bf62ce7c50c1caee1e2e88fe7cc5449cf83428 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91bf62ce7c50c1caee1e2e88fe7cc5449cf83428/account_statement_from_invoice.py
users = self.pool.get('res_users')
users = self.pool.get('res.users')
def set_default_menu(self, cr, uid, menu, context=None): users = self.pool.get('res_users') users.write(cr, uid, users.search(cr, uid, [('action_id','=','Setup')], context=context), {'action_id': menu.id}, context=context) users.write(cr, uid, users.search(cr, uid, [('menu_id','=','Setup')], context=context), {'menu_id...
c6a32c9b1bb17d16b233f600da631a32cee365d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6a32c9b1bb17d16b233f600da631a32cee365d2/__init__.py
'factor': fields.float('Ratio', required=True,digits=(12, 6),
'factor': fields.float('Ratio', required=True,digits=(12, 12),
def create(self, cr, uid, data, context={}): if 'factor_inv' in data: if data['factor_inv'] <> 1: data['factor'] = self._compute_factor_inv(data['factor_inv']) del(data['factor_inv']) return super(product_uom, self).create(cr, uid, data, context)
36c6bbfe6fde6fd649044cdcdd3a16e926902c3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36c6bbfe6fde6fd649044cdcdd3a16e926902c3c/product.py
res = dict.fromkeys(ids, {name: 0})
res = dict.fromkeys(ids, {'leaves_taken': 0, 'remaining_leaves': 0, 'max_leaves': 0})
def _user_left_days(self, cr, uid, ids, name, args, context=None): if context is None: context = {} return_false = False employee_id = False res = {}
0f42beb105569232cae71f21a5fca22ca73720ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f42beb105569232cae71f21a5fca22ca73720ec/hr_holidays.py
company_id = period_obj.browse(cr, uid, data['form']['period_from'], context=context).company_id
company_id = period_obj.browse(cr, uid, data['form']['period_from'], context=context).company_id.id
def _build_contexts(self, cr, uid, ids, data, context=None): if context is None: context = {} result = {} period_obj = self.pool.get('account.period') fiscal_obj = self.pool.get('account.fiscalyear') result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] or False result['journal_ids'] ...
4c5d3e446f411e3d923c3ce434708d994d87f91a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4c5d3e446f411e3d923c3ce434708d994d87f91a/account_report_common.py
raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name)))
raise osv.except_osv(_('Error !'), (_('User %s does not have rights to access %s journal !') % (statement.user_id.name, statement.journal_id.name)))
def button_open(self, cr, uid, ids, context=None): """ Changes statement state to Running. @return: True """ if context is None: context = {} statement_pool = self.pool.get('account.bank.statement') for statement in statement_pool.browse(cr, uid, ids, context=context): vals = {} force_allow = context.get('force_allow',...
c62536705f45f0fdb7ebb70a58da67f858cc352d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c62536705f45f0fdb7ebb70a58da67f858cc352d/account_cash_statement.py
type1 = context['type'] or 'move_history_ids'
type1 = context['type'] or 'move_history_ids2'
def action_traceability(self, cr, uid, ids, context={}): """ It traces the information of a product @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of IDs selected @param context: A standard dictionary @return: A dictionary of values """
093ca431b36c22347d4440169d96365bbc23db18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/093ca431b36c22347d4440169d96365bbc23db18/stock_traceability.py
'name': ((type1=='move_history_ids') and 'Donwstream Traceability') or 'Upstream Traceability',
'name': ((type1=='move_history_ids2') and 'Upstream Traceability') or 'Downstream Traceability',
def action_traceability(self, cr, uid, ids, context={}): """ It traces the information of a product @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of IDs selected @param context: A standard dictionary @return: A dictionary of values """
093ca431b36c22347d4440169d96365bbc23db18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/093ca431b36c22347d4440169d96365bbc23db18/stock_traceability.py
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') readonly = False access_pool = self.pool.get('ir.model.access') for group in groups: readonly = readonly or access_pool.check_groups(cr, user, group) if not readonly: node.set('invisible', '1') del(node.attrib['groups'])
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
7b6827a6b4b88be4401d98627b7b8ed009926f77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b6827a6b4b88be4401d98627b7b8ed009926f77/orm.py
dom = [] if column._domain and not isinstance(column._domain, (str, unicode)): dom = column._domain dom += eval(node.get('domain','[]'), {'uid':user, 'time':time}) context.update(eval(node.get('context','{}'))) attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context,limit=None) if (n...
else: dom = [] if column._domain and not isinstance(column._domain, (str, unicode)): dom = column._domain dom += eval(node.get('domain','[]'), {'uid':user, 'time':time}) context.update(eval(node.get('context','{}'))) attrs['selection'] = self.pool.get(relation)._name_search(cr, user, '', dom, context=context,limit=None...
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
7b6827a6b4b88be4401d98627b7b8ed009926f77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b6827a6b4b88be4401d98627b7b8ed009926f77/orm.py
if node.get('groups'): groups = node.get('groups').split(',') readonly = False access_pool = self.pool.get('ir.model.access') for group in groups: readonly = readonly or access_pool.check_groups(cr, user, group) if not readonly: node.set('invisible', '1') del(node.attrib['groups'])
check_group(node)
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
7b6827a6b4b88be4401d98627b7b8ed009926f77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b6827a6b4b88be4401d98627b7b8ed009926f77/orm.py
if not args: args = [] if not context: context = {} args = args[:] if name: args += [(self._rec_name, operator, name)] ids = self.search(cr, user, args, limit=limit, context=context) res = self.name_get(cr, user, ids, context) return res
return self._name_search(cr, user, name, args, operator, context, limit, user)
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): """
7b6827a6b4b88be4401d98627b7b8ed009926f77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b6827a6b4b88be4401d98627b7b8ed009926f77/orm.py
self.pool.get('stock.move').action_confirm(cr, uid, [move]) self.pool.get('stock.move').force_assign(cr,uid, [move])
todo_moves.append(move) self.pool.get('stock.move').action_confirm(cr, uid, todo_moves) self.pool.get('stock.move').force_assign(cr, uid, todo_moves)
def action_picking_create(self,cr, uid, ids, *args): picking_id = False for order in self.browse(cr, uid, ids): loc_id = order.partner_id.property_stock_supplier.id istate = 'none' if order.invoice_method=='picking': istate = '2binvoiced' pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.in') picking...
0fd5a4477ecf4782c48be4a142423ec12d03930e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fd5a4477ecf4782c48be4a142423ec12d03930e/purchase.py
res = a and opj(a, *args) or False
if not a: raise ValueError('Could not find path for module %s'%module) resource_path = opj(a, *args)
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...
fcdebe59240ea817b7b144c87ebb72e89a3937ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fcdebe59240ea817b7b144c87ebb72e89a3937ad/__init__.py
res = '/'.join(args) if res in files: return opj(a, res) elif os.path.exists(res): return res return False
resource_path = '/'.join(args) if resource_path in files: return opj(a, resource_path) elif os.path.exists(resource_path): return resource_path raise IOError('Could not find resource %s'%resource_path)
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...
fcdebe59240ea817b7b144c87ebb72e89a3937ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fcdebe59240ea817b7b144c87ebb72e89a3937ad/__init__.py
self.write(cr, uid, move.id, {'state':'assigned'})
self.write(cr, uid, [move.id], {'state':'assigned'})
def check_assign(self, cr, uid, ids, context=None): """ Checks the product type and accordingly writes the state. @return: No. of moves done """ done = [] count = 0 pickings = {} if context is None: context = {} for move in self.browse(cr, uid, ids, context=context): if move.product_id.type == 'consu': if move.state in...
4b8d7618a505cb704d70813ec07b8b4193d5f532 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b8d7618a505cb704d70813ec07b8b4193d5f532/stock.py
ret = super(users,self).login(db, login, password)
ret = super(users,self).login(db, login, password) tools.debug(ret)
def login(self, db, login, password): ret = super(users,self).login(db, login, password) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
cr = pooler.get_db(db).cursor()
cr = pooler.get_db(db).cursor()
def login(self, db, login, password): ret = super(users,self).login(db, login, password) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ldap_base, \"user\", create_user FROM res_company_ldap
SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ldap_base, "user", create_user FROM res_company_ldap
def login(self, db, login, password): ret = super(users,self).login(db, login, password) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
if l.bind_s(dn, passwd):
if l.bind_s(dn, password):
def login(self, db, login, password): ret = super(users,self).login(db, login, password) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
continue
continue
def login(self, db, login, password): ret = super(users,self).login(db, login, password) if ret: return ret pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') cr.execute(""" SELECT id, company, ldap_server, ldap_server_port, ldap_binddn, ldap_password, ldap_filter, ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor()
cr = pooler.get_db(db).cursor()
def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) except: # AccessDenied pass pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: l = ldap.open(res_company_ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
name = result_data[0][1]['cn']
def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) except: # AccessDenied pass pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: l = ldap.open(res_company_ld...
d5087fd9736baa7f0ff8e5421ddf76083f0cfde5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5087fd9736baa7f0ff8e5421ddf76083f0cfde5/users_ldap.py
'res_users': menu.res_model,
'res_model': menu.res_model,
def menu(self, cr, uid, ids, context=None): menu = self.get_default_menu(cr, uid, context=context) self.set_default_menu(cr, uid, menu, context=context)
c0dcc4ffac22f43aa5142fca3745b53fd21987c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c0dcc4ffac22f43aa5142fca3745b53fd21987c3/__init__.py
'description': fields.text('Description'),
'description': fields.text('Note'),
def _compute_day(self, cr, uid, ids, fields, args, context={}): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual va...
e0b5f5c64245e3737a6753dac890ac1c7d3c7381 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e0b5f5c64245e3737a6753dac890ac1c7d3c7381/crm_lead.py
}
}
def _compute_day(self, cr, uid, ids, fields, args, context={}): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual va...
e0b5f5c64245e3737a6753dac890ac1c7d3c7381 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e0b5f5c64245e3737a6753dac890ac1c7d3c7381/crm_lead.py
manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id.id return {'value': {'parent_id':manager or False}}
if not department_id: return {'value':{'parent_id': False}} manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id return {'value': {'parent_id':manager and manager.id or False}}
def onchange_department(self, cr, uid, ids, department_id, context=None): manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id.id return {'value': {'parent_id':manager or False}}
babd5d6703a6109ee7a75ad022c342cb6e734733 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/babd5d6703a6109ee7a75ad022c342cb6e734733/hr.py
'photo': fields.binary('Photo')
'photo': fields.binary('Photo'), 'passport_id':fields.char('Passport', size=64)
def job_open(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'open'}) return True
c6968eaf3e4fcb54be5bb0fa61ebd2a11a62635e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6968eaf3e4fcb54be5bb0fa61ebd2a11a62635e/hr.py
self.res_find_all = parent.res_find_all
if isinstance(parent, node_res_dir): self.res_find_all = parent.res_find_all else: self.res_find_all = False
def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id = None): super(node_res_obj,self).__init__(path, parent,context) assert parent #todo: more info from dirr self.dir_id = dir_id self.mimetype = 'application/x-directory' # 'httpd/unix-directory' self.create_date = parent.create_date # TODO: the ...
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
res.append(klass(res_name, dir_id=self.dir_id, parent=self, context=self.context, res_model=self.res_model, res_bo=bo))
rnode = klass(res_name, dir_id=self.dir_id, parent=self, context=self.context, res_model=self.res_model, res_bo=bo) rnode.res_find_all = self.res_find_all res.append(rnode)
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
res.append(klass(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = None, res_id = self.res_id))
res.append(klass(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = bo, res_id = self.res_id))
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
res.append(klass(dirr.name,self,self.context, dirr, {'active_id': self.res_id}))
res.append(klass(dirr.name,self,self.context, dirr, {'active_id': self.res_id}))
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
where3 = where2 + [('res_model', '=', self.res_model), ('res_id','=',self.res_id)]
where3 = where2 + [('res_model', '=', self.res_model), ('res_id','=',self.res_id)]
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
where5 = where4 + [('ressource_id','=',0)]
where5 = where4 + ['|', ('ressource_id','=',0), ('ressource_id','=',self.res_id)]
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
where5 = where4 + [('ressource_id','=',self.res_id)] dirids = dirids + dirobj.search(cr,uid, where5)
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
res.append(klass(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = None, res_id = self.res_id))
rnode = klass(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = bo, res_id = self.res_id) rnode.res_find_all = dirr.resource_find_all res.append(rnode)
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
res.append(klass(dirr.name, self, self.context, dirr, {'active_id': self.res_id}))
rnode = klass(dirr.name, self, self.context, dirr, {'active_id': self.res_id}) rnode.res_find_all = dirr.resource_find_all res.append(rnode)
def _child_get(self, cr, name=None, domain=None): dirobj = self.context._dirobj
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
'parent_id' : False
'parent_id' : False, 'resource_find_all': False,
def create_child_collection(self, cr, objname): dirobj = self.context._dirobj is_allowed = self.check_perms(2) if not is_allowed: raise IOError(errno.EPERM,"Permission denied")
0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py
'factor': fields.float('Ratio', digits_compute=dp.get_precision('Product UoM'), required=True,
'factor': fields.float('Ratio', required=True,digits=(12, 6),
def create(self, cr, uid, data, context={}): if 'factor_inv' in data: if data['factor_inv'] <> 1: data['factor'] = self._compute_factor_inv(data['factor_inv']) del(data['factor_inv']) return super(product_uom, self).create(cr, uid, data, context)
c3508d6f841c12903a68d5e42f023e4271ec1dea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c3508d6f841c12903a68d5e42f023e4271ec1dea/product.py
emails = [obj.email_to]
emails = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_to or '')
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """ hist_obj = self.pool.get('mailgate.message')
77c6be308100b69f6d9b83a1d43a236a32ad0b06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/77c6be308100b69f6d9b83a1d43a236a32ad0b06/crm_send_email.py
res.update({'reply_to': case.section_id.reply_to})
res.update({'reply_to': case.section_id.reply_to or ''})
def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('mailgate.message') res_ids = context and context.get('active_ids', []) or []
77c6be308100b69f6d9b83a1d43a236a32ad0b06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/77c6be308100b69f6d9b83a1d43a236a32ad0b06/crm_send_email.py
'product_packaging': False
'product_packaging': False, 'price_unit': 0.0,
def _number_packages(self, cr, uid, ids, field_name, arg, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): try: res[line.id] = int((line.product_uom_qty+line.product_packaging.qty-0.0001) / line.product_packaging.qty) except: res[line.id] = 1 return res
270f0d158aed5a67cc6aca5fdcb3670e39715e33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/270f0d158aed5a67cc6aca5fdcb3670e39715e33/sale.py
'context':{'date_from':product_margin_obj.from_date,'date_to':product_margin_obj.to_date,'invoice_state' : product_margin_obj.invoice_state},
'context': context,
def action_open_window(self, cr, uid, ids, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the ID or list of IDs if we want more than one
fd7a65d1426c135ed9bd05ff6d947ef9bb0de69e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd7a65d1426c135ed9bd05ff6d947ef9bb0de69e/product_margin.py
ids = move_line_pool.search(cr, uid, [('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, context=None): """price Returns a dict that contains new values and context
c8bf3b0e55794659e290247409a4193fddf16f4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c8bf3b0e55794659e290247409a4193fddf16f4c/account_voucher.py
def unlink(self, cr, uid, ids, context=None): voucher_obj = self.pool.get('account.voucher') statement_line = self.browse(cr, uid, ids, context) unlink_ids = [] for st_line in statement_line: if st_line.voucher_id: unlink_ids.append(st_line.voucher_id.id) voucher_obj.unlink(cr, uid, unlink_ids, context=context) return ...
c8bf3b0e55794659e290247409a4193fddf16f4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c8bf3b0e55794659e290247409a4193fddf16f4c/account_voucher.py
prod_obj = self.pool.get('product.template') location_obj = self.pool.get('stock.location') lot_obj = self.pool.get('stock.report.prodlots') move_obj = self.pool.get('account.move') move_line_obj = self.pool.get('account.move.line') data_obj = self.pool.get('ir.model.data') res = self.read(cr, uid, ids[0], ['new_price...
assert rec_id, _('Active ID is not set in Context') prod_obj = self.pool.get('product.product') res = self.browse(cr, uid, ids) datas = { 'new_price' : res[0].new_price, 'stock_output_account' : res[0].stock_account_output.id, 'stock_input_account' : res[0].stock_account_input.id, 'stock_journal' : res[0].stock_journal...
def change_price(self, cr, uid, ids, context): """ Changes the Standard Price of Product. And creates an account move accordingly.
28ec7935d022a62700a84a5e0904705a3f353045 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/28ec7935d022a62700a84a5e0904705a3f353045/stock_change_standard_price.py
return [(r['id'], r['name'] + ' - ' + r['vat']) \
return [(r['id'], r['name'] or '' + ' - ' + r['vat'] or '') \
def name_get(self, cr, uid, ids, context={}): if not len(ids): return [] return [(r['id'], r['name'] + ' - ' + r['vat']) \ for r in self.read(cr, uid, ids, ['name', 'vat'], context, load='_classic_write')]
e86966d460e2ed55f852e472ad7cd3f673f2edc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e86966d460e2ed55f852e472ad7cd3f673f2edc7/l10_be_partner_vat_listing.py
ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1))
if uid !=1: flag = True for dom in args: if dom[0] == 'parent_id': flag = False break if flag: args += [('parent_id','child_of',self._parents)] ids = osv.orm.orm.search(self, cr, uid, args, offset, uid==1 and limit or None, order, context=context, count=(count and uid==1))
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: return ids
d0a898c5c52681074df7751d862b7acc0aa42282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0a898c5c52681074df7751d862b7acc0aa42282/ir_ui_menu.py
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: return ids
d0a898c5c52681074df7751d862b7acc0aa42282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0a898c5c52681074df7751d862b7acc0aa42282/ir_ui_menu.py
continue
continue
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: return ids
d0a898c5c52681074df7751d862b7acc0aa42282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0a898c5c52681074df7751d862b7acc0aa42282/ir_ui_menu.py
self._cache[key] = True
self._cache[key] = True
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: return ids
d0a898c5c52681074df7751d862b7acc0aa42282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0a898c5c52681074df7751d862b7acc0aa42282/ir_ui_menu.py
if l.account_id.id==src_account_id:
if l.account_id.id == src_account_id:
def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''): if context is None: context = {} #TODO check if we can use different period for payment and the writeoff line assert len(ids)==1, "Can only p...
931315680fbda61ee20a07df9327f381532a8447 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/931315680fbda61ee20a07df9327f381532a8447/invoice.py
attrs.append('string="'+field_it[2]+'"')
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal') if context is None: context = {} result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) i...
0291ffa1e506f051b880759ed40bb2431ebdd241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0291ffa1e506f051b880759ed40bb2431ebdd241/account_move_line.py
def _get_source(self, cr, uid, name, tt, lang, source=None): if source: #if isinstance(source, unicode): # source = source.encode('utf8') cr.execute('select value ' \ 'from ir_translation ' \ 'where lang=%s ' \ 'and type=%s ' \ 'and name=%s ' \ 'and src=%s', (lang, tt, tools.ustr(name), source)) else: cr.execute('sel...
e05d255c010e8bb660d81c16909ed44b5961cd32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e05d255c010e8bb660d81c16909ed44b5961cd32/ir_translation.py
return ids
return ids
def create(self, cursor, user, vals, context=None): if not context: context = {} ids = super(ir_translation, self).create(cursor, user, vals, context=context) for trans_obj in self.read(cursor, user, [ids], ['name','type','res_id'], context=context): self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], ...
e05d255c010e8bb660d81c16909ed44b5961cd32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e05d255c010e8bb660d81c16909ed44b5961cd32/ir_translation.py
return result
return result
def unlink(self, cursor, user, ids, context=None): if not context: context = {} for trans_obj in self.read(cursor, user, ids, ['name','type','res_id'], context=context): self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) self._get_ids.clear_cache(cu...
e05d255c010e8bb660d81c16909ed44b5961cd32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e05d255c010e8bb660d81c16909ed44b5961cd32/ir_translation.py
group_by = groupby if fget[groupby]['type'] in ('date','datetime'):
group_by = groupby if fget.get(groupby,False) and fget[groupby]['type'] in ('date','datetime'):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
389031837c71c79ce2f170c17f9ca6b08b40853e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/389031837c71c79ce2f170c17f9ca6b08b40853e/orm.py