rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
raise LookupError(_("Couldn't find previous ir.actions.todo")) | self.__logger.warn(_("Couldn't find previous ir.actions.todo")) return | def _set_previous_todo(self, cr, uid, state, context=None): """ lookup the previous (which is still the next at this point) ir.actions.todo, set it to whatever state was provided. | 89af2f0c8e1fe2b8154dbae862c824ad285d3663 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89af2f0c8e1fe2b8154dbae862c824ad285d3663/res_config.py |
if not len(XMLRPCRequestHandler.rpc_paths): XMLRPCRequestHandler.rpc_paths = map(lambda s: '/%s' % s, netsvc.ExportService._services.keys()) pass | self.rpc_paths = map(lambda s: '/%s' % s, netsvc.ExportService._services.keys()) | def setup(self): self.connection = dummyconn() if not len(XMLRPCRequestHandler.rpc_paths): XMLRPCRequestHandler.rpc_paths = map(lambda s: '/%s' % s, netsvc.ExportService._services.keys()) pass | 5f3939be3c61a895d961dda559d4793a9ca75dfb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5f3939be3c61a895d961dda559d4793a9ca75dfb/http_server.py |
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False | 9338fc0c4838de6da3f4e8b7897009ba230641b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9338fc0c4838de6da3f4e8b7897009ba230641b4/orm.py | ||
done = [] | def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False | 9338fc0c4838de6da3f4e8b7897009ba230641b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9338fc0c4838de6da3f4e8b7897009ba230641b4/orm.py | |
"AND (s.user_id IN %s) " %(tuple(so_line), tuple(so), company, tuple(users))) | "AND (s.user_id IN %s) " ,(tuple(so_line), tuple(so), company, tuple(users))) | def _sales_per_users(self, cr, uid, so, so_line, company, users): cr.execute("SELECT sum(sol.product_uom_qty) FROM sale_order_line AS sol LEFT JOIN sale_order AS s ON (s.id = sol.order_id) " \ "WHERE (sol.id IN %s) AND (s.state NOT IN (\'draft\',\'cancel\')) AND (s.id IN %s) AND (s.company_id=%s) " \ "AND (s.user_id IN... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
"AND (s.shop_id IN %s)" %(tuple(so_line), tuple(so), company, tuple(shops))) | "AND (s.shop_id IN %s)" ,(tuple(so_line), tuple(so), company, tuple(shops))) | def _sales_per_warehouse(self, cr, uid, so, so_line, company, shops): cr.execute("SELECT sum(sol.product_uom_qty) FROM sale_order_line AS sol LEFT JOIN sale_order AS s ON (s.id = sol.order_id) " \ "WHERE (sol.id IN %s) AND (s.state NOT IN (\'draft\',\'cancel\')) AND (s.id IN %s)AND (s.company_id=%s) " \ "AND (s.shop_id... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
dept_ids_set = ','.join(map(str,dept_ids)) cr.execute("SELECT user_id FROM hr_department_user_rel WHERE (department_id IN %s)" %(tuple(dept_ids_set),)) | cr.execute("SELECT user_id FROM hr_department_user_rel WHERE (department_id IN %s)" ,(tuple(dept_ids),)) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
so_period_ids = so_obj.search(cr, uid, [('date_order','>=',period.date_start), ('date_order','<=',period.date_stop)], context = context) | so_period_ids = so_obj.search(cr, uid, [('date_order','>=',period.date_start), ], context = context) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
so_period_set = ','.join(map(str,so_period_ids)) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py | |
sales[i][0] =self._sales_per_users(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, user_set) | sales[i][0] =self._sales_per_users(cr, uid, so_period_ids, so_line_product_ids, obj.company_id.id, user_set) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
sales[i][1]= self._sales_per_users(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, dept_users_set) | sales[i][1]= self._sales_per_users(cr, uid, so_period_ids, so_line_product_ids, obj.company_id.id, dept_users_set) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
sales[i][2]= self._sales_per_warehouse(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, shops_set) | sales[i][2]= self._sales_per_warehouse(cr, uid, so_period_ids, so_line_product_ids, obj.company_id.id, shops_set) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
sales[i][3]= self._sales_per_company(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, ) | sales[i][3]= self._sales_per_company(cr, uid, so_period_ids, so_line_product_ids, obj.company_id.id, ) | def calculate_sales_history(self, cr, uid, ids, context, *args): sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],] for obj in self.browse(cr, uid, ids): periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id so_obj = self.pool.get('... | bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc84ee95c63ab674a62ad477d7cffbaeb2eb2ddf/stock_planning.py |
'get_start_date': self.get_start_date, 'get_end_date': self.get_end_date | def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update({ 'time': time, 'lines': self.lines, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, 'ge... | c5b104951fb0bfaf14537e4a0b29222b415623b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5b104951fb0bfaf14537e4a0b29222b415623b3/central_journal.py | |
print 'Not Found', key | def write(self, cr, uid, ids, values, context=None): if not hasattr(ids, '__iter__'): ids = [ids] if ids == [uid]: for key in values.keys(): if not (key in self.SELF_WRITEABLE_FIELDS or key.startswith('context_')): print 'Not Found', key break else: if 'company_id' in values: if not (values['company_id'] in self.read(c... | 5ba8d704991309c2e60ba451e915322c8aa61694 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5ba8d704991309c2e60ba451e915322c8aa61694/res_user.py | |
if isinstance(ids, (str, int, long)): ids = [ids] data = super(ir_model, self).read(cr, uid, ids, fields=fields, \ | new_ids = isinstance(ids, (str, int, long)) and [ids] or ids data = super(ir_model, self).read(cr, uid, new_ids, fields=fields, \ | def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): """ Read IR Model @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 IR Model’s IDs. @param context: A standard dictionary for contex... | 08042b1fb3b1da1ab55a6f6f1888f7c452199cf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/08042b1fb3b1da1ab55a6f6f1888f7c452199cf1/base_calendar.py |
return data | return new_ids = isinstance(ids, (str, int, long)) and data[0] or data | def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): """ Read IR Model @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 IR Model’s IDs. @param context: A standard dictionary for contex... | 08042b1fb3b1da1ab55a6f6f1888f7c452199cf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/08042b1fb3b1da1ab55a6f6f1888f7c452199cf1/base_calendar.py |
def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | ||
def desperate_fixer(g): return ' ' html = re.sub('<.*?>', desperate_fixer, html) | html = re.sub('<.*?>', ' ', html) | def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
def _decode_header(self, s): | def _decode_header(self, text): | def _decode_header(self, s): from email.Header import decode_header s = decode_header(s.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
s = decode_header(s.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | if text: text = decode_header(text.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), text or [])) | def _decode_header(self, s): from email.Header import decode_header s = decode_header(s.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
try: id = self.rpc(self.model, 'create', data) self.rpc(self.model, 'history', [id], 'Receive', True, msg_to, message['body'], msg_from, False, {'model' : self.model}) except Exception, e: if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode: e = '\n\nThe Specified user does not have an access to the CRM ca... | values = { 'message_ids' : [ (0, 0, { 'model_id' : self.rpc('ir.model', 'search', [('name', '=', self.model)])[0], 'date' : time.strftime('%Y-%m-%d %H:%M:%S'), 'description' : message['body'], 'email_from' : msg_from, 'email_to' : msg_to, 'name' : 'Receive', 'history' : True, 'user_id' : self.rpc.user_id, } ) ] } threa... | def msg_new(self, msg): message = self.msg_body_get(msg) msg_subject = self._decode_header(msg['Subject']) msg_from = self._decode_header(msg['From']) msg_to = self._decode_header(msg['To']) msg_cc = self._decode_header(msg['Cc'] or '') data = { 'name': msg_subject, 'email_from': msg_from, 'email_cc': msg_cc, 'user_id... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
'res_id': id | 'res_id': oid | def msg_new(self, msg): message = self.msg_body_get(msg) msg_subject = self._decode_header(msg['Subject']) msg_from = self._decode_header(msg['From']) msg_to = self._decode_header(msg['To']) msg_cc = self._decode_header(msg['Cc'] or '') data = { 'name': msg_subject, 'email_from': msg_from, 'email_cc': msg_cc, 'user_id... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
return id | return (oid, thread_id,) | def msg_new(self, msg): message = self.msg_body_get(msg) msg_subject = self._decode_header(msg['Subject']) msg_from = self._decode_header(msg['From']) msg_to = self._decode_header(msg['To']) msg_cc = self._decode_header(msg['Cc'] or '') data = { 'name': msg_subject, 'email_from': msg_from, 'email_cc': msg_cc, 'user_id... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
message = {}; message['body'] = ''; message['attachment'] = {}; | message = { 'body' : '', 'attachment' : {}, } | def msg_body_get(self, msg): message = {}; message['body'] = ''; message['attachment'] = {}; attachment = message['attachment']; counter = 1; def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
def replace(match): return '' | def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | |
txt = re.sub("<(\w)>", replace, txt) txt = re.sub("<\/(\w)>", replace, txt) | txt = re.sub("<\/?(\w)>", '', txt) | def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
elif txt and part.get_content_subtype() == 'html': | elif txt and part.get_content_subtype() == 'html': | def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.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 replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
if filename : attachment[filename] = part.get_payload(decode=True); else: | if not filename : | def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
attachment[filename] = part.get_payload(decode=True); | attachment[filename] = part.get_payload(decode=True); | def replace(match): return '' | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), body['body'], self._decode_header(msg['From']), False, {'model' : self.model}) | self.create_message(id, msg['From'], msg['To'], 'Send', message['body']) | def msg_user(self, msg, id): body = self.msg_body_get(msg) | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
if not len(emails): | if not emails: | def msg_send(self, msg, emails, priority=None): if not len(emails): return False del msg['To'] msg['To'] = emails[0] if len(emails)>1: if 'Cc' in msg: del msg['Cc'] msg['Cc'] = ','.join(emails[1:]) del msg['Reply-To'] msg['Reply-To'] = self.email if priority: msg['X-Priority'] = priorities.get(priority, '3 (Normal)') s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
del msg['To'] | def msg_send(self, msg, emails, priority=None): if not len(emails): return False del msg['To'] msg['To'] = emails[0] if len(emails)>1: if 'Cc' in msg: del msg['Cc'] msg['Cc'] = ','.join(emails[1:]) del msg['Reply-To'] msg['Reply-To'] = self.email if priority: msg['X-Priority'] = priorities.get(priority, '3 (Normal)') s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | |
if len(emails)>1: if 'Cc' in msg: del msg['Cc'] | if len(emails) > 1: | def msg_send(self, msg, emails, priority=None): if not len(emails): return False del msg['To'] msg['To'] = emails[0] if len(emails)>1: if 'Cc' in msg: del msg['Cc'] msg['Cc'] = ','.join(emails[1:]) del msg['Reply-To'] msg['Reply-To'] = self.email if priority: msg['X-Priority'] = priorities.get(priority, '3 (Normal)') s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
del msg['Reply-To'] | def msg_send(self, msg, emails, priority=None): if not len(emails): return False del msg['To'] msg['To'] = emails[0] if len(emails)>1: if 'Cc' in msg: del msg['Cc'] msg['Cc'] = ','.join(emails[1:]) del msg['Reply-To'] msg['Reply-To'] = self.email if priority: msg['X-Priority'] = priorities.get(priority, '3 (Normal)') s... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | |
def msg_partner(self, msg, id): message = self.msg_body_get(msg) body = message['body'] act = 'case_open' self.rpc(self.model, act, [id]) #body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) #data = { # 'description':body, #} #self.rpc(self.model, 'write', [id], data) attachments = message['attachment... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | ||
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), message['body'], self._decode_header(msg['From']), False, {'model' : self.model}) | self.create_message(id, msg['From'], msg['To'], 'Send', message['body']) | def msg_partner(self, msg, id): message = self.msg_body_get(msg) body = message['body'] act = 'case_open' self.rpc(self.model, act, [id]) #body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) #data = { # 'description':body, #} #self.rpc(self.model, 'write', [id], data) attachments = message['attachment... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
emails = self.rpc(self.model, 'emails_get', int(case_str)) return (int(case_str), emails) | case_id = int(case_str) emails = self.rpc(self.model, 'emails_get', [case_id]) return (case_id, emails) | def msg_test(self, msg, case_str): if not case_str: return (False, False) emails = self.rpc(self.model, 'emails_get', int(case_str)) return (int(case_str), emails) | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
if emails[0] and self.email_get(emails[0])==self.email_get(self._decode_header(msg['From'])): | values = self.rpc(self.model, 'read', [case_id], ['thread_id']) if values: thread_id = values[0]['thread_id'][0] emails = emails[str(thread_id)] user_email = filter(None, emails['user_email'])[0] if user_email and self.email_get(user_email) == self.email_get(self._decode_header(msg['From'])): | def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
case_id = self.msg_new(msg) subject = self._decode_header(msg['subject']) if msg.get('Subject', ''): del msg['Subject'] msg['Subject'] = '['+str(case_id)+'] '+subject msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(case_id)+'@'+socket.gethostname()+'>' emails = self.rpc(self.model, 'emails_get', case_id) p... | case_id, thread_id = self.msg_new(msg) subject = self._decode_header(msg['Subject']) msg['Subject'] = "[%s] %s" % (case_id, subject,) msg['Message-Id'] = "<%s-openerpcrm-%s@%s>" % (time.time(), case_id, socket.gethostname(),) logging.info(" case: %r", case_id) logging.info(" thread: %r", thread_id) values = self.rp... | def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
del msg['Subject'] | def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | |
return case_id, emails | return case_id, thread_id, emails | def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py |
import sys, optparse | def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | |
def parse(self, msg): case_str = reference_re.search(msg.get('References', '')) if case_str: case_str = case_str.group(1) else: case_str = case_re.search(msg.get('Subject', '')) if case_str: case_str = case_str.group(1) (case_id, emails) = self.msg_test(msg, case_str) if case_id: if emails[0] and self.email_get(emails[... | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | ||
def create(self, cr, uid, vals, context=None): if (not vals.get('company_ids',[])): company_ids = self._get_companies(cr, uid, context=context) if company_ids and len(company_ids): vals['company_ids'] = [(6, 0, company_ids)] return super(users, self).create(cr, uid, vals, context=context) | def create(self, cr, uid, vals, context=None): if (not vals.get('company_ids',[])): company_ids = self._get_companies(cr, uid, context=context) if company_ids and len(company_ids): vals['company_ids'] = [(6, 0, company_ids)] return super(users, self).create(cr, uid, vals, context=context) | 236e74c3964942f354ae00f5bea0883b4842693e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e74c3964942f354ae00f5bea0883b4842693e/res_user.py | |
msg['Message-Id'] = "<%s-openobject-%s@%s>" % (time.time(), openobject_id, socket.gethostname()) | message['Message-Id'] = "<%s-openobject-%s@%s>" % (time.time(), openobject_id, socket.gethostname()) | def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True ... | 09e9462aae9d7f9df75e5426f279281adcbc8a53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/09e9462aae9d7f9df75e5426f279281adcbc8a53/misc.py |
msg.as_string()) | message.as_string()) | def _email_send(message, openobject_id=None, debug=False): """Low-level method to send directly a Message through the configured smtp server. :param message: an email.message.Message to send :param debug: True if messages should be output to stderr before being sent, and smtplib.SMTP put into debug mode. :return: True ... | 09e9462aae9d7f9df75e5426f279281adcbc8a53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/09e9462aae9d7f9df75e5426f279281adcbc8a53/misc.py |
'remaining_hours' : fields.float('Remaining Hours', digits=(16,2), help="Re-estimated time that will change the remaining hours of the task"), } | 'remaining_hours' : fields.float('Remaining Hours', digits=(16,2), help="Put here the remaining hours required to close the task."), } | def _get_remaining(self,cr, uid, ctx): task_obj = self.pool.get('project.task') if 'active_id' in ctx: return task_obj.browse(cr,uid,ctx['active_id'],context=ctx).remaining_hours return False | c3ccf9696856263ef2aa044e1a0c6b015c50fb2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c3ccf9696856263ef2aa044e1a0c6b015c50fb2b/project.py |
} | } | def _get_remaining(self,cr, uid, ctx): task_obj = self.pool.get('project.task') if 'active_id' in ctx: return task_obj.browse(cr,uid,ctx['active_id'],context=ctx).remaining_hours return False | c3ccf9696856263ef2aa044e1a0c6b015c50fb2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c3ccf9696856263ef2aa044e1a0c6b015c50fb2b/project.py |
amount = 0.0 | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
'amount':line.credit | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
'amount':line.debit | def onchange_partner_id(self, cr, uid, ids, partner_id, ttype, journal_id=False, context={}): """ Returns a dict that contains new values and context @param cr: A database cursor @param user: ID of the user currently logged in @param partner_id: latest value from user input for field partner_id @param args: other argu... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
'name':inv.name, | 'name':inv.name and inv.name or '/', | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py |
rec_ids = [] | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
rec_ids = [] | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
'name':line.name, | 'name':line.name and line.name or '/', | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py |
def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | ||
for move_line in line.move_id.line_id: if line.account_id.id == move_line.account_id.id: rec_ids += [move_line.id] | if line.move_line_id: rec_ids += [line.move_line_id.id] if rec_ids: cr.commit() move_line_pool.reconcile_partial(cr, uid, rec_ids) | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py |
'name':inv.tax_id.name, | 'name':name, | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py |
if rec_ids: move_line_pool.reconcile_partial(cr, uid, rec_ids) | def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.p... | bf6f28068a75d64e45c8c384f74b759fbd4ebf5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6f28068a75d64e45c8c384f74b759fbd4ebf5b/voucher.py | |
cr.execute(""" SELECT move.id FROM stock_picking pick RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s WHERE pick.id = %s""", ('done', move.picking_id.id)) res = cr.fetchall() if len(res) == len(move.picking_id.move_lines): picking_obj.action_move(cr, uid, [move.picking_id.id]) wf_service.t... | if move.picking_id.id : cr.execute(""" SELECT move.id FROM stock_picking pick RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s WHERE pick.id = %s""", ('done', move.picking_id.id)) res = cr.fetchall() if len(res) == len(move.picking_id.move_lines): picking_obj.action_move(cr, uid, [move.pick... | def do_partial(self, cr, uid, ids, partial_datas, context={}): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.pi... | 77fc796e7f50b245eee03d59571118913429c80c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/77fc796e7f50b245eee03d59571118913429c80c/stock.py |
def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = F... | 6fe87d7ea4f860425b7134018d1eba52ba789fe7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6fe87d7ea4f860425b7134018d1eba52ba789fe7/sale.py | ||
where id=%%d' % model_obj._table,(datas.id,)) | where id=%%s' % model_obj._table,(datas.id,)) | def do_alarm_unlink(self, cr, uid, ids, model, context=None): """ Delete alarm specified in ids @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of res alarm’s IDs. @param model: Model name for which alarm is to be cleared. @return: True """ i... | d5b94c8d65264b4aa437c2dc011ee8a6bae2ced1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5b94c8d65264b4aa437c2dc011ee8a6bae2ced1/base_calendar.py |
cr.execute('select id from %s where recurrent_uid=%s' % (self._table, event_id)) | cr.execute('select id from %s where recurrent_uid=%s' , (self._table, event_id)) | def unlink_events(self, cr, uid, ids, context=None): """ This function deletes event which are linked with the event with recurrent_uid (Removes the events which refers to the same UID value) """ if not context: context = {} for event_id in ids: cr.execute('select id from %s where recurrent_uid=%s' % (self._table, eve... | d5b94c8d65264b4aa437c2dc011ee8a6bae2ced1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5b94c8d65264b4aa437c2dc011ee8a6bae2ced1/base_calendar.py |
to_write.update({'email_cc' : case.email_cc or '' + ','.join(new_cc)}) | to_write.update({'email_cc' : ', '.join(new_cc) }) | def action_forward(self, cr, uid, ids, context=None): """ Forward the lead to a partner """ this = self.browse(cr, uid, ids[0], context=context) case_pool = self.pool.get(context.get('active_model')) res_id = context and context.get('active_id', False) or False case = case_pool.browse(cr, uid, res_id, context=context) | bdef8968eef5e8b2cc6951f91115f5cac1140ba0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdef8968eef5e8b2cc6951f91115f5cac1140ba0/crm_forward_to_partner.py |
self.log(cr, user, id, message) return super(stock_picking, self).create(cr, user, vals, context) | self.log(cr, user, new_id, message) return new_id | def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): vals['name'] = self.pool.get('ir.sequence').get(cr, user, 'stock.picking') type_list = { 'out':_('Packing List'), 'in':_('Reception'), 'internal': _('Internal picking'), 'delivery': _('Delivery order') } if not vals.get(... | d29cc529804edcdbdd6babe358327ff781738ac0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d29cc529804edcdbdd6babe358327ff781738ac0/stock.py |
res_user=self.pool.get('res.users').browse(cr,uid,uid) | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') wf_service = netsvc.LocalService("workflow") | cae8860346af6b4598b807f36782ed61c41ffbaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cae8860346af6b4598b807f36782ed61c41ffbaf/mrp_pull.py | |
'company_id': line.company_id and line.company_id.id or False, | 'company_id': res_user.company_id and res_user.company_id.id or False, | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') wf_service = netsvc.LocalService("workflow") | cae8860346af6b4598b807f36782ed61c41ffbaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cae8860346af6b4598b807f36782ed61c41ffbaf/mrp_pull.py |
'company_id': line.company_id and line.company_id.id or False, | 'company_id': res_user.company_id and res_user.company_id.id or False, | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') wf_service = netsvc.LocalService("workflow") | cae8860346af6b4598b807f36782ed61c41ffbaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cae8860346af6b4598b807f36782ed61c41ffbaf/mrp_pull.py |
'company_id': line.company_id and line.company_id.id or False, | 'company_id': res_user.company_id and res_user.company_id.id or False, | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') wf_service = netsvc.LocalService("workflow") | cae8860346af6b4598b807f36782ed61c41ffbaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cae8860346af6b4598b807f36782ed61c41ffbaf/mrp_pull.py |
message = _('Invoice ') + " '" + inv.name + "' "+ _("is confirm") self.log(cr, uid, inv.id, message) | def action_move_create(self, cr, uid, ids, *args): """Creates invoice related analytics and financial move lines""" ait_obj = self.pool.get('account.invoice.tax') cur_obj = self.pool.get('res.currency') context = {} for inv in self.browse(cr, uid, ids): if not inv.journal_id.invoice_sequence_id: raise osv.except_osv(_(... | 0f74edc455e7ed12e4c98a6c9311e91290b9ef70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f74edc455e7ed12e4c98a6c9311e91290b9ef70/invoice.py | |
cr.execute('SELECT id, type, number, move_id, reference ' \ 'FROM account_invoice ' \ 'WHERE id IN %s', (tuple(ids),)) obj_inv = self.browse(cr, uid, ids)[0] for (id, invtype, number, move_id, reference) in cr.fetchall(): | for obj_inv in self.browse(cr, uid, ids): id = obj_inv.id invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False reference = obj_inv.reference | def action_number(self, cr, uid, ids, *args): cr.execute('SELECT id, type, number, move_id, reference ' \ 'FROM account_invoice ' \ 'WHERE id IN %s', (tuple(ids),)) obj_inv = self.browse(cr, uid, ids)[0] for (id, invtype, number, move_id, reference) in cr.fetchall(): if not number: if obj_inv.journal_id.invoice_sequenc... | 0f74edc455e7ed12e4c98a6c9311e91290b9ef70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f74edc455e7ed12e4c98a6c9311e91290b9ef70/invoice.py |
tools.pdf_utils.fill_pdf(tools.config['addons_path']+'/l10n_lu/wizard/2008_DECL_F_M10.pdf', '/tmp/output.pdf', result) | tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), '/tmp/output.pdf', result) | def create(self, cr, uid, ids, datas, context=None): | 7f5e2da3d42fcb90bd765ad2042cb6c21b992772 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f5e2da3d42fcb90bd765ad2042cb6c21b992772/print_vat.py |
def print_vat_declaration_report(self, cr, uid, ids, context=None): active_ids = context.get('active_ids',[]) data = {} data['form'] = {} data['ids'] = active_ids data['form']['tax_code_id'] = self.browse(cr, uid, ids)[0].tax_code_id.id data['form']['period_id'] = self.browse(cr, uid, ids)[0].period_id.id return { 'typ... | 7f5e2da3d42fcb90bd765ad2042cb6c21b992772 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f5e2da3d42fcb90bd765ad2042cb6c21b992772/print_vat.py | ||
count(*) as nbr, sum(planned_revenue) as amount_revenue, sum(planned_cost) as amount_costs, sum(planned_revenue*probability/100)::decimal(16,2) as amount_revenue_prob, avg(probability)::decimal(16,2) as probability, | count(*) as nbr, | def init(self, cr): tools.drop_view_if_exists(cr, 'project_issue_report') cr.execute(""" create or replace view project_issue_report as ( select min(c.id) as id, to_char(c.create_date, 'YYYY') as name, to_char(c.create_date, 'MM') as month, c.state, c.user_id, c.section_id, c.categ_id, c.stage_id, to_char(c.date_closed... | 415d714484c5d54d1cc8079746452135bb06741b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/415d714484c5d54d1cc8079746452135bb06741b/project_issue_report.py |
function, values = node.items()[0] | function, params = node.items()[0] | def process_function(self, node): function, values = node.items()[0] if self.isnoupdate(function) and self.mode != 'init': return context = self.get_context(function, self.eval_context) args = [] if function.eval: args = eval(function.eval, self.eval_context) for value in values: if not 'model' in value and (not 'eval'... | 60cd823fa36df6749813124441c9c36d3eb493a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60cd823fa36df6749813124441c9c36d3eb493a7/yaml_import.py |
for value in values: if not 'model' in value and (not 'eval' in value or not 'search' in value): raise YamlImportException('You must provide a "model" and an "eval" or "search" to evaluate.') value_model = self.get_model(value['model']) local_context = {'obj': lambda x: value_model.browse(self.cr, self.uid, x, context=... | for i, param in enumerate(params): if 'model' in param: param_model = self.get_model(param['model']) else: param_model = model if 'search' in param: q = eval(param['search'], self.eval_context) ids = param_model.search(cr, uid, q) value = self._get_first_result(ids) elif 'eval' in param: local_context = {'obj': lambda ... | def process_function(self, node): function, values = node.items()[0] if self.isnoupdate(function) and self.mode != 'init': return context = self.get_context(function, self.eval_context) args = [] if function.eval: args = eval(function.eval, self.eval_context) for value in values: if not 'model' in value and (not 'eval'... | 60cd823fa36df6749813124441c9c36d3eb493a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60cd823fa36df6749813124441c9c36d3eb493a7/yaml_import.py |
_inherits = {'res.alarm': "alarm_id"} | _inherit = 'res.alarm' | def do_alarm_unlink(self, cr, uid, ids, model, context={}): alarm_obj = self.pool.get('calendar.alarm') ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] model_obj = self.pool.get(model) for datas in model_obj.browse(cr, uid, ids): alarm_ids = alarm_obj.search(cr, uid, [('... | 1011c0fffa29564de054c4e0235c2e6b107e1fa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1011c0fffa29564de054c4e0235c2e6b107e1fa2/caldav.py |
if vals.has_key('alarm_id'): | if vals.has_key('alarm_id') or vals.has_key('caldav_alarm_id'): | def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids new_ids = [] for id in select: id = caldav_id2real_id(id) if not id in new_ids: new_ids.append(id) res = super(calendar_event, self).write(cr, uid, new_ids, vals, con... | 1011c0fffa29564de054c4e0235c2e6b107e1fa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1011c0fffa29564de054c4e0235c2e6b107e1fa2/caldav.py |
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date') | context.update({'alarm_id': vals.get('alarm_id')}) alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date', context=context) | def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids new_ids = [] for id in select: id = caldav_id2real_id(id) if not id in new_ids: new_ids.append(id) res = super(calendar_event, self).write(cr, uid, new_ids, vals, con... | 1011c0fffa29564de054c4e0235c2e6b107e1fa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1011c0fffa29564de054c4e0235c2e6b107e1fa2/caldav.py |
r['amount'] = round(r['balance'] * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')) - total | r['amount'] = round(r.get('balance', 0.0) * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')) - total | def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): """ Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. | 0a97edf8b3606179c15bdc49d6bfbbf186d33dc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a97edf8b3606179c15bdc49d6bfbbf186d33dc3/account.py |
r['amount'] = round(r['amount'] * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')) | r['amount'] = round(r.get('amount', 0.0) * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')) | def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): """ Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. | 0a97edf8b3606179c15bdc49d6bfbbf186d33dc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a97edf8b3606179c15bdc49d6bfbbf186d33dc3/account.py |
response_re = response_re = re.compile("Are you coming\?.*\n*.*(YES|NO|MAYBE).*", re.UNICODE) | response_re = re.compile("Are you coming\?.*\n*.*(YES|NO|MAYBE).*", re.UNICODE) | def _lang_get(self, cr, uid, context={}): obj = self.pool.get('res.lang') ids = obj.search(cr, uid, []) res = obj.read(cr, uid, ids, ['code', 'name'], context) res = [((r['code']).replace('_', '-'), r['name']) for r in res] return res | 7444a76e9711d5729a6a68f6fa8ebaf327779891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7444a76e9711d5729a6a68f6fa8ebaf327779891/base_calendar.py |
if journal.type in journal_type and not journal.invoice_sequence_id: res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))]) inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id inv_seq_id res.update({ 'invoice_sequence_id':inv_seq_id }) | def create_sequence(self, cr, uid, ids, context={}): """ Create new entry sequence for every new Joural @param cr: cursor to database @param user: id of current user @param ids: list of record ids to be process @param context: context arguments, like lang, time zone @return: return a result """ | 684a10886e660577d2faa16ef1d6be7544bc0335 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/684a10886e660577d2faa16ef1d6be7544bc0335/account.py | |
invoice = context.get('invoice') | invoice = context.get('invoice', False) | def post(self, cr, uid, ids, context=None): invoice = context.get('invoice') if self.validate(cr, uid, ids, context) and len(ids): for move in self.browse(cr, uid, ids): if move.name =='/': new_name = False journal = move.journal_id if invoice.internal_number: new_name = invoice.internal_number else: if journal.sequen... | 684a10886e660577d2faa16ef1d6be7544bc0335 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/684a10886e660577d2faa16ef1d6be7544bc0335/account.py |
if invoice.internal_number: | if invoice and invoice.internal_number: | def post(self, cr, uid, ids, context=None): invoice = context.get('invoice') if self.validate(cr, uid, ids, context) and len(ids): for move in self.browse(cr, uid, ids): if move.name =='/': new_name = False journal = move.journal_id if invoice.internal_number: new_name = invoice.internal_number else: if journal.sequen... | 684a10886e660577d2faa16ef1d6be7544bc0335 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/684a10886e660577d2faa16ef1d6be7544bc0335/account.py |
elif method in ['get_available_updates', 'get_migration_scripts', 'set_loglevel', 'get_os_time']: | elif method in ['get_available_updates', 'get_migration_scripts', 'set_loglevel', 'get_os_time', 'get_sqlcount']: | def dispatch(self, method, auth, params): logger = netsvc.Logger() if method in [ 'ir_set','ir_del', 'ir_get' ]: return self.common_dispatch(method,auth,params) if method == 'login': # At this old dispatcher, we do NOT update the auth proxy res = security.login(params[0], params[1], params[2]) msg = res and 'successful... | 1f380f050417c247e40f2f29d14d6c1fbd80360e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f380f050417c247e40f2f29d14d6c1fbd80360e/web_services.py |
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True) | 'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True, required=True) | def _get_order(self, cr, uid, ids, context=None): if context is None: context = {} result = {} for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True return result.keys() | e96c7220fbbece8cdff118cf5321fd35792de3e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e96c7220fbbece8cdff118cf5321fd35792de3e1/sale.py |
self._logger.debug('"%s" %s %s', | self._logger.log(netsvc.logging.DEBUG_RPC, '"%s" %s %s', | def log_request(self, code='-', size='-'): self._logger.debug('"%s" %s %s', self.requestline, str(code), str(size)) | 0ee47f021c9e8ee4dd61b0b3df9c58d9bdfc29c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ee47f021c9e8ee4dd61b0b3df9c58d9bdfc29c8/http_server.py |
class StaticHTTPHandler(HttpLogHandler, HTTPHandler): | class StaticHTTPHandler(HttpLogHandler, FixSendError, HTTPHandler): | def init_xmlrpc(): if tools.config.get('xmlrpc', False): # Example of http file serving: # reg_http_service(HTTPDir('/test/',HTTPHandler)) reg_http_service(HTTPDir('/xmlrpc/', XMLRPCRequestHandler)) logging.getLogger("web-services").info("Registered XML-RPC over HTTP") if tools.config.get('xmlrpcs', False): reg_http_s... | 59efa51612d8f85fab2ad503080b353fe4930bde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/59efa51612d8f85fab2ad503080b353fe4930bde/http_server.py |
import base64 | def _image(self, node): import urllib from reportlab.lib.utils import ImageReader if not node.get('file') : if node.get('name'): image_data = self.images[node.get('name')] s = cStringIO.StringIO(image_data) else: import base64 if self.localcontext: res = utils._regex.findall(node.text) for key in res: newtext = eval(ke... | 6e3c34ddd5717bef2d81b2348d2310bc60425889 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e3c34ddd5717bef2d81b2348d2310bc60425889/trml2pdf.py | |
res = utils._regex.findall(node.text) for key in res: newtext = eval(key, {}, self.localcontext) node.text = newtext image_data = base64.decodestring(node.text) if not image_data: return False s = cStringIO.StringIO(image_data) | res = utils._regex.findall(node.text) for key in res: newtext = eval(key, {}, self.localcontext) node.text = newtext image_data = None if node.text: image_data = base64.decodestring(node.text) if image_data: s = cStringIO.StringIO(image_data) else: return False | def _image(self, node): import urllib from reportlab.lib.utils import ImageReader if not node.get('file') : if node.get('name'): image_data = self.images[node.get('name')] s = cStringIO.StringIO(image_data) else: import base64 if self.localcontext: res = utils._regex.findall(node.text) for key in res: newtext = eval(ke... | 6e3c34ddd5717bef2d81b2348d2310bc60425889 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e3c34ddd5717bef2d81b2348d2310bc60425889/trml2pdf.py |
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor)*count(l.product_id))::decimal(16,2) as price_average, | (sum(l.product_uom_qty*l.price_unit)/sum(nullif(l.product_uom_qty * u.factor,0))*count(l.product_id))::decimal(16,2) as price_average, | def init(self, cr): tools.drop_view_if_exists(cr, 'sale_report') cr.execute(""" create or replace view sale_report as ( select el.*, -- (select count(1) from sale_order_line where order_id = s.id) as nbr, (select 1) as nbr, s.date_order as date, s.date_confirm as date_confirm, to_char(s.date_order, 'YYYY') as year, to_... | dc8fef96db0a0891a6217549883889f273b00dd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dc8fef96db0a0891a6217549883889f273b00dd4/sale_report.py |
account_id = False | def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res | 0ff1aecac1373f7324c3f2f5212cfb5654cdce8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ff1aecac1373f7324c3f2f5212cfb5654cdce8d/account_bank_statement.py | |
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} if 'date' in vals: new_vals = {} obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview') current_record = self.browse(cr, uid, ids, context=context)[0] survey_requests = current_record.survey_request_ids new_vals.update({'date... | def button_cancel(self, cr, uid, ids, context=None): if context is None: context = {} self.write(cr, uid, ids,{'state':'cancel'}, context=context) return True | bee7aabb044619af2af858a03fcce88ae24a873b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bee7aabb044619af2af858a03fcce88ae24a873b/hr_evaluation.py | |
'code': wc.code | 'ref': wc.code, 'product_id': wc.product_id.id, 'unit_amount': wc.costs_hour * wc.time_cycle, 'product_uom_id': wc.product_id.uom_id.id | 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_... | b25062ed300bbc94a7fc21332672d685e1e0cda0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b25062ed300bbc94a7fc21332672d685e1e0cda0/mrp.py |
'code': wc.code, | 'ref': wc.code, 'product_id': wc.product_id.id, 'unit_amount': wc.costs_hour * wc.time_cycle, 'product_uom_id': wc.product_id.uom_id.id | 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_... | b25062ed300bbc94a7fc21332672d685e1e0cda0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b25062ed300bbc94a7fc21332672d685e1e0cda0/mrp.py |
def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} | def _current_rate(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} res = {} | def _current_rate(self, cr, uid, ids, name, arg, context={}): res={} if 'date' in context: date=context['date'] else: date=time.strftime('%Y-%m-%d') date= date or time.strftime('%Y-%m-%d') for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s ORDER BY name desc... | 36b0157f8b336cf9d43a953525eed60e7d679f75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b0157f8b336cf9d43a953525eed60e7d679f75/res_currency.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.