rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
date=context['date']
date = context['date']
def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} if 'date' in context: date=context['date'] else: date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d') for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s ORDER BY name desc...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d')
date = time.strftime('%Y-%m-%d') date = date or time.strftime('%Y-%m-%d')
def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} if 'date' in context: date=context['date'] else: date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d') for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s ORDER BY name desc...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
id, rate=cr.fetchall()[0] res[id]=rate
id, rate = cr.fetchall()[0] res[id] = rate
def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} if 'date' in context: date=context['date'] else: date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d') for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s ORDER BY name desc...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
res[id]=0
res[id] = 0
def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} if 'date' in context: date=context['date'] else: date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d') for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s ORDER BY name desc...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
currency_rate_obj=self.pool.get('res.currency.rate') currency_date=currency_rate_obj.read(cr,user,rates[0],['name'])['name'] r['date']=currency_date
currency_rate_obj= self.pool.get('res.currency.rate') currency_date = currency_rate_obj.read(cr,user,rates[0],['name'])['name'] r['date'] = currency_date
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): res=super(osv.osv, self).read(cr, user, ids, fields, context, load) for r in res: if r.__contains__('rate_ids'): rates=r['rate_ids'] if rates: currency_rate_obj=self.pool.get('res.currency.rate') currency_date=currency_rate_obj.read(cr,user...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False):
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context=None, account=None, account_invert=False): if context is None: context = {}
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False): if not from_currency_id: from_currency_id = to_currency_id if not to_currency_id: to_currency_id = from_currency_id xc = self.browse(cr, uid, [from_currency_id,to_currency_id], context=...
36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py
return dict([(a["id"], "%s (%s)" % (a['email_id'], a['name'])) for a in self.read(cr, uid, ids, ['name', 'email_id'], context=context)])
return [(a["id"], "%s (%s)" % (a['email_id'], a['name'])) for a in self.read(cr, uid, ids, ['name', 'email_id'], context=context)]
def name_get(self, cr, uid, ids, context=None): return dict([(a["id"], "%s (%s)" % (a['email_id'], a['name'])) for a in self.read(cr, uid, ids, ['name', 'email_id'], context=context)])
9dad4a098e637ab9e45ef7b483634d0571cfda52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9dad4a098e637ab9e45ef7b483634d0571cfda52/email_template_account.py
@param details: Description, Ddtails of case history if any
@param details: Description, Details of case history if any
def history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, email_cc=None, \ email_bcc=None, email_date=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor...
91147298af06d8794f21edb9c87d76078f43d951 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91147298af06d8794f21edb9c87d76078f43d951/mail_gateway.py
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True),
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
56e877f5ab679222d4f483ad3c30d040da778190 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e877f5ab679222d4f483ad3c30d040da778190/stock.py
if context.get('active_model','') in ['res.partner']: partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0]
if context is None: context = {} if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']: partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): journal_obj = self.pool.get('account.journal') if context.get('active_model','') in ['res.partner']: partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[...
87372a16dea552b4113d4877f1bbfd9df0532551 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87372a16dea552b4113d4877f1bbfd9df0532551/invoice.py
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.tree')])[0]
view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')])[0]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): journal_obj = self.pool.get('account.journal') if context.get('active_model','') in ['res.partner']: partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[...
87372a16dea552b4113d4877f1bbfd9df0532551 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87372a16dea552b4113d4877f1bbfd9df0532551/invoice.py
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.supplier.form')])[0]
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')])[0]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): journal_obj = self.pool.get('account.journal') if context.get('active_model','') in ['res.partner']: partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[...
87372a16dea552b4113d4877f1bbfd9df0532551 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87372a16dea552b4113d4877f1bbfd9df0532551/invoice.py
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')])[0]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): journal_obj = self.pool.get('account.journal') if context.get('active_model','') in ['res.partner']: partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[...
87372a16dea552b4113d4877f1bbfd9df0532551 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87372a16dea552b4113d4877f1bbfd9df0532551/invoice.py
def msg_new(self, msg): message = self.msg_body_get(msg) data = { 'name': self._decode_header(msg['Subject']), 'email_from': self._decode_header(msg['From']), 'email_cc': self._decode_header(msg['Cc'] or ''), 'canal_id': self.canal_id, 'user_id': False, 'description': message['body'], } data.update(self.partner_get(sel...
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
def replace(match): return ''
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
'description': body['body'],
def msg_user(self, msg, id): body = self.msg_body_get(msg)
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
self.rpc(self.model, 'history', [id], 'Send', True, msg['From'], message['body'])
self.rpc(self.model, 'history', [id], 'Send', True, msg['From'], body['body'])
def msg_user(self, msg, id): body = self.msg_body_get(msg)
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) data = { 'description':body, } self.rpc(self.model, 'write', [id], data)
def msg_partner(self, msg, id): message = self.msg_body_get(msg) body = message['body'] act = 'case_open' self.rpc(self.model, act, [id]) body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) data = { 'description':body, } self.rpc(self.model, 'write', [id], data) self.rpc(self.model, 'history', [id], 'Sen...
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[...
50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50005078fc6a0c1da2fc90e8a4bd7a52c3231bcc/openerp_mailgate.py
except ExceptionNoTb:
except security.ExceptionNoTb:
def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) except ExceptionNoTb: # AccessDenied pass cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) logger = logging.getLogger('orm.ldap') if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: l ...
bb8533edc6ed45ecb4996f1f7951b5ccbaccd9c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb8533edc6ed45ecb4996f1f7951b5ccbaccd9c0/users_ldap.py
if form['qty'+str(i)] > 0 and form['qty'+str(i)] not in vals.values(): vals['qty'+str(qtys)] = form['qty'+str(i)] qtys += 1
vals['qty'+str(qtys)] = form['qty'+str(i)] qtys += 1
def _get_titles(self,form): lst = [] vals = {} qtys = 1
aa7b817b4222f234e8e037c630dd89e3baba3594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aa7b817b4222f234e8e037c630dd89e3baba3594/product_pricelist.py
else: self.quantity.append(0)
def _set_quantity(self,form): for i in range(1,6): q = 'qty%d'%i if form[q] >0 and form[q] not in self.quantity: self.quantity.append(form[q])
aa7b817b4222f234e8e037c630dd89e3baba3594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aa7b817b4222f234e8e037c630dd89e3baba3594/product_pricelist.py
val['qty'+str(i)] = ""
val['qty'+str(i)] = 0.0
def _get_categories(self, products,form): cat_ids=[] res=[] self.pricelist = form['price_list'] self._set_quantity(form) pool = pooler.get_pool(self.cr.dbname) pro_ids=[] for product in products: pro_ids.append(product.id) if product.categ_id.id not in cat_ids: cat_ids.append(product.categ_id.id) cats = pool.get('produ...
aa7b817b4222f234e8e037c630dd89e3baba3594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aa7b817b4222f234e8e037c630dd89e3baba3594/product_pricelist.py
i += 1
i += 1
def _get_categories(self, products,form): cat_ids=[] res=[] self.pricelist = form['price_list'] self._set_quantity(form) pool = pooler.get_pool(self.cr.dbname) pro_ids=[] for product in products: pro_ids.append(product.id) if product.categ_id.id not in cat_ids: cat_ids.append(product.categ_id.id) cats = pool.get('produ...
aa7b817b4222f234e8e037c630dd89e3baba3594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aa7b817b4222f234e8e037c630dd89e3baba3594/product_pricelist.py
res.append({'name':cat['name'],'products':products})
res.append({'name':cat['name'],'products': products})
def _get_categories(self, products,form): cat_ids=[] res=[] self.pricelist = form['price_list'] self._set_quantity(form) pool = pooler.get_pool(self.cr.dbname) pro_ids=[] for product in products: pro_ids.append(product.id) if product.categ_id.id not in cat_ids: cat_ids.append(product.categ_id.id) cats = pool.get('produ...
aa7b817b4222f234e8e037c630dd89e3baba3594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aa7b817b4222f234e8e037c630dd89e3baba3594/product_pricelist.py
def compute_tax(self, cr, uid, ids, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') voucher_line_pool = self.pool.get('account.voucher.line') voucher_pool = self.pool.get('account.voucher') for voucher in voucher_...
d6ae30d2ff5b5823d9f4e563059913cc8e4b0ac0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6ae30d2ff5b5823d9f4e563059913cc8e4b0ac0/voucher.py
period_date_start = period_obj.read(cr, uid, data['form']['period_from'], ['date_start'])[0]['date_start'] period_date_stop = period_obj.read(cr, uid, data['form']['period_to'], ['date_stop'])[0]['date_stop']
period_obj = self.pool.get('account.period') period_date_start = period_obj.read(cr, uid, data['form']['period_from'], ['date_start'])['date_start'] period_date_stop = period_obj.read(cr, uid, data['form']['period_to'], ['date_stop'])['date_stop']
def _build_context(self, cr, uid, ids, data, context = None): result = {} result['fiscalyear'] = data['form']['fiscalyear_id'] and data['form']['fiscalyear_id'] or False if data['form']['filter'] == 'filter_date': result['date_from'] = data['form']['date_from'] result['date_to'] = data['form']['date_to'] elif data['for...
41255ffacfd1eb78d16a18981694ad4842de21df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41255ffacfd1eb78d16a18981694ad4842de21df/account_common_report.py
query_line = obj_acc_move_line._query_get(cr, uid, obj='l', context=used_context)
query_line = obj_acc_move_line._query_get(cr, uid, obj='l', context=used_context)
def check_report(self, cr, uid, ids, context=None): obj_acc_move_line = self.pool.get('account.move.line') data = {} data['ids'] = context.get('active_ids',[]) data['model'] = context.get('active_model', 'ir.ui.menu') data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'per...
41255ffacfd1eb78d16a18981694ad4842de21df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41255ffacfd1eb78d16a18981694ad4842de21df/account_common_report.py
qu1 = ' where '+string.join(qu1, ' and ')
qu1 = ' where ' qu1 += ' and '.join(qu1)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
if len(qu1_join): qu1 = qu1 + ' and ' qu1 += ' and '.join(qu1_join)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
if not args:
if args is None:
def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None): 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(c...
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
if not context:
if context is None:
def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None): 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(c...
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
a828eea7255bf501d3547db89a206df63cbe9cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a828eea7255bf501d3547db89a206df63cbe9cbc/orm.py
res.update({'product_qty': move.product_qty.id})
res.update({'product_qty': move.product_qty})
def default_get(self, cr, uid, fields, context=None): """ Get default values @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for default value @param context: A standard dictionary @return: default values of fields """ res = s...
c5f3a4c94137645f9a6ad3bda19348334af27727 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5f3a4c94137645f9a6ad3bda19348334af27727/stock_move.py
email_text = MIMEText(email_body, _subtype=subtype, _charset='utf-8')
try: email_text = MIMEText(email_body.encode('utf8') or '',_subtype=subtype,_charset='utf-8') except: email_text = MIMEText(email_body or '',_subtype=subtype,_charset='utf-8')
def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3'): """Send an email. Arguments: `email_from`: A string used to fill the `From` header, if falsy, config['email_from...
faec4cbc803b18194a72b6a4a5bc3bc66495bc87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/faec4cbc803b18194a72b6a4a5bc3bc66495bc87/misc.py
if app_acc_in.company_id.id != company_id and app_acc_exp.company_id.id != company_id:
if app_acc_in and app_acc_in.company_id.id != company_id and app_acc_exp and app_acc_exp.company_id.id != company_id:
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
940eaa4a68a69a565da9f8f87a8a948b94b32621 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/940eaa4a68a69a565da9f8f87a8a948b94b32621/invoice.py
netsvc.Logger().notifyChannel("web-services", netsvc.LOG_WARNING, "Netrpc: closing because of exception %s" % str(e))
import logging logging.getLogger('web-services').warning("Netrpc: closing because of exception %s" % str(e))
def run(self): # import select try: self.running = True while self.running: (clientsocket, address) = self.socket.accept() ct = TinySocketClientThread(clientsocket, self.threads) clientsocket = None self.threads.append(ct) ct.start() lt = len(self.threads) if (lt > 10) and (lt % 10 == 0): # Not many threads should be s...
d4d1302faeb9c691a71d4e014d8b13d85815ae34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4d1302faeb9c691a71d4e014d8b13d85815ae34/netrpc_server.py
res = super(stock_move, self)._auto_init(cursor, context=contexts)
res = super(stock_move, self)._auto_init(cursor, context=context)
def _auto_init(self, cursor, context=None): res = super(stock_move, self)._auto_init(cursor, context=contexts) cursor.execute('SELECT indexname \ FROM pg_indexes \ WHERE indexname = \'stock_move_location_id_location_dest_id_product_id_state\'') if not cursor.fetchone(): cursor.execute('CREATE INDEX stock_move_location_...
140211673f3b353958df7056663537a003335621 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/140211673f3b353958df7056663537a003335621/stock.py
location_obj = self.pool.get('stock.location')
def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, c...
9e1ee6bc40d5898da2b52a5d26c56de5a89a7cc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e1ee6bc40d5898da2b52a5d26c56de5a89a7cc5/mrp_pull.py
return self.write(cr, uid, ids, {'state': 'installed'}, context)
res = self.write(cr, uid, ids, {'state': 'installed'}, context) if res: return "Installed"
def button_install(self, cr, uid, ids, context={}): return self.write(cr, uid, ids, {'state': 'installed'}, context)
ecd53f7ea025862e25168dd9a6b2b56f028e0832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ecd53f7ea025862e25168dd9a6b2b56f028e0832/module_web.py
return self.write(cr, uid, ids, {'state': 'uninstalled'}, context)
res = self.write(cr, uid, ids, {'state': 'uninstalled'}, context) if res: return "Uninstalled"
def button_uninstall(self, cr, uid, ids, context={}): return self.write(cr, uid, ids, {'state': 'uninstalled'}, context)
ecd53f7ea025862e25168dd9a6b2b56f028e0832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ecd53f7ea025862e25168dd9a6b2b56f028e0832/module_web.py
self.write(cr, uid, id, {'history':history or '' + "\n" + time.strftime("%Y-%m-%d %H:%M:%S") + ": " + tools.ustr(message)}, context)
self.write(cr, uid, id, {'history': (history or '' )+ "\n" + time.strftime("%Y-%m-%d %H:%M:%S") + ": " + tools.ustr(message)}, context)
def historise(self, cr, uid, ids, message='', context=None): for id in ids: history = self.read(cr, uid, id, ['history'], context).get('history', '') self.write(cr, uid, id, {'history':history or '' + "\n" + time.strftime("%Y-%m-%d %H:%M:%S") + ": " + tools.ustr(message)}, context)
300556bc1f9c0753fc50f7c02067ad63d000ef1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/300556bc1f9c0753fc50f7c02067ad63d000ef1b/email_template_mailbox.py
case_obj.write(cr, uid, case.id, {'ref': 'sale.order,%s' % new_id})
case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id})
def _makeOrder(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) case_obj = pool.get('crm.case') sale_obj = pool.get('sale.order') partner_obj = pool.get('res.partner') sale_line_obj = pool.get('sale.order.line')
4c338ea12f041a03556bc7f0a7ee90ca0311b276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4c338ea12f041a03556bc7f0a7ee90ca0311b276/makesale.py
self.write(cr, uid, ids, {'state':'done'}, context=context)
self.write(cr, uid, ids, {'state':'close'}, context=context)
def set_done(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'done'}, context=context) return True
a70ea4f2619b778b564e481733a5289787669b9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a70ea4f2619b778b564e481733a5289787669b9f/project.py
cr.execute('update project_task set active=True where project_id in ('+','.join(map(str, ids))+')')
if ids: cr.execute('update project_task set active=True where project_id in ('+','.join(map(str, ids))+')')
def copy(self, cr, uid, id, default={},context={}): proj = self.browse(cr, uid, id, context=context) default = default or {} context['active_test'] = False default['state'] = 'open' if not default.get('name', False): default['name'] = proj.name+_(' (copy)') res = super(project, self).copy(cr, uid, id, default, context)...
a70ea4f2619b778b564e481733a5289787669b9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a70ea4f2619b778b564e481733a5289787669b9f/project.py
cr.execute('select id from project_project where parent_id=%s', (proj.id,)) res = cr.fetchall() project_ids = [x[0] for x in res] for child in project_ids: self.duplicate_template(cr, uid, [child],context={'parent_id':new_id})
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)]) if child_ids: self.duplicate_template(cr, uid, child_ids, context={'parent_id':new_id})
def duplicate_template(self, cr, uid, ids,context={}): for proj in self.browse(cr, uid, ids): parent_id=context.get('parent_id',False) new_id=self.pool.get('project.project').copy(cr, uid, proj.id,default={'name':proj.name+_(' (copy)'),'state':'open','parent_id':parent_id}) cr.execute('select id from project_task where...
a70ea4f2619b778b564e481733a5289787669b9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a70ea4f2619b778b564e481733a5289787669b9f/project.py
cr.execute('select id from project_project where parent_id=%s', (proj.id,)) project_ids = [x[0] for x in cr.fetchall()] for child in project_ids: self.setActive(cr, uid, [child], value, context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)]) if child_ids: self.setActive(cr, uid, child_ids, value, context)
def setActive(self, cr, uid, ids, value=True, context={}): for proj in self.browse(cr, uid, ids, context): self.write(cr, uid, [proj.id], {'state': value and 'open' or 'template'}, context) cr.execute('select id from project_task where project_id=%s', (proj.id,)) tasks_id = [x[0] for x in cr.fetchall()] if tasks_id: se...
a70ea4f2619b778b564e481733a5289787669b9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a70ea4f2619b778b564e481733a5289787669b9f/project.py
if not line.sequence: account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
def write(self, cr, uid, ids, vals, context=None): res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context) account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') for statement in self.browse(cr, uid, ids, context): seq = 0 for line in statement.line_ids: seq += 1 if ...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
return st_number + ' - ' + str(st_line.sequence)
return st_number + '/' + str(st_line.sequence)
def get_next_st_line_number(self, cr, uid, st_number, st_line, context=None): return st_number + ' - ' + str(st_line.sequence)
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None):
def onchange_type(self, cr, uid, line_id, partner_id, type, context=None):
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
line = self.browse(cursor, user, line_id)
line = self.browse(cr, uid, line_id)
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
part = obj_partner.browse(cursor, user, partner_id, context=context)
part = obj_partner.browse(cr, uid, partner_id, context=context)
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
if account_id and (not line or (line and not line[0].amount)) and not context.get('amount', False): company_currency_id = res_users_obj.browse(cursor, user, user, context=context).company_id.currency_id.id if not currency_id: currency_id = company_currency_id cursor.execute('SELECT sum(debit-credit) \ FROM account_mo...
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
'name': fields.char('Name', size=64, required=True),
'name': fields.char('Communication', size=64, required=True),
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py
def create(self, cr, user, vals, context={}): """ Create a new record for a model idea_idea @param cr: A database cursor @param user: ID of the user currently logged in @param vals: provides data for new record @param context: context arguments, like lang, time zone
95b83f741efe93d8e9749dd0e6a149b09b9d5bdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95b83f741efe93d8e9749dd0e6a149b09b9d5bdb/idea.py
def create(self, cr, user, vals, context={}): """ Create a new record for a model idea_idea @param cr: A database cursor @param user: ID of the user currently logged in @param vals: provides data for new record @param context: context arguments, like lang, time zone
95b83f741efe93d8e9749dd0e6a149b09b9d5bdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95b83f741efe93d8e9749dd0e6a149b09b9d5bdb/idea.py
visibility = False if vals.get('category_id', False): category_pool = self.pool.get('idea.category') category = category_pool.browse(cr, user, vals.get('category_id'), context) visibility = category.visibility vals.update({ 'visibility':visibility })
def write(self, cr, user, ids, vals, context=None): """ Update redord(s) exist in {ids}, with new value provided in {vals}
95b83f741efe93d8e9749dd0e6a149b09b9d5bdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95b83f741efe93d8e9749dd0e6a149b09b9d5bdb/idea.py
src_model = rec.get('src_model','').encode('utf-8')
src_model = rec.get('src_model','').encode('utf-8')
def _tag_act_window(self, cr, rec, data_node=None): name = rec.get('name','').encode('utf-8') xml_id = rec.get('id','').encode('utf8') self._test_xml_id(xml_id) type = rec.get('type','').encode('utf-8') or 'ir.actions.act_window' view_id = False if rec.get('view'): view_id = self.id_get(cr, 'ir.actions.act_window', rec...
17b9f5802f563fcd1cd22750afc384f65d892de9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17b9f5802f563fcd1cd22750afc384f65d892de9/convert.py
def _tag_act_window(self, cr, rec, data_node=None): name = rec.get('name','').encode('utf-8') xml_id = rec.get('id','').encode('utf8') self._test_xml_id(xml_id) type = rec.get('type','').encode('utf-8') or 'ir.actions.act_window' view_id = False if rec.get('view'): view_id = self.id_get(cr, 'ir.actions.act_window', rec...
17b9f5802f563fcd1cd22750afc384f65d892de9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17b9f5802f563fcd1cd22750afc384f65d892de9/convert.py
rcal = self.export_cal(cr, uid, r_ids, 'vevent', context=context)
r_datas = model_obj.read(cr, uid, r_ids, context=context) rcal = CalDAV.export_cal(self, cr, uid, r_datas, 'vevent', context=context) for revents in rcal.contents.get('vevent', []): ical.contents['vevent'].append(revents)
def create_ics(self, cr, uid, datas, name, ical, context=None): """ create calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """
26ca4db0831e90cd5348874bd2ae18ddabdf9878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ca4db0831e90cd5348874bd2ae18ddabdf9878/calendar.py
def export_cal(self, cr, uid, datas, vobj=None, context=None): """ Export Calendar @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 datas: Get Data's for caldav @param context: A standard dictionary for contextual values ...
26ca4db0831e90cd5348874bd2ae18ddabdf9878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ca4db0831e90cd5348874bd2ae18ddabdf9878/calendar.py
data_ids = mod_obj.search(cr, uid, line_domain, context=context)
data_ids = mod_obj.search(cr, uid, line_domain, order="id", context=context)
def get_calendar_objects(self, cr, uid, ids, parent=None, domain=None, context=None): if not context: context = {} if not domain: domain = [] res = [] ctx_res_id = context.get('res_id', None) ctx_model = context.get('model', None) for cal in self.browse(cr, uid, ids): for line in cal.line_ids: if ctx_model and ctx_mode...
26ca4db0831e90cd5348874bd2ae18ddabdf9878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ca4db0831e90cd5348874bd2ae18ddabdf9878/calendar.py
def export_cal(self, cr, uid, ids, vobj='vevent', context=None): """ Export Calendar @param ids: List of calendar’s IDs @param vobj: the type of object to export @return the ical data. """ if not context: context = {} ctx_model = context.get('model', None) ctx_res_id = context.get('res_id', None) ical = vobject.iCalen...
26ca4db0831e90cd5348874bd2ae18ddabdf9878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ca4db0831e90cd5348874bd2ae18ddabdf9878/calendar.py
def import_cal(self, cr, uid, content, data_id=None, context=None): """ Import Calendar @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 data_id: Get Data’s ID or False @param context: A standard dictionary for contextual...
26ca4db0831e90cd5348874bd2ae18ddabdf9878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ca4db0831e90cd5348874bd2ae18ddabdf9878/calendar.py
def get_children(self,uri, filters=None):
def get_childs(self,uri, filters=None):
def get_children(self,uri, filters=None): """ return the child objects as self.baseuris for the given URI """ self.parent.log_message('get children: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True)
f25e5da78726c2efe93b2d140e3ab87a37baf7f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f25e5da78726c2efe93b2d140e3ab87a37baf7f4/dav_fs.py
fp = Popen(['file','-b',fname], shell=False, stdout=PIPE).stdout
fp = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE).stdout
def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj...
71fa375ac07ed23e7105f253fc45fff98890c1c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/71fa375ac07ed23e7105f253fc45fff98890c1c4/content_index.py
mime2 = result.strip()
mime2 = result.split(';')[0]
def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj...
71fa375ac07ed23e7105f253fc45fff98890c1c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/71fa375ac07ed23e7105f253fc45fff98890c1c4/content_index.py
'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
'planned_hours': fields.float('Planned Hours', help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
def _is_template(self, cr, uid, ids, field_name, arg, context=None): res = {} for task in self.browse(cr, uid, ids, context=context): res[task.id] = True if task.project_id: if task.project_id.active == False or task.project_id.state == 'template': res[task.id] = False return res
993a1f275e6b0ab4aee514f02014591118b04e53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/993a1f275e6b0ab4aee514f02014591118b04e53/project.py
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model !'), ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model !'),
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'), ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
def generate(self, cr, uid, ids, datas={}, context={}): move_ids = [] for model in self.browse(cr, uid, ids, context): period_id = self.pool.get('account.period').find(cr,uid, context=context) if not period_id: raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !')) period_id = period_id[0] m...
c25b354ed78c5bf0d9ce67931eb52862580d8b5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c25b354ed78c5bf0d9ce67931eb52862580d8b5f/account.py
result = obj_model.read(cr, uid, [vals['res_id']], context=context)
result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context)
def create(self, cr, uid, vals, context=None): if not context: context = {} vals['title'] = vals['name'] vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False) if not vals['parent_id']: vals['parent_id'] = self.pool.get('document.directory')._get_root_directory(cr,uid, context) if not vals....
d91fa1c56eb25cd2a9afde75186428effd9a08ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d91fa1c56eb25cd2a9afde75186428effd9a08ed/document.py
if not ids: raise osv.except_osv(_('Invalid !'), _('Please save voucher before selection partner !')) line_ids = line_pool.search(cr, uid, [('voucher_id','=',ids[0])]) if line_ids: line_pool.unlink(cr, uid, line_ids) voucher_id = ids[0]
voucher_id = ids and ids[0] or False
def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other arguments @param conte...
4359aaefcdb807ccafa0133705b8777e68fa4809 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4359aaefcdb807ccafa0133705b8777e68fa4809/voucher.py
result[id] = price
result[id] = price result['item_id'] = {id: item_id}
def price_get(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), } ''' context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.pool.get('product.product') supp...
e72c090ed9ab83f8857499ac40273aed7dc04fd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e72c090ed9ab83f8857499ac40273aed7dc04fd0/pricelist.py
'type': 'other',
'type': 'liquidity',
def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.templ...
8e59d73e71dc2406f96ee3bb4fe2477532f46993 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e59d73e71dc2406f96ee3bb4fe2477532f46993/account.py
vals_journal['type'] = 'cash'
vals_journal['type'] = line.account_type == 'cash' and 'cash' or 'bank'
def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.templ...
8e59d73e71dc2406f96ee3bb4fe2477532f46993 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e59d73e71dc2406f96ee3bb4fe2477532f46993/account.py
if type(sel_list) == type([]): r = [x[1] for x in sel_list if r==x[0]][0]
if r and type(sel_list) == type([]): r = [x[1] for x in sel_list if r==x[0]] r = r and r[0] or False
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False
9f1015621bd3024bba5ec1cb0f544fc0b882837b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f1015621bd3024bba5ec1cb0f544fc0b882837b/orm.py
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): """ To produce final product based on production mode (consume/consume&produce). If Production mode is consume, all stock move lines of raw materials will be done/consumed. If Production mode is consume & produce, all stock...
2eaf0ee8a420b5273e173e5069355a17c874349e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eaf0ee8a420b5273e173e5069355a17c874349e/mrp.py
consumed_products[consumed_product.product_id.id] = 0 consumed_products[consumed_product.product_id.id] -= consumed_product.product_qty
consumed_products[consumed_product.product_id.id] = consumed_product.product_qty check[consumed_product.product_id.id] = 0 for f in production.product_lines: if f.product_id.id == consumed_product.product_id.id: if (len(production.move_lines2) - scraped) > len(production.product_lines): check[consumed_product.product_i...
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): """ To produce final product based on production mode (consume/consume&produce). If Production mode is consume, all stock move lines of raw materials will be done/consumed. If Production mode is consume & produce, all stock...
2eaf0ee8a420b5273e173e5069355a17c874349e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eaf0ee8a420b5273e173e5069355a17c874349e/mrp.py
if f.product_id.id==raw_product.product_id.id:
if f.product_id.id == raw_product.product_id.id:
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): """ To produce final product based on production mode (consume/consume&produce). If Production mode is consume, all stock move lines of raw materials will be done/consumed. If Production mode is consume & produce, all stock...
2eaf0ee8a420b5273e173e5069355a17c874349e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eaf0ee8a420b5273e173e5069355a17c874349e/mrp.py
rest_qty = production_qty * f.product_qty / production.product_qty - consumed_qty if rest_qty > 0: stock_mov_obj.action_consume(cr, uid, [raw_product.id], rest_qty, production.location_src_id.id, context=context)
if consumed_qty == 0: consumed_qty = production_qty * f.product_qty / production.product_qty if consumed_qty > 0: stock_mov_obj.action_consume(cr, uid, [raw_product.id], consumed_qty, production.location_src_id.id, context=context)
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): """ To produce final product based on production mode (consume/consume&produce). If Production mode is consume, all stock move lines of raw materials will be done/consumed. If Production mode is consume & produce, all stock...
2eaf0ee8a420b5273e173e5069355a17c874349e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2eaf0ee8a420b5273e173e5069355a17c874349e/mrp.py
vals_line['amount'] = 00.0
vals_line['amount'] = 0.0
def create(self, cr, uid, vals, *args, **kwargs): obj_timesheet = self.pool.get('hr.analytic.timesheet') task_obj = self.pool.get('project.task') vals_line = {} obj_task = task_obj.browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
timeline_id = obj_timesheet.create(cr, uid, vals=vals_line, context=kwargs['context'])
timeline_id = obj_timesheet.create(cr, uid, vals=vals_line, context=context)
def create(self, cr, uid, vals, *args, **kwargs): obj_timesheet = self.pool.get('hr.analytic.timesheet') task_obj = self.pool.get('project.task') vals_line = {} obj_task = task_obj.browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
prod_id, amount, unit, context=kwargs['context']) if amount_unit: vals_line['amount'] = (-1) * vals['hours']* (amount_unit.get('value',{}).get('amount',0.0) or 0.0) obj_timesheet.write(cr, uid, [timeline_id], vals_line, {})
prod_id, amount, unit, context=context) if amount_unit and 'amount' in amount_unit.get('value',{}): updv = { 'amount': amount_unit['value']['amount'] * (-1.0) } obj_timesheet.write(cr, uid, [timeline_id], updv, context=context)
def create(self, cr, uid, vals, *args, **kwargs): obj_timesheet = self.pool.get('hr.analytic.timesheet') task_obj = self.pool.get('project.task') vals_line = {} obj_task = task_obj.browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
vals_line = {}
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} vals_line = {} obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0] line_id = task.hr_analytic_timesheet_i...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0] line_id = task.hr_analytic_timesheet_id list_avail_ids = timesheet_obj.search(cr, uid, [], context=context) if line_id in list_avail_ids:
if isinstance(ids, (long, int)): ids = [ids,] for task in self.browse(cr, uid, ids, context=context): line_id = task.hr_analytic_timesheet_id if not line_id: continue vals_line = {}
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} vals_line = {} obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0] line_id = task.hr_analytic_timesheet_i...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
vals_line['product_id'] = result['product_id'] vals_line['general_account_id'] = result['general_account_id'] vals_line['journal_id'] = result['journal_id'] vals_line['product_uom_id'] = result['product_uom_id']
for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): if result.get(fld, False): vals_line[fld] = result[fld]
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} vals_line = {} obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0] line_id = task.hr_analytic_timesheet_i...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
unit = False amount_unit=obj.on_change_unit_amount(cr, uid, line_id, vals_line['product_id'], vals_line['unit_amount'], unit, context=context) if amount_unit: vals_line['amount'] = (-1) * vals['hours'] * (amount_unit.get('value',{}).get('amount',0.0) or 0.0) obj.write(cr, uid, [line_id], vals_line, context=context)
amount_unit = obj.on_change_unit_amount(cr, uid, line_id.id, prod_id=prod_id, unit_amount=vals_line['unit_amount'], unit=False, context=context) if amount_unit and 'amount' in amount_unit.get('value',{}): vals_line['amount'] = amount_unit['value']['amount'] * (-1.0) obj.write(cr, uid, [line_id.id], vals_line, context...
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} vals_line = {} obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0] line_id = task.hr_analytic_timesheet_i...
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
pool_analytic_timesheet = self.pool.get('hr.analytic.timesheet') for work_id in ids: timesheet_id = self.read(cr, uid, work_id, ['hr_analytic_timesheet_id'])['hr_analytic_timesheet_id']
hat_obj = self.pool.get('hr.analytic.timesheet') hat_ids = [] for task in self.browse(cr, uid, ids): if task.hr_analytic_timesheet_id: hat_ids.append(task.hr_analytic_timesheet_id)
def unlink(self, cr, uid, ids, *args, **kwargs): pool_analytic_timesheet = self.pool.get('hr.analytic.timesheet') for work_id in ids: timesheet_id = self.read(cr, uid, work_id, ['hr_analytic_timesheet_id'])['hr_analytic_timesheet_id']
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
list_avail_ids = pool_analytic_timesheet.search(cr, uid, []) if timesheet_id in list_avail_ids: obj = pool_analytic_timesheet.unlink(cr, uid, [timesheet_id], *args, **kwargs)
if hat_ids: hat_obj.unlink(cr, uid, hat_ids, *args, **kwargs)
def unlink(self, cr, uid, ids, *args, **kwargs): pool_analytic_timesheet = self.pool.get('hr.analytic.timesheet') for work_id in ids: timesheet_id = self.read(cr, uid, work_id, ['hr_analytic_timesheet_id'])['hr_analytic_timesheet_id']
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
'hr_analytic_timesheet_id':fields.integer('Related Timeline Id')
'hr_analytic_timesheet_id':fields.many2one('hr.analytic.timesheet','Related Timeline Id', ondelete='set null'),
def unlink(self, cr, uid, ids, *args, **kwargs): pool_analytic_timesheet = self.pool.get('hr.analytic.timesheet') for work_id in ids: timesheet_id = self.read(cr, uid, work_id, ['hr_analytic_timesheet_id'])['hr_analytic_timesheet_id']
c7aa00c70f256f0611b6d06a92928cb15447ab24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c7aa00c70f256f0611b6d06a92928cb15447ab24/project_timesheet.py
def _lang_get(self, cr, uid, context={}):
def _lang_get(self, cr, uid, context=None):
def _lang_get(self, cr, uid, context={}): """ Get language for language selection field. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values @return: list of dictionary which contain code and name and id...
ff92d26b785376d922a04928216940ff42bc351d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff92d26b785376d922a04928216940ff42bc351d/base_calendar.py
def _tz_get(self, cr, uid, context={}):
def _tz_get(self, cr, uid, context=None):
def _tz_get(self, cr, uid, context={}): return [(x.lower(), x) for x in pytz.all_timezones]
ff92d26b785376d922a04928216940ff42bc351d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff92d26b785376d922a04928216940ff42bc351d/base_calendar.py
def onchange_allday(self, cr, uid, ids, allday, context={}):
def onchange_allday(self, cr, uid, ids, allday, context=None):
def onchange_allday(self, cr, uid, ids, allday, context={}): """Sets duration as 24 Hours if event is selcted for all day @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 calendar event’s IDs. @param allday: ...
ff92d26b785376d922a04928216940ff42bc351d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff92d26b785376d922a04928216940ff42bc351d/base_calendar.py
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}):
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process=None):
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}): """ Overrides orm browse method. @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 crm meeting's ids @param context: A standard...
ff92d26b785376d922a04928216940ff42bc351d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff92d26b785376d922a04928216940ff42bc351d/base_calendar.py
WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id']))
WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id']))
def _lines_p(self, date1, date2): res = [] acc_obj = self.pool.get('account.account')
e36331787c17b71bcb2d7a5977d19917b2457494 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e36331787c17b71bcb2d7a5977d19917b2457494/analytic_check.py
WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id']))
WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id']))
def _lines_p(self, date1, date2): res = [] acc_obj = self.pool.get('account.account')
e36331787c17b71bcb2d7a5977d19917b2457494 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e36331787c17b71bcb2d7a5977d19917b2457494/analytic_check.py
'confirmed': "is scheduled for the '" + datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d') + "'.",
'confirmed': "is scheduled for the '" + msg ,
def log_picking(self, cr, uid, ids, context=None): """ This function will create log messages for picking. @param cr: the database cursor @param uid: the current user's ID for security checks, @param ids: List of Picking Ids @param context: A standard dictionary for contextual values """ for pick in self.browse(cr, uid...
fa4e65df71ad1b87927438c040f34e634eb74604 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa4e65df71ad1b87927438c040f34e634eb74604/stock.py
self.styles[style.get('name')] = self._para_style_update(style)
sname = style.get('name') self.styles[sname] = self._para_style_update(style) self.styles_obj[sname] = reportlab.lib.styles.ParagraphStyle(sname, self.default_style["Normal"], **self.styles[sname])
def __init__(self, nodes, localcontext): self.localcontext = localcontext self.styles = {} self.names = {} self.table_styles = {} for node in nodes: for style in node.findall('blockTableStyle'): self.table_styles[style.get('id')] = self._table_style_get(style) for style in node.findall('paraStyle'): self.styles[style.g...
1bfd4b60d0c9062ff808b28698b1b334ffd59186 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1bfd4b60d0c9062ff808b28698b1b334ffd59186/trml2pdf.py
if node.get('style'): if node.get('style') in self.styles: styles = reportlab.lib.styles.getSampleStyleSheet() sname = node.get('style') style = reportlab.lib.styles.ParagraphStyle(sname, styles["Normal"], **self.styles[sname])
sname = node.get('style') if sname: if sname in self.styles_obj: style = self.styles_obj[sname]
def para_style_get(self, node): style = False if node.get('style'): if node.get('style') in self.styles: styles = reportlab.lib.styles.getSampleStyleSheet() sname = node.get('style') style = reportlab.lib.styles.ParagraphStyle(sname, styles["Normal"], **self.styles[sname]) else: sys.stderr.write('Warning: style not fou...
1bfd4b60d0c9062ff808b28698b1b334ffd59186 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1bfd4b60d0c9062ff808b28698b1b334ffd59186/trml2pdf.py