rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
raise RuntimeError('media offline')
raise IOError(errno.EREMOTE, 'medium offline') if storage_bo.readonly: raise IOError(errno.EPERM, "Readonly medium")
def prepare_unlink(self, cr, uid, storage_bo, fil_bo): """ Before we unlink a file (fil_boo), prepare the list of real files that have to be removed, too. """
26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py
if not sbro.online: raise IOError(errno.EREMOTE, 'medium offline') if sbro.readonly: raise IOError(errno.EPERM, "Readonly medium")
def simple_rename(self, cr, uid, file_node, new_name, context=None): """ A preparation for a file rename. It will not affect the database, but merely check and perhaps rename the realstore file. @return the dict of values that can safely be be stored in the db. """ sbro = self.browse(cr, uid, file_node.storage_id, con...
26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py
'action_id': _get_menu,
def _get_group(self,cr, uid, context={}): ids = self.pool.get('res.groups').search(cr, uid, [('name','=','Employee')]) return ids or False
ac7ec1748c09d72b170831ae67dbdae66b1f3000 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac7ec1748c09d72b170831ae67dbdae66b1f3000/res_user.py
result.append((sur.id, sur.title))
res = True break
def _get_survey(self, cr, uid, context=None): """ Set the value In survey_id field.
dbe6aa5f692e4d95f56d3c9a402e8d3765d43ede /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dbe6aa5f692e4d95f56d3c9a402e8d3765d43ede/survey_selection.py
result.append((sur.id, sur.title))
res = True break if res: result.append((sur.id, sur.title))
def _get_survey(self, cr, uid, context=None): """ Set the value In survey_id field.
dbe6aa5f692e4d95f56d3c9a402e8d3765d43ede /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dbe6aa5f692e4d95f56d3c9a402e8d3765d43ede/survey_selection.py
if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: journal = self.browse(cr, uid, id[0], context=context) if journal.journal_id: return journal.journal_id.id
md = self.pool.get('ir.model.data') try: result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal') return result[1] except ValueError, e: pass
def _getAnalyticJournal(self, cr, uid, context=None): if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: journal = self.browse(cr, uid, id[0], context=context) if journal.journal_id: return journal.journal_id.id return False
e61f615c7b892b10c291f8e43cb27f000cc3d6db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e61f615c7b892b10c291f8e43cb27f000cc3d6db/hr_timesheet.py
def _getAnalyticJournal(self, cr, uid, context=None): if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: journal = self.browse(cr, uid, id[0], context=context) if journal.journal_id: return journal.journal_id.id return False
e61f615c7b892b10c291f8e43cb27f000cc3d6db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e61f615c7b892b10c291f8e43cb27f000cc3d6db/hr_timesheet.py
if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: prod = self.browse(cr, uid, id[0], context=context) if prod.product_id: return prod.product_id.id
md = self.pool.get('ir.model.data') try: result = md.get_object_reference(cr, uid, 'hr_timesheet', 'product_consultant') return result[1] except ValueError, e: pass
def _getEmployeeProduct(self, cr, uid, context=None): if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: prod = self.browse(cr, uid, id[0], context=context) if prod.product_id: return prod.product_id.id return False
e61f615c7b892b10c291f8e43cb27f000cc3d6db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e61f615c7b892b10c291f8e43cb27f000cc3d6db/hr_timesheet.py
def _getEmployeeProduct(self, cr, uid, context=None): if context is None: context = {} id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) if id: prod = self.browse(cr, uid, id[0], context=context) if prod.product_id: return prod.product_id.id return False
e61f615c7b892b10c291f8e43cb27f000cc3d6db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e61f615c7b892b10c291f8e43cb27f000cc3d6db/hr_timesheet.py
value = dict.fromkeys(fields_list)
value = dict.fromkeys(fields_list, False)
def default_get(self, cr, uid, fields_list, context=None): self.view_init(cr, uid, fields_list, context) if not context: context = {} # we define default value for each field existing in the object value = dict.fromkeys(fields_list) # get the default values for the inherited fields for f in fields_list: if f in self._d...
506cd4a2af422ba5f5498f41e765612732ffb8c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/506cd4a2af422ba5f5498f41e765612732ffb8c9/orm.py
'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'xmlrpcs', 'syslog',
'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'syslog',
def die(cond, msg): if cond: print msg sys.exit(1)
68512a9a76811350eb79ed0ecdb4787e16392240 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/68512a9a76811350eb79ed0ecdb4787e16392240/config.py
fp = open(addons.get_module_resource('survey', 'report') + file_name + '.pdf', 'wb+');
ret_file_name = addons.get_module_resource('survey', 'report') + file_name + '.pdf' fp = open(ret_file_name, 'wb+');
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False, context=None): """ If any user give answer of survey then last create report of this answer and if 'E-mail Notification on Answer' set True in survey then send mail on responsible person of this survey and attach survey answer report in pdf ...
a444bf77e9acb8fd9d8bf95593641bd46bf7b2f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a444bf77e9acb8fd9d8bf95593641bd46bf7b2f3/survey_answer.py
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
writeoff_acc_id = False for entry in move.reconcile_id.line_new_ids: writeoff_acc_id = entry.account_id.id break account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
def button_confirm(self, cr, uid, ids, context={}): done = [] 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_bank_statement_line_obj = \ self.pool.get('account...
db12e88f2b48edab95e33399bfbd233039a9f56e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db12e88f2b48edab95e33399bfbd233039a9f56e/account_bank_statement.py
except Exception, e:
from reportlab.graphics.barcode import createBarcodeDrawing except ImportError:
def _flowable(self, node, extra_style=None): if node.tag=='pto': return self._pto(node) if node.tag=='para': style = self.styles.para_style_get(node) if extra_style: style.__dict__.update(extra_style) result = [] for i in self._textual(node).split('\n'): result.append(platypus.Paragraph(i, style, **(utils.attr_get(node...
aaac6a602f3836ae6f9c8919fcf6c1af5896ac51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aaac6a602f3836ae6f9c8919fcf6c1af5896ac51/trml2pdf.py
'code128': lambda x: code128.Code128(x, **args), 'standard39': lambda x: code39.Standard39(x, **args), 'standard93': lambda x: code93.Standard93(x, **args),
'code128': lambda x: code128.Code128(str(x), **args), 'standard39': lambda x: code39.Standard39(str(x), **args), 'standard93': lambda x: code93.Standard93(str(x), **args),
def _flowable(self, node, extra_style=None): if node.tag=='pto': return self._pto(node) if node.tag=='para': style = self.styles.para_style_get(node) if extra_style: style.__dict__.update(extra_style) result = [] for i in self._textual(node).split('\n'): result.append(platypus.Paragraph(i, style, **(utils.attr_get(node...
aaac6a602f3836ae6f9c8919fcf6c1af5896ac51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aaac6a602f3836ae6f9c8919fcf6c1af5896ac51/trml2pdf.py
'extended39': lambda x: code39.Extended39(x, **args), 'extended93': lambda x: code93.Extended93(x, **args),
'extended39': lambda x: code39.Extended39(str(x), **args), 'extended93': lambda x: code93.Extended93(str(x), **args),
def _flowable(self, node, extra_style=None): if node.tag=='pto': return self._pto(node) if node.tag=='para': style = self.styles.para_style_get(node) if extra_style: style.__dict__.update(extra_style) result = [] for i in self._textual(node).split('\n'): result.append(platypus.Paragraph(i, style, **(utils.attr_get(node...
aaac6a602f3836ae6f9c8919fcf6c1af5896ac51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aaac6a602f3836ae6f9c8919fcf6c1af5896ac51/trml2pdf.py
'res_id': res_id,
'domain' : "[('id','=',%d)]"%(res_id),
def open_document(self, cr, uid, ids, context): """ To Open Document @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: the ID of messages @param context: A standard dictionary """ action_data = False if ids: message_id = ids[0] mailgate_data = self....
05782bc2d275ff7fe8e7374712b8b900b6cb9d11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05782bc2d275ff7fe8e7374712b8b900b6cb9d11/mail_gateway.py
def open_document(self, cr, uid, ids, context): """ To Open Document @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: the ID of messages @param context: A standard dictionary """ action_data = False if ids: message_id = ids[0] mailgate_data = self....
05782bc2d275ff7fe8e7374712b8b900b6cb9d11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05782bc2d275ff7fe8e7374712b8b900b6cb9d11/mail_gateway.py
def copy(self, cr, uid, id, default=None, context={}):
def copy(self, cr, uid, id, default=None, context=None):
def copy(self, cr, uid, id, default=None, context={}): group_name = self.read(cr, uid, [id], ['name'])[0]['name'] default.update({'name': _('%s (copy)')%group_name}) return super(groups, self).copy(cr, uid, id, default, context)
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
def _lang_get(self, cr, uid, context={}):
def _lang_get(self, cr, uid, context=None):
def _lang_get(self, cr, uid, context={}): obj = self.pool.get('res.lang') ids = obj.search(cr, uid, [('translatable','=',True)]) res = obj.read(cr, uid, ids, ['code', 'name'], context) res = [(r['code'], r['name']) for r in res] return res
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
res = obj.read(cr, uid, ids, ['code', 'name'], context)
res = obj.read(cr, uid, ids, ['code', 'name'], context=context)
def _lang_get(self, cr, uid, context={}): obj = self.pool.get('res.lang') ids = obj.search(cr, uid, [('translatable','=',True)]) res = obj.read(cr, uid, ids, ['code', 'name'], context) res = [(r['code'], r['name']) for r in res] return res
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
def _tz_get(self,cr,uid, context={}):
def _tz_get(self,cr,uid, context=None):
def _tz_get(self,cr,uid, context={}): return [(x, x) for x in pytz.all_timezones]
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
def copy(self, cr, uid, id, default=None, context={}):
def copy(self, cr, uid, id, default=None, context=None):
def copy(self, cr, uid, id, default=None, context={}): user2copy = self.read(cr, uid, [id], ['login','name'])[0] if default is None: default = {} copy_pattern = _("%s (copy)") default.update(login=(copy_pattern % user2copy['login']), name=(copy_pattern % user2copy['name']), address_id=False, # avoid sharing the address...
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
def action_get(self, cr, uid, context={}):
def action_get(self, cr, uid, context=None):
def action_get(self, cr, uid, context={}): dataobj = self.pool.get('ir.model.data') data_id = dataobj._get_id(cr, 1, 'base', 'action_res_users_my') return dataobj.browse(cr, uid, data_id, context).res_id
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
return dataobj.browse(cr, uid, data_id, context).res_id
return dataobj.browse(cr, uid, data_id, context=context).res_id
def action_get(self, cr, uid, context={}): dataobj = self.pool.get('ir.model.data') data_id = dataobj._get_id(cr, 1, 'base', 'action_res_users_my') return dataobj.browse(cr, uid, data_id, context).res_id
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
if res: cr.execute("update res_users set date=%s where id=%s", (time.strftime('%Y-%m-%d %H:%M:%S'),res[0])) cr.commit() result = res[0] cr.close() return result
try: cr.execute('SELECT id FROM res_users WHERE login=%s AND password=%s AND active', (tools.ustr(login), tools.ustr(password))) res = cr.fetchone() if res: cr.execute("UPDATE res_users SET date=%s WHERE id=%s", (time.strftime('%Y-%m-%d %H:%M:%S'),res[0])) cr.commit() return res[0] else: return False finally: cr.close(...
def login(self, db, login, password): if not password: return False cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where login=%s and password=%s and active', (tools.ustr(login), tools.ustr(password))) res = cr.fetchone() result = False if res: cr.execute("update res_users set date=%s where id=%s"...
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
cr.execute('select count(1) from res_users where id=%s and password=%s and active=%s', (int(uid), passwd, True)) res = cr.fetchone()[0] cr.close() if not bool(res): raise security.ExceptionNoTb('AccessDenied') if res: if self._uid_cache.has_key(db): ulist = self._uid_cache[db] ulist[uid] = passwd else: self._uid_cache[...
try: cr.execute('SELECT COUNT(1) FROM res_users WHERE id=%s AND password=%s AND active=%s', (int(uid), passwd, True)) res = cr.fetchone()[0] if not bool(res): raise security.ExceptionNoTb('AccessDenied') if res: if self._uid_cache.has_key(db): ulist = self._uid_cache[db] ulist[uid] = passwd else: self._uid_cache[db] = ...
def check(self, db, uid, passwd): if not passwd: return False cached_pass = self._uid_cache.get(db, {}).get(uid) if (cached_pass is not None) and cached_pass == passwd: return True cr = pooler.get_db(db).cursor() cr.execute('select count(1) from res_users where id=%s and password=%s and active=%s', (int(uid), passwd, T...
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
cr.execute('select id from res_users where id=%s and password=%s', (uid, passwd)) res = cr.fetchone() cr.close() if not res: raise security.ExceptionNoTb('Bad username or password') return res[0]
try: cr.execute('SELECT id FROM res_users WHERE id=%s AND password=%s', (uid, passwd)) res = cr.fetchone() if not res: raise security.ExceptionNoTb('Bad username or password') return res[0] finally: cr.close()
def access(self, db, uid, passwd, sec_level, ids): if not passwd: return False cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where id=%s and password=%s', (uid, passwd)) res = cr.fetchone() cr.close() if not res: raise security.ExceptionNoTb('Bad username or password') return res[0]
b4e5c513112036bb6d6eee7e16eda547ccda80eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4e5c513112036bb6d6eee7e16eda547ccda80eb/res_user.py
tax_ids = self.pool.get('account.tax').search(cr, uid, [('company_id', '=', company_id)])
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
36ee30f34881372be5e0bb24e82a2cc084a7229b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36ee30f34881372be5e0bb24e82a2cc084a7229b/invoice.py
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
def_sale_taxes = map(lambda x: x.id, res.taxes_id) sale_tax_list = [tax for tax in tax_ids if tax in def_sale_taxes] sale_tax_id = self.pool.get('account.tax').browse(cr, uid, sale_tax_list) sale_taxes = sale_tax_id and sale_tax_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id =...
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
36ee30f34881372be5e0bb24e82a2cc084a7229b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36ee30f34881372be5e0bb24e82a2cc084a7229b/invoice.py
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
def_pur_taxes = map(lambda x: x.id, res.supplier_taxes_id) pur_tax_list = [tax for tax in tax_ids if tax in def_pur_taxes] pur_tax_id = self.pool.get('account.tax').browse(cr, uid, pur_tax_list) pur_taxes = pur_tax_id and pur_tax_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) tax_id ...
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
36ee30f34881372be5e0bb24e82a2cc084a7229b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36ee30f34881372be5e0bb24e82a2cc084a7229b/invoice.py
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
36ee30f34881372be5e0bb24e82a2cc084a7229b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36ee30f34881372be5e0bb24e82a2cc084a7229b/invoice.py
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
36ee30f34881372be5e0bb24e82a2cc084a7229b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36ee30f34881372be5e0bb24e82a2cc084a7229b/invoice.py
'padding': 3
'padding': 3, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'padding': 3
'padding': 3, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'padding': 3
'padding': 3, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'padding': 3
'padding': 3, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'analytic_journal_id': analitical_journal_sale
'analytic_journal_id': analitical_journal_sale, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'analytic_journal_id': analitical_journal_purchase
'analytic_journal_id': analitical_journal_purchase, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'analytic_journal_id': analitical_journal_sale
'analytic_journal_id': analitical_journal_sale, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
'analytic_journal_id': analitical_journal_purchase
'analytic_journal_id': analitical_journal_purchase, 'company_id': company_id.id
def generate_configurable_chart(self, cr, uid, ids, context=None): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_tax_code = self.pool.get('account.tax.code') obj_acc_template = self.pool.get('account.account.template') obj_ac...
f943acfa3702f01fdf9706c676422fee6dbe481d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f943acfa3702f01fdf9706c676422fee6dbe481d/installer.py
dict_op = {'not in':'!=','in':'='}
operator = ( operator in ['<','>','<=','>='] ) and 'in' or operator dict_op = {'not in':'!=','in':'=','=':'in','!=':'not in','<>':'not in'}
def _get_expression(field_obj,cr, uid, left, right, operator, context=None): if context is None: context = {} c = context.copy() c['active_test'] = False dict_op = {'not in':'!=','in':'='} if isinstance(right,tuple): right = list(right) if (not isinstance(right,list)) and operator in ['not in','in']: operator = dict_op...
40ed04d094f5654333d638112cec8c06a8f07cf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40ed04d094f5654333d638112cec8c06a8f07cf2/expression.py
if isinstance(right, basestring): m2o_str = True elif isinstance(right, list) or isinstance(right, tuple): m2o_str = True for ele in right: if not isinstance(ele, basestring): m2o_str = False break
if right: if isinstance(right, basestring): m2o_str = True elif isinstance(right,(list,tuple)): m2o_str = True for ele in right: if not isinstance(ele, basestring): m2o_str = False break else: new_op = '=' if operator in ['not like','not ilike','not in','<>','!=']: new_op = '!=' self.__exp[i] = (left,new_op,False)
def _get_expression(field_obj,cr, uid, left, right, operator, context=None): if context is None: context = {} c = context.copy() c['active_test'] = False dict_op = {'not in':'!=','in':'='} if isinstance(right,tuple): right = list(right) if (not isinstance(right,list)) and operator in ['not in','in']: operator = dict_op...
40ed04d094f5654333d638112cec8c06a8f07cf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40ed04d094f5654333d638112cec8c06a8f07cf2/expression.py
acc = l.product_id.product_tmpl_id.property_account_expense.id
acc = l.product_id.product_tmpl_id.property_account_expense
def action_invoice_create(self, cr, uid, ids): res = False invoice_obj = self.pool.get('account.invoice') for exp in self.browse(cr, uid, ids): lines = [] for l in exp.line_ids: tax_id = [] if l.product_id: acc = l.product_id.product_tmpl_id.property_account_expense.id if not acc: acc = l.product_id.categ_id.property_a...
22ba7bca40c89e239ee701497860421e5e244866 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22ba7bca40c89e239ee701497860421e5e244866/hr_expense.py
acc = l.product_id.categ_id.property_account_expense_categ.id
acc = l.product_id.categ_id.property_account_expense_categ
def action_invoice_create(self, cr, uid, ids): res = False invoice_obj = self.pool.get('account.invoice') for exp in self.browse(cr, uid, ids): lines = [] for l in exp.line_ids: tax_id = [] if l.product_id: acc = l.product_id.product_tmpl_id.property_account_expense.id if not acc: acc = l.product_id.categ_id.property_a...
22ba7bca40c89e239ee701497860421e5e244866 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22ba7bca40c89e239ee701497860421e5e244866/hr_expense.py
freq='' if freq == 'None':
freq=datas.get('rrule_type') if freq == 'none':
def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string according to value type RECUR of iCalendar from the values given. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param datas: diction...
b106119a0d426180f5026fe1398746b768d10322 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b106119a0d426180f5026fe1398746b768d10322/base_calendar.py
if datas.get('rrule_type')=='daily_working': freq ='weekly' else: freq=datas.get('rrule_type')
def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string according to value type RECUR of iCalendar from the values given. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param datas: diction...
b106119a0d426180f5026fe1398746b768d10322 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b106119a0d426180f5026fe1398746b768d10322/base_calendar.py
if vals.get('date_start', False) and vals['date_start'] < task_rec.date_start: dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S') work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource.id or False) if work_times: vals['date_end'] = work_times[-1][1].st...
if vals.get('date_start', False) and vals['date_start'] < task_rec.date_start: dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S') work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource.id or False) if work_times: vals['date_end'] = work_times[-1][1].st...
def write(self, cr, uid, ids, vals, context={}): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') if not context: context = {} if context.get('scheduler',False): return super(task, self).write(cr, uid, ids, vals, context=context)
80cc3fca7e51f8690bfeb265fe403eb53987fea8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/80cc3fca7e51f8690bfeb265fe403eb53987fea8/project_long_term.py
['date', 'rdates', 'rrule', 'exdate']):
['date', 'rrule', 'exdate']):
def unlink(self, cr, uid, ids, context=None): for id in ids: if len(str(id).split('-')) > 1: date_new = time.strftime("%Y-%m-%d %H:%M:%S", \ time.strptime(str(str(id).split('-')[1]), "%Y%m%d%H%M%S")) for record in self.read(cr, uid, [common.caldevIDs2readIDs(id)], \ ['date', 'rdates', 'rrule', 'exdate']): if record['rr...
2b65916f36d34dbf635087b9e6250f2927a5fb9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b65916f36d34dbf635087b9e6250f2927a5fb9d/crm_meeting.py
if partner.membership_state != 'canceled': res[partner.id] = False else:
res[partner.id] = False if partner.membership_state == 'canceled':
def _membership_cancel(self, cr, uid, ids, name, args, context=None): '''Return the cancel date of membership''' res = {} member_line_obj = self.pool.get('membership.membership_line') for partner in self.browse(cr, uid, ids, context=context): if partner.membership_state != 'canceled': res[partner.id] = False else: line...
e9bb40be31d4030609c80654ae91cc6a926693c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e9bb40be31d4030609c80654ae91cc6a926693c8/membership.py
else: res[partner.id] = False
def _membership_cancel(self, cr, uid, ids, name, args, context=None): '''Return the cancel date of membership''' res = {} member_line_obj = self.pool.get('membership.membership_line') for partner in self.browse(cr, uid, ids, context=context): if partner.membership_state != 'canceled': res[partner.id] = False else: line...
e9bb40be31d4030609c80654ae91cc6a926693c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e9bb40be31d4030609c80654ae91cc6a926693c8/membership.py
'account.invoice':(_get_invoice_partner,['state'], 10),
'account.invoice':(_get_invoice_partner,['state'], 11),
def _get_partners(self, cr, uid, ids, context={}): ids2 = ids while ids2: ids2 = self.search(cr, uid, [('associate_member','in',ids2)], context=context) ids+=ids2 return ids
e9bb40be31d4030609c80654ae91cc6a926693c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e9bb40be31d4030609c80654ae91cc6a926693c8/membership.py
'sale':[('type','in',['sale','purchase_refund'])], 'purchase':[('type','in',['purchase','sale_refund'])],
'sale':[('type','in',['sale','sale_refund'])], 'purchase':[('type','in',['purchase','purchase_refund'])],
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param view_id: list of fields, which required to read signatures @param view_type: defines a view type. it can be one of ...
596a6ccbc682098840db22988d579a2f9b20473a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/596a6ccbc682098840db22988d579a2f9b20473a/voucher.py
'sale_refund':[('type','in',['sale','purchase_refund'])], 'purchase_refund':[('type','in',['purchase','sale_refund'])]
'sale_refund':[('type','in',['sale','sale_refund'])], 'purchase_refund':[('type','in',['purchase','purchase_refund'])]
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Returns views and fields for current model where view will depend on {view_type}. @param view_id: list of fields, which required to read signatures @param view_type: defines a view type. it can be one of ...
596a6ccbc682098840db22988d579a2f9b20473a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/596a6ccbc682098840db22988d579a2f9b20473a/voucher.py
where = [('collection_id','=',self.dir_id)]
where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') if len(res) > 1: name = res[0] ext = '.ics'
def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj ...
65ed78ef9172300bdd03c02c27d8aed1c75fcebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65ed78ef9172300bdd03c02c27d8aed1c75fcebc/caldav_node.py
res.append(node_calendar(calender.name, self, self.context, calender))
if not ext: res.append(node_calendar(calender.name, self, self.context, calender)) else: res.append(res_node_calendar(name, self, self.context, calender))
def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj ...
65ed78ef9172300bdd03c02c27d8aed1c75fcebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65ed78ef9172300bdd03c02c27d8aed1c75fcebc/caldav_node.py
def __init__(self,path, parent, context, res_obj, res_model, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.calendar_id = parent.calendar_id
def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None): super(res_node_calendar,self).__init__(path, parent, context)
def __init__(self,path, parent, context, res_obj, res_model, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.calendar_id = parent.calendar_id self.mimetype = 'text/calendar' self.create_date = parent.create_date self.write_date = parent.write_date or parent.create_date if res_obj: self....
65ed78ef9172300bdd03c02c27d8aed1c75fcebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65ed78ef9172300bdd03c02c27d8aed1c75fcebc/caldav_node.py
return '%s_%d' % (self.model, self.res_id)
res = False if self.model and self.res_id: res = '%s_%d' % (self.model, self.res_id) elif self.calendar_id: res = '%d' % (self.calendar_id) return res
def _get_ttag(self,cr): return '%s_%d' % (self.model, self.res_id)
65ed78ef9172300bdd03c02c27d8aed1c75fcebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65ed78ef9172300bdd03c02c27d8aed1c75fcebc/caldav_node.py
if not real_event_id in new_ids:
if real_event_id and not real_event_id in new_ids:
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ Overrides orm write method. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm meeting's ids @param vals: Dictionary of ...
a58c266d2cc1b9ea62859c12fec2dfb23ed9417b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a58c266d2cc1b9ea62859c12fec2dfb23ed9417b/base_calendar.py
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
if new_ids: res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ Overrides orm write method. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm meeting's ids @param vals: Dictionary of ...
a58c266d2cc1b9ea62859c12fec2dfb23ed9417b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a58c266d2cc1b9ea62859c12fec2dfb23ed9417b/base_calendar.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(100.0 * (l.price_unit*l.product_qty*u.factor) / NULLIF(t.standard_price*l.product_qty*u.factor, 0.0))::decimal(16,2) 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...
47b85907f3d32851fb1afdfb7d1a3a3c578b695b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/47b85907f3d32851fb1afdfb7d1a3a3c578b695b/purchase_report.py
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
(sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty*u.factor),0.0))::decimal(16,2) as price_average
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...
47b85907f3d32851fb1afdfb7d1a3a3c578b695b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/47b85907f3d32851fb1afdfb7d1a3a3c578b695b/purchase_report.py
return result and result[0] or False return result
return ids and ids[0] or False return ids
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): if not limit: limit = 100 if isinstance(select, (str, int, long)): ids = [select] else: ids = select result = [] if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting...
4b86fafb0eca8dcc40c2cda9bc85cb6380d1ec22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4b86fafb0eca8dcc40c2cda9bc85cb6380d1ec22/crm_meeting.py
return res
return list(res)
def _models_field_get(self, cr, uid, field_key, field_value, context=None): get = attrgetter(field_key, field_value) obj = self.pool.get('ir.model.fields') ids = obj.search(cr, uid, [('view_load','=',1)], context=context) res = set() for o in obj.browse(cr, uid, ids, context=context): res.add(get(o)) return res
1a0f5847792d711b2989fdd5fa64b8352515a6d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a0f5847792d711b2989fdd5fa64b8352515a6d9/ir_property.py
class WriteToLogger(object): def __init__(self): self.logger = netsvc.Logger() def write(self, s): self.logger.notifyChannel('email_send', netsvc.LOG_DEBUG, s)
def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3'): """Send an email. Arguments: `email_from`: A string used to fill the `From` header, if falsy, config['email_from...
d90f632ad719a7c67e89b06113a15f5f0fb43699 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d90f632ad719a7c67e89b06113a15f5f0fb43699/misc.py
elif type == 'out_refund':
elif inv.type == 'out_refund':
def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
80da473c81276ef77c60b7ff4029e6f11e94c4d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/80da473c81276ef77c60b7ff4029e6f11e94c4d8/account_invoice_refund.py
objlst = obj.browse(cr, uid, ids, context=context)
objlst = obj.browse(cr, 1, ids, context=context)
def _fnct_read(self, obj, cr, uid, ids, field_name, args, context=None): self._field_get2(cr, uid, obj, context) if not ids: return {} relation = obj._name res = {}.fromkeys(ids, False)
37e218e36a2e23c900812a57949546859fe72601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/37e218e36a2e23c900812a57949546859fe72601/fields.py
ng = dict(obj.pool.get(self._obj).name_get(cr, uid, ids, context=context))
ng = dict(obj.pool.get(self._obj).name_get(cr, 1, ids, context=context))
def _fnct_read(self, obj, cr, uid, ids, field_name, args, context=None): self._field_get2(cr, uid, obj, context) if not ids: return {} relation = obj._name res = {}.fromkeys(ids, False)
37e218e36a2e23c900812a57949546859fe72601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/37e218e36a2e23c900812a57949546859fe72601/fields.py
self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_from)
def to_email(text): return re.findall(r'([^ ,<@]+@[^> ,]+)', text or '') emails = to_email(','.join(filter(None, emails))) email_froms = to_email(email_from) if email_froms: self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_froms[0])
def do_action(self, cr, uid, action, model_obj, obj, context=None): """ 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 diction...
3b13de26ae20c18b3c42064a8d0a54e73b129b31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b13de26ae20c18b3c42064a8d0a54e73b129b31/base_action_rule.py
def get_module_info(self, name):
@classmethod def get_module_info(cls, name):
def get_module_info(self, name): info = {} try: info = addons.load_information_from_description_file(name) if 'version' in info: info['version'] = release.major_version + '.' + info['version'] except Exception: self.__logger.debug('Error when trying to fetch informations for ' 'module %s', name, exc_info=True) return i...
5cd8b368b2b7c9f951d421f67fc3e84481ea61fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5cd8b368b2b7c9f951d421f67fc3e84481ea61fb/module.py
self.__logger.debug('Error when trying to fetch informations for '
cls.__logger.debug('Error when trying to fetch informations for '
def get_module_info(self, name): info = {} try: info = addons.load_information_from_description_file(name) if 'version' in info: info['version'] = release.major_version + '.' + info['version'] except Exception: self.__logger.debug('Error when trying to fetch informations for ' 'module %s', name, exc_info=True) return i...
5cd8b368b2b7c9f951d421f67fc3e84481ea61fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5cd8b368b2b7c9f951d421f67fc3e84481ea61fb/module.py
terp = self.get_module_info(module.name) try: self._check_external_dependencies(terp) except Exception, e: if newstate == 'to install': msg = _('Unable to install module "%s" because an external dependency is not met: %s') elif newstate == 'to upgrade': msg = _('Unable to upgrade module "%s" because an external depende...
self.check_external_dependencies(module.name, newstate)
def state_update(self, cr, uid, ids, newstate, states_to_update, context=None, level=100): if level<1: raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !')) demo = False for module in self.browse(cr, uid, ids): mdemo = False for dep in module.dependencies_id: if dep.state == 'unknown': raise ...
5cd8b368b2b7c9f951d421f67fc3e84481ea61fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5cd8b368b2b7c9f951d421f67fc3e84481ea61fb/module.py
def get_real_price(res_dict, product_id, pricelist):
def get_real_price(res_dict, product_id, qty, uom, pricelist):
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
product = product_obj.browse(cr, uid, product_id, context) product_tmpl_id = product.product_tmpl_id.id
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
return product_read[field_name]
factor = 1.0 if uom and uom != product.uom_id.id: product_uom_obj = self.pool.get('product.uom') uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id) factor = uom_data.factor return product_read[field_name] * factor
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
new_list_price = get_real_price(list_price, product.id, pricelist)
new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
def get_real_price(res_dict, product_id, pricelist):
def get_real_price(res_dict, product_id, qty, uom, pricelist):
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
product = product_obj.browse(cr, uid, product_id, context) product_tmpl_id = product.product_tmpl_id.id
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
return product_read[field_name]
factor = 1.0 if uom and uom != product.uom_id.id: product_uom_obj = self.pool.get('product.uom') uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id) factor = uom_data.factor return product_read[field_name] * factor
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
real_price = get_real_price(price_unit_res, product.id, pricelist)
real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
real_price = get_real_price(price_unit_res, product.id, pricelist)
real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
def get_real_price(res_dict, product_id, pricelist): item_obj = self.pool.get('product.pricelist.item') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price'
95124a4a3f5b4124e6d6fd7b365643e639e0c5f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95124a4a3f5b4124e6d6fd7b365643e639e0c5f7/product_visible_discount.py
p_obj = self.pool.get('product.product').browse(cr,uid,product_id).list_price
p_obj = self.pool.get('product.product').browse(cr,uid,[product_id])[0] uom_id=p_obj.uom_po_id.id
def price_by_product(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): if not product_id: return 0.0 if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\n' \ 'Please set one before choosing a product.')) p_obj = self.pool.get('product.produ...
6ac363ae0149da9ae401f50c3abeeefdc238815d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ac363ae0149da9ae401f50c3abeeefdc238815d/pos.py
[pricelist], product_id, qty or 1.0, partner_id)[pricelist] return price or p_obj
[pricelist], product_id, qty or 1.0, partner_id,{'uom': uom_id})[pricelist] if price is False: raise osv.except_osv(_('No valid pricelist line found !'), _("Couldn't find a pricelist line matching this product" \ " and quantity.\nYou have to change either the product," \ " the quantity or the pricelist.")) return pric...
def price_by_product(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): if not product_id: return 0.0 if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\n' \ 'Please set one before choosing a product.')) p_obj = self.pool.get('product.produ...
6ac363ae0149da9ae401f50c3abeeefdc238815d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ac363ae0149da9ae401f50c3abeeefdc238815d/pos.py
lang=self.pool.get('res.partner').read(cr, uid, partner_id)['lang']
lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang']
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False): if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\...
43ccf2f7743d55cd01acd4aba62fdb415e4b0fef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/43ccf2f7743d55cd01acd4aba62fdb415e4b0fef/purchase.py
'write_date': fields.datetime('Modifided Date', readonly=True), 'description': fields.text("description"),
'write_date': fields.datetime('Write Date', readonly=True), 'description': fields.text("Description"),
def import_cal(self, cr, uid, content, data_id=None, context=None): """ Import Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param data_id: Get Data’s ID or False @param context: A standard dictionary for contextual...
1734ffbe26bddea77eaa07d7aea2acb41414697a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1734ffbe26bddea77eaa07d7aea2acb41414697a/calendar.py
'fn': lambda *a: 'field',
'fn': 'field',
def create(self, cr, uid, vals, context=None): """ create calendar's line @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 the Values @param context: A standard dictionary for contextual values """
1734ffbe26bddea77eaa07d7aea2acb41414697a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1734ffbe26bddea77eaa07d7aea2acb41414697a/calendar.py
seconds = child.value.seconds days = child.value.days diff = (days * 86400) + seconds interval = 'days' related = 'before'
if isinstance(child.value, timedelta): seconds = child.value.seconds days = child.value.days diff = (days * 86400) + seconds interval = 'days' related = 'before' elif isinstance(child.value, datetime): raise NotImplementedError("we cannot parse absolute triggers")
def import_cal(self, cr, uid, ical_data, context=None): """ Import Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ical_data: Get calendar's Data @param context: A standard dictionary for contextual values """
1734ffbe26bddea77eaa07d7aea2acb41414697a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1734ffbe26bddea77eaa07d7aea2acb41414697a/calendar.py
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name] i+=1
if f.field_id.model: fields['field'+str(i)] = models[f.field_id.model][f.field_id.name] i+=1 else: fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
def fields_get(self, cr, user, fields=None, context=None): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_get(cr, user, fields, context) report = self.browse(cr, user, context['report_id']) models = {} for model in report.model_ids: models[model.model] = self.pool.get(model.mo...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name] i+=1
if f.field_id.model: fields['field'+str(i)] = models[f.field_id.model][f.field_id.name] i+=1 else: fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar) report = self.browse(cr, user, context['report_id']) models = {} for model ...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
arch += '<field name="%s" select="1"/>' % ('field'+str(i),) i+=1
if f.field_id.model: arch += '<field name="%s" select="1"/>' % ('field'+str(i),) i+=1 else: arch += '<field name="%s" select="1"/>' % ('column_count',)
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar) report = self.browse(cr, user, context['report_id']) models = {} for model ...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
set_dict[f.calendar_mode] = 'field'+str(i) i+=1
if f.field_id.model: field_cal = 'field'+str(i) i+=1 else: field_cal = 'column_count' set_dict[f.calendar_mode] = field_cal
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar) report = self.browse(cr, user, context['report_id']) models = {} for model ...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'field'+str(i)}) i+=1
if f.field_id.model: temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'field'+str(i)}) i+=1 else: temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'column_count'})
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar) report = self.browse(cr, user, context['report_id']) models = {} for model ...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
arch += '<field name="%s" select="1"/>' % ('field'+str(i),) i+=1
if f.field_id.model: arch += '<field name="%s" select="1"/>' % ('field'+str(i),) i+=1 else: arch += '<field name="%s" select="1"/>' % ('column_count',)
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False): if (not context) or 'report_id' not in context: return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar) report = self.browse(cr, user, context['report_id']) models = {} for model ...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
fields['field'+str(i)] = (f.field_id.model, f.field_id.name) i+=1
if f.field_id.model: fields['field'+str(i)] = (f.field_id.model, f.field_id.name) i+=1 else: fields['column_count'] = (False, 'Count')
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if (not context) or 'report_id' not in context: return super(report_creator, self).search(cr, user, args, offset, limit, order, context, count) report = self.browse(cr, user, context['report_id']) i = 0 fields = {} for f in r...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
res = self.pool.get(fields[a[0]][0])._where_calc(cr, user, [[fields[a[0]][1],a[1],a[2]]], active_test=False, context=context) newargs+=res[0] newargs2+=res[1]
if fields[a[0]][0]: res = self.pool.get(fields[a[0]][0])._where_calc(cr, user, [[fields[a[0]][1],a[1],a[2]]], active_test=False, context=context) newargs+=res[0] newargs2+=res[1] else: newargs += [("count(*) " + a[1] +" " + str(a[2]))]
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if (not context) or 'report_id' not in context: return super(report_creator, self).search(cr, user, args, offset, limit, order, context, count) report = self.browse(cr, user, context['report_id']) i = 0 fields = {} for f in r...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
groupby.append(t+'.'+f.field_id.name)
def _sql_query_get(self, cr, uid, ids, prop, unknow_none, context, where_plus=[], limit=None, offset=None): result = {} for obj in self.browse(cr, uid, ids): fields = [] groupby = [] i = 0 for f in obj.field_ids: t = self.pool.get(f.field_id.model_id.model)._table if f.group_method == 'group': fields.append('\t'+t+'.'+...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
def _sql_query_get(self, cr, uid, ids, prop, unknow_none, context, where_plus=[], limit=None, offset=None): result = {} for obj in self.browse(cr, uid, ids): fields = [] groupby = [] i = 0 for f in obj.field_ids: t = self.pool.get(f.field_id.model_id.model)._table if f.group_method == 'group': fields.append('\t'+t+'.'+...
17fa646423590f02430c3d746b50e74f26e40817 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/17fa646423590f02430c3d746b50e74f26e40817/base_report_creator.py
parser.add_option("--no-netrpc", dest="netrpc", action="store_false", default=True, help="disable netrpc") parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", default=True, help="disable xmlrpc")
parser.add_option("--no-netrpc", dest="netrpc", action="store_false", help="disable netrpc") parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", help="disable xmlrpc")
def __init__(self, fname=None): self.options = { 'email_from':False, 'interface': '', # this will bind the server to all interfaces 'port': 8069, 'netinterface': '', 'netport': 8070, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'ne...
6e90109b674a9488dde3eb471b0299546bd436a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e90109b674a9488dde3eb471b0299546bd436a3/config.py
return str(result)
return tools.ustr(result)
def merge(match): obj_pool = self.pool.get(action.model_id.model) id = context.get('active_id') obj = obj_pool.browse(cr, uid, id) exp = str(match.group()[2:-2]).strip() result = eval(exp, {'object':obj, 'context': context,'time':time}) if result in (None, False): return str("--------") return str(result)
03c74daf840952df3300367d343aa6946a949337 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03c74daf840952df3300367d343aa6946a949337/ir_actions.py
week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + (dt - ldt).hours
week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + ((dt - ldt).seconds/3600)
def create_xml(self, cr, uid, ids, datas, context=None): obj_emp = pooler.get_pool(cr.dbname).get('hr.employee') start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d') end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d') first_monday = start_date - relativedelta(days=start_date.date().we...
1f159ce453faeb8ff8fdec9ac78838734de6d7cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f159ce453faeb8ff8fdec9ac78838734de6d7cd/timesheet.py