rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if inv.type in ('sale'):
if inv.type in ('sale', 'receipt'):
def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p...
5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param cr: A database cursor @param user: ID of the user currently logged in @param view_id: list of fields, which require...
5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py
'date_original': fields.date('Date', readonly="1"), 'date_due': fields.date('Due Date', readonly="1"),
'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly="1"), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly="1"),
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param cr: A database cursor @param user: ID of the user currently logged in @param view_id: list of fields, which require...
5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py
'amount_unreconciled': fields.float('Open Balance', readonly="1"),
'amount_unreconciled': fields.related('move_line_id','balance', type='float', relation='account.move.line', string='Open Balance', readonly="1"),
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param cr: A database cursor @param user: ID of the user currently logged in @param view_id: list of fields, which require...
5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py
'type': lambda *a: 'cr'
'type': lambda *a: 'cr', 'name': lambda *a: 'Payment'
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param cr: A database cursor @param user: ID of the user currently logged in @param view_id: list of fields, which require...
5e56a23f983ef8307bea7ad99f730bb7aee1eb09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5e56a23f983ef8307bea7ad99f730bb7aee1eb09/voucher.py
pool.get(model).import_data(cr, uid, fields, datas,mode, module, noupdate, filename=fname_partial)
result, rows, warning_msg, dummy = pool.get(model).import_data(cr, uid, fields, datas,mode, module, noupdate, filename=fname_partial) if result < 0: raise except_orm(_('Module loading failed'), _('Loading %s/%s failed:\n %s') % (module, fname, warning_msg))
def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init', noupdate=False): '''Import csv file : quote: " delimiter: , encoding: utf-8''' if not idref: idref={} logger = logging.getLogger('init') model = ('.'.join(fname.split('.')[:-1]).split('-'))[0] #remove folder path from model head, model = os....
12ba501178e56235ae7b2016378a47fdf2c0c2ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/12ba501178e56235ae7b2016378a47fdf2c0c2ac/convert.py
'name': case.partner_name or case.name,
'name': case.partner_contact or case.name,
def _create_partner(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) case_obj = pool.get('crm.phonecall') partner_obj = pool.get('res.partner') contact_obj = pool.get('res.partner.address') partner_ids = [] partner_id = False contact_id = False for case in case_obj.browse(cr, uid, data['ids']): if data[...
4b8f2856ef4f7fb58a202ae0a11c9b97d61ccb40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b8f2856ef4f7fb58a202ae0a11c9b97d61ccb40/crm_phonecall_wizard.py
'phone': case.phone, 'mobile': case.mobile,
'phone': case.partner_phone, 'mobile': case.partner_mobile,
def _create_partner(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) case_obj = pool.get('crm.phonecall') partner_obj = pool.get('res.partner') contact_obj = pool.get('res.partner.address') partner_ids = [] partner_id = False contact_id = False for case in case_obj.browse(cr, uid, data['ids']): if data[...
4b8f2856ef4f7fb58a202ae0a11c9b97d61ccb40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b8f2856ef4f7fb58a202ae0a11c9b97d61ccb40/crm_phonecall_wizard.py
inv_line['account_id'] = acc
def action_invoice(self, cr, uid, ids, context=None): """Create a invoice of order """ inv_ref = self.pool.get('account.invoice') inv_line_ref = self.pool.get('account.invoice.line') product_obj = self.pool.get('product.product') inv_ids = []
53b327827b9dd02d3762ae3b9bf1deb8bf9ac543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/53b327827b9dd02d3762ae3b9bf1deb8bf9ac543/point_of_sale.py
right = map(lambda x: x[0], res_ids) self.__exp[i] = (left, 'in', right)
if not res_ids: self.__exp[i] = ('id','=',0) else: right = map(lambda x: x[0], res_ids) self.__exp[i] = (left, 'in', right)
def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type)
220517082345862716e388ed9e7557c33e105db0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/220517082345862716e388ed9e7557c33e105db0/expression.py
res.append((r.id, self.pool.get('res.partner.contact').name_get(cr, uid, [r.contact_id.id])[0][1] + funct ))
res.append((r.id, self.pool.get('res.partner.contact').name_get(cr, uid, [r.contact_id.id])[0][1] + funct))
def name_get(self, cr, uid, ids, context={}): if not len(ids): return [] res = [] for r in self.browse(cr, uid, ids): funct = r.function_id and (", " + r.function_id.name) or "" res.append((r.id, self.pool.get('res.partner.contact').name_get(cr, uid, [r.contact_id.id])[0][1] + funct )) return res
b1643c7af602f7724e87867569ca047669d45d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1643c7af602f7724e87867569ca047669d45d20/base_contact.py
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): job_ids = []
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): for arg in args: if arg[0]=='address_id': self._order = 'sequence_partner' if arg[0]=='contact_id': self._order = 'sequence_contact' return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, cou...
b1643c7af602f7724e87867569ca047669d45d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1643c7af602f7724e87867569ca047669d45d20/base_contact.py
if arg[0]=='address_id':
if arg[0] == 'address_id':
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): for arg in args: if arg[0]=='address_id': self._order = 'sequence_partner' if arg[0]=='contact_id': self._order = 'sequence_contact' return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, cou...
b1643c7af602f7724e87867569ca047669d45d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1643c7af602f7724e87867569ca047669d45d20/base_contact.py
if arg[0]=='contact_id':
elif arg[0] == 'contact_id':
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): for arg in args: if arg[0]=='address_id': self._order = 'sequence_partner' if arg[0]=='contact_id': self._order = 'sequence_contact' return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, cou...
b1643c7af602f7724e87867569ca047669d45d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1643c7af602f7724e87867569ca047669d45d20/base_contact.py
return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, count)
elif arg[0] == 'name': contact_obj = self.pool.get('res.partner.contact') search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])] contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, limit=limit, order=order, context=context, count=count) contacts = contact_obj.browse(cr, user, c...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): for arg in args: if arg[0]=='address_id': self._order = 'sequence_partner' if arg[0]=='contact_id': self._order = 'sequence_contact' return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, cou...
b1643c7af602f7724e87867569ca047669d45d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1643c7af602f7724e87867569ca047669d45d20/base_contact.py
class many2many_domain(fields.many2many): def set(self, cr, obj, id, name, values, user=None, context=None): return super(many2many_domain, self).set(cr, obj, id, name, values, user=user, context=context) def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} m...
def rounding(f, r): if not r: return f return round(f / r) * r
9475077629755339394a61202454fc340cc48478 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9475077629755339394a61202454fc340cc48478/mrp.py
'move_lines': many2many_domain('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), 'move_lines2': many2many_domain('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed...
'move_lines': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), 'move_lines2': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed...
def _production_date(self, cr, uid, ids, prop, unknow_none, context={}): """ Finds production planned date. @param prop: Name of field. @param unknow_none: @return: Dictionary of values. """ result = {} for prod in self.browse(cr, uid, ids, context=context): result[prod.id] = prod.date_planned[:10] return result
9475077629755339394a61202454fc340cc48478 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9475077629755339394a61202454fc340cc48478/mrp.py
def _check_dates(self, cr, uid, ids, context=None): task = self.read(cr, uid, ids[0], ['date_start', 'date_end']) if task['date_start'] and task['date_end']: if task['date_start'] > task['date_end']: return False return True
6ba2fbc74afcd6a987e27508c61d2a566a8b85b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ba2fbc74afcd6a987e27508c61d2a566a8b85b5/project.py
(_check_dates, 'Error! Task start-date must be lower then task end-date.', ['date_start', 'date_end'])
(_check_dates, 'Error! Task start-date must be lower then task end-date.', ['date_start', 'date_end']), (_check_recursion, _('Error ! You cannot create recursive tasks.'), ['parent_ids'])
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
6ba2fbc74afcd6a987e27508c61d2a566a8b85b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ba2fbc74afcd6a987e27508c61d2a566a8b85b5/project.py
except Exception:
except Exception, e:
def get_childs(self, uri, filters=None): """ return the child objects as self.baseuris for the given URI """ self.parent.log_message('get childs: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True)
732ca8b5cf9b0108d13de83a5d9267d77f62f275 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/732ca8b5cf9b0108d13de83a5d9267d77f62f275/dav_fs.py
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]))
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]), context=context)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) search_extended = False timebox_obj = self.pool.get('project.gtd.timebox') access_pool = ...
52e91e76204d4fbbf8d07dda160212bf5f2eb648 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52e91e76204d4fbbf8d07dda160212bf5f2eb648/project_gtd.py
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'])
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'], context=context)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) search_extended = False timebox_obj = self.pool.get('project.gtd.timebox') access_pool = ...
52e91e76204d4fbbf8d07dda160212bf5f2eb648 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52e91e76204d4fbbf8d07dda160212bf5f2eb648/project_gtd.py
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print, header=False)
def _sum_credit(self, period_id, journal_id): self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0
84087f97b91ff4e3c9bd0d44d13cb800f85d5cf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/84087f97b91ff4e3c9bd0d44d13cb800f85d5cf9/account_journal.py
value = {
value = {
def open_wiki_page(self, cr, uid, ids, context):
f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a/wiki.py
def copy_data(self, cr, uid, id, default=None, context=None):
f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a/wiki.py
def create_history(self, cr, uid, ids, vals, context=None): history_id = False history = self.pool.get('wiki.wiki.history') if vals.get('text_area'): res = { 'minor_edit': vals.get('minor_edit', True), 'text_area': vals.get('text_area', ''), 'write_uid': uid, 'wiki_id': ids[0], 'summary':vals.get('summary', '') } histo...
f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a/wiki.py
id = super(Wiki, self).create(cr, uid, vals, context)
id = super(wiki_wiki2, self).create(cr, uid, vals, context)
def create(self, cr, uid, vals, context=None):
f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a/wiki.py
result = super(Wiki, self).write(cr, uid, ids, vals, context)
result = super(wiki_wiki2, self).write(cr, uid, ids, vals, context)
def write(self, cr, uid, ids, vals, context=None):
f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f60ec8bc68c45657c8ab2fca93a3a6b01de0f75a/wiki.py
self.query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context_initial_bal', {}))
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context_initial_bal', {}))
def set_context(self, objects, data, ids, report_type=None): new_ids = ids obj_move = self.pool.get('account.move.line') self.sortby = data['form'].get('sortby', 'sort_date') self.query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(cr, uid, ob...
5c4592ba23d4057ad0143ee7a84d0acb93ba88ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c4592ba23d4057ad0143ee7a84d0acb93ba88ad/account_general_ledger.py
AND s.user_id = e.user_id) \
AND s.user_id = r.user_id) \
def _sheet(self, cursor, user, ids, name, args, context): sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') cursor.execute("SELECT a.id, COALESCE(MAX(s.id), 0) \ FROM hr_timesheet_sheet_sheet s \ LEFT JOIN (hr_attendance a \ LEFT JOIN hr_employee e \ ON (a.employee_id = e.id)) \ ON (s.date_to >= date_trunc('day',a....
404bf5ca1ac193cae02fe0b0397ef20d283c3a5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/404bf5ca1ac193cae02fe0b0397ef20d283c3a5a/hr_timesheet_sheet.py
if new[c2][2]==c[2]:
if new[c2][2]==c[2] and new[c2][0]==c[0]:
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: if isinstance(parent_names, (str, unicode)): name = cls._name or parent_names parent_names = [parent_names] else: name = cls._name if not name: raise TypeError('_name is mandatory in case of multiple inheritance')
ee6e52fac75f277f675c12c0476127afa5439691 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee6e52fac75f277f675c12c0476127afa5439691/osv.py
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context=None, account=None, account_invert=False):
def _get_conversion_rate(self, cr, uid, from_currency, to_currency, context=None):
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 = {} 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_cu...
25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7/res_currency.py
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=context) from_currency = (xc[0].id == from_currency_id and xc[0]) or xc[1] to_currency = (xc[0].id == to_currency_id and xc[0]) or xc[1...
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 = {} 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_cu...
25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7/res_currency.py
rate = to_currency.rate/from_currency.rate if account and (account.currency_mode=='average') and account.currency_id: q = self.pool.get('account.move.line')._query_get(cr, uid, context=context) cr.execute('select sum(debit-credit),sum(amount_currency) from account_move_line l ' \ 'where l.currency_id=%s and l.account_i...
return to_currency.rate/from_currency.rate def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context=None): 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]...
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 = {} 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_cu...
25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25d6d96be8cf2e66c8629bcc5e86a21afc01a0a7/res_currency.py
'sequence' : lambda * a: 1,
def _get_in_visible_answer_type(self,cr, uid, context={}): return context.get('in_visible_answer_type', False)
62e7869832545289d5f2296b73ebdf4e0ef53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62e7869832545289d5f2296b73ebdf4e0ef53157/survey.py
from account_period where date('%s')
from account_period where date(%s)
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
8710567e1847970b7324e2f92429d386ac40c66a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8710567e1847970b7324e2f92429d386ac40c66a/account_invoice_refund.py
(form['date'], self.pool.get('res.users').browse(cr, uid, uid,context=context).company_id.id,))
(date, self.pool.get('res.users').browse(cr, uid, uid,context=context).company_id.id,))
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
8710567e1847970b7324e2f92429d386ac40c66a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8710567e1847970b7324e2f92429d386ac40c66a/account_invoice_refund.py
from account_period where date('%s')
from account_period where date(%s)
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
8710567e1847970b7324e2f92429d386ac40c66a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8710567e1847970b7324e2f92429d386ac40c66a/account_invoice_refund.py
limit 1 """, (form['date'],))
limit 1 """, (date,))
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
8710567e1847970b7324e2f92429d386ac40c66a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8710567e1847970b7324e2f92429d386ac40c66a/account_invoice_refund.py
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
8710567e1847970b7324e2f92429d386ac40c66a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8710567e1847970b7324e2f92429d386ac40c66a/account_invoice_refund.py
'name': ((type1=='move_history_ids') and 'Upstream Traceability') or 'Downstream Traceability',
'name': ((type1=='move_history_ids') and 'Donwstream Traceability') or 'Upstream 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 """
2ce90f1ba49b2796d0649516fb578ed9a4539d43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2ce90f1ba49b2796d0649516fb578ed9a4539d43/stock_traceability.py
if line.state == 'exception': for pick in order.picking_ids: for moves in pick.move_lines: if moves.state == 'cancel': move_obj.write(cr, uid, [move_id], {'product_qty': moves.product_qty}) proc_obj.write(cr, uid, [proc_id], {'product_qty': moves.product_qty, 'product_uos_qty': moves.product_qty})
def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = F...
6269b4aabed7e43f03b64f97c0656e0617bf01c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6269b4aabed7e43f03b64f97c0656e0617bf01c6/sale.py
val['shipped'] = False
def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = F...
6269b4aabed7e43f03b64f97c0656e0617bf01c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6269b4aabed7e43f03b64f97c0656e0617bf01c6/sale.py
if len(obj.message_ids) >= action.trg_max_history:
history_ids = filter(lambda x: x.history, obj.message_ids) if len(history_ids) <= action.trg_max_history:
def do_check(self, cr, uid, action, obj, context={}): """ @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""" ok = super(base_action_rule, self).do_check(cr, uid, actio...
ac41c6912b8a41bedab97af9357a827f9776dc09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac41c6912b8a41bedab97af9357a827f9776dc09/crm_action_rule.py
vevent.add(field).value = str(data[map_field])
vevent.add(field).value = str(data[map_field].encode('utf8'))
def create_ics(self, cr, uid, datas, name, ical, context=None): if not datas: model = context.get('model', None) war_str = "No data available" + (model and " for " + model) or "" raise osv.except_osv(_('Warning !'), _(war_str)) for data in datas: vevent = ical.add(name) for field in self.__attribute__.keys(): map_field...
805d377ce84582d16093f777830b9c489a9df45d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/805d377ce84582d16093f777830b9c489a9df45d/base_calendar.py
vevent.add(field).value = data.get(map_field)[1]
vevent.add(field).value = (data.get(map_field)[1]).encode('utf8')
def create_ics(self, cr, uid, datas, name, ical, context=None): if not datas: model = context.get('model', None) war_str = "No data available" + (model and " for " + model) or "" raise osv.except_osv(_('Warning !'), _(war_str)) for data in datas: vevent = ical.add(name) for field in self.__attribute__.keys(): map_field...
805d377ce84582d16093f777830b9c489a9df45d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/805d377ce84582d16093f777830b9c489a9df45d/base_calendar.py
vevent.add(field).value = (data[map_field]).upper()
vevent.add(field).value = (data[map_field].encode('utf8')).upper()
def create_ics(self, cr, uid, datas, name, ical, context=None): if not datas: model = context.get('model', None) war_str = "No data available" + (model and " for " + model) or "" raise osv.except_osv(_('Warning !'), _(war_str)) for data in datas: vevent = ical.add(name) for field in self.__attribute__.keys(): map_field...
805d377ce84582d16093f777830b9c489a9df45d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/805d377ce84582d16093f777830b9c489a9df45d/base_calendar.py
def _get_objects(self, empty_acc): if self.read_data: return self.read_data self.empty_acc = empty_acc self.read_data = [] self.get_children(self.ids)
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
def _move_sum(self, account_id, date1, date2, option): if account_id not in self.acc_data_dict: account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) self.acc_data_dict[account_id] = ids else: ids = self.acc_data_d...
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
def _move_sum(self, account_id, date1, date2, option): if account_id not in self.acc_data_dict: account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) self.acc_data_dict[account_id] = ids else: ids = self.acc_data_d...
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
def _move_sum(self, account_id, date1, date2, option): if account_id not in self.acc_data_dict: account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) self.acc_data_dict[account_id] = ids else: ids = self.acc_data_d...
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
query_params = (tuple(ids2), date1, date2)
query_params = (tuple(ids2), date1, date2)
def _sum_all(self, accounts, date1, date2, option): ids = map(lambda x: x['id'], accounts) if not len(ids): return 0.0
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
def _sum_all(self, accounts, date1, date2, option): ids = map(lambda x: x['id'], accounts) if not len(ids): return 0.0
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
def _sum_all(self, accounts, date1, date2, option): ids = map(lambda x: x['id'], accounts) if not len(ids): return 0.0
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
def _sum_all(self, accounts, date1, date2, option): ids = map(lambda x: x['id'], accounts) if not len(ids): return 0.0
49c75feee78ae23fad12924fec92ee41d69a6e7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49c75feee78ae23fad12924fec92ee41d69a6e7e/analytic_balance.py
self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'), 'probability' : 100.0})
def case_close(self, cr, uid, ids, *args): """Closes Case @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 case Ids @param *args: Tuple Value for additional Params """ cases = self.browse(cr, uid, ids) cases[...
ff924e342cb3863293c0549afb489bf310088438 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff924e342cb3863293c0549afb489bf310088438/crm.py
self.write(cr, uid, ids, {'state': 'cancel', 'active': True})
self.write(cr, uid, ids, {'state': 'cancel', 'active': True, 'probability' : 0.0})
def case_cancel(self, cr, uid, ids, *args): """Cancels Case @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 case Ids @param *args: Tuple Value for additional Params """ cases = self.browse(cr, uid, ids) case...
ff924e342cb3863293c0549afb489bf310088438 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff924e342cb3863293c0549afb489bf310088438/crm.py
'email_to': fields.char('Email TO', size=84),
'email_to': fields.char('Email To', size=84),
def _note_get(self, cursor, user, ids, name, arg, context=None): """ Gives case History Description @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 case History’s IDs @param context: A standard dictionary fo...
ff924e342cb3863293c0549afb489bf310088438 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff924e342cb3863293c0549afb489bf310088438/crm.py
ftp.login(user.get('login',''), user.get('password',''))
ftp.login(user.get('login',''), user.get('login',''))
def get_ftp_login(cr, uid, ormobj): ftp = get_plain_ftp() user = ormobj.pool.get('res.users').read(cr, uid, uid) ftp.login(user.get('login',''), user.get('password','')) ftp.cwd("/" + cr.dbname) return ftp
d98ffbe1b8b254473743421263e13847028f9378 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d98ffbe1b8b254473743421263e13847028f9378/test_easyftp.py
def ffp(data, ndata): if len(data)+ len(ndata) > limit: raise IndexError('Data over the limit') data.append(ndata)
d98ffbe1b8b254473743421263e13847028f9378 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d98ffbe1b8b254473743421263e13847028f9378/test_easyftp.py
ids = self.pool.get('res.groups').search(cr, uid, [('name','=','Employee')], context=context) return ids or False
dataobj = self.pool.get('ir.model.data') data_id = dataobj._get_id(cr, 1, 'base', 'group_user') return data_id and [data_id] or False
def _get_group(self,cr, uid, context=None): ids = self.pool.get('res.groups').search(cr, uid, [('name','=','Employee')], context=context) return ids or False
3c1c74df2cf513a27ac56ae132785330c6dcc498 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3c1c74df2cf513a27ac56ae132785330c6dcc498/res_user.py
'planned_hours': backlog.planned_hours,
'planned_hours': backlog.expected_hours,
def do_create(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') task = self.pool.get('project.task') backlog_id = self.pool.get('scrum.product.backlog') ids_task = []
c132caa77ec4558d9bcb8762672c2bd386ab2a78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c132caa77ec4558d9bcb8762672c2bd386ab2a78/scrum_backlog_create_task.py
def do_create(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') task = self.pool.get('project.task') backlog_id = self.pool.get('scrum.product.backlog') ids_task = []
c132caa77ec4558d9bcb8762672c2bd386ab2a78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c132caa77ec4558d9bcb8762672c2bd386ab2a78/scrum_backlog_create_task.py
from reportlab.pdfbase import pdfmetrics
def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
3e3270264fb49739144e4fefd6a55182ea9900cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e3270264fb49739144e4fefd6a55182ea9900cc/trml2pdf.py
if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname
def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
3e3270264fb49739144e4fefd6a55182ea9900cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e3270264fb49739144e4fefd6a55182ea9900cc/trml2pdf.py
_order = "date desc"
_order = "date desc ,id desc"
def _currency(self, cursor, user, ids, name, args, context=None): res = {} res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') default_currency = res_users_obj.browse(cursor, user, user, context=context).company_id.currency_id for statement in self.browse(cursor, user, ids, conte...
fd4c44f3f48607c9b323b92b54eac86d70b48523 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd4c44f3f48607c9b323b92b54eac86d70b48523/account_bank_statement.py
fnode = nodes.node_file(None, None, nctx, fbro)
if not fbro.parent_id: cr.execute("select db_datas from ir_attachment where id = %s" ,(fbro.id,)) res = cr.fetchone() datas = res[0] or '' size = len(datas) else: fnode = nodes.node_file(None, None, nctx, fbro) datas = fnode.get_data(cr, fbro) datas = base64.encodestring(datas or '') size = fnode.get_data_len(cr, fbro)...
def _data_get(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} fbrl = self.browse(cr, uid, ids, context=context) nctx = nodes.get_node_context(cr, uid, context={}) # nctx will /not/ inherit the caller's context. Most of # it would be useless, anyway (like active_id, active_model, # bin_siz...
ebd5c62dbc6ffa689ea36b85951c4202e1317dac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ebd5c62dbc6ffa689ea36b85951c4202e1317dac/document.py
data = fnode.get_data(cr, fbro) result[fbro.id] = base64.encodestring(data or '') else: result[fbro.id] = fnode.get_data_len(cr, fbro)
result[fbro.id] = datas else: result[fbro.id] = size
def _data_get(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} fbrl = self.browse(cr, uid, ids, context=context) nctx = nodes.get_node_context(cr, uid, context={}) # nctx will /not/ inherit the caller's context. Most of # it would be useless, anyway (like active_id, active_model, # bin_siz...
ebd5c62dbc6ffa689ea36b85951c4202e1317dac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ebd5c62dbc6ffa689ea36b85951c4202e1317dac/document.py
work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, date_end, hours or 0.0, resource_id or False)
work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, date_end, hours or 0.0, resource_id and resource_id[0] or False)
def _check_date_start(self, cr, uid, task, date_end, context={}): """ Check And Compute date_end of task if change in date_start < older time. """ resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') calendar_id = task.project_id.resource_calendar_id and task.proj...
38d6ac1db2682a5f241e50820292261cd58f1030 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/38d6ac1db2682a5f241e50820292261cd58f1030/project_long_term.py
work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, date_start, hours or 0.0, resource.id or False)
work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, date_start, hours or 0.0, resource_id and resource_id[0] or False)
def _check_date_end(self, cr, uid, task, date_start, context={}): """ Check And Compute date_end of task if change in date_end > older time. """ resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') calendar_id = task.project_id.resource_calendar_id and task.projec...
38d6ac1db2682a5f241e50820292261cd58f1030 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/38d6ac1db2682a5f241e50820292261cd58f1030/project_long_term.py
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
return {'value': {'price_unit': 0.0, 'name': '', 'product_qty': 1.0, 'date_planned': False, 'notes': '', 'product_uom' : False}, 'domain':{'product_uom':[]}}
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False): if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\...
b3f09a0263d96f8e580d4da79ef7d917c1cb63da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b3f09a0263d96f8e580d4da79ef7d917c1cb63da/purchase.py
'product_qty': qty,
'product_qty': qty or 1.0,
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False): if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\...
b3f09a0263d96f8e580d4da79ef7d917c1cb63da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b3f09a0263d96f8e580d4da79ef7d917c1cb63da/purchase.py
if isinstance(expression, Eval):
if is_eval(expression):
def process_ir_set(self, node): if not self.mode == 'init': return False _, fields = node.items()[0] res = {} for fieldname, expression in fields.items(): if isinstance(expression, Eval): value = eval(expression.expression, self.eval_context) else: value = expression res[fieldname] = value self.pool.get('ir.model.data'...
64ffd5e8b7a701876fdea722d0ecd033d9d6e87e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64ffd5e8b7a701876fdea722d0ecd033d9d6e87e/yaml_import.py
move_id = move_obj.create(cr, uid, {'journal_id': data.property_stock_journal.id})
move_id = move_obj.create(cr, uid, {'journal_id': data.categ_id.property_stock_journal.id})
def change_price(self, cr, uid, ids, context): """ @summary: Changes the Standard Price of Product. And creates an account move accordingly. @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 dictionar...
49e9a1ee0de150645be482613c6401daae6f79d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/49e9a1ee0de150645be482613c6401daae6f79d1/stock_change_standard_price.py
os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --no-xmlrpcs --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
def start_server(root_path, port, netport, addons_path): os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
72b861187e32f2799673f218ef7ca0879bb52c7f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/72b861187e32f2799673f218ef7ca0879bb52c7f/base_quality_interrogation.py
'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Version'),
def _get_data(self, cr, uid, ids, field_names, arg, context=None): if context is None: context = {} """ @param cr: the current row, from the database cursor, @param uid: the current users ID for security checks, @param ids: List of case and section Datas IDs @param context: A standard dictionary for contextual values "...
e3c4cb38d8aadc9424cc493b61f386607a0200d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e3c4cb38d8aadc9424cc493b61f386607a0200d4/project_issue_report.py
data[fpos] = r
data[fpos] = r 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
80b21b75d964ab3e90c286102ad9adaea547e4e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/80b21b75d964ab3e90c286102ad9adaea547e4e2/orm.py
if hasattr(value, '__unicode__'):
try:
def ustr(value): """This method is similar to the builtin `str` method, except it will return Unicode string. @param value: the value to convert @rtype: unicode @return: unicode string """ if isinstance(value, unicode): return value if hasattr(value, '__unicode__'): return unicode(value) if not isinstance(value, s...
8f81995ec84899292709608945287d8a3faf1b6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8f81995ec84899292709608945287d8a3faf1b6d/misc.py
if not isinstance(value, str): value = str(value) try: return unicode(value, 'utf-8')
def ustr(value): """This method is similar to the builtin `str` method, except it will return Unicode string. @param value: the value to convert @rtype: unicode @return: unicode string """ if isinstance(value, unicode): return value if hasattr(value, '__unicode__'): return unicode(value) if not isinstance(value, s...
8f81995ec84899292709608945287d8a3faf1b6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8f81995ec84899292709608945287d8a3faf1b6d/misc.py
try: return unicode(value, 'iso-8859-15') except: pass from locale import getlocale return unicode(value, getlocale()[1])
for ln in get_encodings(): try: return unicode(value, ln) except: pass raise UnicodeError('unable de to convert %r' % (orig,))
def ustr(value): """This method is similar to the builtin `str` method, except it will return Unicode string. @param value: the value to convert @rtype: unicode @return: unicode string """ if isinstance(value, unicode): return value if hasattr(value, '__unicode__'): return unicode(value) if not isinstance(value, s...
8f81995ec84899292709608945287d8a3faf1b6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8f81995ec84899292709608945287d8a3faf1b6d/misc.py
cr.execute("select id from account_journal where name= '%s' and special_journal='t'"%(r[0]))
cr.execute("select id from account_journal where name= '%s' and special_journal='t'"%(r))
def _get_v( self, cr, uid, ids,*a): """ Changed the Validation state of order @return: State """
b8a25493df438ddb7ffac532d2c29d50e5a4d181 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b8a25493df438ddb7ffac532d2c29d50e5a4d181/pos.py
cr.execute('select distinct product_id, location_id from stock_move where location_id in %s or location_dest_id in %s', (tuple(ids), tuple(ids))) res_products_by_location = sorted(cr.dictfetchall(), key=itemgetter('location_id'))
cr.execute('select distinct product_id, location_id from stock_move where location_id in %s', (tuple(ids), )) dict1 = cr.dictfetchall() cr.execute('select distinct product_id, location_dest_id as location_id from stock_move where location_dest_id in %s', (tuple(ids), )) dict2 = cr.dictfetchall() res_products_by_locatio...
def _product_value(self, cr, uid, ids, field_names, arg, context=None): """Computes stock value (real and virtual) for a product, as well as stock qty (real and virtual). @param field_names: Name of field @return: Dictionary of values """ prod_id = context and context.get('product_id', False)
b1f8aa98da905cef5bbb9c3ccc63cede1165e1a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b1f8aa98da905cef5bbb9c3ccc63cede1165e1a7/stock.py
if mline.date_from <= today and mline.date_to >= today:
if mline.date_to >= today:
def _membership_state(self, cr, uid, ids, name, args, context=None): res = {} for id in ids: res[id] = 'none' today = time.strftime('%Y-%m-%d') for id in ids: partner_data = self.browse(cr,uid,id) if partner_data.membership_cancel and today > partner_data.membership_cancel: res[id] = 'canceled' continue if partner_data...
caf2746c0485623a44b55ec2cdd09732c813fa9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/caf2746c0485623a44b55ec2cdd09732c813fa9c/membership.py
state = obj_inv.browse(cr, uid, context['active_id']).state if obj_inv.browse(cr, uid, context['active_id']).state != 'draft': raise osv.except_osv(_('Error'), _('You can only change currency for Draft Invoice !')) pass
if context.get('active_id',False): state = obj_inv.browse(cr, uid, context['active_id']).state if obj_inv.browse(cr, uid, context['active_id']).state != 'draft': raise osv.except_osv(_('Error'), _('You can only change currency for Draft Invoice !')) pass
def view_init(self, cr , uid , fields_list, context=None): obj_inv = self.pool.get('account.invoice') if context is None: context = {} state = obj_inv.browse(cr, uid, context['active_id']).state if obj_inv.browse(cr, uid, context['active_id']).state != 'draft': raise osv.except_osv(_('Error'), _('You can only change cu...
f96ee5cded18e23b805880a89dd07a36c45e0579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f96ee5cded18e23b805880a89dd07a36c45e0579/account_change_currency.py
if self.path not in self.redirect_paths:
redir_path = self._find_redirect() if redir_path is False:
def send_head(self): """Common code for GET and HEAD commands.
0b77e833d5d6dc6788a6781778ac7d852091e078 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0b77e833d5d6dc6788a6781778ac7d852091e078/redirect.py
location = baseuri + self.redirect_paths[self.path]
location = baseuri + redir_path
def send_head(self): """Common code for GET and HEAD commands.
0b77e833d5d6dc6788a6781778ac7d852091e078 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0b77e833d5d6dc6788a6781778ac7d852091e078/redirect.py
self._logger.debug("redirecting %s to %s", self.path, self.redirect_paths[self.path])
self._logger.debug("redirecting %s to %s", self.path, redir_path)
def send_head(self): """Common code for GET and HEAD commands.
0b77e833d5d6dc6788a6781778ac7d852091e078 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0b77e833d5d6dc6788a6781778ac7d852091e078/redirect.py
currency = self.pool.get('res.currency').browse(cr, uid, currency_id) currency_obj.round(cr, uid, currency, 300)
currency = currency_obj.browse(cr, uid, currency_id)
def _product_value(self, cr, uid, ids, field_names, arg, context=None): """Computes stock value (real and virtual) for a product, as well as stock qty (real and virtual). @param field_names: Name of field @return: Dictionary of values """ prod_id = context and context.get('product_id', False)
d34cff12465f0e29d8c018c32f44a08e357cc5d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34cff12465f0e29d8c018c32f44a08e357cc5d4/stock.py
def product_detail(self, cr, uid, id, field, context={}): res = {} res[id] = {} final_value = 0.0 field_to_read = 'virtual_available' if field == 'stock_real_value': field_to_read = 'qty_available' cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)', (id, id)) result ...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def product_detail(self, cr, uid, id, field, context={}): res = {} res[id] = {} final_value = 0.0 field_to_read = 'virtual_available' if field == 'stock_real_value': field_to_read = 'qty_available' cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)', (id, id)) result ...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
amount_unit=product.price_get(pricetype.field, context)[product.id]
amount_unit=product.price_get(pricetype.field, context)[product.id]
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def get_currency_id(self, cursor, user, picking):
def get_currency_id(self, cr, uid, picking):
def get_currency_id(self, cursor, user, picking): return False
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_payment_term(self, cursor, user, picking):
def _get_payment_term(self, cr, uid, picking):
def _get_payment_term(self, cursor, user, picking): '''Return {'contact': address, 'invoice': address} for invoice''' partner_obj = self.pool.get('res.partner') partner = picking.address_id.partner_id return partner.property_payment_term and partner.property_payment_term.id or False
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_address_invoice(self, cursor, user, picking):
def _get_address_invoice(self, cr, uid, picking):
def _get_address_invoice(self, cursor, user, picking): '''Return {'contact': address, 'invoice': address} for invoice''' partner_obj = self.pool.get('res.partner') partner = picking.address_id.partner_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
return partner_obj.address_get(cursor, user, [partner.id],
return partner_obj.address_get(cr, uid, [partner.id],
def _get_address_invoice(self, cursor, user, picking): '''Return {'contact': address, 'invoice': address} for invoice''' partner_obj = self.pool.get('res.partner') partner = picking.address_id.partner_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_comment_invoice(self, cursor, user, picking):
def _get_comment_invoice(self, cr, uid, picking):
def _get_comment_invoice(self, cursor, user, picking): '''Return comment string for invoice''' return picking.note or ''
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_price_unit_invoice(self, cursor, user, move_line, type):
def _get_price_unit_invoice(self, cr, uid, move_line, type, context=None):
def _get_price_unit_invoice(self, cursor, user, move_line, type): '''Return the price unit for the move line''' if type in ('in_invoice', 'in_refund'): # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.ge...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.get('product.price.type').browse(cr,uid,price_type_id) context['currency_id']=move_line.company_id.currency_id.id amount_unit=move_line.product_id.price_get(pricetype.field, context)[move_lin...
price_type_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.property_valuation_price_type.id pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id) context['currency_id'] = move_line.company_id.currency_id.id amount_unit = move_line.product_id.price_get(pricetype.field, context)[...
def _get_price_unit_invoice(self, cursor, user, move_line, type): '''Return the price unit for the move line''' if type in ('in_invoice', 'in_refund'): # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.ge...
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py