rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
'sum_currency_amount_account': self._sum_currency_amount_account,
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, 'g...
21ed7a5f7a67b9f90d736f8dcd521522ef7f421c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21ed7a5f7a67b9f90d736f8dcd521522ef7f421c/account_journal.py
def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone() if self.account_cur...
def _set_get_account_currency_code(self, account_id): self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() if result: self.account_currency = result[0] else: self.account_currency = False
21ed7a5f7a67b9f90d736f8dcd521522ef7f421c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21ed7a5f7a67b9f90d736f8dcd521522ef7f421c/account_journal.py
res=self.cr.fetchone()[0]
res=self.cr.fetchone()[0] or 0.0
def __pos_payment_date__total__(self,form): dt1 = form['date_start'] + ' 00:00:00' dt2 = form['date_end'] + ' 23:59:59' res=[] self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt....
2f4cc792d8468e34401e533202c5cb9cacebfd83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f4cc792d8468e34401e533202c5cb9cacebfd83/pos_payment_report_date.py
assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id') % (xml_id)
assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % (xml_id)
def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None): warning = True model_obj = self.pool.get(model) if not context: context = {} if xml_id and ('.' in xml_id): assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids shoul...
69147e278f1a4f14963cebf5332787c9463e713c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69147e278f1a4f14963cebf5332787c9463e713c/ir_model.py
partner_address_id = val_invoice['value']['address_invoice_id'] value = inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id) l = inv_lines_pool.read(cr, uid, lines)
def _make_invoice(self, cr, uid, reg, lines, context=None): """ Create Invoice from Invoice lines @param reg : Model of Event Registration @param lines: Ids of Invoice lines """ if context is None: context = {} inv_pool = self.pool.get('account.invoice') inv_lines_pool = self.pool.get('account.invoice.line')
fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py
contact_id = contact_obj.browse(cr, uid, contact)
def onchange_contact_id(self, cr, uid, ids, contact, partner):
fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py
partner_data = res_obj.browse(cr, uid, part)
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False): """This function returns value of Patner Invoice id, Unit Price, badget title based on partner and Event. @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks,...
fa5db5c01e82d1469008c4358667c6d3619c51aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa5db5c01e82d1469008c4358667c6d3619c51aa/event.py
return obj_payment_order.set_done(cr, uid, context['active_id'], context)
obj_payment_order.set_done(cr, uid, context['active_id'], context) return {}
def launch_wizard(self, cr, uid, ids, context=None): """ Search for a wizard to launch according to the type. If type is manual. just confirm the order. """ obj_payment_order = self.pool.get('payment.order')
0a2b5ca83438242580e1a83455ce54515782f334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a2b5ca83438242580e1a83455ce54515782f334/account_payment_pay.py
res = self.write(cr, uid, event_id, {'exdate': date_new})
exdate = (record['exdate'] and (record['exdate'] + ',') or '') + date_new res = self.write(cr, uid, event_id, {'exdate': exdate})
def unlink(self, cr, uid, ids, context=None): """ Deletes records specified in ids. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: List of calendar event's id. @param context: A standard dictionary for contextual values @return: True """ res = False for event_id in ids...
7ec3aa1f03df69bff406e5d582e4da288c7f1af2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ec3aa1f03df69bff406e5d582e4da288c7f1af2/base_calendar.py
domain = {}
fields_process = {}
def __init__(self, cr, uid, id, table, cache, context=None, list_class=None, fields_process=None): ''' table : the object (inherited from orm) context : dictionary with an optional context ''' if fields_process is None: domain = {} if context is None: context = {} self._list_class = list_class or browse_record_list sel...
8b3bd3cceea2c3861f9714de6c67decbd755547e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8b3bd3cceea2c3861f9714de6c67decbd755547e/orm.py
default['backorder_id'] = False return super(stock_picking, self).copy(cr, uid, id, default, context)
default['backorder_id'] = False res=super(stock_picking, self).copy(cr, uid, id, default, context) if res: picking_obj = self.browse(cr, uid, [res], context)[0] for move in picking_obj.move_lines: move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False}) return res
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() picking_obj = self.browse(cr, uid, [id], context)[0] if ('name' not in default) or (picking_obj.name=='/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence'...
1a6f4471f42713b54c4e0269b2be6ba514d8d660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1a6f4471f42713b54c4e0269b2be6ba514d8d660/stock.py
def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True
def button_confirm(self, cr, uid, ids, *args): for id in ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) self.force_assign(cr, uid, ids, *args) return True
65730d7060b143b313f2ba3eb660ea1ca4ceb4e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/65730d7060b143b313f2ba3eb660ea1ca4ceb4e8/stock.py
class account_bank_statement_line(osv.osv): def _default_company(self, cr, uid, context={}): """ To get default company for the object" @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 bank statement ids @pa...
def _user_allow(self, cr, uid, ids, statement, context={}): res = False uids = [] for user in statement.journal_id.journal_users: uids.append(user.id) if uid in uids: res = True return res
c4f4f475dd0eef7e9be88811fcf620d03650feeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4f4f475dd0eef7e9be88811fcf620d03650feeb/account_bank_statement.py
return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context)))
adrs_detail = dict(map(operator.attrgetter('id', 'address_id'), self.browse(cr, uid, ids, context=context))) for id,adrs in adrs_detail.items(): adrs_detail[id] = adrs.email return adrs_detail
def _email_get(self, cr, uid, ids, name, arg, context=None): return dict(map(operator.attrgetter('id', 'address_id.email'), self.browse(cr, uid, ids, context=context)))
c596d163a5d57a0cbff813207b14c5b13d897c4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c596d163a5d57a0cbff813207b14c5b13d897c4b/res_user.py
f_size = getattr(f, 'size', 16)
f_size = getattr(f, 'size', None) or 16
def get_pg_type(f): ''' returns a tuple (type returned by postgres when the column was created, type expression to create the column) ''' type_dict = { fields.boolean: 'bool', fields.integer: 'int4', fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', fields.datetime: 'timestamp'...
3816dadb22090212fa6c8eae24b3e9c3076a5e90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3816dadb22090212fa6c8eae24b3e9c3076a5e90/orm.py
(check_duplicate, 'Warning! Can\'t have duplicate server configuration!', ['user', 'password'])
(check_duplicate, 'Warning! Can\'t have duplicate server configuration!', ['user', 'password']), (check_model, 'Warning! Record for slected Model can not be created\nPlease choose valid Model', ['object_id'])
def check_duplicate(self, cr, uid, ids):
42d6b54c2dff0fbdd8f86ba5da92ab8e8e1c41e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/42d6b54c2dff0fbdd8f86ba5da92ab8e8e1c41e4/fetchmail.py
context_wo_lang = context
context_wo_lang = context.copy()
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
63d562de395face054ae4f55c576782a2795e6f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/63d562de395face054ae4f55c576782a2795e6f4/orm.py
self.ical_set(cal_data.name.lower(), {'name': cal_data.params['CN'][0]}, 'value')
self.ical_set(cal_data.name.lower(), {'name': cal_data.params.get('CN') and cal_data.params.get('CN')[0]}, 'value')
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @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 context: A standard dictionary for contextual values ...
59426ee2760aed87a52d78a37d051aaff6d42525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/59426ee2760aed87a52d78a37d051aaff6d42525/calendar.py
else: rml_head = self.rml_header
def _add_header(self, rml_dom, header='internal'): if header=='internal': rml_head = self.rml_header2 else: rml_head = self.rml_header
50ea35380abf1157ea8353d36ecb25bc77084de7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50ea35380abf1157ea8353d36ecb25bc77084de7/report_sxw.py
'product_qty': product_qty, 'product_uos_qty': product_qty
'product_qty': move.product_qty, 'product_uos_qty': move.product_qty
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain 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.picking') delivery_obj = self.pool.get('stock.deliver...
3e267b1e3c058b62abc175b642d292a7ded27bfe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e267b1e3c058b62abc175b642d292a7ded27bfe/stock.py
sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),)
sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id = %d and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit"""%(o.id)
def _get_data(self,o): data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) data = self.cr.dictfetchall() ...
e5bef4c1d0badf41aa1f09a6793de244e726648c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5bef4c1d0badf41aa1f09a6793de244e726648c/pos_users_product.py
name = allocation.resource_id.name if allocation.user_id: name = '%s' %(allocation.user_id.name)
name = allocation.phase_id.name
def get_name(self, cr, uid, ids, field_name, arg, context=None): res = {} for allocation in self.browse(cr, uid, ids, context=context): name = allocation.resource_id.name if allocation.user_id: name = '%s' %(allocation.user_id.name) name += ' (%s%%)' %(allocation.useability) res[allocation.id] = name return res
db6ee299b9bda8561074d6b70f4327b3341ec96d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/db6ee299b9bda8561074d6b70f4327b3341ec96d/project_long_term.py
('shortcut_unique', 'unique(res_id, user_id)', 'Shortcut for this menu already exists!'),
('shortcut_unique', 'unique(res_id, resource, user_id)', 'Shortcut for this menu already exists!'),
def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context={}): ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context) return self.read(cr, uid, ids, ['res_id','name'], context=context)
b83c7d01c1183b816740aba227d1af1f24f7ca79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b83c7d01c1183b816740aba227d1af1f24f7ca79/ir_ui_view.py
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] ...
f377b3696cb8ad93a09d0e09be825ab121eaaa30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f377b3696cb8ad93a09d0e09be825ab121eaaa30/account_entries_report.py
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_period': current_period = period_obj.find(cr, uid)[0] ...
f377b3696cb8ad93a09d0e09be825ab121eaaa30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f377b3696cb8ad93a09d0e09be825ab121eaaa30/account_entries_report.py
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None):
def get_id(self, cr, uid, sequence_id, test='id', context=None):
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment...
712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py
cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True))
assert test in ('code','id') cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+'=%s AND active=%s FOR UPDATE', (sequence_id, True))
def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment...
712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py
return self.get_id(cr, uid, code, test='code=%s')
return self.get_id(cr, uid, code, test='code')
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
712389da82ed665ca558685a819b37cc0a3b1e80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/712389da82ed665ca558685a819b37cc0a3b1e80/ir_sequence.py
if view_ref:
if view_ref and not view_id:
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: re...
502318629321fb71481e1cab6ebf91b34234939e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/502318629321fb71481e1cab6ebf91b34234939e/orm.py
r = {}
def _debit_calc(self, cr, uid, ids, name, arg, context={}):
9abd6c97c6ff432e2b5d4eafe678b6b007a231ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9abd6c97c6ff432e2b5d4eafe678b6b007a231ff/project.py
move_ids = []
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.a...
90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py
move_ids.append(res.id)
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.a...
90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py
self.pool.get('stock.move').action_done(cr, uid, new_moves)
def action_production_end(self, cr, uid, ids): move_ids = [] for production in self.browse(cr, uid, ids): for res in production.move_lines: for move in production.move_created_ids: #XXX must use the orm cr.execute('INSERT INTO stock_move_history_ids \ (parent_id, child_id) VALUES (%s,%s)', (res.id, move.id)) move_ids.a...
90e95708cdebb79eb9c9fcd209e5f2fe962a3744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e95708cdebb79eb9c9fcd209e5f2fe962a3744/mrp.py
relation,view_load,state,select_level
relation,view_load,state,select_level,relation_field
def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self....
34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s
def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self....
34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py
vals['select_level']
vals['select_level'],vals['relation_field']
def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self....
34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py
view_load=%s, select_level=%s, readonly=%s ,required=%s
view_load=%s, select_level=%s, readonly=%s ,required=%s ,relation_field=%s
def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self....
34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py
vals['select_level'], bool(vals['readonly']),bool(vals['required']), vals['model'], vals['name']
vals['select_level'], bool(vals['readonly']),bool(vals['required']), vals['relation_field'], vals['model'], vals['name']
def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) if not cr.rowcount: cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',)) model_id = cr.fetchone()[0] cr.execute("INSERT INTO ir_model (id,model, name, info,state) VALUES (%s, %s, %s, %s, %s)", (model_id, self....
34b1d4c06bd9defde2f33cec9d672a0973cb62ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34b1d4c06bd9defde2f33cec9d672a0973cb62ef/orm.py
def process_sql_file(cr, file):
def process_sql_file(cr, fp):
def process_sql_file(cr, file): queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query)
af6d826facac8bae1eacf2d1654bd35ee8a8b173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af6d826facac8bae1eacf2d1654bd35ee8a8b173/__init__.py
process_sql_file(cr, fp)
process_sql_file(cr, file)
def _load_data(cr, module_name, id_map, mode, kind): noupdate = (kind == 'demo') for filename in package.data.get(kind, []): _, ext = os.path.splitext(filename) log.info("module %s: loading %s", module_name, filename) pathname = os.path.join(module_name, filename) file = tools.file_open(pathname) # TODO manage .csv fil...
af6d826facac8bae1eacf2d1654bd35ee8a8b173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af6d826facac8bae1eacf2d1654bd35ee8a8b173/__init__.py
if context is None:
if context is None:
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context)
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=time.strftime('%Y-%m-%d'), context=context)
def populate_statement(self, cr, uid, ids, context=None): if context is None: context = {} statement_id = context.get('statement_id', False) if not statement_id: return {} data = self.read(cr, uid, ids, context=context)[0] line_ids = data['line_ids'] if not line_ids: return {}
7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py
if context is None:
if context is None:
def search_invoices(self, cr, uid, ids, context=None): if context is None: context = {} line_obj = self.pool.get('account.move.line') statement_obj = self.pool.get('account.bank.statement') journal_obj = self.pool.get('account.journal') mod_obj = self.pool.get('ir.model.data') statement_id = 'statement_id' in context a...
7cd178554d9162e655ae1ad43898cd71b227b0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7cd178554d9162e655ae1ad43898cd71b227b0a6/account_statement_from_invoice.py
x_headers = { 'Reply-To':"%s" % case.section_id.reply_to, }
x_headers = dict()
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
7c7be29028dbe4568e7179afc5d193adb86f4db7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7c7be29028dbe4568e7179afc5d193adb86f4db7/crm_send_email.py
res = defaultdict(list)
res = {} for id in ids: res[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 = {}
2cfe39726e678fc3965077a715a4bc2a2d1ef606 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2cfe39726e678fc3965077a715a4bc2a2d1ef606/fields.py
res[r[self._fields_id]].append(r['id'])
if r[self._fields_id] in res.values(): 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 = {}
2cfe39726e678fc3965077a715a4bc2a2d1ef606 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2cfe39726e678fc3965077a715a4bc2a2d1ef606/fields.py
params.append(max_amount)
params += max_amount
def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 power = form['power'] allow_w...
81a6bd02b044dfd837951f299d70e5f89af07243 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81a6bd02b044dfd837951f299d70e5f89af07243/account_automatic_reconcile.py
res[event.id]['register_current'] = len(reg_ids)
res[event.id]['register_current'] = number and number[0] or 0.0
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o...
463d928a0e098afd326eb695c26c8f1e2d65865b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/463d928a0e098afd326eb695c26c8f1e2d65865b/event.py
res[event.id]['register_prospect'] = len(reg_ids)
res[event.id]['register_prospect'] = number and number[0] or 0.0
def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o...
463d928a0e098afd326eb695c26c8f1e2d65865b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/463d928a0e098afd326eb695c26c8f1e2d65865b/event.py
task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['open', 'draft', 'pending'] , phase.task_ids)))
task_ids = map(lambda x : x.id, (filter(lambda x : x.state in ['draft'] , phase.task_ids)))
def schedule_tasks(self, cr, uid, ids, context=None): """ Schedule the tasks according to resource available and priority. """ task_pool = self.pool.get('project.task') resource_pool = self.pool.get('resource.resource') resources_list = self.generate_resources(cr, uid, ids, context=context) return_msg = {} for phase in...
f8c4b4e72ffea7448648cb1b5e4e5576c9cfa970 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f8c4b4e72ffea7448648cb1b5e4e5576c9cfa970/project_long_term.py
res = {} result_acc = []
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py
parents = ids
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py
accounts = obj_account.read(self.cr, self.uid, ids, ['type','code','name','debit','credit','balance','parent_id','level'], ctx) for account in accounts: if account['id'] in done: continue done[account['id']] = 1 res = { 'id': account['id'], 'type': account['type'], 'code': account['code'], 'name': account['name'], 'lev...
accounts = obj_account.read(self.cr, self.uid, ids, ['type','code','name','debit','credit','balance','parent_id','level','child_id'], ctx) for parent in parents: if parent in done: continue done[parent] = 1 _process_child(accounts,form['display_account'],parent) return self.result_acc
def lines(self, form, ids=[], done=None):#, level=1): obj_account = self.pool.get('account.account') if not ids: ids = self.ids if not ids: return [] if not done: done={}
d3a5b6266269b8d6a294ef6cab9d004a9f335a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d3a5b6266269b8d6a294ef6cab9d004a9f335a88/account_balance.py
return new_ids = isinstance(ids, (str, int, long)) and data[0] or data
return 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...
c53fbb38986fa6585a12e05e9148ad64096c194f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c53fbb38986fa6585a12e05e9148ad64096c194f/base_calendar.py
last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work')
last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) task_obj = self.pool.get('project.task.work')
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date',...
d0317628aade90d1d8015cae782440683b862e21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0317628aade90d1d8015cae782440683b862e21/task_report.py
last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 obj=self.pool.get('hr_timesheet_sheet.sheet.day')
last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) obj = self.pool.get('hr_timesheet_sheet.sheet.day')
def get_hrs_timesheet(self, cr, uid, ids, name,args,context): result = {} sum = 0.0 for record in self.browse(cr, uid, ids, context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 obj=self.pool.get('hr_timesheet_sheet.sheet.day') sheet_ids = obj.search(cr, uid, [('sheet_id.user_id...
d0317628aade90d1d8015cae782440683b862e21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0317628aade90d1d8015cae782440683b862e21/task_report.py
data = self.read(cr, uid, ids, [], context)[0] line_ids= data['entries']
payment_obj = self.pool.get('payment.line') if context is None: context = {} data = self.read(cr, uid, ids, [])[0] line_ids = data['entries']
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
payment = order_obj.browse(cr, uid, data['active_id'], context=context)
payment = order_obj.browse(cr, uid, context['active_id'], context=context)
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
line2bank = pool.get('account.move.line').line2bank(cr, uid, line_ids, t, context)
line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
pool.get('payment.line').create(cr, uid,{
payment_obj.create(cr, uid,{
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
return {}
return {'nodestroy':True,}
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
if context is None: context = {}
def search_entries(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data')
0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ab7889c98f4e0e3bdf2f271587dad4164d5d6a4/account_payment_order.py
def change_currency(self, cr, uid, ids, context=None): obj_inv = self.pool.get('account.invoice') obj_inv_line = self.pool.get('account.invoice.line') obj_currency = self.pool.get('res.currency') invoice_ids = [] if context is None: context = {} data = self.read(cr, uid, ids)[0] new_currency = data['currency_id']
eea417316217cb43a25b2464ef3e0371e13a98d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eea417316217cb43a25b2464ef3e0371e13a98d0/account_change_currency.py
last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1
last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1
def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date',...
ae5b993dce95dcca373e91e88a4cefbbad2c2510 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ae5b993dce95dcca373e91e88a4cefbbad2c2510/task_report.py
'base_code_id': fields.many2one('account.tax.code', 'Base Code', help="Use this code for the VAT declaration."), 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="Use this code for the VAT declaration."),
'base_code_id': fields.many2one('account.tax.code', 'Account Base Code', help="Use this code for the VAT declaration."), 'tax_code_id': fields.many2one('account.tax.code', 'Account Tax Code', help="Use this code for the VAT declaration."),
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() default.update({'line_ids': []}) return super(account_tax_code, self).copy(cr, uid, id, default, context)
818f9a443842174874f2b491ef26ff25cb3d3338 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/818f9a443842174874f2b491ef26ff25cb3d3338/account.py
check if it's already installed (neither uninstallable nor uninstalled)
check if it's already installed (either 'to install', 'to upgrade' or 'installed')
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module')
26ed95e7729fc93370ca8d9b34e4ed41797f482e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ed95e7729fc93370ca8d9b34e4ed41797f482e/res_config.py
('state','not in',['uninstallable', 'uninstalled'])],
('state','in',['to install', 'installed', 'to upgrade'])],
def _already_installed(self, cr, uid, context=None): """ For each module (boolean fields in a res.config.installer), check if it's already installed (neither uninstallable nor uninstalled) and if it is, check it by default """ modules = self.pool.get('ir.module.module')
26ed95e7729fc93370ca8d9b34e4ed41797f482e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26ed95e7729fc93370ca8d9b34e4ed41797f482e/res_config.py
_description = "NOte Type"
_description = "Note Type"
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\ toolbar=False, submenu=False): """ Overrides orm field_view_get. @return: Dictionary of Fields, arch and toolbar. """
cf7ffa4adc308d0c5bc0d60b96961219651f2306 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf7ffa4adc308d0c5bc0d60b96961219651f2306/board.py
replaces[rep] = dict(obj.pool.get(rep).name_get(cr, uid, replaces[rep].keys(), context=context))
nids = obj.pool.get(rep).search(cr, uid, [('id','in',replaces[rep].keys())], context=context) replaces[rep] = dict(obj.pool.get(rep).name_get(cr, uid, nids, context=context))
def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, conte...
3ec84880c0b931e3ffaaf444bdff4db18cae69b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3ec84880c0b931e3ffaaf444bdff4db18cae69b9/fields.py
res_id = model_pool.message_new(cr, uid, msg, context)
res_id = model_pool.message_new(cr, uid, msg, context)fetchmail/fetchmail.py
logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name))
85cb8855353dd63ab74f936af9da115e16e5aa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cb8855353dd63ab74f936af9da115e16e5aa06/fetchmail.py
fp = os.popen('ping www.google.com -c 1 -w 5',"r") if not fp.read(): logger.notifyChannel('imap', netsvc.LOG_WARNING, 'lost internet connection !')
def fetch_mail(self, cr, uid, ids, context={}):
85cb8855353dd63ab74f936af9da115e16e5aa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/85cb8855353dd63ab74f936af9da115e16e5aa06/fetchmail.py
date_planned = (date_planned - relativedelta(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S')
date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S')
def action_ship_create(self, cr, uid, ids, *args): 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 = False for line in order.order_line: proc_id = ...
d37ef0a57183ba5ed91064c8bbe32aea90f4a1d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d37ef0a57183ba5ed91064c8bbe32aea90f4a1d1/sale.py
"AND reconcile_id IS NULL " \
" " + RECONCILE_TAG + " "\
def _get_intial_balance(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
f3d14cd792daaa9a466e49798baad4ded51ca0f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f3d14cd792daaa9a466e49798baad4ded51ca0f7/account_partner_ledger.py
'am_out': fields.boolean('Controle for Output Operations'), 'disc_controle': fields.boolean('Discount Controle '),
'am_out': fields.boolean('Control for Output Operations'), 'disc_controle': fields.boolean('Discount Control'),
def _scan_product(self, cr, uid, ean, qty, order): # search pricelist_id product_obj=self.pool.get('product.product') pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] ) if not pricelist_id: return False
c822a92a4058c8393c294cb73857cc166ad85882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c822a92a4058c8393c294cb73857cc166ad85882/pos.py
LOG_DEBUG2 = 'debug2'
def log(lvl,msg): netsvc.Logger().notifyChannel("index",lvl,msg)
83f646f97767fb00af65e05abb55642c4edeb4ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83f646f97767fb00af65e05abb55642c4edeb4ec/content_index.py
_columns = { 'year': fields.char('Year', size='4', readonly=True, select=1), 'canceled_number': fields.integer('Canceled', readonly=True), 'waiting_number': fields.integer('Waiting', readonly=True), 'invoiced_number': fields.integer('Invoiced', readonly=True), 'paid_number': fields.integer('Paid', readonly=True), 'can...
def init(self, cr): '''Create the view''' cr.execute("""
8ea62c39b6787b3fe12a7b257f8ebc7cfa89bfa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8ea62c39b6787b3fe12a7b257f8ebc7cfa89bfa2/membership.py
case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context)[0] for att in case_val.attendees:
case_val = case_obj.browse(cr, uid, alarmdata.get('id'), context) for att in case_val.attendee_ids:
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): if not context: context = {} cr.execute('select c.id as id, crm_case.date as date, alarm.id as alarm_id, alarm.name as name,\ alarm.trigger_interval, alarm.trigger_duration, alarm.trigger_related, \ alarm.trigger_occurs from crm_me...
58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py
ls = common.caldav_id2real_id(caldav_id)
ls = common.caldav_id2real_id(id)
def unlink(self, cr, uid, ids, context=None): for id in ids: ls = common.caldav_id2real_id(caldav_id) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: date_new = ls[1] for record in self.read(cr, uid, [common.caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: exdate = (record['exdate']...
58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py
'availability': fields.selection([('free', 'Free'), \ ('busy', 'Busy'), ('both', 'Both')], 'User Avaliability') } _defaults = { 'availability': lambda *x: 'free', }
}
def _get_user_avail(self, cr, uid, ids, name, args, context=None): res={} if not context or not context.get('model'): return {} else: model = context.get('model') obj = self.pool.get(model) event_obj = obj.browse(cr, uid, context['active_id']) event_start = event_obj.date event_end = datetime.datetime.strptime(event_ob...
58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py
datas = self.read(cr, uid, ids)[0] if not context or not context.get('model') or not datas.get('users'): return {} else: model = context.get('model') obj = self.pool.get(model) res_obj = obj.browse(cr, uid, context['active_id']) user_obj = self.pool.get('res.users') attendee_obj = self.pool.get('crm.caldav.attendee') f...
def do_invite(self, cr, uid, ids, context={}): #TODO: Add attendee return {}
58daced386e81a5f6a388d673de2232a232c686d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58daced386e81a5f6a388d673de2232a232c686d/crm_meeting.py
res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}}
res = {'value' : {}}
def on_change_parent(self, cr, uid, id, parent_id): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) numchild = len(childs) if parent['partner_id']: partner = parent['partner_id'][0] else: partner = False res = ...
c99638ab487563e5166f897714200532dc0afca9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c99638ab487563e5166f897714200532dc0afca9/project.py
value = acct_obj.search(cr, uid, [('type', 'in',('sale','sale_refund') )])
value = acct_obj.search(cr, uid, [('type', 'in',('sale','purchase_refund') )])
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
16620a3fff685df659700434c88a10374d682b86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16620a3fff685df659700434c88a10374d682b86/stock_invoice_onshipping.py
value = acct_obj.search(cr, uid, [('type', 'in',('purchase','purchase_refund') )])
value = acct_obj.search(cr, uid, [('type', 'in',('purchase','sale_refund') )])
def _get_journal_id(self, cr, uid, context=None): if context is None: context = {}
16620a3fff685df659700434c88a10374d682b86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16620a3fff685df659700434c88a10374d682b86/stock_invoice_onshipping.py
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, m.duration, \
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): """Gives virtual event ids for recurring events based on value of Recurrence Rule This method gives ids of dates that comes between start date and end date of calendar views @param self: The object pointer @param cr: the current ...
d44cd8ca622666b945c2e56d0c8b27c10a0970a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d44cd8ca622666b945c2e56d0c8b27c10a0970a0/base_calendar.py
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False)
def _get_account(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name return super(journal_print ,self)._get_account(data) def _get_fiscalyear(self, data): if data['model']=='account.journal.period': return self.p...
def _sum_currency_amount_account(self, account, form): self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) total = self.cr.fetchone()
1afb884e8d7aed85742d9900e7a9bf36cb857b9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1afb884e8d7aed85742d9900e7a9bf36cb857b9e/central_journal.py
return super(event_event, self)._check_recursion(self, cr, uid, ids)
return super(event_event, self)._check_recursion(cr, uid, ids)
def _check_recursion(self, cr, uid, ids): return super(event_event, self)._check_recursion(self, cr, uid, ids)
8fa6d985a7f79f332b6711b15fa6aea0afbade55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8fa6d985a7f79f332b6711b15fa6aea0afbade55/event.py
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
date = time.strptime(vals['date'], '%Y-%m-%d') if not (date >= time.strptime(period.date_start,'%Y-%m-%d') and date <= time.strptime(period.date_stop,'%Y-%m-%d') ):
def check_date(self, cr, uid, vals, context=None, check=True): if not context: context = {} if 'date' in vals.keys(): if 'journal_id' in vals and 'journal_id' not in context: journal_id = vals['journal_id'] if 'period_id' in vals and 'period_id' not in context: period_id = vals['period_id'] elif 'journal_id' not in con...
011f5100f3282b08855d6f105d0771f90321f094 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/011f5100f3282b08855d6f105d0771f90321f094/account_date_check.py
'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Real Entry'),
'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True, states={'draft':[('readonly',False)]}),
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id else: return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
7f6ef794068c1262a2e0f834b55d6b73b8b29611 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f6ef794068c1262a2e0f834b55d6b73b8b29611/voucher.py
val = {'invoiced': True}
for line in order.order_line: if line.state == 'exception': self.pool.get('sale.order.line').write(cr, uid, [line.id], {'state': 'confirmed'}, context=context)
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress'
06d2f4d107669396fbeb360194fd24f4ad3f41ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d2f4d107669396fbeb360194fd24f4ad3f41ac/sale.py
val['state'] = 'progress' for line in order.order_line: towrite = [] if line.state == 'exception': towrite.append(line.id) if towrite: self.pool.get('sale.order.line').write(cr, uid, towrite, {'state': 'confirmed'}, context=context) self.write(cr, uid, [order.id], val)
self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context)
def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} for order in self.browse(cr, uid, ids, context=context): val = {'invoiced': True} if order.state == 'invoice_except': val['state'] = 'progress'
06d2f4d107669396fbeb360194fd24f4ad3f41ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d2f4d107669396fbeb360194fd24f4ad3f41ac/sale.py
'logrotate': '1',
'logrotate': True,
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
group.add_option("--cert-file", dest="secure_cert_file", default="server.cert", help="specify the certificate file for the SSL connection") group.add_option("--pkey-file", dest="secure_pkey_file", default="server.pkey", help="specify the private key file for the SSL connection")
group.add_option("--cert-file", dest="secure_cert_file", help="specify the certificate file for the SSL connection") group.add_option("--pkey-file", dest="secure_pkey_file", help="specify the private key file for the SSL connection")
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
help="set the timeout for the cache system", default=100000, type="int")
help="set the timeout for the cache system", type="int")
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
default=None, help="do not rotate the logfile")
help="do not rotate the logfile")
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
group.add_option('--email-from', dest='email_from', default='', help='specify the SMTP email address for sending email') group.add_option('--smtp', dest='smtp_server', default='', help='specify the SMTP server for sending email') group.add_option('--smtp-port', dest='smtp_port', default='25', help='specify the SMTP por...
group.add_option('--email-from', dest='email_from', help='specify the SMTP email address for sending email') group.add_option('--smtp', dest='smtp_server', help='specify the SMTP server for sending email') group.add_option('--smtp-port', dest='smtp_port', help='specify the SMTP port', type="int") group.add_option('--sm...
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
group.add_option("--db_maxconn", dest="db_maxconn", default='64',
group.add_option("--db_maxconn", dest="db_maxconn", type='int',
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
security.add_option('--no-database-list', action="store_false", dest='list_db', default=True, help="disable the ability to return the list of databases")
security.add_option('--no-database-list', action="store_false", dest='list_db', help="disable the ability to return the list of databases")
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False...
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py
'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout','smtp_ssl', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password',
'db_port', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password',
def die(cond, msg): if cond: print msg sys.exit(1)
417f87440ec5b4bc42abe1f51f61b2309e111672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/417f87440ec5b4bc42abe1f51f61b2309e111672/config.py