rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
id = self.pool.get('ir.model.data')._update_dummy(self.cr, self.uid, record.model, self.module, record.id)
id = self.pool.get('ir.model.data')._update_dummy(self.cr, 1, record.model, self.module, record.id)
def process_record(self, node): import osv record, fields = node.items()[0] model = self.get_model(record.model) if isinstance(model, osv.osv.osv_memory): record_dict=self.create_osv_memory_record(record, fields) else: self.validate_xml_id(record.id) if self.isnoupdate(record) and self.mode != 'init': id = self.pool.ge...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \
id = self.pool.get('ir.model.data')._update(self.cr, 1, record.model, \
def process_record(self, node): import osv record, fields = node.items()[0] model = self.get_model(record.model) if isinstance(model, osv.osv.osv_memory): record_dict=self.create_osv_memory_record(record, fields) else: self.validate_xml_id(record.id) if self.isnoupdate(record) and self.mode != 'init': id = self.pool.ge...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
pid = self.pool.get('ir.model.data')._update(self.cr, self.uid, \
pid = self.pool.get('ir.model.data')._update(self.cr, 1, \
def process_menuitem(self, node): self.validate_xml_id(node.id)
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', \
self.pool.get('ir.model.data').ir_set(self.cr, 1, 'action', \
def process_menuitem(self, node): self.validate_xml_id(node.id)
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
id = self.pool.get('ir.model.data')._update(self.cr, self.uid, \
id = self.pool.get('ir.model.data')._update(self.cr, 1, \
def process_act_window(self, node): assert getattr(node, 'id'), "Attribute %s of act_window is empty !" % ('id',) assert getattr(node, 'name'), "Attribute %s of act_window is empty !" % ('name',) assert getattr(node, 'res_model'), "Attribute %s of act_window is empty !" % ('res_model',) self.validate_xml_id(node.id) vi...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', keyword, \
self.pool.get('ir.model.data').ir_set(self.cr, 1, 'action', keyword, \
def process_act_window(self, node): assert getattr(node, 'id'), "Attribute %s of act_window is empty !" % ('id',) assert getattr(node, 'name'), "Attribute %s of act_window is empty !" % ('name',) assert getattr(node, 'res_model'), "Attribute %s of act_window is empty !" % ('res_model',) self.validate_xml_id(node.id) vi...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids)
self.pool.get('ir.model.data')._unlink(self.cr, 1, node.model, ids)
def process_delete(self, node): assert getattr(node, 'model'), "Attribute %s of delete tag is empty !" % ('model',) if self.pool.get(node.model): if len(node.search): ids = self.pool.get(node.model).search(self.cr, self.uid, eval(node.search, self.eval_context)) else: ids = [self.get_id(node.id)] if len(ids): self.pool...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
id = self.pool.get('ir.model.data')._update(self.cr, self.uid, \
id = self.pool.get('ir.model.data')._update(self.cr, 1, \
def process_url(self, node): self.validate_xml_id(node.id)
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', \
self.pool.get('ir.model.data').ir_set(self.cr, 1, 'action', \
def process_url(self, node): self.validate_xml_id(node.id)
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, res['key'], res['key2'], \
self.pool.get('ir.model.data').ir_set(self.cr, 1, res['key'], res['key2'], \
def process_ir_set(self, node): if not self.mode == 'init': return False _, fields = node.items()[0] res = {} for fieldname, expression in fields.items(): if is_eval(expression): value = eval(expression.expression, self.eval_context) else: value = expression res[fieldname] = value self.pool.get('ir.model.data').ir_set(...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
id = self.pool.get('ir.model.data')._update(self.cr, self.uid, "ir.actions.report.xml", \
id = self.pool.get('ir.model.data')._update(self.cr, 1, "ir.actions.report.xml", \
def process_report(self, node): values = {} for dest, f in (('name','string'), ('model','model'), ('report_name','name')): values[dest] = getattr(node, f) assert values[dest], "Attribute %s of report is empty !" % (f,) for field,dest in (('rml','report_rml'),('file','report_rml'),('xml','report_xml'),('xsl','report_xsl...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', \
self.pool.get('ir.model.data').ir_set(self.cr, 1, 'action', \
def process_report(self, node): values = {} for dest, f in (('name','string'), ('model','model'), ('report_name','name')): values[dest] = getattr(node, f) assert values[dest], "Attribute %s of report is empty !" % (f,) for field,dest in (('rml','report_rml'),('file','report_rml'),('xml','report_xml'),('xsl','report_xsl...
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
'scrum_master_id': fields.many2one('res.users', 'Scrum Manager', required=True,help="The person who is maintains the processes for the product"),
'scrum_master_id': fields.many2one('res.users', 'Scrum Master', required=True,help="The person who is maintains the processes for the product"),
def button_pending(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'pending'}, context=context) return True
5bf12997cc5ad8729d0db465469e2a839b4e920d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bf12997cc5ad8729d0db465469e2a839b4e920d/scrum.py
self.email_send(cr, uid, ids, email)
self.email_send(cr, uid, ids, meeting_id.sprint_id.scrum_master_id.user_email)
def button_send_to_master(self, cr, uid, ids, context=None): meeting_id = self.browse(cr, uid, ids)[0] user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email: self.email_send(cr, uid, ids, email) else: raise osv.except_osv(_('Error !'), ...
5bf12997cc5ad8729d0db465469e2a839b4e920d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bf12997cc5ad8729d0db465469e2a839b4e920d/scrum.py
self.email_send(cr,uid,ids,email)
self.email_send(cr,uid,ids,meeting_id.sprint_id.product_owner_id.user_email)
def button_send_product_owner(self, cr, uid, ids, context=None): meeting_id = self.browse(cr, uid, ids)[0] if meeting_id.sprint_id.product_owner_id.user_email: self.email_send(cr,uid,ids,email) else: raise osv.except_osv(_('Error !'), _('Please provide email address for product owner defined on sprint.')) return True
5bf12997cc5ad8729d0db465469e2a839b4e920d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5bf12997cc5ad8729d0db465469e2a839b4e920d/scrum.py
"packages": ["lxml", "lxml.builder", "lxml._elementpath", "lxml.etree", "lxml.objectify", "decimal", "xml", "encodings", "dateutil", "wizard", "pychart", "PIL", "pyparsing", "pydot", "asyncore","asynchat", "reportlab", "vobject", "HTMLParser", "select", "yaml"],
"packages": [ "lxml", "lxml.builder", "lxml._elementpath", "lxml.etree", "lxml.objectify", "decimal", "xml", "xml", "xml.dom", "xml.xpath", "encodings", "dateutil", "wizard", "pychart", "PIL", "pyparsing", "pydot", "asyncore","asynchat", "reportlab", "vobject", "HTMLParser", "select", "libxslt", "libxml2", "mako", "pop...
def run(self): # create startup script start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-server.py $@\n"\ % (join(self.install_libbase, "openerp-server"), sys.executable) # write script f = open('openerp-server', 'w') f.write(start_script) f.close() install.run(self)
b027ff80a6a09a77e8369d403f11975b30ae02a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b027ff80a6a09a77e8369d403f11975b30ae02a0/setup.py
def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency=False, company_currency=False, context=None): data={}
d23c2d51da254ac274567667da433c0618100ad2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d23c2d51da254ac274567667da433c0618100ad2/account_payment.py
DROP LANGUAGE IF EXISTS plpgsql CASCADE; CREATE LANGUAGE plpgsql ;
def execute(self, cr, uid, ids, context=None): """ This function is used to create contact and address from existing partner address """ obj = self.pool.get("base.contact.installer").browse(cr, uid, uid, context=context) if obj.migrate: cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact; DROP LANGU...
e34a35cc42119a04bfcc48e9f7bbaf6311a62ce9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e34a35cc42119a04bfcc48e9f7bbaf6311a62ce9/base_contact_installer.py
cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;")
def execute(self, cr, uid, ids, context=None): """ This function is used to create contact and address from existing partner address """ obj = self.pool.get("base.contact.installer").browse(cr, uid, uid, context=context) if obj.migrate: cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact; DROP LANGU...
e34a35cc42119a04bfcc48e9f7bbaf6311a62ce9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e34a35cc42119a04bfcc48e9f7bbaf6311a62ce9/base_contact_installer.py
return int(self.pool.get('ir.model.data').read(cr, self.uid, [result], ['res_id'])[0]['res_id'])
res = self.pool.get('ir.model.data').read(cr, self.uid, [result], ['res_id']) if res and res[0] and res[0]['res_id']: return int(res[0]['res_id']) return False
def id_get(self, cr, model, id_str): if id_str in self.idref: return self.idref[id_str] mod = self.module if '.' in id_str: mod,id_str = id_str.split('.') result = self.pool.get('ir.model.data')._get_id(cr, self.uid, mod, id_str) return int(self.pool.get('ir.model.data').read(cr, self.uid, [result], ['res_id'])[0]['res...
8898d430e200bec46aa1dbbda4974fd74ca1bd4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8898d430e200bec46aa1dbbda4974fd74ca1bd4f/convert.py
'work_phone': fields.related('address_id', 'phone', type='char', size=32, string='Work Phone', readonly=True), 'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'),
'work_phone': fields.char('Work Phone', size=32, readonly=False), 'work_email': fields.char('Work E-mail', size=240),
def job_open(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'open'}) return True
c3aaa57d4f13d396e89d613db958cf6d489c7268 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c3aaa57d4f13d396e89d613db958cf6d489c7268/hr.py
first_monday = start_date - relativedelta(days=start_date.day_of_week) last_monday = end_date + relativedelta(days=7 - end_date.day_of_week)
first_monday = start_date - relativedelta(days=start_date.date().weekday()) last_monday = end_date + relativedelta(days=7 - end_date.date().weekday())
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.day_of_we...
209c2f59c88aaf9271a9834c7e1e31f6b83bd102 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/209c2f59c88aaf9271a9834c7e1e31f6b83bd102/timesheet.py
week_wh[ldt.day_of_week] = week_wh.get(ldt.day_of_week, 0) + (dt - ldt).hours
week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + (dt - ldt).hours
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.day_of_we...
209c2f59c88aaf9271a9834c7e1e31f6b83bd102 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/209c2f59c88aaf9271a9834c7e1e31f6b83bd102/timesheet.py
xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
if not to_currency_id: to_currency_id = from_currency_id xc = self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False): if not from_currency_id: from_currency_id = to_currency_id xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context) from_currency = (xc[0].id == from_currency_id and ...
941cb819cd49c5350ccca47d982d9f4fe103d08e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/941cb819cd49c5350ccca47d982d9f4fe103d08e/res_currency.py
if 'company_id' in vals: move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) if move_lines: raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
if context is None: context = {} for journal in self.browse(cr, uid, ids, context=context): if 'company_id' in vals and journal.company_id.id != vals['company_id']: move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) if move_lines: raise osv.except_osv(_('Warning !'), _('You can...
def write(self, cr, uid, ids, vals, context=None): if 'company_id' in vals: move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) if move_lines: raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines')) return s...
48d4d8b4a32c8e464795858cab22500e1e51a05c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/48d4d8b4a32c8e464795858cab22500e1e51a05c/account.py
view_id = type_map.get(type, 'general')
view_id = type_map.get(type, 'account_journal_view')
def onchange_type(self, cr, uid, ids, type, currency): obj_data = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users')
48d4d8b4a32c8e464795858cab22500e1e51a05c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/48d4d8b4a32c8e464795858cab22500e1e51a05c/account.py
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...
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
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...
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
if self.has_ssl: group.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not')
group.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not')
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...
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
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...
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout',
'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout','smtp_ssl',
def die(cond, msg): if cond: print msg sys.exit(1)
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
keys.extend(['smtp_ssl', 'secure_cert_file', 'secure_pkey_file'])
keys.extend(['secure_cert_file', 'secure_pkey_file'])
def die(cond, msg): if cond: print msg sys.exit(1)
b90cc7e852c4aba6be5602a8bd5746ddd4969554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b90cc7e852c4aba6be5602a8bd5746ddd4969554/config.py
ids = prop.search(cr, uid, domain, order='company_id', context=context)
ids = prop.search(cr, uid, domain, context=context)
def _get_defaults(self, obj, cr, uid, prop_name, context=None): prop = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name), ('res_id','=',False)] ids = prop.search(cr, uid, domain, order='company_id', context=context) replaces = {} default_value = {}.fromkeys(pro...
31efd060f4ad81cb5106942a0bfd02a76265b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/31efd060f4ad81cb5106942a0bfd02a76265b531/fields.py
cr.execute('SELECT min(%s.id) AS id, count(%s.id) AS %s_count, ' % (self._table, self._table, group_count) + flist + ' FROM ' + from_clause + where_clause + gb + limit_str + offset_str, where_clause_params)
cr.execute('SELECT min(%s.id) AS id, count(%s.id) AS %s_count' % (self._table, self._table, group_count) + (flist and ',') + flist + ' FROM ' + from_clause + where_clause + gb + limit_str + offset_str, where_clause_params)
assert groupby_def and groupby_def._classic_write, "Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True"
1ba2ff569f11aa08185a42d2faae91ae8c290b05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1ba2ff569f11aa08185a42d2faae91ae8c290b05/orm.py
'partner_id': fields.related('address_id','partner_id',type='many2one',relation='res.partner',string='Partner'),
'partner_id': fields.related('address_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True),
def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): seq_obj_name = 'stock.picking.' + vals['type'] vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) new_id = super(stock_picking, self).create(cr, user, vals, context) return new_id
4d30bd409f8ae21c8616ab5eff2173a86a1989d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d30bd409f8ae21c8616ab5eff2173a86a1989d7/stock.py
def action_invoice_create(self, cr, uid, ids, journal_id=False, group=False, type='out_invoice', context=None): """ Creates invoice based on the invoice state selected for picking. @param journal_id: Id of journal @param group: Whether to create a group invoice or not @param type: Type invoice to be created @return: Id...
4d30bd409f8ae21c8616ab5eff2173a86a1989d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d30bd409f8ae21c8616ab5eff2173a86a1989d7/stock.py
if args is None:
if not len(args):
def name_search(self, cr, user, name, args=None, operator='ilike', context={}): if args is None: args = [] ids = [] if name: ids = self.search(cr, user, [('obj_num','=',int(name))] + args) if not ids: ids = self.search(cr, user, [('name',operator,name)] + args) return self.name_get(cr, user, ids)
2fa9a707fadac0f3604cd823b2ec1acf0cb8c95d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2fa9a707fadac0f3604cd823b2ec1acf0cb8c95d/auction.py
'date_planned': procurement.date_planned,
'date_expected': procurement.date_planned,
def action_confirm(self, cr, uid, ids, context={}): """ Confirms procurement and writes exception message if any. @return: True """ move_obj = self.pool.get('stock.move') for procurement in self.browse(cr, uid, ids): if procurement.product_qty <= 0.00: raise osv.except_osv(_('Data Insufficient !'), _('Please check the ...
c750ac729b3ee9115e721481cedd543a380659a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c750ac729b3ee9115e721481cedd543a380659a7/procurement.py
message['body'] = tools.ustr(message['body'].decode(encoding))
message['body'] = self._to_decode(message['body'], [encoding]) from_mail = self._decode_header(message['From'])
def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @...
817ae449127e154dfebfe18df0f6f85578f83905 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/817ae449127e154dfebfe18df0f6f85578f83905/mail_gateway.py
Hello %s,
Hello %s,""" % (from_mail)) body += _(""" Your Request ID: %s""") % (res_id) body += _("""
def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @...
817ae449127e154dfebfe18df0f6f85578f83905 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/817ae449127e154dfebfe18df0f6f85578f83905/mail_gateway.py
Your Request ID: %s
def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @...
817ae449127e154dfebfe18df0f6f85578f83905 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/817ae449127e154dfebfe18df0f6f85578f83905/mail_gateway.py
""") %(message['From'], res_id, message['body'])
""") % (self._to_decode(message['body'], [encoding]))
def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @...
817ae449127e154dfebfe18df0f6f85578f83905 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/817ae449127e154dfebfe18df0f6f85578f83905/mail_gateway.py
def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None): """ Overrides the default stock valuation to take into account the currency that was specified on the purchase order in case the valuation data was not directly specified during picking confirmation. """ reference_amount, reference_c...
b12bcdc3841e3f46e0223f3c1448fda5a9997244 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b12bcdc3841e3f46e0223f3c1448fda5a9997244/stock.py
:param details: if True, *_uid fields are replaced with the name of the user
:param details: if True, \*_uid fields are replaced with the name of the user
def perm_read(self, cr, user, ids, context=None, details=True): """ Read the permission for record of the given ids
1a3b72c8f372c177748335b448f52da08833ebc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a3b72c8f372c177748335b448f52da08833ebc8/orm.py
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
85cebae10ada4353a6779606e282abe2119d7118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cebae10ada4353a6779606e282abe2119d7118/orm.py
result = []
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
85cebae10ada4353a6779606e282abe2119d7118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cebae10ada4353a6779606e282abe2119d7118/orm.py
self.pool.get(object)._store_set_values(cr, user, ids, fields, context)
key = (object,tuple(fields)) done.setdefault(key, {}) todo = [] for id in ids: if id not in done[key]: done[key][id] = True todo.append(id) self.pool.get(object)._store_set_values(cr, user, todo, fields, context)
def write(self, cr, user, ids, vals, context=None): """ Update records with given ids with the given field values
85cebae10ada4353a6779606e282abe2119d7118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cebae10ada4353a6779606e282abe2119d7118/orm.py
raise False
return False
def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) if not a: return False resource_path = opj(a, *args) if zipfile.is_zipfile( a +'...
11c4cbd31f513869e0323616bfb07cf100e02559 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/11c4cbd31f513869e0323616bfb07cf100e02559/__init__.py
where_str = " WHERE %s" % " AND ".join(where)
if where: where_str = " WHERE %s" % " AND ".join(where) else: where_str = ""
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
6eff548f0bbc69750221124392c6cd16f537e227 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6eff548f0bbc69750221124392c6cd16f537e227/orm.py
raise osv.osv.except_osv('Error!',"Module '%s' was not found" % (module,))
continue
def upgrade_graph(graph, cr, module_list, force=None): if force is None: force = [] packages = [] len_graph = len(graph) for module in module_list: mod_path = get_module_path(module) terp_file = get_module_resource(module, '__openerp__.py') if not terp_file or not os.path.isfile(terp_file): terp_file = get_module_resou...
d582f8c56bdea9c0b15ed20842932e9b68883051 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d582f8c56bdea9c0b15ed20842932e9b68883051/__init__.py
assert r"\n" not in s, "Translation terms may not include escaped newlines ('\\n'), please use only literal newlines"
assert r"\n" not in s, "Translation terms may not include escaped newlines ('\\n'), please use only literal newlines! (in '%s')" % s
def quote(s): """Returns quoted PO term string, with special PO characters escaped""" assert r"\n" not in s, "Translation terms may not include escaped newlines ('\\n'), please use only literal newlines" return '"%s"' % s.replace('\\','\\\\') \ .replace('"','\\"') \ .replace('\n', '\\n"\n"')
8472cfb7e3230ed4de00f473de858e7624749bc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8472cfb7e3230ed4de00f473de858e7624749bc6/translate.py
picking_id = self.pool.get('stock.picking').create(cr, uid, {
picking_id =picking_obj.create(cr, 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") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in pr...
fa99a1d9c04f0859a4d185a55a27780f4d2da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa99a1d9c04f0859a4d185a55a27780f4d2da4c1/mrp_pull.py
move_id = self.pool.get('stock.move').create(cr, uid, {
move_id =move_obj.create(cr, 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") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in pr...
fa99a1d9c04f0859a4d185a55a27780f4d2da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa99a1d9c04f0859a4d185a55a27780f4d2da4c1/mrp_pull.py
self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], {
move_obj.write(cr,uid, [proc.move_id.id], {
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") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in pr...
fa99a1d9c04f0859a4d185a55a27780f4d2da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa99a1d9c04f0859a4d185a55a27780f4d2da4c1/mrp_pull.py
proc_id = self.pool.get('procurement.order').create(cr, uid, {
proc_id = proc_obj.create(cr, 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") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in pr...
fa99a1d9c04f0859a4d185a55a27780f4d2da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa99a1d9c04f0859a4d185a55a27780f4d2da4c1/mrp_pull.py
self.pool.get('stock.move').write(cr, uid, [proc.move_id.id],
move_obj.write(cr, uid, [proc.move_id.id],
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") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in pr...
fa99a1d9c04f0859a4d185a55a27780f4d2da4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa99a1d9c04f0859a4d185a55a27780f4d2da4c1/mrp_pull.py
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') res = { 'tax_amount': False, 'amount': False, } voucher_total = 0.0 voucher_line_ids = []
12e5a78d6ecc369a181e7950fca2991a36db8d07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/12e5a78d6ecc369a181e7950fca2991a36db8d07/account_voucher.py
line_amount = line[2].get('amount')
line_amount = line[2] and line[2].get('amount',0.0) or 0.0
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') res = { 'tax_amount': False, 'amount': False, } voucher_total = 0.0 voucher_line_ids = []
12e5a78d6ecc369a181e7950fca2991a36db8d07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/12e5a78d6ecc369a181e7950fca2991a36db8d07/account_voucher.py
user_id = context.get('user_id', uid) user = self.pool.get('res.users').browse(cr, uid, user_id, context=context)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
def _search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None):
3c4cdab9f2fddb9a5bde1a50e5121ae142c4679c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3c4cdab9f2fddb9a5bde1a50e5121ae142c4679c/res_company.py
def _get_cash_box_lines(self, cr, uid, ids, context={}):
def _get_cash_open_box_lines(self, cr, uid, ids, context={}):
def _get_cash_box_lines(self, cr, uid, ids, context={}): res = [] curr = [1, 2, 5, 10, 20, 50, 100, 500] for rs in curr: dct = { 'pieces':rs, 'number':0 } res.append(dct) return res
c6ebaa98b12653299c12094a333f94428d5fde73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6ebaa98b12653299c12094a333f94428d5fde73/account_cash_statement.py
def _get_cash_close_box_lines(self, cr, uid, ids, context={}): res = [] curr = [1, 2, 5, 10, 20, 50, 100, 500] for rs in curr: dct = { 'pieces':rs, 'number':0 } res.append((0, 0, dct)) return res
def _get_cash_box_lines(self, cr, uid, ids, context={}): res = [] curr = [1, 2, 5, 10, 20, 50, 100, 500] for rs in curr: dct = { 'pieces':rs, 'number':0 } res.append(dct) return res
c6ebaa98b12653299c12094a333f94428d5fde73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6ebaa98b12653299c12094a333f94428d5fde73/account_cash_statement.py
'starting_details_ids':_get_cash_box_lines, 'ending_details_ids':_get_cash_box_lines
'starting_details_ids':_get_cash_open_box_lines, 'ending_details_ids':_get_cash_open_box_lines
def _get_cash_box_lines(self, cr, uid, ids, context={}): res = [] curr = [1, 2, 5, 10, 20, 50, 100, 500] for rs in curr: dct = { 'pieces':rs, 'number':0 } res.append(dct) return res
c6ebaa98b12653299c12094a333f94428d5fde73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c6ebaa98b12653299c12094a333f94428d5fde73/account_cash_statement.py
tuple = (proba * 100, benefit)
tuple_benefit = (proba * 100, benefit)
def create(self, cr, uid, ids, datas, context={}):
6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098/report_businessopp.py
responsible_data[userid].append(tuple)
responsible_data[userid].append(tuple_benefit)
def create(self, cr, uid, ids, datas, context={}):
6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098/report_businessopp.py
tuple = (proba * 100, cost, benefit) data.append(tuple)
tuple_benefit = (proba * 100, cost, benefit) data.append(tuple_benefit)
def create(self, cr, uid, ids, datas, context={}):
6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6084e072d6f3a1b9aa6ff3b0189cfd30c1f09098/report_businessopp.py
usage = 'customer'
src_usage = dest_usage = None
def _get_type(self, cr, uid, context=None): """ To get invoice type. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: The ID or list of IDs if we want more than one @param context: A standard dictionary @return: Invoice type """ if context is None:...
969f0b9460373fdad20a19dcb436f3fe6f3d86af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/969f0b9460373fdad20a19dcb436f3fe6f3d86af/stock_invoice_onshipping.py
usage = pick.move_lines[0].location_id.usage if pick.type == 'out' and usage == 'supplier':
src_usage = pick.move_lines[0].location_id.usage dest_usage = pick.move_lines[0].location_dest_id.usage if pick.type == 'out' and dest_usage == 'supplier':
def _get_type(self, cr, uid, context=None): """ To get invoice type. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: The ID or list of IDs if we want more than one @param context: A standard dictionary @return: Invoice type """ if context is None:...
969f0b9460373fdad20a19dcb436f3fe6f3d86af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/969f0b9460373fdad20a19dcb436f3fe6f3d86af/stock_invoice_onshipping.py
elif pick.type == 'out' and usage == 'customer':
elif pick.type == 'out' and dest_usage == 'customer':
def _get_type(self, cr, uid, context=None): """ To get invoice type. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: The ID or list of IDs if we want more than one @param context: A standard dictionary @return: Invoice type """ if context is None:...
969f0b9460373fdad20a19dcb436f3fe6f3d86af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/969f0b9460373fdad20a19dcb436f3fe6f3d86af/stock_invoice_onshipping.py
elif pick.type == 'in' and usage == 'supplier':
elif pick.type == 'in' and src_usage == 'supplier':
def _get_type(self, cr, uid, context=None): """ To get invoice type. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: The ID or list of IDs if we want more than one @param context: A standard dictionary @return: Invoice type """ if context is None:...
969f0b9460373fdad20a19dcb436f3fe6f3d86af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/969f0b9460373fdad20a19dcb436f3fe6f3d86af/stock_invoice_onshipping.py
elif pick.type == 'in' and usage == 'customer':
elif pick.type == 'in' and src_usage == 'customer':
def _get_type(self, cr, uid, context=None): """ To get invoice type. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: The ID or list of IDs if we want more than one @param context: A standard dictionary @return: Invoice type """ if context is None:...
969f0b9460373fdad20a19dcb436f3fe6f3d86af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/969f0b9460373fdad20a19dcb436f3fe6f3d86af/stock_invoice_onshipping.py
if r[self._fields_id] in res: res[r[self._fields_id]].append(r['id'])
res[r[self._fields_id]].append(r['id'])
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if self._context: context = context.copy() context.update(self._context) if not values: values = {}
092c4dff88f22a1cb0b59819399930c72663330d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/092c4dff88f22a1cb0b59819399930c72663330d/fields.py
for picking in picking_obj.browse(cr, uid, context.get('active_ids', []), context=context): if picking.invoice_state == '2binvoiced': res = picking_obj.action_invoice_create(cr, uid, [picking.id], journal_id = onshipdata_obj['journal_id'], group=onshipdata_obj['group'], type=self._get_type(picking), context=context) in...
active_ids=context.get('active_ids', []) picking = picking_obj.browse(cr, uid,active_ids, context=context)[0] if onshipdata_obj['group']: res = picking_obj.action_invoice_create(cr, uid,active_ids, journal_id = onshipdata_obj['journal_id'], group=onshipdata_obj['group'], type=self._get_type(picking), context=context) ...
def create_invoice(self, cr, uid, ids, context=None): if context is None: context = {} result = [] picking_obj = self.pool.get('stock.picking') onshipdata_obj = self.read(cr, uid, ids[0], ['journal_id', 'group', 'invoice_date']) if context.get('new_picking', False): onshipdata_obj['id'] = onshipdata_obj.new_picking ons...
3e9cf431b3bb7970972134241615b2f6de7c62a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e9cf431b3bb7970972134241615b2f6de7c62a9/stock_invoice_onshipping.py
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context).id
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
5fc48ab9ef97e6a2403dd8e3033e2e0966ce547d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fc48ab9ef97e6a2403dd8e3033e2e0966ce547d/pos.py
operand1,operand2 = name.split(' ',1)
operand1,operand2 = name.split(' ',1)
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: context = {} args = args[:] ids = [] try: if name and str(name).startswith('partner:'): part_id = int(name.split(':')[1]) part = self.pool.get('res.partner').browse(cr, user, part_id, cont...
69549b1571f4b6e03e6e91268bf36f7d091efbe0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69549b1571f4b6e03e6e91268bf36f7d091efbe0/account.py
return (int(real_id), real_date)
start = datetime.strptime(real_date, "%Y-%m-%d %H:%M:%S") end = start + timedelta(hours=with_date) return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S"))
def caldav_id2real_id(caldav_id=None, with_date=False): if caldav_id and isinstance(caldav_id, (str, unicode)): res = caldav_id.split('-') if len(res) >= 2: real_id = res[0] if with_date: real_date = time.strftime("%Y-%m-%d %H:%M:%S", \ time.strptime(res[1], "%Y%m%d%H%M%S")) return (int(real_id), real_date) return int(...
d351065fb195ed7d20a5087a0f650fc37672f39e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d351065fb195ed7d20a5087a0f650fc37672f39e/common.py
cr.execute("select m.id, m.rrule, m.date, m.exdate \ from " + self._table + " m where m.id in ("\
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \ m.exdate from " + self._table + \ " m where m.id in ("\
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, m.date, m.exdate \ from " + self...
d351065fb195ed7d20a5087a0f650fc37672f39e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d351065fb195ed7d20a5087a0f650fc37672f39e/common.py
if start_date and event_date < start_date:
if start_date and (event_date < start_date):
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, m.date, m.exdate \ from " + self...
d351065fb195ed7d20a5087a0f650fc37672f39e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d351065fb195ed7d20a5087a0f650fc37672f39e/common.py
if until_date and event_date > until_date:
if until_date and (event_date > until_date):
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, m.date, m.exdate \ from " + self...
d351065fb195ed7d20a5087a0f650fc37672f39e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d351065fb195ed7d20a5087a0f650fc37672f39e/common.py
ls = caldav_id2real_id(caldav_id, with_date=True)
ls = caldav_id2real_id(caldav_id, with_date=res.get('duration', 0))
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids select = map(lambda x: (x, caldav_id2real_id(x)), select) result = [] if fields and 'date' not in fields: fields.append('date') for caldav_id, real_id in select: res = sup...
d351065fb195ed7d20a5087a0f650fc37672f39e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d351065fb195ed7d20a5087a0f650fc37672f39e/common.py
obj_inv = self.browse(cr, uid, ids)[0]
inv = self.browse(cr, uid, ids)[0]
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: tmp_context = { 'fiscalyear_id': inv....
4dc7691b1a6840b26d13350edeed29ed78c55dc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4dc7691b1a6840b26d13350edeed29ed78c55dc8/invoice.py
if obj_inv.journal_id.invoice_sequence_id: sid = obj_inv.journal_id.invoice_sequence_id.id number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
if inv.journal_id.invoice_sequence_id: sid = inv.journal_id.invoice_sequence_id.id number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': inv.period_id.fiscalyear_id.id})
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: tmp_context = { 'fiscalyear_id': inv....
4dc7691b1a6840b26d13350edeed29ed78c55dc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4dc7691b1a6840b26d13350edeed29ed78c55dc8/invoice.py
def move_line_get(self, cr, uid, invoice_id): res = [] cr.execute('SELECT * FROM account_invoice_tax WHERE invoice_id=%s', (invoice_id,)) for t in cr.dictfetchall(): if not t['amount'] \ and not t['tax_code_id'] \ and not t['tax_amount']: continue res.append({ 'type':'tax', 'name':t['name'], 'price_unit': t['amount'], ...
4dc7691b1a6840b26d13350edeed29ed78c55dc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4dc7691b1a6840b26d13350edeed29ed78c55dc8/invoice.py
obj_action.unlink(cr, uid, w_id) value = "ir.actions.act_window" + ',' + str(w_id[0])
if w_id: obj_action.unlink(cr, uid, w_id) value = "ir.actions.act_window" + ',' + str(w_id[0])
def unsubscribe(self, cr, uid, ids, *args): """ Unsubscribe Auditing Rule on object @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Auddittrail Rule’s IDs. @return: True """ obj_action = self.pool.get('ir.actions.act_window') val_obj = sel...
f022e07378a25d7ed6b54d724f29bf3767bc8c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f022e07378a25d7ed6b54d724f29bf3767bc8c8e/audittrail.py
group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Survey / Manager','Survey / User'))])
group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Tools / Manager','Tools / User'))])
def _get_survey(self, cr, uid, context=None): """ Set the value In survey_id field.
3c7d66b0148b3d3d7a8b016c2579d96887af93ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3c7d66b0148b3d3d7a8b016c2579d96887af93ad/survey_selection.py
for colname,col in self.pool.get(obj)._columns.items(): if isinstance(col, fields.float):
for colname, col in self.pool.get(obj)._columns.items(): if isinstance(col, (fields.float, fields.function)):
def write(self, cr, uid, ids, data, *args, **argv): res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv) for obj in self.pool.obj_list(): for colname,col in self.pool.get(obj)._columns.items(): if isinstance(col, fields.float): col.digits_change(cr) self.precision_get.clear_cache(cr.dbname) ret...
0694b1415fe5e906a3e977c32b4a575459538bf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0694b1415fe5e906a3e977c32b4a575459538bf5/decimal_precision.py
self.precision_get.clear_cache(cr.dbname)
def write(self, cr, uid, ids, data, *args, **argv): res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv) for obj in self.pool.obj_list(): for colname,col in self.pool.get(obj)._columns.items(): if isinstance(col, fields.float): col.digits_change(cr) self.precision_get.clear_cache(cr.dbname) ret...
0694b1415fe5e906a3e977c32b4a575459538bf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0694b1415fe5e906a3e977c32b4a575459538bf5/decimal_precision.py
def change_digit(cr): res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, application) return (16, res)
0694b1415fe5e906a3e977c32b4a575459538bf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0694b1415fe5e906a3e977c32b4a575459538bf5/decimal_precision.py
wf_service = netsvc.LocalService("workflow")
def default_get(self, cr, uid, fields, context): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dictiona...
214960b36e9a3bf83ed20f8209c62fbc339d792e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/214960b36e9a3bf83ed20f8209c62fbc339d792e/pos_payment.py
raise osv.except_osv('Error!','No order lines defined for this sale ')
raise osv.except_osv(_('Error!'),_('No order lines defined for this sale '))
def view_init(self, cr, uid, fields_list, context=None): res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context) active_id = context and context.get('active_id', False) or False if active_id: order = self.pool.get('pos.order').browse(cr, uid, active_id) if not order.lines: raise osv.except_...
214960b36e9a3bf83ed20f8209c62fbc339d792e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/214960b36e9a3bf83ed20f8209c62fbc339d792e/pos_payment.py
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.resource', c)
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.resource', context=context)
def interval_get(self, cr, uid, id, dt_from, hours, resource=False, byday=True): resource_cal_leaves = self.pool.get('resource.calendar.leaves') dt_leave = [] if not id: return [(dt_from,dt_from + mx.DateTime.RelativeDateTime(hours=int(hours)*3))] resource_leave_ids = resource_cal_leaves.search(cr, uid, [('calendar_id'...
bc49f91b7cdf775f805c026ddb42d18e2351fc7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc49f91b7cdf775f805c026ddb42d18e2351fc7d/resource.py
return date.strftime(str(self.lang_obj.date_format))
return date.strftime(str(self.lang_obj.date_format))
def __str__(self): if self.val: if getattr(self,'name', None): date = datetime.strptime(self.name, DT_FORMAT) return date.strftime(str(self.lang_obj.date_format)) return self.val
c2d3bf17441a88ff6111864c62a123bf3224613a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c2d3bf17441a88ff6111864c62a123bf3224613a/report_sxw.py
try: date = datetime.datetime(str(value), parse_format) except: return str(value)
return time.strftime(date_format, time.strptime(value, parse_format))
def formatLang(self, value, digits=2, date=False,date_time=False, grouping=True, monetary=False): if isinstance(value, (str, unicode)) and not value: return '' if not self.lang_dict_called: self._get_lang_dict() self.lang_dict_called = True
c2d3bf17441a88ff6111864c62a123bf3224613a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c2d3bf17441a88ff6111864c62a123bf3224613a/report_sxw.py
'amount':total
'amount':total, 'state':voucher.state
def open_voucher(self, dbcr, uid, ids, context={}): cr = 0.0 dr = 0.0 total = 0.0 new_line = []
5fdc5443095e1c685c298d72b1af479e3bf07e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fdc5443095e1c685c298d72b1af479e3bf07e45/voucher.py
def write(self, cr, uid, ids, vals, context={}): res = super(account_voucher, self).write(cr, uid, ids, vals, context) if not 'state' in vals.keys(): self.open_voucher(cr, uid, ids, context) return res
def open_voucher(self, dbcr, uid, ids, context={}): cr = 0.0 dr = 0.0 total = 0.0 new_line = []
5fdc5443095e1c685c298d72b1af479e3bf07e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fdc5443095e1c685c298d72b1af479e3bf07e45/voucher.py
self.open_voucher(cr, uid, ids, context)
def voucher_recheck(self, cr, uid, ids, context={}): self.open_voucher(cr, uid, ids, context) self.write(cr, uid, ids, {'state':'recheck'}, context) return True
5fdc5443095e1c685c298d72b1af479e3bf07e45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5fdc5443095e1c685c298d72b1af479e3bf07e45/voucher.py
test_context = {'ref': self._ref, '_ref': self._ref}
local_context = {'ref': self._ref, '_ref': self._ref} context = self.get_context(assertion, local_context)
def process_assert(self, node): assertion, expressions = node.items()[0]
88635654ce8aa65af2e0d311178c356dd8e2cd42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88635654ce8aa65af2e0d311178c356dd8e2cd42/yaml_test.py
record = model.browse(self.cr, self.uid, id, assertion.context)
record = model.browse(self.cr, self.uid, id, context)
def process_assert(self, node): assertion, expressions = node.items()[0]
88635654ce8aa65af2e0d311178c356dd8e2cd42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88635654ce8aa65af2e0d311178c356dd8e2cd42/yaml_test.py
success = eval(test, test_context, record)
success = eval(test, local_context, record)
def process_assert(self, node): assertion, expressions = node.items()[0]
88635654ce8aa65af2e0d311178c356dd8e2cd42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88635654ce8aa65af2e0d311178c356dd8e2cd42/yaml_test.py
model = self.get_model(record.model) record_dict = self._create_record(model, fields) id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ self.module, record_dict, record.id, mode=self.mode) self.id_map[record.id] = int(id) if config.get('import_partial', False): self.cr.commit()
if self.isnoupdate(record) and self.mode != 'init': model = self.get_model(record.model) record_dict = self._create_record(model, fields) id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ self.module, record_dict, record.id, noupdate=self.isnoupdate(node), mode=self.mode) self.id_map[record...
def process_record(self, node): record, fields = node.items()[0]
88635654ce8aa65af2e0d311178c356dd8e2cd42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88635654ce8aa65af2e0d311178c356dd8e2cd42/yaml_test.py
if self.mode != 'init':
function, values = node.items()[0] if self.isnoupdate(function) and self.mode != 'init':
def process_function(self, node): if self.mode != 'init': return function, values = node.items()[0] local_context = {'ref': self._ref, '_ref': self._ref} context = self.get_context(node, local_context) args = [] if function.eval: args = eval(function.eval, local_context) for value in values: if not 'model' in value and...
88635654ce8aa65af2e0d311178c356dd8e2cd42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/88635654ce8aa65af2e0d311178c356dd8e2cd42/yaml_test.py