rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
qu1 = qu1 + dom[0] qu2 = qu2 + dom[1]
where_clause = where_clause + dom[0] where_params = where_params + dom[1]
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
dad082f9991b97ad75f54e84689c074e2a578247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad082f9991b97ad75f54e84689c074e2a578247/orm.py
if len(qu1): qu1 = ' where '+string.join(qu1, ' and ')
tables, where_clause = self._inherits_join_calc(groupby,tables,where_clause) if len(where_clause): where_clause = ' where '+string.join(where_clause, ' and ')
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
dad082f9991b97ad75f54e84689c074e2a578247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad082f9991b97ad75f54e84689c074e2a578247/orm.py
qu1 = ''
where_clause = ''
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
dad082f9991b97ad75f54e84689c074e2a578247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad082f9991b97ad75f54e84689c074e2a578247/orm.py
cr.execute('select min(id) as id,'+flist+' from ' + self._table +qu1+' group by '+ groupby + limit_str + offset_str,qu2)
cr.execute('select min(%s.id) as id,' % self._table + flist + ' from ' + ','.join(tables) + where_clause + ' group by '+ groupby + limit_str + offset_str, where_params)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
dad082f9991b97ad75f54e84689c074e2a578247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad082f9991b97ad75f54e84689c074e2a578247/orm.py
def _get_type(self, cr, uid, ids, context=None): if context is None: context = {}
def _get_type(self, cr, uid, context=None): if context is None: context = {}
def _get_type(self, cr, uid, ids, context=None): if context is None: context = {} return context.get('type', False)
4a08aee8d84b3051643aef1cd9d3ea9e38e8cfda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4a08aee8d84b3051643aef1cd9d3ea9e38e8cfda/account_voucher.py
act_ids = [ act_id.id for act_id in campaign.activity_ids] act_ids = self.pool.get('marketing.campaign.activity').search(cr, uid, [('id', 'in', act_ids), ('start', '=', True)])
actvity_ids = [ act_id.id for act_id in campaign.activity_ids] act_obj = self.pool.get('marketing.campaign.activity') act_ids = act_obj.search(cr, uid, [('id', 'in', actvity_ids), ('start', '=', True)])
def state_running_set(self, cr, uid, ids, *args): campaign = self.browse(cr, uid, ids[0]) if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") act_ids = [ act_id.id for act_id in campaign.activity_ids] act_ids = self.pool.get('marketing.campaign.activity').search(cr, u...
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
'server_action' : self.process_wi_action,
'action' : self.process_wi_action,
def __init__(self, *args): self._actions = {'paper' : self.process_wi_report, 'email' : self.process_wi_email, 'server_action' : self.process_wi_action, } return super(marketing_campaign_activity, self).__init__(*args)
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
return self.pool.get('email.template').generate_mail(cr, uid, activity.email_template_id.id, [workitem.res_id], context=context)
return self.pool.get('email.template').generate_mail(cr, uid, activity.email_template_id.id, [workitem.res_id], context=context)
def process_wi_email(self, cr, uid, activity, workitem, context=None): return self.pool.get('email.template').generate_mail(cr, uid, activity.email_template_id.id, [workitem.res_id], context=context)
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
server_obj.run(cr, uid, [activity.server_action_id.id], context) return True
context['active_id'] = workitem.res_id return server_obj.run(cr, uid, [activity.server_action_id.id], context)
def process_wi_action(self, cr, uid, activity, workitem, context={}): context = {} server_obj = self.pool.get('ir.actions.server') server_obj.run(cr, uid, [activity.server_action_id.id], context) return True
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
'res_id': fields.integer('Resource ID', select=1),
'res_id': fields.integer('Resource ID', select=1, readonly=1),
def _res_name_get(self, cr, uid, ids, field_name, arg, context=None): res = {} for obj in self.browse(cr, uid, ids, context=context): if obj.res_id: try: res[obj.id] = self.pool.get(obj.object_id.model).name_get(cr, uid, [obj.res_id], context=context)[0][1] except: res[obj.id] = '/' else: res[obj.id] = '/' return res
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
vals['error_msg'] = result['error_msg']
vals['error_msg'] = result['error_msg']
def process(self, cr, uid, workitem_ids, context={}): for wi in self.browse(cr, uid, workitem_ids): if wi.state == 'todo': eval_context = { 'pool': self.pool, 'cr': cr, 'uid': uid, 'wi': wi, 'object': wi.activity_id, 'transition': wi.activity_id.to_ids } try: expr = eval(str(wi.activity_id.condition), eval_context) if ...
fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0030c8f5a3e1c3f2b5ccc0a600111746ef3da7/marketing_campaign.py
def unlink(self, cr, uid, ids, context=None): group_users = [] for record in self.read(cr, uid, ids, ['users'], context=context): if record['users']: group_users.extend(record['users']) if group_users: group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): gr...
c34d2ae6d4cdc3f4995751c5254257b7277940b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c34d2ae6d4cdc3f4995751c5254257b7277940b5/res_user.py
group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): group_names.append(rec['name']) if len(group_names) >=5: group_names = group_names[:5] group_names += '...' except Exception: raise osv.except_osv(_('Warning !'), _('Make sure you have no users linked with...
user_names = [user.name for user in self.pool.get('res.users').browse(cr, uid, group_users, context=context)] if len(user_names) >= 5: user_names = user_names[:5] user_names += '...'
def unlink(self, cr, uid, ids, context=None): group_users = [] for record in self.read(cr, uid, ids, ['users'], context=context): if record['users']: group_users.extend(record['users']) if group_users: group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): gr...
c34d2ae6d4cdc3f4995751c5254257b7277940b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c34d2ae6d4cdc3f4995751c5254257b7277940b5/res_user.py
_('Group(s) cannot be deleted, because user(s) %s participate in them!') % \ ', '.join(group_names))
_('Group(s) cannot be deleted, because some user(s) still belong to them: %s !') % \ ', '.join(user_names))
def unlink(self, cr, uid, ids, context=None): group_users = [] for record in self.read(cr, uid, ids, ['users'], context=context): if record['users']: group_users.extend(record['users']) if group_users: group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): gr...
c34d2ae6d4cdc3f4995751c5254257b7277940b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c34d2ae6d4cdc3f4995751c5254257b7277940b5/res_user.py
if account_id and (not line or (line and not line[0].amount)):
if account_id and (not line or (line and not line[0].amount)) and not context.get('amount', False):
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...
b46bbb5e6565624c1bd3ca797ac4b3b225272e2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b46bbb5e6565624c1bd3ca797ac4b3b225272e2d/account_bank_statement.py
trans_data=[]
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
if data[f] != False:
if data[f]: data[f].sort()
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
d,t = rel.copy_data(cr, uid, rel_id, context=context)
d = rel.copy_data(cr, uid, rel_id, context=context)
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
trans_data += t
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
trans_obj = self.pool.get('ir.translation') for f in fields: trans_name = '' if f in self._columns and self._columns[f].translate: trans_name = self._name+","+f elif f in self._inherit_fields and self._inherit_fields[f][2].translate: trans_name = self._inherit_fields[f][0] + "," + f if trans_name: trans_ids = trans_o...
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
return data, trans_data
return data def copy_translations(self, cr, uid, old_id, new_id, context=None): trans_obj = self.pool.get('ir.translation') fields = self.fields_get(cr, uid, context=context) translation_records = [] for field_name, field_def in fields.items(): if field_def['type'] in ('one2one', 'one2many'): target_obj = self.pool....
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
trans_obj = self.pool.get('ir.translation') data, trans_data = self.copy_data(cr, uid, id, default, context)
data = self.copy_data(cr, uid, id, default, context)
def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record with given id updating it with default values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
for record in trans_data: del record['id'] record['res_id'] = new_id trans_obj.create(cr, uid, record, context)
self.copy_translations(cr, uid, id, new_id, context)
def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record with given id updating it with default values
39e866ce70121c8138f7be0079ca7f0ceefb0a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39e866ce70121c8138f7be0079ca7f0ceefb0a42/orm.py
'date': fields.datetime('Date Planned', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
'date': fields.datetime('Date ', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
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...
cec285803f60dbc6936e9033a2466184277695a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cec285803f60dbc6936e9033a2466184277695a0/stock.py
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%d')}
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
def generate(self, cr, uid, ids, datas={}, context={}): move_ids = [] entry = {} account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') pt_obj = self.pool.get('account.payment.term')
d9ab88c8913b437e9e90fc116cf9b4c2821c8707 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d9ab88c8913b437e9e90fc116cf9b4c2821c8707/account.py
raise osv.except_osv(_('Unmet dependency !'), _('Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages)))
raise osv.except_osv(_('Unmet dependency !'), _('Following modules are not installed or unknown: %s') % ('\n\n' + '\n'.join(unmet_packages)))
def upgrade_module(self, cr, uid, ids, context): pool = pooler.get_pool(cr.dbname) mod_obj = self.pool.get('ir.module.module') data_obj = self.pool.get('ir.model.data') ids = mod_obj.search(cr, uid, [('state', 'in', ['to upgrade', 'to remove', 'to install'])]) unmet_packages = [] mod_dep_obj = pool.get('ir.module.modul...
d644417abb6d962287ebc2d9293a901a38dcf238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d644417abb6d962287ebc2d9293a901a38dcf238/base_module_upgrade.py
if not exp.employee_id.address_id: raise osv.except_osv(_('Error !'), _('The employee must have a working address')) acc = exp.employee_id.address_id.partner_id.property_account_payable.id payment_term_id = exp.employee_id.address_id.partner_id.property_payment_term.id
if not exp.employee_id.address_home_id: raise osv.except_osv(_('Error !'), _('The employee must have a Home address')) acc = exp.employee_id.address_home_id.partner_id.property_account_payable.id payment_term_id = exp.employee_id.address_home_id.partner_id.property_payment_term.id
def action_invoice_create(self, cr, uid, ids): res = False invoice_obj = self.pool.get('account.invoice') property_obj = self.pool.get('ir.property') sequence_obj = self.pool.get('ir.sequence') analytic_journal_obj = self.pool.get('account.analytic.journal') account_journal = self.pool.get('account.journal') for exp in...
fd73a9b5a5d3432fa50e4be58a6b653652b20e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd73a9b5a5d3432fa50e4be58a6b653652b20e45/hr_expense.py
'partner_id': exp.employee_id.address_id.partner_id.id, 'address_invoice_id': exp.employee_id.address_id.id, 'address_contact_id': exp.employee_id.address_id.id,
'partner_id': exp.employee_id.address_home_id.partner_id.id, 'address_invoice_id': exp.employee_id.address_home_id.id, 'address_contact_id': exp.employee_id.address_home_id.id,
def action_invoice_create(self, cr, uid, ids): res = False invoice_obj = self.pool.get('account.invoice') property_obj = self.pool.get('ir.property') sequence_obj = self.pool.get('ir.sequence') analytic_journal_obj = self.pool.get('account.analytic.journal') account_journal = self.pool.get('account.journal') for exp in...
fd73a9b5a5d3432fa50e4be58a6b653652b20e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd73a9b5a5d3432fa50e4be58a6b653652b20e45/hr_expense.py
'fiscal_position': exp.employee_id.address_id.partner_id.property_account_position.id
'fiscal_position': exp.employee_id.address_home_id.partner_id.property_account_position.id
def action_invoice_create(self, cr, uid, ids): res = False invoice_obj = self.pool.get('account.invoice') property_obj = self.pool.get('ir.property') sequence_obj = self.pool.get('ir.sequence') analytic_journal_obj = self.pool.get('account.analytic.journal') account_journal = self.pool.get('account.journal') for exp in...
fd73a9b5a5d3432fa50e4be58a6b653652b20e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd73a9b5a5d3432fa50e4be58a6b653652b20e45/hr_expense.py
drop_view_if_exists(cr, 'stock_report_prodlots')
drop_view_if_exists(cr, 'stock_report_tracklots')
def init(self, cr): drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view stock_report_tracklots as ( select max(id) as id, location_id, product_id, tracking_id, sum(qty) as name from ( select -max(sm.id) as id, sm.location_id, sm.product_id, sm.tracking_id, -sum(sm.product_qty /uo.fac...
db3bb656ef71840123bed9b645c9f872d87e5bf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db3bb656ef71840123bed9b645c9f872d87e5bf9/report_stock.py
drop_view_if_exists(cr, 'stock_report_prodlots')
drop_view_if_exists(cr, 'report_stock_lines_date')
def init(self, cr): drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view report_stock_lines_date as ( select p.id as id, p.id as product_id, max(s.date) as date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) left join stock_inventory s on (l.invent...
db3bb656ef71840123bed9b645c9f872d87e5bf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db3bb656ef71840123bed9b645c9f872d87e5bf9/report_stock.py
self.log(cr, uid, id, message)
self.log(cr, uid, case.id, message)
def case_open(self, cr, uid, ids, *args): """Overrides cancel for crm_case for setting Open Date @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's Ids @param *args: Give Tuple Value """ old_state = self...
ab30c4663ccca6e0152c6629461287fd17468f2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab30c4663ccca6e0152c6629461287fd17468f2c/crm_lead.py
self.log(cr, uid, id, message)
self.log(cr, uid, case.id, message)
def case_close(self, cr, uid, ids, *args): """Overrides close for crm_case for setting close date @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 """ ...
ab30c4663ccca6e0152c6629461287fd17468f2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab30c4663ccca6e0152c6629461287fd17468f2c/crm_lead.py
if r['product_id']== move.product_id.id: move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
if r['product_id'] == move.product_id.id: move_lines_obj.write(cr, uid, [move.id], {'product_qty' : r['product_qty']})
def change_prod_qty(self, cr, uid, ids, context): """ Changes the Quantity of 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: """ record_id = context and context.get('act...
a5c59a2f139c5de622cf82ad8bd777c96e5bc4ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a5c59a2f139c5de622cf82ad8bd777c96e5bc4ec/change_production_qty.py
move_lines_obj.write(cr, uid,m.id, {'product_qty': wiz_qty.product_qty})
move_lines_obj.write(cr, uid, [m.id], {'product_qty': wiz_qty.product_qty})
def change_prod_qty(self, cr, uid, ids, context): """ Changes the Quantity of 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: """ record_id = context and context.get('act...
a5c59a2f139c5de622cf82ad8bd777c96e5bc4ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a5c59a2f139c5de622cf82ad8bd777c96e5bc4ec/change_production_qty.py
a = self.pool.get('ir.property').get(cr, uid,
prop = self.pool.get('ir.property').get(cr, uid,
def _get_line_uom(line): if (line.order_id.invoice_quantity=='order') or not line.procurement_id: if line.product_uos: return line.product_uos.id return line.product_uom.id else: return self.pool.get('procurement.order').uom_get(cr, uid, line.procurement_id.id, context=context)
b57746aa19914c9cab1510bab1db9afc87a85897 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b57746aa19914c9cab1510bab1db9afc87a85897/sale.py
context=context).id
context=context) a = prop and prop.id or False
def _get_line_uom(line): if (line.order_id.invoice_quantity=='order') or not line.procurement_id: if line.product_uos: return line.product_uos.id return line.product_uom.id else: return self.pool.get('procurement.order').uom_get(cr, uid, line.procurement_id.id, context=context)
b57746aa19914c9cab1510bab1db9afc87a85897 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b57746aa19914c9cab1510bab1db9afc87a85897/sale.py
if context is None: context = {}
def _check_recursion(self, cr, uid, ids, context=None): if context is None: context = {} level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),)) ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True
4f8144b83ae4e96fb2101df2ca36eb52edb35001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f8144b83ae4e96fb2101df2ca36eb52edb35001/hr.py
cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),))
cr.execute('SELECT DISTINCT parent_id FROM hr_employee WHERE id IN %s AND parent_id!=id',(tuple(ids),))
def _check_recursion(self, cr, uid, ids, context=None): if context is None: context = {} level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),)) ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True
4f8144b83ae4e96fb2101df2ca36eb52edb35001 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f8144b83ae4e96fb2101df2ca36eb52edb35001/hr.py
line_domain = eval(line.domain)
line_domain = eval(line.domain or '[]')
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...
5b6dcd8ffedc2ffd718d82097ca719c968a3df63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6dcd8ffedc2ffd718d82097ca719c968a3df63/calendar.py
domain = eval(line.domain)
domain = eval(line.domain or '[]')
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...
5b6dcd8ffedc2ffd718d82097ca719c968a3df63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6dcd8ffedc2ffd718d82097ca719c968a3df63/calendar.py
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, required=True),
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True),
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...
7186fc2250f252d4bb5a6423535aecca60cad715 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7186fc2250f252d4bb5a6423535aecca60cad715/account_bank_statement.py
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, required=True),
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True),
def _reconcile_amount(self, cursor, user, ids, name, args, context=None): if not ids: return {} res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users')
7186fc2250f252d4bb5a6423535aecca60cad715 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7186fc2250f252d4bb5a6423535aecca60cad715/account_bank_statement.py
return 'length("%s") as "%s"' % (f_qual, f)
return 'length(%s) as "%s"' % (f_qual, f)
def convert_field(f): f_qual = "%s.%s" % (self._table, f) # need fully-qualified references in case len(tables) > 1 if f in ('create_date', 'write_date'): return "date_trunc('second', %s) as %s" % (f_qual, f) if f == self.CONCURRENCY_CHECK_FIELD: if self._log_access: return "COALESCE(%s.write_date, %s.create_date, now(...
51ebb43210b77869c4d9418844c3a342eeccbd25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/51ebb43210b77869c4d9418844c3a342eeccbd25/orm.py
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
to_update[partner_id] = {} to_update[partner_id].update({id: fups[followup_line_id][1],})
def _get_partners_followp(self, cr, uid, ids, context=None): data = {} if context is None: context = {} if ids: data = self.read(cr, uid, ids, [])[0] cr.execute( "SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\ "FROM account_move_line AS l "\ "LEFT JOIN account_account AS a "\ "ON (l.account_id...
acb3fb220550ff2fbdae4528f9c26e36ee6ea238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acb3fb220550ff2fbdae4528f9c26e36ee6ea238/account_followup_print.py
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
to_update[partner_id] = {} to_update[partner_id].update({id: fups[followup_line_id][1],})
def _get_partners_followp(self, cr, uid, ids, context=None): data = {} if context is None: context = {} if ids: data = self.read(cr, uid, ids, [])[0] cr.execute( "SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\ "FROM account_move_line AS l "\ "LEFT JOIN account_account AS a "\ "ON (l.account_id...
acb3fb220550ff2fbdae4528f9c26e36ee6ea238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acb3fb220550ff2fbdae4528f9c26e36ee6ea238/account_followup_print.py
'name': _('Follwoup Summary'),
'name': _('Followup Summary'),
def do_mail(self ,cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') move_obj = self.pool.get('account.move.line') user_obj = self.pool.get('res.users') line_obj = self.pool.get('account_followup.stat')
acb3fb220550ff2fbdae4528f9c26e36ee6ea238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acb3fb220550ff2fbdae4528f9c26e36ee6ea238/account_followup_print.py
res = self._get_partners_followp(cr, uid, ids, context)['to_update'] to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and context['date'] or data['date'] for id in to_update.keys(): if to_update[id]['partner_id'] in data['partner_ids']: cr.execu...
res = self._get_partners_followp(cr, uid, ids, context) self._update_partners(cr, uid, res, context=context)
def do_print(self, cr, uid, ids, context=None): if context is None: context = {} data = self.read(cr, uid, ids, [])[0] res = self._get_partners_followp(cr, uid, ids, context)['to_update'] to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and cont...
acb3fb220550ff2fbdae4528f9c26e36ee6ea238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acb3fb220550ff2fbdae4528f9c26e36ee6ea238/account_followup_print.py
'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, help="The state of th...
'state': fields.selection(STATE_SELECTION, 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the s...
def _invoiced(self, cursor, user, ids, name, arg, context=None): res = {} for purchase in self.browse(cursor, user, ids, context=context): if purchase.invoice_id.reconciled: res[purchase.id] = purchase.invoice_id.reconciled else: res[purchase.id] = False return res
5365e331e8ea64c195928ecb289ad593d40402ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5365e331e8ea64c195928ecb289ad593d40402ef/purchase.py
state_dict = {'wait':'Waiting','confirmed':'Confirmed','approved':'Approved','except_picking': 'Shipping Exception','except_invoice': 'Invoice Exception','done': 'Done'} raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!') %_(eval(s['state'],state_dict)))
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!') % _(dict(purchase_order.STATE_SELECTION).get(s['state'])))
def unlink(self, cr, uid, ids, context=None): purchase_orders = self.read(cr, uid, ids, ['state']) unlink_ids = [] for s in purchase_orders: if s['state'] in ['draft','cancel']: unlink_ids.append(s['id']) else: state_dict = {'wait':'Waiting','confirmed':'Confirmed','approved':'Approved','except_picking': 'Shipping Exce...
5365e331e8ea64c195928ecb289ad593d40402ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5365e331e8ea64c195928ecb289ad593d40402ef/purchase.py
def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']:
def write(self, cr, uid, ids, vals, *args, **kwargs): if isinstance(ids, (int, long)): ids = [ids] if vals.get('date', False):
def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']: data_project = self.browse(cr, uid, ids) for prj in data_project: new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) if prj.date: old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) for task in prj.tasks: if ...
6a3807ad02582f94099dad259dec71efaefa2c49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a3807ad02582f94099dad259dec71efaefa2c49/project_retro_planning.py
self.pool.get('project.task').write(cr, uid, task.id, {'date_start':start_dt, 'date_deadline':deadline_dt})
self.pool.get('project.task').write(cr, uid, [task.id], {'date_start':start_dt, 'date_deadline':deadline_dt})
def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']: data_project = self.browse(cr, uid, ids) for prj in data_project: new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) if prj.date: old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) for task in prj.tasks: if ...
6a3807ad02582f94099dad259dec71efaefa2c49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a3807ad02582f94099dad259dec71efaefa2c49/project_retro_planning.py
self.pool.get('project.task').write(cr, uid, task.id, {'date_start':start_dt})
self.pool.get('project.task').write(cr, uid, [task.id], {'date_start':start_dt})
def write(self, cr, uid, ids,vals, *args, **kwargs): if 'date' in vals and vals['date']: data_project = self.browse(cr, uid, ids) for prj in data_project: new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) if prj.date: old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) for task in prj.tasks: if ...
6a3807ad02582f94099dad259dec71efaefa2c49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a3807ad02582f94099dad259dec71efaefa2c49/project_retro_planning.py
return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
try: return self.canvas.setFont(fname, utils.unit_get(node.get('size'))) except KeyError, e: raise KeyError('Font "%s" is not registered in the engine' % fname)
def setFont(self, node): fname = node.get('name') return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
652be11b5795a03d95e8a60730161200c3cc6f65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/652be11b5795a03d95e8a60730161200c3cc6f65/trml2pdf.py
fore.send_error(501, "Unsupported method (%r)" % fore.command)
self.send_error(501, "Unsupported method (%r)" % fore.command)
def _handle_one_foreign(self,fore, path, auth_provider): """ This method overrides the handle_one_request for *children* handlers. It is required, since the first line should not be read again..
60d11da63e68aa1e84a2c74eb454dfb4cfa48b6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60d11da63e68aa1e84a2c74eb454dfb4cfa48b6e/websrv_lib.py
ref_obj_ids = model_obj.search(cr, uid, [], 0, 20, 'id desc', context=context)
ref_obj_ids = model_obj.search(cr, uid, [], 0, 20, 'id', context=context)
def _get_model_recs(self, cr, uid, context=None): if context is None: context = {} #Fills up the selection box which allows records from the selected object to be displayed self.context = context if 'template_id' in context: ref_obj_id = self.pool.get('email.template').read(cr, uid, context['template_id'], ['object_nam...
c197227fff84539cedf63e4b903045ec4ea16ba9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c197227fff84539cedf63e4b903045ec4ea16ba9/email_template.py
""" Calculates Sub total"
""" Calculates Sub total
def _sub_total(self, cr, uid, ids, name, arg, context=None): """ Calculates Sub total" @param name: Names of fields. @param arg: User defined arguments @return: Dictionary of values. """ res = {} for obj in self.browse(cr, uid, ids): res[obj.id] = obj.pieces * obj.number return res
aca407a77fa4c3b4fc024f9f585013b0b8ab565b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aca407a77fa4c3b4fc024f9f585013b0b8ab565b/account_cash_statement.py
'account_id': a.id,
'account_id': a,
def inv_line_create(self, cr, uid, a, ol): return (0, False, { 'name': ol.name, 'account_id': a.id, 'price_unit': ol.price_unit or 0.0, 'quantity': ol.product_qty, 'product_id': ol.product_id.id or False, 'uos_id': ol.product_uom.id or False, 'invoice_line_tax_id': [(6, 0, [x.id for x in ol.taxes_id])], 'account_analyt...
5b6f1af9e716aa5ab8619c915c60cdacd6110fb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6f1af9e716aa5ab8619c915c60cdacd6110fb1/purchase.py
a = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
a = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category').id
def action_invoice_create(self, cr, uid, ids, *args): res = False
5b6f1af9e716aa5ab8619c915c60cdacd6110fb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b6f1af9e716aa5ab8619c915c60cdacd6110fb1/purchase.py
if not inv.line_ids: raise osv.except_osv(_('No Lines !'), _('Please create some lines'))
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
credit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
credit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount)
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
debit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
debit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount)
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
sign = debit - credit < 0 and -1 or 1
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
'currency_id': inv.currency_id.id, 'amount_currency': inv.amount,
'currency_id': company_currency <> current_currency and current_currency or False, 'amount_currency': company_currency <> current_currency and sign * inv.amount or 0.0,
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
amount = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, line.amount)
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount)
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
'currency_id': inv.currency_id.id, 'amount_currency': line.amount,
'currency_id': company_currency <> current_currency and current_currency or False,
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
if (not account_id) and 'account_id' in fields_list: raise osv.except_osv(_('Invalid Error !'), _('Please change partner and try again !'))
def default_get(self, cr, user, fields_list, context=None): """ Returns default values for fields @param fields_list: list of fields, for which default values are required to be read @param context: context arguments, like lang, time zone
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
def unlink(self, cr, uid, ids, context=None): voucher_obj = self.pool.get('account.voucher') statement_line = self.browse(cr, uid, ids, context) unlink_ids = [] for st_line in statement_line: if st_line.voucher_id: unlink_ids.append(st_line.voucher_id.id) voucher_obj.unlink(cr, uid, unlink_ids, context=context) return ...
25887e10a764e0d56ee8855d2460d52cfdac9b32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25887e10a764e0d56ee8855d2460d52cfdac9b32/account_voucher.py
def default_get(self, cr, uid, fields, context): """ To get default values for the object. @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 which we want default values @param context: A standard dictionary @return: A dictiona...
d7ed28f534b42c198e2595b1cde400d83d23596a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d7ed28f534b42c198e2595b1cde400d83d23596a/pos_payment.py
if journal: journal = journal[0] else: journal = None
journal = journal and journal[0] or False
def default_get(self, cr, uid, fields, context): """ To get default values for the object. @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 which we want default values @param context: A standard dictionary @return: A dictiona...
d7ed28f534b42c198e2595b1cde400d83d23596a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d7ed28f534b42c198e2595b1cde400d83d23596a/pos_payment.py
for user_id in datas.get('user_ids', []):
if not datas.get('user_ids'): raise osv.except_osv(_('Error!'), ("Please select any User")) for user_id in datas.get('user_ids'):
def do_invite(self, cr, uid, ids, context={}): datas = self.read(cr, uid, ids)[0] model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context...
e5f3ead146ae9fd9acbfacb79d41010b3ab19718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5f3ead146ae9fd9acbfacb79d41010b3ab19718/base_calendar.py
att_id = att_obj.create(cr, uid, vals) if model_field: obj.write(cr, uid, res_obj.id, {model_field: [(4, att_id)]})
def do_invite(self, cr, uid, ids, context={}): datas = self.read(cr, uid, ids)[0] model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context...
e5f3ead146ae9fd9acbfacb79d41010b3ab19718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5f3ead146ae9fd9acbfacb79d41010b3ab19718/base_calendar.py
att_id = att_obj.create(cr, uid, vals) if model_field: obj.write(cr, uid, res_obj.id, {model_field: [(4, att_id)]})
def do_invite(self, cr, uid, ids, context={}): datas = self.read(cr, uid, ids)[0] model = False model_field = False if not context or not context.get('model'): return {} else: model = context.get('model') model_field = context.get('attendee_field', False) obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context...
e5f3ead146ae9fd9acbfacb79d41010b3ab19718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5f3ead146ae9fd9acbfacb79d41010b3ab19718/base_calendar.py
todata.append('MAILTO:' + parent.email)
if parent.email: todata.append('MAILTO:' + parent.email)
def _compute_data(self, cr, uid, ids, name, arg, context): name = name[0] result = {}
e5f3ead146ae9fd9acbfacb79d41010b3ab19718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5f3ead146ae9fd9acbfacb79d41010b3ab19718/base_calendar.py
fromdata.append('MAILTO:' + child.email)
if child.email: fromdata.append('MAILTO:' + child.email)
def _compute_data(self, cr, uid, ids, name, arg, context): name = name[0] result = {}
e5f3ead146ae9fd9acbfacb79d41010b3ab19718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5f3ead146ae9fd9acbfacb79d41010b3ab19718/base_calendar.py
if view_type == 'search': journal_list = journal_pool.name_search(cr, uid, '', [], context=context) result['fields']['journal_id']['selection'] = journal_list
if view_type == 'search' and result['fields'].get('journal_id', False): result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): journal_pool = self.pool.get('account.journal')
7e61b3f7c5a53eb0237ff45d23ea9f8b9ae729ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7e61b3f7c5a53eb0237ff45d23ea9f8b9ae729ae/account_move_line.py
(_check_uos, 'Error: UOS must be in a different category than the UOM', ['uos_id']),
def _check_uos(self, cursor, user, ids): for product in self.browse(cursor, user, ids): if product.uos_id \ and product.uos_id.category_id.id \ == product.uom_id.category_id.id: return False return True
203545eac4157f27eea02018bbe6ff08d5753957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/203545eac4157f27eea02018bbe6ff08d5753957/product.py
'logo':_get_logo
def _get_header(self,cr,uid,ids): try : return tools.file_open(os.path.join('base', 'report', 'corporate_rml_header.rml')).read() except: return """
ce4c5bdfc8dbd10996a8cbbdd3f19501a46b222d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ce4c5bdfc8dbd10996a8cbbdd3f19501a46b222d/res_company.py
result[id][name] = obj['date']
result[id][name] = obj.get('date')
def get_delegate_data(user): email = user.address_id and user.address_id.email or '' return self._get_address(user.name, email)
83e5509f9c86ddef5921dad105df178c1096393a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83e5509f9c86ddef5921dad105df178c1096393a/caldav.py
result[id][name] = obj['date_deadline']
result[id][name] = obj.get('date_deadline')
def get_delegate_data(user): email = user.address_id and user.address_id.email or '' return self._get_address(user.name, email)
83e5509f9c86ddef5921dad105df178c1096393a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83e5509f9c86ddef5921dad105df178c1096393a/caldav.py
result[id][name] = obj['user_id']
result[id][name] = obj.get('user_id')
def get_delegate_data(user): email = user.address_id and user.address_id.email or '' return self._get_address(user.name, email)
83e5509f9c86ddef5921dad105df178c1096393a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83e5509f9c86ddef5921dad105df178c1096393a/caldav.py
def _get_user_avail(self, cr, uid, ids, context=None): current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') res = {} attendee_obj = self.pool.get('calendar.attendee') attendee_ids = attendee_obj.search(cr, uid, [ ('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime), ('state', '=...
83e5509f9c86ddef5921dad105df178c1096393a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83e5509f9c86ddef5921dad105df178c1096393a/caldav.py
vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context)
vals = None try: vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context) except: raise osv.except_osv(_('Warning !'),_('Invalid format of the ics, file can not be imported'))
def process_imp_ics(self, cr, uid, ids, context=None): """ Process Import ics File. @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 import’s IDs @return: dictionary of calendar evet import window with Import successful msg....
1e8410729726b92f98eaf13161f71bbba1fb72bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1e8410729726b92f98eaf13161f71bbba1fb72bd/calendar_event_import.py
end = datetime.strptime(meeting.date_deadline[:19], "%Y-%m-%d %H:%M:%S") diff = end - start duration = float(diff.days)* 24 + (float(diff.seconds) / 3600) res[meeting.id] = round(duration, 2)
if meeting.date_deadline: end = datetime.strptime(meeting.date_deadline[:19], "%Y-%m-%d %H:%M:%S") diff = end - start duration = float(diff.days)* 24 + (float(diff.seconds) / 3600) res[meeting.id] = round(duration, 2)
def _get_duration(self, cr, uid, ids, name, arg, context): res = {} for meeting in self.browse(cr, uid, ids, context=context): start = datetime.strptime(meeting.date, "%Y-%m-%d %H:%M:%S") end = datetime.strptime(meeting.date_deadline[:19], "%Y-%m-%d %H:%M:%S") diff = end - start duration = float(diff.days)* 24 + (floa...
bee0d0e6b570feef5ddd31e8325f01e99ae820d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bee0d0e6b570feef5ddd31e8325f01e99ae820d0/crm_meeting.py
open = self.pool.get('ir.actions.todo')\
closed = self.pool.get('ir.actions.todo')\
def _progress(self, cr, uid, context=None): total = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [], context) open = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [('state','<>','open')], context) if total: return round(open*100./total) return 100.
24bc556abb9ce2e3515d1787c5b8c135e961b194 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/24bc556abb9ce2e3515d1787c5b8c135e961b194/res_config.py
return round(open*100./total)
return round(closed*100./total)
def _progress(self, cr, uid, context=None): total = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [], context) open = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [('state','<>','open')], context) if total: return round(open*100./total) return 100.
24bc556abb9ce2e3515d1787c5b8c135e961b194 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/24bc556abb9ce2e3515d1787c5b8c135e961b194/res_config.py
fp = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE).stdout try: result = fp.read() finally: fp.close()
pop = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE) (result, _) = pop.communicate()
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): fob...
18a5ade8fd72edcbca951240d4071f2a8fccaa48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18a5ade8fd72edcbca951240d4071f2a8fccaa48/content_index.py
return security.ExceptionNoTb('AccessDenied')
raise security.ExceptionNoTb('AccessDenied')
def check(db, uid, passwd): cached_pass = security._uid_cache.get(db, {}).get(uid) if (cached_pass is not None) and cached_pass == passwd: return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_log...
a5c654f0989ec9a5481a2bd794fc85a06877edb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a5c654f0989ec9a5481a2bd794fc85a06877edb1/crypt.py
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \
res_final = {} child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) for i in child_ids: res[i] = {} for n in [name]: res[i][n] = 0.0 if not child_ids: return res if child_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount), 0.0) \
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
GROUP BY account_analytic_line.account_id", (parent_ids,))
GROUP BY account_analytic_line.account_id", (child_ids,))
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
res[account_id] = round(sum,2) return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context=context)
res[account_id][name] = round(sum,2) data = self._compute_level_tree(cr, uid, ids, child_ids, res, [name], context) for i in data: res_final[i] = data[i][name] return res_final
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \
res_final = {} child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) for i in child_ids: res[i] = {} for n in [name]: res[i][n] = 0.0 if not child_ids: return res if child_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount), 0.0) \
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
GROUP BY account_analytic_line.account_id""",(parent_ids,))
GROUP BY account_analytic_line.account_id""",(child_ids,))
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
res[account_id] = round(sum,2) return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context=context)
res[account_id][name] = round(sum,2) data = self._compute_level_tree(cr, uid, ids, child_ids, res, [name], context) for i in data: res_final[i] = data[i][name] return res_final
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an...
4b09311a7342151ec794c610eafc2ea578fd49b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b09311a7342151ec794c610eafc2ea578fd49b9/account_analytic_analysis.py
return voucher.ref
return voucher.name
def _get_ref(self, voucher_id, move_ids): voucher_line = self.pool.get('account.voucher.line').search(self.cr, self.uid, [('partner_id','=',move_ids.partner_id.id), ('voucher_id','=',voucher_id)]) if voucher_line: voucher = self.pool.get('account.voucher.line').browse(self.cr, self.uid, voucher_line)[0] return voucher....
75a2c7dbf61c051bb2a5c9060ff10de8e1f5adb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75a2c7dbf61c051bb2a5c9060ff10de8e1f5adb1/report_voucher.py
do_create = (mode[1] in ('w','a')) )
do_create = (mode[0] in ('w','a')) )
def get_file(self, cr, uid, id, file_node, mode, context=None): """ Return a file-like object for the contents of some node """ if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly and mode not in ('r', 'rb'): raise I...
4959480bc1518d0c9bf838c8dcd700dd36e40eb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4959480bc1518d0c9bf838c8dcd700dd36e40eb8/document_storage.py
if (not os.path.exists(fpath)) and mode[1] == 'r':
if (not os.path.exists(fpath)) and mode[0] == 'r':
def get_file(self, cr, uid, id, file_node, mode, context=None): """ Return a file-like object for the contents of some node """ if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly and mode not in ('r', 'rb'): raise I...
4959480bc1518d0c9bf838c8dcd700dd36e40eb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4959480bc1518d0c9bf838c8dcd700dd36e40eb8/document_storage.py
elif mode[1] in ('w', 'a') and not ira.store_fname:
elif mode[0] in ('w', 'a') and not ira.store_fname:
def get_file(self, cr, uid, id, file_node, mode, context=None): """ Return a file-like object for the contents of some node """ if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') if boo.readonly and mode not in ('r', 'rb'): raise I...
4959480bc1518d0c9bf838c8dcd700dd36e40eb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4959480bc1518d0c9bf838c8dcd700dd36e40eb8/document_storage.py
raise NotImplementedError("Cannot move in realstore, yet") fname = fil_bo.store_fname
ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context) path, opath = self.__prepare_realpath(cr, file_node, ira, sbro.path, do_create=False) fname = ira.store_fname
def simple_move(self, cr, uid, file_node, ndir_bro, context=None): """ A preparation for a file move. It will not affect the database, but merely check and perhaps move the realstore file. @param ndir_bro a browse object of document.directory, where this file should move to. @return the dict of values that can safely ...
4959480bc1518d0c9bf838c8dcd700dd36e40eb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4959480bc1518d0c9bf838c8dcd700dd36e40eb8/document_storage.py
return ValueError("Tried to rename a non-stored file") path = sbro.path oldpath = os.path.join(path, fname) for ch in ('*', '|', "\\", '/', ':', '"', '<', '>', '?', '..'): if ch in new_name: raise ValueError("Invalid char %s in name %s" %(ch, new_name)) file_node.fix_ppath(cr, ira) npath = file_node.full_path() or []...
self._doclog.warning("Trying to rename a non-stored file") if fname != os.path.join(*opath): self._doclog.warning("inconsistency in realstore: %s != %s" , fname, repr(opath)) oldpath = os.path.join(path, opath[-1]) npath = [sbro.path,] + (ndir_bro.get_full_path() or []) npath = filter(lambda x: x is not None, npath) ...
def simple_move(self, cr, uid, file_node, ndir_bro, context=None): """ A preparation for a file move. It will not affect the database, but merely check and perhaps move the realstore file. @param ndir_bro a browse object of document.directory, where this file should move to. @return the dict of values that can safely ...
4959480bc1518d0c9bf838c8dcd700dd36e40eb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4959480bc1518d0c9bf838c8dcd700dd36e40eb8/document_storage.py