rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
9188a9c47b10cbea19db8c7701d349e1bdbd83ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9188a9c47b10cbea19db8c7701d349e1bdbd83ef/pos.py
params += max_amount
params += (max_amount,)
def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 power = form['power'] allow_w...
c3cbb6649c3539d096dd630a2ee258cb80933b45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c3cbb6649c3539d096dd630a2ee258cb80933b45/account_automatic_reconcile.py
exists, r_id = caldav.uid2openobjectid(cr, val['id'], context.get('model'), \
exists, r_id = calendar.uid2openobjectid(cr, val['id'], context.get('model'), \
def check_import(self, cr, uid, vals, 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 vals: Get Values @param context: A standard dictionary for contextual values """ ids = [] model_obj = self.pool.get(c...
9d4e369c847ce2bd696bdeb9d356e6d2d72f313d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9d4e369c847ce2bd696bdeb9d356e6d2d72f313d/crm_caldav.py
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context={}):
def email_send(self, cr, uid, obj, emails, body, emailfrom=None, context=None):
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context={}): """ send email @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 email: pass the emails @param emailfrom: Pass ...
c2b346743214ee3e9cac1aefeb2b874c6d090634 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c2b346743214ee3e9cac1aefeb2b874c6d090634/base_action_rule.py
self.email_send(cr, uid, obj, emails, action.act_mail_body)
email_from = eval(action.act_email_from, { 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context), 'obj' : obj, }) self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_from)
def do_action(self, cr, uid, action, model_obj, obj, context={}): """ Do Action @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 action: pass action @param model_obj: pass Model object @param context: A standard dictionar...
c2b346743214ee3e9cac1aefeb2b874c6d090634 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c2b346743214ee3e9cac1aefeb2b874c6d090634/base_action_rule.py
attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context)
attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context,limit=None)
def __view_look_dom(self, cr, user, node, view_id, context=None): if not context: context = {} result = False fields = {} childs = True
7d81ac0cde8243d593c270a4497e0c9d1611d35e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7d81ac0cde8243d593c270a4497e0c9d1611d35e/orm.py
res = obj.create(cr, uid, data, context)
obj.create(cr, uid, data, context)
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security ...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
'name':fields.char('Subject', size=128), 'model': fields.char('Object Name', size=128), 'res_id': fields.integer('Resource ID'),
'name':fields.char('Subject', size=128), 'model': fields.char('Object Name', size=128, select=1), 'res_id': fields.integer('Resource ID', select=1),
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security ...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
'date': fields.datetime('Date'),
'date': fields.datetime('Date'),
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security ...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True), 'message': fields.text('Description'), 'email_from': fields.char('Email From', size=84), 'email_to': fields.char('Email To', size=84), 'email_cc': fields.char('Email CC', size=84), 'email_bcc': fields.char('Email BCC', size=84),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True), 'message': fields.text('Description'), 'email_from': fields.char('Email From', size=84), 'email_to': fields.char('Email To', size=84), 'email_cc': fields.char('Email CC', size=84), 'email_bcc': fields.char('Email BCC', size=84),
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security ...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
'description': fields.text('Description'), 'partner_id': fields.many2one('res.partner', 'Partner', required=False), 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
'description': fields.text('Description'), 'partner_id': fields.many2one('res.partner', 'Partner', required=False), 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security ...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
msg_id = msg_pool.create(cr, uid, msg_data, context=context)
msg_pool.create(cr, uid, msg_data, context=context)
def history(self, cr, uid, model, res_ids, msg, attach, context=None): """This function creates history for mails fetched @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 model: OpenObject Model @param res_ids: Ids of the...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
return res_id
return res_id, att_ids
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
counter = 1
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text':
elif part.get_content_maintype() in ('application', 'image', 'text'):
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
new_res_id = create_record(msg)
new_res_id, attachment_ids = create_record(msg)
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
attach = msg.get('attachments', {}).items(),
attach = attachments.items(),
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
self.history(cr, uid, model, res_ids, msg, att_ids, context=context)
self.history(cr, uid, model, res_ids, msg, attachment_ids, context=context)
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
25f3c114cde830404ca9430e1cd75cadc8bfd6fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/25f3c114cde830404ca9430e1cd75cadc8bfd6fd/mail_gateway.py
bom_parent = bom_obj.browse(cr, uid, context['active_id'])
bom_id = context and context.get('active_id', False) or False cr.execute('select id from mrp_bom') if all(bom_id != r[0] for r in cr.fetchall()): ids.sort() bom_id = ids[0] bom_parent = bom_obj.browse(cr, uid, bom_id)
def _child_compute(self, cr, uid, ids, name, arg, context={}): """ Gets child bom. @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param name: Name of the field @param arg: User defined argument @...
ab65a9c67cd6c1fac4415711c2e9229744ac7b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab65a9c67cd6c1fac4415711c2e9229744ac7b30/mrp.py
if bom_parent.multi_level_bom or bom.id == context['active_id']:
if (bom_parent and bom_parent.multi_level_bom) or bom.id == bom_id:
def _child_compute(self, cr, uid, ids, name, arg, context={}): """ Gets child bom. @param self: The object pointer @param cr: The current row, from the database cursor, @param uid: The current user ID for security checks @param ids: List of selected IDs @param name: Name of the field @param arg: User defined argument @...
ab65a9c67cd6c1fac4415711c2e9229744ac7b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab65a9c67cd6c1fac4415711c2e9229744ac7b30/mrp.py
where active")
WHERE active")
def pre_action(self, cr, uid, ids, model, context=None): # Searching for action rules cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \ LEFT JOIN ir_model model on (model.id = rule.model_id) \ where active") res = cr.fetchall() # Check if any rule matching with current object for obj_name, rule_id i...
42ca50081352be6ecc44b3cc746553dbbda5c0a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/42ca50081352be6ecc44b3cc746553dbbda5c0a0/base_action_rule.py
'company_id': fields.many2one('res.company', 'Company', select=True, required=True),
'company_id': fields.many2one('res.company', 'Company', select=True, required=False),
def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context): res = self.name_get(cr, uid, ids, context) return dict(res)
3c2cd6a12a802f1d27c6bedffcd368e0175d424c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3c2cd6a12a802f1d27c6bedffcd368e0175d424c/hr_department.py
avg(100.0 * (l.price_unit*l.product_qty*u.factor) / (t.standard_price*l.product_qty*u.factor))::decimal(16,2) as negociation,
avg(case when t.standard_price <= 0 then (100.0 * (l.price_unit*l.product_qty*u.factor)) else (100.0 * (l.price_unit*l.product_qty*u.factor) / (t.standard_price*l.product_qty*u.factor)) end) as negociation,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'purchase_report') cr.execute(""" create or replace view purchase_report as ( select min(l.id) as id, s.date_order as date, to_char(s.date_order, 'YYYY') as name, to_char(s.date_order, 'MM') as month, to_char(s.date_order, 'YYYY-MM-DD') as day, s.state, s.date_appro...
876bcf590be102c0ac1cd0a0f0048fe20f7fe929 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/876bcf590be102c0ac1cd0a0f0048fe20f7fe929/purchase_report.py
'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases")
'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"), 'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"),
def phase_done(self, cr, uid, ids,*args): self.write(cr, uid, ids, {'state': 'done'}) return True
350baa314cdadc1ba4c88fb972a876dea678c6bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/350baa314cdadc1ba4c88fb972a876dea678c6bc/project.py
if company_currency_id==st_line.account_id.currency_id.id: amount_cur = st_line.amount else: amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, st_line.account_id.currency_id.id, amount, context=context, account=acc_cur) val['amount_currency'] = amount_cur
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, st_line.account_id.currency_id.id, amount, context=context, account=acc_cur) val['amount_currency'] = -amount_cur
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): res_currency_obj = self.pool.get('res.currency') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = self.pool.get('accoun...
3b368f40344361c82c02193ec64ff949cc93656e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b368f40344361c82c02193ec64ff949cc93656e/account_bank_statement.py
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res acc...
3b368f40344361c82c02193ec64ff949cc93656e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b368f40344361c82c02193ec64ff949cc93656e/account_bank_statement.py
data['amount'] = cur_price_unit - reduce(lambda x,y: y.get('amount',0.0)+x, res, 0.0) data['balance'] = cur_price_unit
amount = cur_price_unit - reduce(lambda x,y: y.get('amount',0.0)+x, res, 0.0)
def _unit_compute_inv(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None): taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner)
6ba1955ac1d0e009b238908d0f5be2adf8f44220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ba1955ac1d0e009b238908d0f5be2adf8f44220/account.py
print "RULE: %s" % (rule,) print " %s" % (rule.last_run,)
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): """ This Function is call by scheduler. """ rule_pool = self.pool.get('base.action.rule') rule_ids = rule_pool.search(cr, uid, [], context=context) self._register_hook(cr, uid, rule_ids, context=context)
6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c/base_action_rule.py
print " OBJ: %s" % (obj_id,)
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): """ This Function is call by scheduler. """ rule_pool = self.pool.get('base.action.rule') rule_ids = rule_pool.search(cr, uid, [], context=context) self._register_hook(cr, uid, rule_ids, context=context)
6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c/base_action_rule.py
print " D: %s" % (d,)
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): """ This Function is call by scheduler. """ rule_pool = self.pool.get('base.action.rule') rule_ids = rule_pool.search(cr, uid, [], context=context) self._register_hook(cr, uid, rule_ids, context=context)
6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c/base_action_rule.py
print " RUNNING"
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): """ This Function is call by scheduler. """ rule_pool = self.pool.get('base.action.rule') rule_ids = rule_pool.search(cr, uid, [], context=context) self._register_hook(cr, uid, rule_ids, context=context)
6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6027763a6ac656c9fd5dd6a4377e6c24ecd91e0c/base_action_rule.py
date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
date_formatted = time.strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
def _get_and_change_date_format_for_swiss (self,date_to_format): date_formatted='' print date_to_format if date_to_format: date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') return date_formatted
2777e022aa3487d0d5fb436df80ed7a522eb3554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2777e022aa3487d0d5fb436df80ed7a522eb3554/bvr_report.py
if not partner.ean13: continue if len(partner.ean13) not in [13,14,8]: return False try: int(partner.ean13) except: return False oddsum=0 evensum=0 total=0 eanvalue=partner.ean13 reversevalue = eanvalue[::-1] finalean=reversevalue[1:] for i in range(len(finalean)): if is_pair(i): oddsum += int(finalean[i]) else: evens...
res = check_ean(partner.ean13) return res
def _check_ean_key(self, cr, uid, ids): for partner in self.browse(cr, uid, ids): if not partner.ean13: continue if len(partner.ean13) not in [13,14,8]: return False try: int(partner.ean13) except: return False oddsum=0 evensum=0 total=0 eanvalue=partner.ean13 reversevalue = eanvalue[::-1] finalean=reversevalue[1:]
05a612012c00d1880266fc26fdf83943ff821296 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05a612012c00d1880266fc26fdf83943ff821296/product.py
ids = self.search(cr, user, [('code', '=', name)] + args,
ids = self.search(cr, user, [('code', 'ilike', name)] + args,
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80): if not args: args=[] if not context: context={} ids = False if len(name) == 2: ids = self.search(cr, user, [('code', '=', name)] + args, limit=limit, context=context) if not ids: ids = self.search(cr, user, [('name', operator...
6a5c13c0188a2d91ab7dd73f52c35b6680daa06d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a5c13c0188a2d91ab7dd73f52c35b6680daa06d/country.py
emp_ids = obj_emp.search(cr, uid, [('category_id', '=', record.category_id.id)])
emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
def holidays_validate(self, cr, uid, ids, *args): obj_emp = self.pool.get('hr.employee') data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) vals = {'state':'validate'} ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)]) if ids2: if data_holiday[0].state == 'validate1': vals['manager_id2'] = ...
279d41f156ee676cae9373e27b6354b7f07c9a9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/279d41f156ee676cae9373e27b6354b7f07c9a9a/hr_holidays.py
'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True),
def set_done(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'done'}) return True
f5707955cdf4beee85a0b02e96e56a4746b9504e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f5707955cdf4beee85a0b02e96e56a4746b9504e/project_long_term.py
'target': 'new',
'target': 'current',
def invoice_pay_customer(self, cr, uid, ids, context={}): if not ids: return [] inv = self.browse(cr, uid, ids[0], context=context) return { 'name':_("Pay Invoice"), 'view_mode': 'form', 'view_id': False, 'view_type': 'form', 'res_model': 'account.voucher', 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': ...
b51521b97daa579ac3c4d647c41d582b3c68ff05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b51521b97daa579ac3c4d647c41d582b3c68ff05/invoice.py
Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
def log(self, title, msg): Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
2f0ff7766a28a952e65d5bf4ed7bbbc23b6dc1c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f0ff7766a28a952e65d5bf4ed7bbbc23b6dc1c8/netsvc.py
db = pooler.get_db_only(cr.dbname) interface.register_all(db)
pool.get('ir.actions.report.xml').register_all(cr)
def upload_report(self, cr, uid, report_id, file_sxw, file_type, context): ''' Untested function ''' pool = pooler.get_pool(cr.dbname) sxwval = StringIO(base64.decodestring(file_sxw)) if file_type=='sxw': fp = open(addons.get_module_resource('base_report_designer','openerp_sxw2rml', 'normalized_oo2rml.xsl'),'rb') if fi...
eee6870817d7c80b624ba067ad9fdf713bb00e4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eee6870817d7c80b624ba067ad9fdf713bb00e4f/base_report_designer.py
def _amount_reconciled(self, cursor, user, ids, name, args, context=None): if not ids: return {} res_currency_obj = self.pool.get('res.currency') res = {} company_currency_id = False
3750db76b595c7d880580965769a0fe56a91923e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3750db76b595c7d880580965769a0fe56a91923e/account_voucher.py
if not company_currency_id: company_currency_id = line.company_id.id
def _amount_reconciled(self, cursor, user, ids, name, args, context=None): if not ids: return {} res_currency_obj = self.pool.get('res.currency') res = {} company_currency_id = False
3750db76b595c7d880580965769a0fe56a91923e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3750db76b595c7d880580965769a0fe56a91923e/account_voucher.py
res[line.id] = res_currency_obj.compute(cursor, user, company_currency_id, line.statement_id.currency.id, line.voucher_id.amount, context=context)
res[line.id] = line.voucher_id.amount
def _amount_reconciled(self, cursor, user, ids, name, args, context=None): if not ids: return {} res_currency_obj = self.pool.get('res.currency') res = {} company_currency_id = False
3750db76b595c7d880580965769a0fe56a91923e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3750db76b595c7d880580965769a0fe56a91923e/account_voucher.py
domain = [('object_id.name', '=', model),
domain = [('object_id.model', '=', model),
def signal(self, cr, uid, model, res_id, signal, context=None): if not signal: raise ValueError('signal cannot be False')
d675dc9bd8a6670b9802331a869bb1482c7c31cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d675dc9bd8a6670b9802331a869bb1482c7c31cb/marketing_campaign.py
result = Activities.process(activity.id, workitem.id,
result = Activities.process(cr, uid, activity.id, workitem.id,
def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': return
d675dc9bd8a6670b9802331a869bb1482c7c31cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d675dc9bd8a6670b9802331a869bb1482c7c31cb/marketing_campaign.py
except Exception, e: workitem.write({'state': 'exception', 'error_msg': str(e)},
except Exception: tb = "".join(format_exception(*exc_info())) workitem.write({'state': 'exception', 'error_msg': tb},
def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': return
d675dc9bd8a6670b9802331a869bb1482c7c31cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d675dc9bd8a6670b9802331a869bb1482c7c31cb/marketing_campaign.py
t_id=t_data.id
t_id = t_data.id
def _fnct_write(self,obj,cr, uid, ids, field_name, values, args, context=None): if values and field_name: self._field_get2(cr, uid, obj, context) relation = obj._name res = {} if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id=None t_data = data relation = obj._name for i in ...
cab8f8f0fb5d4fa0e7957d27942bdfd383ef399f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cab8f8f0fb5d4fa0e7957d27942bdfd383ef399f/fields.py
t_id=t_data['id']
t_id = t_data['id']
def _fnct_write(self,obj,cr, uid, ids, field_name, values, args, context=None): if values and field_name: self._field_get2(cr, uid, obj, context) relation = obj._name res = {} if type(ids) != type([]): ids=[ids] objlst = obj.browse(cr, uid, ids) for data in objlst: t_id=None t_data = data relation = obj._name for i in ...
cab8f8f0fb5d4fa0e7957d27942bdfd383ef399f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cab8f8f0fb5d4fa0e7957d27942bdfd383ef399f/fields.py
if ctx.get('action_id', False): return ctx['action_id']
if ctx.get('active_id', False): return ctx['active_id']
def _get_picking(self, cr, uid, ctx=None): if ctx is None: ctx = {} if ctx.get('action_id', False): return ctx['action_id'] return False
a22787cadf9fdef396f44178ea5b249acbdced9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a22787cadf9fdef396f44178ea5b249acbdced9c/stock.py
if context.get('action_id', False): picking = picking_obj.browse(cr, uid, [context['action_id']])[0]
if context.get('active_id', False): picking = picking_obj.browse(cr, uid, [context['active_id']])[0]
def _get_picking_address(self, cr, uid, context=None): picking_obj = self.pool.get('stock.picking') if context is None: context = {} if context.get('action_id', False): picking = picking_obj.browse(cr, uid, [context['action_id']])[0] return picking.address_id and picking.address_id.id or False return False
a22787cadf9fdef396f44178ea5b249acbdced9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a22787cadf9fdef396f44178ea5b249acbdced9c/stock.py
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id.id, context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_anal...
8386fa5580c1af8a5070e0fce854dac2280e8158 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8386fa5580c1af8a5070e0fce854dac2280e8158/account_bank_statement.py
cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s", [tuple(ids), tuple(valid_move_ids)]) related_move_map = cr.fetchall() related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0))) res.update(relat...
if valid_move_ids: cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s", [tuple(ids), tuple(valid_move_ids)]) related_move_map = cr.fetchall() related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)...
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {}
fa9a98c6924b0cf1a8d56dbbe71f29ea910f682c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa9a98c6924b0cf1a8d56dbbe71f29ea910f682c/mrp.py
def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100):
def get_recurrent_ids(self, cr, uid, ids, base_start_date, base_until_date, limit=100):
def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100): if not limit: limit = 100 if ids and (start_date or until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x: str(x), ids))+")") ...
4f9aefa2a1589f080154fd62ab0ed432072da6bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f9aefa2a1589f080154fd62ab0ed432072da6bd/crm_meeting.py
if ids and (start_date or until_date):
if ids and (base_start_date or base_until_date):
def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100): if not limit: limit = 100 if ids and (start_date or until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x: str(x), ids))+")") ...
4f9aefa2a1589f080154fd62ab0ed432072da6bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f9aefa2a1589f080154fd62ab0ed432072da6bd/crm_meeting.py
count = 0 start_date = start_date and datetime.datetime.strptime(start_date, "%Y-%m-%d") or False until_date = until_date and datetime.datetime.strptime(until_date, "%Y-%m-%d") or False for data in cr.dictfetchall():
count = 0 for data in cr.dictfetchall(): start_date = base_start_date and datetime.datetime.strptime(base_start_date, "%Y-%m-%d") or False until_date = base_until_date and datetime.datetime.strptime(base_until_date, "%Y-%m-%d") or False
def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100): if not limit: limit = 100 if ids and (start_date or until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ where m.id in ("+ ','.join(map(lambda x: str(x), ids))+")") ...
4f9aefa2a1589f080154fd62ab0ed432072da6bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f9aefa2a1589f080154fd62ab0ed432072da6bd/crm_meeting.py
until_date = arg[2]
until_date = arg[2]
def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): args_without_date = [] start_date = False until_date = False for arg in args: if arg[0] not in ('date', unicode('date')): args_without_date.append(arg) else: if arg[1] in ('>', '>='): start_date = arg[2] elif arg[1] in ('<', '<...
4f9aefa2a1589f080154fd62ab0ed432072da6bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f9aefa2a1589f080154fd62ab0ed432072da6bd/crm_meeting.py
return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): args_without_date = [] start_date = False until_date = False for arg in args: if arg[0] not in ('date', unicode('date')): args_without_date.append(arg) else: if arg[1] in ('>', '>='): start_date = arg[2] elif arg[1] in ('<', '<...
4f9aefa2a1589f080154fd62ab0ed432072da6bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f9aefa2a1589f080154fd62ab0ed432072da6bd/crm_meeting.py
except:
except SyntaxError: raise except TypeError: raise except Exception, e:
def test_expr(expr, allowed_codes, mode="eval"): """test_expr(expression, allowed_codes[, mode]) -> code_object Test that the expression contains only the allowed opcodes. If the expression is valid and contains only allowed codes, return the compiled code object. Otherwise raise a ValueError. """ try: code_obj = comp...
4afe236b0c036f98d97a5d4bf30b630957599ef5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4afe236b0c036f98d97a5d4bf30b630957599ef5/safe_eval.py
if record_id is None:
if record_id is None or not record_id:
def create(self, cr, user, vals, context=None): """ Create new record with specified value
33a7b33730ce2641a2190f690585cfda8ffa6084 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33a7b33730ce2641a2190f690585cfda8ffa6084/orm.py
res[line.id]['price_subtotal']= round(res[line.id]['price_subtotal'], int(config['price_accuracy'])) res[line.id]['price_subtotal_incl']= round(res[line.id]['price_subtotal_incl'], int(config['price_accuracy']))
res[line.id]['price_subtotal']= round(res[line.id]['price_subtotal'], int(config['price_accuracy'])) res[line.id]['price_subtotal_incl']= round(res[line.id]['price_subtotal_incl'], int(config['price_accuracy']))
def _amount_line2(self, cr, uid, ids, name, args, context=None): """ Return the subtotal excluding taxes with respect to price_type. """ res = {} tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') for line in self.browse(cr, uid, ids): cur = line.invoice_id and line.invoice_id.currency_id or...
00064d587f4deedf05f2d56e698b374d48290692 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/00064d587f4deedf05f2d56e698b374d48290692/invoice_tax_incl.py
sum(ail.quantity*ail.price_unit)/sum(ail.quantity*u.factor)*count(ail.product_id)::decimal(16,2) as price_average,
(case when ai.type in ('out_refund','in_invoice') then sum(ail.quantity*ail.price_unit*-1) else sum(ail.quantity*ail.price_unit) end)/(case when ai.type in ('out_refund','in_invoice') then sum(ail.quantity*u.factor*-1) else sum(ail.quantity*u.factor) end) as price_average,
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
754a0cec0d060d7f4226325f52eaa7843a6c8b12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/754a0cec0d060d7f4226325f52eaa7843a6c8b12/account_invoice_report.py
if int(vat[0:2]) == 0 and len(vat) == 10:
if int(vat[0:2]) in (0, 10, 20) and len(vat) == 10:
def check_vat_sk(self, vat): ''' Check Slovakia VAT number. ''' try: int(vat) except: return False if len(vat) not in(9, 10): return False
154eea64433d2734620100671b96a9ca091af774 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/154eea64433d2734620100671b96a9ca091af774/base_vat.py
help="Number of operations this workcenter can do."), 'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for doing one cycle."),
help="Number of iterations this workcenter has to do in the specified operation of the routing."), 'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for this workcenter to achieve the operation of the specified routing."),
def on_change_product_cost(self, cr, uid, ids, product_id, context=None): if context is None: context = {} value = {}
88bee41f4677f19485945249bc058516d640fb24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88bee41f4677f19485945249bc058516d640fb24/mrp.py
'unit_amount': wc.costs_hour * wc.time_cycle,
'unit_amount': wc_line.hour,
def _costs_generate(self, cr, uid, production): """ Calculates total costs at the end of the production. @param production: Id of production order. @return: Calculated amount. """ amount = 0.0 analytic_line_obj = self.pool.get('account.analytic.line') for wc_line in production.workcenter_lines: wc = wc_line.workcenter_...
88bee41f4677f19485945249bc058516d640fb24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88bee41f4677f19485945249bc058516d640fb24/mrp.py
'unit_amount': wc.costs_hour * wc.time_cycle,
'unit_amount': wc_line.cycle,
def _costs_generate(self, cr, uid, production): """ Calculates total costs at the end of the production. @param production: Id of production order. @return: Calculated amount. """ amount = 0.0 analytic_line_obj = self.pool.get('account.analytic.line') for wc_line in production.workcenter_lines: wc = wc_line.workcenter_...
88bee41f4677f19485945249bc058516d640fb24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88bee41f4677f19485945249bc058516d640fb24/mrp.py
def _get_company(self, cr, uid, ids, context={}):
def _get_company(self, cr, uid, context={}):
def _get_company(self, cr, uid, ids, context={}): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') user = user_obj.browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id else: return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
90ba7bc60b1c0644b4185e251941c4356e3144b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90ba7bc60b1c0644b4185e251941c4356e3144b7/account_vat.py
return {'value': {'work_email':mail}}
return {'value': {'work_email':mail.user_email}}
def onchange_user(self, cr, uid, ids, user_id, context=None): mail = self.pool.get('res.users').browse(cr,uid,user_id) return {'value': {'work_email':mail}}
73807c946566486ccea324eafa772748ad03c152 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/73807c946566486ccea324eafa772748ad03c152/hr.py
if inv.type == 'out_invoice': xml_id = 'action_invoice_tree1' elif inv.type == 'in_invoice': xml_id = 'action_invoice_tree2' elif inv.type == 'out_refund':
if inv.type in ('out_invoice', 'out_refund'):
def compute_refund(self, cr, uid, ids, mode='refund', 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
0d5ea8b1427b71b0d6c57de045636d33be002d51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d5ea8b1427b71b0d6c57de045636d33be002d51/account_invoice_refund.py
'create_date': fields.datetime('Latest Date of Inventory'), }
'date': fields.datetime('Latest Inventory Date'), }
def unlink(self, cr, uid, ids, context={}): raise osv.except_osv(_('Error !'), _('You cannot delete any record!'))
268a1cc776f5749cadd6c7e0afe68b9a29727b8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/268a1cc776f5749cadd6c7e0afe68b9a29727b8b/report_stock.py
l.id as id,
min(l.id) as id,
def init(self, cr): cr.execute(""" create or replace view report_stock_lines_date as ( select l.id as id, p.id as product_id, max(l.create_date) as create_date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) where l.create_date is not null group by p.id,l.id )""")
268a1cc776f5749cadd6c7e0afe68b9a29727b8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/268a1cc776f5749cadd6c7e0afe68b9a29727b8b/report_stock.py
max(l.create_date) as create_date
max(s.date) as date
def init(self, cr): cr.execute(""" create or replace view report_stock_lines_date as ( select l.id as id, p.id as product_id, max(l.create_date) as create_date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) where l.create_date is not null group by p.id,l.id )""")
268a1cc776f5749cadd6c7e0afe68b9a29727b8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/268a1cc776f5749cadd6c7e0afe68b9a29727b8b/report_stock.py
group by p.id,l.id
and s.state = 'done' group by p.id
def init(self, cr): cr.execute(""" create or replace view report_stock_lines_date as ( select l.id as id, p.id as product_id, max(l.create_date) as create_date from product_product p left outer join stock_inventory_line l on (p.id=l.product_id) where l.create_date is not null group by p.id,l.id )""")
268a1cc776f5749cadd6c7e0afe68b9a29727b8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/268a1cc776f5749cadd6c7e0afe68b9a29727b8b/report_stock.py
new_data[n] = data[n]
new_data[n] = data[n]
def __getitem__(self, name): if name == 'id': return self._id if name not in self._data[self._id]: # build the list of fields we will fetch
69912380fb2b59460c20c93979c213b238adb5af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69912380fb2b59460c20c93979c213b238adb5af/orm.py
% self._name)
% self._name)
def create(self, cr, user, vals, context=None): """ create(cr, user, vals, context) -> int cr = database cursor user = user id vals = dictionary of the form {'field_name':field_value, ...} """ if not context: context = {} self.pool.get('ir.model.access').check(cr, user, self._name, 'create')
69912380fb2b59460c20c93979c213b238adb5af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69912380fb2b59460c20c93979c213b238adb5af/orm.py
amount = currency_obj.compute(cr, user, line.currency_id.id,
amount = currency_obj.compute(cr, uid, line.currency_id.id,
def populate_statement(self, cr, uid, ids, context=None):
99847457a7067cc0587b33a46cbfb85f48f441f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99847457a7067cc0587b33a46cbfb85f48f441f7/account_statement_from_invoice.py
amount = currency_obj.compute(cr, user, line.invoice.currency_id.id,
amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,
def populate_statement(self, cr, uid, ids, context=None):
99847457a7067cc0587b33a46cbfb85f48f441f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99847457a7067cc0587b33a46cbfb85f48f441f7/account_statement_from_invoice.py
__logger = logging.getLogger('orm') __schema = logging.getLogger('orm.schema')
def exists(self, cr, uid, id, context=None): return id in self.datas
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger = netsvc.Logger()
def _check_removed_columns(self, cr, log=False): logger = netsvc.Logger() # iterate on the database columns to drop the NOT NULL constraints # of fields which were required but have been removed (or will be added by another module) columns = [c for c in self._columns if not (isinstance(self._columns[c], fields.function...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger.notifyChannel("orm", netsvc.LOG_DEBUG, "column %s is in the table %s but not in the corresponding object %s" % (column['attname'], self._table, self._name))
self.__logger.debug("column %s is in the table %s but not in the corresponding object %s", column['attname'], self._table, self._name)
def _check_removed_columns(self, cr, log=False): logger = netsvc.Logger() # iterate on the database columns to drop the NOT NULL constraints # of fields which were required but have been removed (or will be added by another module) columns = [c for c in self._columns if not (isinstance(self._columns[c], fields.function...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s': dropped NOT NULL constraint" % (self._table, column['attname']))
self.__schema.debug("Table '%s': column '%s': dropped NOT NULL constraint", self._table, column['attname'])
def _check_removed_columns(self, cr, log=False): logger = netsvc.Logger() # iterate on the database columns to drop the NOT NULL constraints # of fields which were required but have been removed (or will be added by another module) columns = [c for c in self._columns if not (isinstance(self._columns[c], fields.function...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger = netsvc.Logger()
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': created" % (self._table, ))
self.__schema.debug("Table '%s': created", self._table)
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger.notifyChannel('orm', netsvc.LOG_ERROR, 'create a column parent_left on object %s: fields.integer(\'Left Parent\', select=1)' % (self._table, )) logging.getLogger('schema').info("Table '%s': added column '%s' with definition=%s" % (self._table, 'parent_left', 'INTEGER'))
self.__logger.error('create a column parent_left on object %s: fields.integer(\'Left Parent\', select=1)', self._table) self.__schema.debug("Table '%s': added column '%s' with definition=%s", self._table, 'parent_left', 'INTEGER')
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger.notifyChannel('orm', netsvc.LOG_ERROR, 'create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)' % (self._table, )) logging.getLogger('schema').info("Table '%s': added column '%s' with definition=%s" % (self._table, 'parent_right', 'INTEGER'))
self.__logger.error('create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)', self._table) self.__schema.debug("Table '%s': added column '%s' with definition=%s", self._table, 'parent_right', 'INTEGER')
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger.notifyChannel('orm', netsvc.LOG_ERROR, "The column %s on object %s must be set as ondelete='cascade'" % (self._parent_name, self._name))
self.__logger.error("The column %s on object %s must be set as ondelete='cascade'", self._parent_name, self._name)
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': added column '%s' with definition=%s" % (self._table, k, logs[k]))
self.__schema.debug("Table '%s': added column '%s' with definition=%s", self._table, k, logs[k])
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': added foreign key '%s' with definition=REFERENCES \"%s\" ON DELETE SET NULL" % (
self.__schema.debug("Table '%s': added foreign key '%s' with definition=REFERENCES \"%s\" ON DELETE SET NULL",
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
)
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Create table '%s': relation between '%s' and '%s'" % (f._rel, self._table, ref))
self.__schema.debug("Create table '%s': relation between '%s' and '%s'", f._rel, self._table, ref)
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': renamed column '%s' to '%s'" % (self._table, f.oldname, k))
self.__schema.debug("Table '%s': renamed column '%s' to '%s'", self._table, f.oldname, k)
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if getattr(self, '_auto', True): cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) if not cr.rowcount: cr.execute('...
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logger.notifyChannel('orm', netsvc.LOG_INFO, 'column %s (%s) in table %s removed: converted to a function !\n' % (k, f.string, self._table))
self.__logger.info('column %s (%s) in table %s removed: converted to a function !\n', k, f.string, self._table)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': dropped column '%s' with cascade" % (self._table, k))
self.__schema.debug("Table '%s': dropped column '%s' with cascade", self._table, k)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s' (type varchar) changed size from %s to %s" % (self._table, k, f_pg_size, f.size))
self.__schema.debug("Table '%s': column '%s' (type varchar) changed size from %s to %s", self._table, k, f_pg_size, f.size)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s' changed type from %s to %s" % (self._table, k, c[0], c[1]))
self.__schema.debug("Table '%s': column '%s' changed type from %s to %s", self._table, k, c[0], c[1])
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s' has changed type (DB=%s, def=%s), data moved to column %s !" % (
self.__schema.debug("Table '%s': column '%s' has changed type (DB=%s, def=%s), data moved to column %s !",
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s': added NOT NULL constraint" % (self._table, k))
self.__schema.debug("Table '%s': column '%s': added NOT NULL constraint", self._table, k)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
"ALTER TABLE %s ALTER COLUMN %s SET NOT NULL" % ( self._table, k, self._table, k) logger.notifyChannel('schema', netsvc.LOG_WARNING, msg)
"ALTER TABLE %s ALTER COLUMN %s SET NOT NULL" self.__schema.warn(msg, self._table, k, self._table, k)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
logging.getLogger('schema').info("Table '%s': column '%s': dropped NOT NULL constraint" % (self._table, k))
self.__schema.debug("Table '%s': column '%s': dropped NOT NULL constraint", self._table, k)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
"Use a search view instead if you simply want to make the field searchable." % (self._table, k, f._type) logger.notifyChannel('schema', netsvc.LOG_WARNING, msg)
"Use a search view instead if you simply want to make the field searchable." self.__schema.warn(msg, self._table, k, f._type)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py
msg = "Table '%s': dropping index for column '%s' of type '%s' as it is not required anymore" % (self._table, k, f._type) logger.notifyChannel('schema', netsvc.LOG_WARNING, msg)
msg = "Table '%s': dropping index for column '%s' of type '%s' as it is not required anymore" self.__schema.warn(msg, self._table, k, f._type)
f_pg_def = res[0]
a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py