rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
'type': fields.many2one('project.task.type', 'Stage'),
'type': fields.many2one('project.task.type', 'Stage',),
def _check_dates(self, cr, uid, ids, context={}): task = self.read(cr, uid, ids[0],['date_start', 'date_end']) if task['date_start'] and task['date_end']: if task['date_start'] > task['date_end']: return False return True
36b13c4073fb3341599c7245cf8b38de3bc26f83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/36b13c4073fb3341599c7245cf8b38de3bc26f83/project.py
res.update({'reply_to': case.section_id.reply_to})
res.update({'reply_to': case.section_id and case.section_id.reply_to or False})
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {}
d061a1955f975aba629007ad3f052e921bae9a02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d061a1955f975aba629007ad3f052e921bae9a02/crm_send_email.py
else: ctx = {}
def tr(src, ttype): # We try to do the same as the _(), but without the frame # inspection, since we aready are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: if args and isinstance(args[-1], dict): ctx = args[-1] else: ctx = {} elif isinstance(kwargs, dict)...
276a54b0af93d1fdd45aeeb4e051b0d7704d560d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/276a54b0af93d1fdd45aeeb4e051b0d7704d560d/osv.py
else: ctx = {}
def tr(src, ttype): # We try to do the same as the _(), but without the frame # inspection, since we aready are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: if args and isinstance(args[-1], dict): ctx = args[-1] else: ctx = {} elif isinstance(kwargs, dict)...
276a54b0af93d1fdd45aeeb4e051b0d7704d560d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/276a54b0af93d1fdd45aeeb4e051b0d7704d560d/osv.py
lang = ctx and ctx.get('lang', False)
lang = ctx and ctx.get('lang')
def tr(src, ttype): # We try to do the same as the _(), but without the frame # inspection, since we aready are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: if args and isinstance(args[-1], dict): ctx = args[-1] else: ctx = {} elif isinstance(kwargs, dict)...
276a54b0af93d1fdd45aeeb4e051b0d7704d560d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/276a54b0af93d1fdd45aeeb4e051b0d7704d560d/osv.py
def tr(src, ttype): # We try to do the same as the _(), but without the frame # inspection, since we aready are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: if args and isinstance(args[-1], dict): ctx = args[-1] else: ctx = {} elif isinstance(kwargs, dict)...
276a54b0af93d1fdd45aeeb4e051b0d7704d560d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/276a54b0af93d1fdd45aeeb4e051b0d7704d560d/osv.py
if not inv.line_ids: raise osv.except_osv(_('Error !'), _('You can not validate a voucher without lines !'))
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
683ab59cfd576b0b25e096b76254847f2b3ba718 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/683ab59cfd576b0b25e096b76254847f2b3ba718/voucher.py
end) as price_total,
end) / cr.rate as price_total,
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
end) as price_total_tax,
end)/(select count(l.id) from account_invoice_line as l left join account_invoice as a ON (a.id=l.invoice_id) where a.id=ai.id) /cr.rate as price_total_tax,
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
end) as price_average,
end) / cr.rate as price_average, cr.rate as currency_rate,
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
end)/(select count(l.*) from account_invoice_line as l
end)/(select count(l.id) from account_invoice_line as l
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
where a.id=ai.id) as residual
where a.id=ai.id) / cr.rate as residual
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
left join product_uom u on (u.id=ail.uos_id)
left join product_uom u on (u.id=ail.uos_id), res_currency_rate cr where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id) and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
def init(self, cr): tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select min(ail.id) as id, ai.date_invoice as date, to_char(ai.date_invoice, 'YYYY') as year, to_char(ai.date_invoice, 'MM') as month, to_char(ai.date_invoice, 'YYYY-MM-DD') as da...
e20699efa6374048d513f15595148d921039290b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e20699efa6374048d513f15595148d921039290b/account_invoice_report.py
counterpart_accounts[i['move_id']]=i['counterpart']
counterpart_accounts[i['move_id']] = i['counterpart']
def lines(self, account): """ Return all the account_move_line of account with their account code counterparts """ move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted', ''] # First compute all counterpart strings for every move_id where this account appear. # Currently, the counterpar...
4ec35ed71100abb1ed17296a8f9108790d20b017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ec35ed71100abb1ed17296a8f9108790d20b017/account_general_ledger.py
def lines(self, account): """ Return all the account_move_line of account with their account code counterparts """ move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted', ''] # First compute all counterpart strings for every move_id where this account appear. # Currently, the counterpar...
4ec35ed71100abb1ed17296a8f9108790d20b017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ec35ed71100abb1ed17296a8f9108790d20b017/account_general_ledger.py
def _get_sortby(self, data): if self.sortby == 'sort_date': return 'Date' elif self.sortby == 'sort_journal_partner': return 'Journal & Partner' return 'Date'
4ec35ed71100abb1ed17296a8f9108790d20b017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4ec35ed71100abb1ed17296a8f9108790d20b017/account_general_ledger.py
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', 0.0) power = form['power'] reconciled = unreconciled = 0 if not form['...
e1287cf82192624cbab3381c6909614c80db9ed0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e1287cf82192624cbab3381c6909614c80db9ed0/account_automatic_reconcile.py
if not obj.search(cr, uid, [('id', '=', field_value)]):
if not obj.search(cr, uid, [('id', '=', field_value or False)]):
fld_def = (field in self._columns) and self._columns[field] or self._inherit_fields[field][2]
9cdc40a633eed1a86a466d41e487b40c154f25cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9cdc40a633eed1a86a466d41e487b40c154f25cb/orm.py
print 'XXXXXXXX : ', cal_list, len(cal_list)
def get_data(self,form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname) #Getting Profit or Loss Balance from profit and Loss report result_pl=self.obj_pl.get_data(form) self.res_pl=self.obj_pl.final_result() type_pool = db_pool.get('account.account.type') account_pool = db_pool.get('account.acc...
48bbaeb25332ca893d2debd594293a33ba9866d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/48bbaeb25332ca893d2debd594293a33ba9866d5/report_bs.py
This method is used when importing data via client menu Example of fields to import for a sale.order
This method is used when importing data via client menu. Example of fields to import for a sale.order::
def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None): """ Import given data in given module
b2270b1a27d2a979e4e1b0129055b9c7c7d0c49e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b2270b1a27d2a979e4e1b0129055b9c7c7d0c49e/orm.py
'shortcut': fields.char('Shortcut', required=True, size=16),
'shortcut': fields.char('Shortcut', required=True, size=16, translate=True),
def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): cr.execute('select distinct parent_id from res_partner_category where id IN %s',(tuple(ids),)) ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True
0cbf401d86b2ab0364d41036a66d5bee4abb87ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cbf401d86b2ab0364d41036a66d5bee4abb87ab/partner.py
if f != 'id' and temp[count] == 1:
if not line.get('__group') and f != 'id' and temp[count] == 1:
def _append_node(name, text): n = etree.SubElement(config, name) n.text = text
043431014637563ca06b30dfced7df8f4140160d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/043431014637563ca06b30dfced7df8f4140160d/ps_list.py
col = etree.SubElement(node_line, 'col', para='yes', tree='no')
col = etree.SubElement(node_line, 'col', para='group', tree='no')
def _append_node(name, text): n = etree.SubElement(config, name) n.text = text
043431014637563ca06b30dfced7df8f4140160d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/043431014637563ca06b30dfced7df8f4140160d/ps_list.py
def get_user_related_details(self, cr, uid, user_id): res = {} emp_obj = self.pool.get('hr.employee') emp_id = emp_obj.search(cr, uid, [('user_id', '=', user_id)]) if not emp_id: user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name'] raise osv.except_osv(_('Bad Configuration !'), _('No emp...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
obj = self.pool.get('hr.analytic.timesheet')
obj_timesheet = self.pool.get('hr.analytic.timesheet') task_obj = self.pool.get('project.task')
def create(self, cr, uid, vals, *args, **kwargs): obj = self.pool.get('hr.analytic.timesheet') vals_line = {} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), too...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id'])
obj_task = task_obj.browse(cr, uid, vals['task_id'])
def create(self, cr, uid, vals, *args, **kwargs): obj = self.pool.get('hr.analytic.timesheet') vals_line = {} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), too...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
res = obj.on_change_account_id(cr, uid, False, acc_id)
res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id)
def create(self, cr, uid, vals, *args, **kwargs): obj = self.pool.get('hr.analytic.timesheet') vals_line = {} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), too...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
timeline_id = obj.create(cr, uid, vals_line, {})
amount = vals_line['unit_amount'] prod_id = vals_line['product_id'] unit = False timeline_id = obj_timesheet.create(cr, uid, vals=vals_line, context=kwargs['context'])
def create(self, cr, uid, vals, *args, **kwargs): obj = self.pool.get('hr.analytic.timesheet') vals_line = {} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), too...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
amount_unit=obj.on_change_unit_amount(cr, uid, line_id, vals_line['product_id'], vals_line['unit_amount'], unit, context) vals_line['amount'] = (-1) * vals['hours']* (unit_amount or 0.0) obj.write(cr, uid,[timeline_id], vals_line, {})
amount_unit=obj_timesheet.on_change_unit_amount(cr, uid, timeline_id, prod_id, amount, unit, context=kwargs['context']) vals_line['amount'] = (-1) * vals['hours']* (amount_unit['value']['amount'] or 0.0) obj_timesheet.write(cr, uid,[timeline_id], vals_line, {})
def create(self, cr, uid, vals, *args, **kwargs): obj = self.pool.get('hr.analytic.timesheet') vals_line = {} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), too...
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
task = self.pool.get('project.task.work').browse(cr, uid, ids)[0]
obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') task = self.pool.get('project.task.work').browse(cr, uid, ids, context=context)[0]
def write(self, cr, uid, ids, vals, context=None): vals_line = {}
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
list_avail_ids = self.pool.get('hr.analytic.timesheet').search(cr, uid, [])
list_avail_ids = timesheet_obj.search(cr, uid, [], context=context)
def write(self, cr, uid, ids, vals, context=None): vals_line = {}
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
obj = self.pool.get('hr.analytic.timesheet')
def write(self, cr, uid, ids, vals, context=None): vals_line = {}
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
def write(self, cr, uid, ids, vals, context=None): vals_line = {}
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
amount_unit=obj.on_change_unit_amount(cr, uid, line_id, vals_line['product_id'], vals_line['unit_amount'], unit, context) vals_line['amount'] = (-1) * vals['hours'] * (amount_unit or 0.0) obj.write(cr, uid, [line_id], vals_line, {})
unit = False amount_unit=obj.on_change_unit_amount(cr, uid, line_id, vals_line['product_id'], vals_line['unit_amount'], unit, context=context) vals_line['amount'] = (-1) * vals['hours'] * (amount_unit['value']['amount'] or 0.0) obj.write(cr, uid, [line_id], vals_line, context=context)
def write(self, cr, uid, ids, vals, context=None): vals_line = {}
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
def unlink(self, cr, uid, ids, *args, **kwargs): for task_obj in self.browse(cr, uid, ids, *args, **kwargs): if task_obj.work_ids: work_ids = [x.id for x in task_obj.work_ids] self.pool.get('project.task.work').unlink(cr, uid, work_ids, *args, **kwargs) return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
def unlink(self, cr, uid, ids, *args, **kwargs): for task_obj in self.browse(cr, uid, ids, *args, **kwargs): if task_obj.work_ids: work_ids = [x.id for x in task_obj.work_ids] self.pool.get('project.task.work').unlink(cr, uid, work_ids, *args, **kwargs) return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
c983859b9d5002f8242dfe4d759712ba51d466a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c983859b9d5002f8242dfe4d759712ba51d466a7/project_timesheet.py
'date': fields.date('Date', readonly=True),
def _amount_all(self, cr, uid, ids, field_name, arg, context): res = {} for id in ids: print context dir, type = id.split(' ') att = self.pool.get('ir.attachment') fids = att.search(cr, uid, [('parent_id','child_of',[int(dir)]),('change_type_id','=',int(type))], context=context) res[id] = { 'amount_required': 0, 'amoun...
936f5e53f333a7436f345dc3199a71746ee0580b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/936f5e53f333a7436f345dc3199a71746ee0580b/document_change_report.py
date_values = [from_date, to_date]
where.append(tuple([from_date])) where.append(tuple([to_date]))
def get_product_available(self, cr, uid, ids, context=None): """ Finds whether product is available or not in particular warehouse. @return: Dictionary of values """ if context is None: context = {} states = context.get('states',[]) what = context.get('what',()) if not ids: ids = self.search(cr, uid, []) res = {}.fromk...
fc8f5385d627e82fbca9d27f60177952ea07c7f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fc8f5385d627e82fbca9d27f60177952ea07c7f8/product.py
where = [tuple(location_ids),tuple(location_ids),tuple(ids),tuple(states)]
def get_product_available(self, cr, uid, ids, context=None): """ Finds whether product is available or not in particular warehouse. @return: Dictionary of values """ if context is None: context = {} states = context.get('states',[]) what = context.get('what',()) if not ids: ids = self.search(cr, uid, []) res = {}.fromk...
fc8f5385d627e82fbca9d27f60177952ea07c7f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fc8f5385d627e82fbca9d27f60177952ea07c7f8/product.py
'partner_id': fields.many2one('res.partner', 'Partner'),
'partner_id': fields.many2one('res.partner', 'Partner', select=1),
def _get_move_lines(self, cr, uid, ids, context=None): result = [] for move in self.pool.get('account.move').browse(cr, uid, ids, context=context): for line in move.line_id: result.append(line.id) return result
44300bb3be8dcadbb9455ebc86a99653bd2cb6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/44300bb3be8dcadbb9455ebc86a99653bd2cb6a4/account_move_line.py
sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context)
def action_produce_assign_service(self, cr, uid, ids, context={}): for procurement in self.browse(cr, uid, ids): sline = self.pool.get('sale.order.line') sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context) content = '' l = None project_id = None for line in sline.browse(cr, uid, sale_ids,...
dad9653395c1de6c799860d6e9be71f5bb231f3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad9653395c1de6c799860d6e9be71f5bb231f3c/mrp.py
proj_name = tools.ustr(procurement.name)
proj_name = tools.ustr(so_ref)
def action_produce_assign_service(self, cr, uid, ids, context={}): for procurement in self.browse(cr, uid, ids): sline = self.pool.get('sale.order.line') sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context) content = '' l = None project_id = None for line in sline.browse(cr, uid, sale_ids,...
dad9653395c1de6c799860d6e9be71f5bb231f3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad9653395c1de6c799860d6e9be71f5bb231f3c/mrp.py
project_id = self.pool.get('project.project').create(cr, uid, {'name':proj_name})
project_id = self.pool.get('project.project').create(cr, uid, {'name':proj_name,'category_id':analytic_account_id, 'partner_id':partner_id})
def action_produce_assign_service(self, cr, uid, ids, context={}): for procurement in self.browse(cr, uid, ids): sline = self.pool.get('sale.order.line') sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context) content = '' l = None project_id = None for line in sline.browse(cr, uid, sale_ids,...
dad9653395c1de6c799860d6e9be71f5bb231f3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad9653395c1de6c799860d6e9be71f5bb231f3c/mrp.py
'name': '%s:%s' %(procurement.product_id.name or procurement.origin, procurement.name or ''),
'name': '%s:%s' % name_task,
def action_produce_assign_service(self, cr, uid, ids, context={}): for procurement in self.browse(cr, uid, ids): sline = self.pool.get('sale.order.line') sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context) content = '' l = None project_id = None for line in sline.browse(cr, uid, sale_ids,...
dad9653395c1de6c799860d6e9be71f5bb231f3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dad9653395c1de6c799860d6e9be71f5bb231f3c/mrp.py
loc_id=False, product_id=False, context=None):
loc_id=False, product_id=False, uom_id=False, context=None):
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False, loc_id=False, product_id=False, context=None): """ On change of production lot gives a warning message. @param prodlot_id: Changed production lot id @param product_qty: Quantity of product @param loc_id: Location id @param product_id: Product ...
bf6cd14b5a1b5084a87a95b94cc562d638e5760a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6cd14b5a1b5084a87a95b94cc562d638e5760a/stock.py
'message': _('You are moving %.2f products but only %.2f available in this lot.') % (product_qty, prodlot.stock_available or 0.0)
'message': _('You are moving %.2f %s products but only %.2f %s available in this lot.') % (product_qty, uom.name, prodlot.stock_available or 0.0, uom.name)
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False, loc_id=False, product_id=False, context=None): """ On change of production lot gives a warning message. @param prodlot_id: Changed production lot id @param product_qty: Quantity of product @param loc_id: Location id @param product_id: Product ...
bf6cd14b5a1b5084a87a95b94cc562d638e5760a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6cd14b5a1b5084a87a95b94cc562d638e5760a/stock.py
def onchange_uos_quantity(self, cr, uid, ids, product_id, product_uos_qty, product_uos, product_uom): """ On change of product quantity finds UoM and UoS quantities @param product_id: Product id @param product_uos_qty: Changed UoS Quantity of product @param product_uom: Unit of measure of product @param product_uos: Un...
bf6cd14b5a1b5084a87a95b94cc562d638e5760a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bf6cd14b5a1b5084a87a95b94cc562d638e5760a/stock.py
def _file_get(self,cr, nodename=False, directory_id=False):
def _file_get(self,cr, nodename=False):
def _file_get(self,cr, nodename=False, directory_id=False): res = [] cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('directory_id','=',directory_id) ] ids = cntobj.search(cr, uid, where, context=ctx) for conte...
6ebec0292d26e73742cb62203b9a0ccf649d76d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ebec0292d26e73742cb62203b9a0ccf649d76d1/nodes.py
cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('directory_id','=',directory_id) ] ids = cntobj.search(cr, uid, where, context=ctx) for content in cntobj.browse(cr, uid, ids, context=ctx): res3 = cntobj._file_g...
def _file_get(self,cr, nodename=False, directory_id=False): res = [] cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('directory_id','=',directory_id) ] ids = cntobj.search(cr, uid, where, context=ctx) for conte...
6ebec0292d26e73742cb62203b9a0ccf649d76d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ebec0292d26e73742cb62203b9a0ccf649d76d1/nodes.py
def get_data(self, cr): res = '' for child in self.children(cr): res += child.get_data(cr) return res
6ebec0292d26e73742cb62203b9a0ccf649d76d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ebec0292d26e73742cb62203b9a0ccf649d76d1/nodes.py
return super(node_dir,self)._file_get(cr, nodename, self.dir_id)
res = super(node_dir,self)._file_get(cr, nodename) cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('directory_id','=',self.dir_id) ] ids = cntobj.search(cr, uid, where, context=ctx) for content in cntobj.brows...
def _file_get(self, cr, nodename=False): return super(node_dir,self)._file_get(cr, nodename, self.dir_id)
6ebec0292d26e73742cb62203b9a0ccf649d76d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ebec0292d26e73742cb62203b9a0ccf649d76d1/nodes.py
'password': generate_random_pass(),
'password': password,
def _create_new_share_users(self, cr, uid, wizard_data, group_id, context=None): user_obj = self.pool.get('res.users') current_user = user_obj.browse(cr, uid, uid) user_ids = [] if wizard_data.user_type == 'new': for new_user in wizard_data.new_users.split('\n'): # attempt to show more user-friendly msg than default co...
6f3ef38b8832d8ccb1d6a0cf03a36e2f952a8085 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6f3ef38b8832d8ccb1d6a0cf03a36e2f952a8085/share_wizard.py
def go_step_2(self, cr, uid, ids, context=None): wizard_data = self.browse(cr, uid, ids and ids[0], context=context) assert wizard_data.action_id and wizard_data.access_mode and \ ((wizard_data.user_type == 'new' and wizard_data.new_users) or \ (wizard_data.user_type == 'existing' and wizard_data.user_ids))
6f3ef38b8832d8ccb1d6a0cf03a36e2f952a8085 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6f3ef38b8832d8ccb1d6a0cf03a36e2f952a8085/share_wizard.py
'login_message','get_stats', 'check_connectivity']:
'login_message','get_stats', 'check_connectivity', 'list_http_services']:
def dispatch(self, method, auth, params): logger = netsvc.Logger() if method in [ 'ir_set','ir_del', 'ir_get' ]: return self.common_dispatch(method,auth,params) if method == 'login': # At this old dispatcher, we do NOT update the auth proxy res = security.login(params[0], params[1], params[2]) msg = res and 'successful...
7d1f26cdd286bb13f05827446955a9391b731fc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7d1f26cdd286bb13f05827446955a9391b731fc6/web_services.py
name, self, ''.join(traceback.format_trace())))
name, self, ''.join(traceback.format_exc())))
def __getitem__(self, name): if name == 'id': return self._id if name not in self._data[self._id]: # build the list of fields we will fetch
2b4d6bb821cba997001225b19e40ab34bb17f196 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b4d6bb821cba997001225b19e40ab34bb17f196/orm.py
ids, self, ''.join(traceback.format_trace())))
ids, self, ''.join(traceback.format_exc())))
def __getitem__(self, name): if name == 'id': return self._id if name not in self._data[self._id]: # build the list of fields we will fetch
2b4d6bb821cba997001225b19e40ab34bb17f196 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2b4d6bb821cba997001225b19e40ab34bb17f196/orm.py
for field,dest in (('rml','report_rml'),('file','report_file'),('xml','report_xml'),('xsl','report_xsl'),('attachment','attachment'),('attachment_use','attachment_use')):
for field,dest in (('rml','report_rml'),('file','report_rml'),('xml','report_xml'),('xsl','report_xsl'),('attachment','attachment'),('attachment_use','attachment_use')):
def _tag_report(self, cr, rec, data_node=None): res = {} for dest,f in (('name','string'),('model','model'),('report_name','name')): res[dest] = rec.get(f,'').encode('utf8') assert res[dest], "Attribute %s of report is empty !" % (f,) for field,dest in (('rml','report_rml'),('file','report_file'),('xml','report_xml'),(...
3e44b15833aeff145186d03663a57039536ffaa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e44b15833aeff145186d03663a57039536ffaa6/convert.py
'company_id' in objects[0] and objects[0].company_id:
objects[0].exists() and 'company_id' in objects[0] and objects[0].company_id:
def set_context(self, objects, data, ids, report_type = None): self.localcontext['data'] = data self.localcontext['objects'] = objects self.localcontext['digits_fmt'] = self.digits_fmt self.localcontext['get_digits'] = self.get_digits self.datas = data self.ids = ids self.objects = objects if report_type: if report_typ...
d33f6f290323a0eaf259817e840a8a8b45e0bb27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d33f6f290323a0eaf259817e840a8a8b45e0bb27/report_sxw.py
uom_id = line.product_id.uom_po_id.id
uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
def create_order(self, cr, uid, ids, context): """ To Create a purchase orders . @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 @param context: A standard dictionary @return: {} """ record_ids = context and context.get('ac...
57d63a488d8793dde3c0aca7ba6a86b381aa5980 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/57d63a488d8793dde3c0aca7ba6a86b381aa5980/purchase_requisition_partner.py
newdate = newdate - line.product_id.seller_ids[0].delay
newdate = newdate -(line.product_id.seller_ids and line.product_id.seller_ids[0].delay or DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
def create_order(self, cr, uid, ids, context): """ To Create a purchase orders . @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 @param context: A standard dictionary @return: {} """ record_ids = context and context.get('ac...
57d63a488d8793dde3c0aca7ba6a86b381aa5980 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/57d63a488d8793dde3c0aca7ba6a86b381aa5980/purchase_requisition_partner.py
partner = line.product_id.seller_ids[0].name pricelist_id = partner.property_product_pricelist_purchase.id
partner = line.product_id.seller_ids and line.product_id.seller_ids[0].name or supplier_data pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id
def create_order(self, cr, uid, ids, context): """ To Create a purchase orders . @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 @param context: A standard dictionary @return: {} """ record_ids = context and context.get('ac...
57d63a488d8793dde3c0aca7ba6a86b381aa5980 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/57d63a488d8793dde3c0aca7ba6a86b381aa5980/purchase_requisition_partner.py
if short: return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d')))
if idate: if short: return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) else: return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
def ics_datetime(idate, short=False): if short: return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) else: return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
568351b86acf37bfade00da7c8f1ba5065f03fc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/568351b86acf37bfade00da7c8f1ba5065f03fc2/base_calendar.py
return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
return False
def ics_datetime(idate, short=False): if short: return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) else: return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
568351b86acf37bfade00da7c8f1ba5065f03fc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/568351b86acf37bfade00da7c8f1ba5065f03fc2/base_calendar.py
sub = res_obj.name att_infos = []
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context=None): """ Send mail for event invitation to event attendees. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of attendee’s IDs. @param emai...
568351b86acf37bfade00da7c8f1ba5065f03fc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/568351b86acf37bfade00da7c8f1ba5065f03fc2/base_calendar.py
else: other_invitation_ids = [] for att2 in self.browse(cr, uid, other_invitation_ids): att_infos.append(((att2.user_id and att2.user_id.name) or \ (att2.partner_id and att2.partner_id.name) or \ att2.email) + ' - Status: ' + att2.state.title()) body_vals = {'name': res_obj.name, 'start_date': res_obj.date, 'end_date'...
for att2 in self.browse(cr, uid, other_invitation_ids): att_infos.append(((att2.user_id and att2.user_id.name) or \ (att2.partner_id and att2.partner_id.name) or \ att2.email) + ' - Status: ' + att2.state.title()) body_vals = {'name': res_obj.name, 'start_date': res_obj.date, 'end_date': res_obj.date_deadline or False...
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context=None): """ Send mail for event invitation to event attendees. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of attendee’s IDs. @param emai...
568351b86acf37bfade00da7c8f1ba5065f03fc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/568351b86acf37bfade00da7c8f1ba5065f03fc2/base_calendar.py
groupby = groupby[0]
if isinstance(groupby, list): groupby = groupby[0]
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): groupby_list = groupby groupby = groupby[0] context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
4f09c9ffa5ef1c45b8480d17fe4af72f74f6edcd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4f09c9ffa5ef1c45b8480d17fe4af72f74f6edcd/orm.py
'lines_ids': [(0,0,{
'line_ids': [(0,0,{
def make_po(self, cr, uid, ids, context={}): sequence_obj=self.pool.get('ir.sequence') res = super(mrp_procurement, self).make_po(cr, uid, ids, context) for proc_id,po_id in res.items(): procurement = self.browse(cr, uid, proc_id) if procurement.product_id.purchase_requisition: self.pool.get('purchase.requisition').cre...
46d953d66031826f0f50781dc8e93ba1efcb2bc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/46d953d66031826f0f50781dc8e93ba1efcb2bc5/purchase_requisition.py
res[r] = str(res[r])
if isinstance(res[r],dict): for record in res[r].keys(): res[r][record] = str(res[r][record]) else: res[r] = str(res[r])
def get(self, cr, obj, ids, name, user=None, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if self._method: res = self._fnct(obj, cr, user, ids, name, self._arg, context) else: res = self._fnct(cr, obj._table, ids, name, self._arg, context)
32d41097f6f7a5b8750f24ceb834653b4877fce1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/32d41097f6f7a5b8750f24ceb834653b4877fce1/fields.py
toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context)
toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context)
def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define a...
f2ee21bc8725b1d69b176d44233f6629ac8894b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2ee21bc8725b1d69b176d44233f6629ac8894b1/account_analytic_plans.py
line.unlink(cr, uid, toremove, context=context)
analytic_line_obj.unlink(cr, uid, toremove, context=context)
def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define a...
f2ee21bc8725b1d69b176d44233f6629ac8894b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2ee21bc8725b1d69b176d44233f6629ac8894b1/account_analytic_plans.py
ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals)
ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context)
def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define a...
f2ee21bc8725b1d69b176d44233f6629ac8894b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2ee21bc8725b1d69b176d44233f6629ac8894b1/account_analytic_plans.py
obj_model = self.pool.get('ir.model.data') obj_act = self.pool.get('ir.actions.act_window') order= obj_payment_order.browse(cr, uid, context['active_id'], context) t = order.mode and order.mode.type.code or 'manual' if t == 'manual' : obj_payment_order.set_done(cr,uid,context['active_id'],context) return {} gw = obj_p...
return obj_payment_order.set_done(cr, uid, context['active_id'], context)
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') obj_model = self.pool.get('ir.model.data') obj_act = self.pool.get('ir.actions.act_window') order= obj_payment_o...
821343fa42b0d41277eea8258cb25a94b8812ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/821343fa42b0d41277eea8258cb25a94b8812ee6/account_payment_pay.py
logging.warning('The module %s does not contain a description file: __openerp__.py or __terp__.py (deprecated)' % module)
logging.getLogger('addons').debug('The module %s does not contain a description file:'\ '__openerp__.py or __terp__.py (deprecated)', module)
def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = addons.get_module_resource(module, filename) if os.path.isfile(description_file): return eval(tools.file_open(description_file).re...
16749901c7f77b6bf85aa6d82894a23142950259 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16749901c7f77b6bf85aa6d82894a23142950259/__init__.py
return self.pool.get('account.period').find(cr, uid)
period_ids = self.pool.get('account.period').find(cr, uid) return period_ids and period_ids[0] or False
def _get_period(self, cr, uid, context=None): """Return default period value""" return self.pool.get('account.period').find(cr, uid)
dbfec32302dec88c6c3d5d0b3bedf5e1c8e83ee8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dbfec32302dec88c6c3d5d0b3bedf5e1c8e83ee8/account_tax_chart.py
opeartor = 'in'
operator = 'in'
def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type)
846f4cab7591309e65f9a897a6d7f4390d276c75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/846f4cab7591309e65f9a897a6d7f4390d276c75/expression.py
vals = model_obj.import_cal(cr, uid, data['file_path'], context['active_id'], context)
vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context)
def process_imp_ics(self, cr, uid, ids, context=None): """ Process Import ics File. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar event import’s IDs @return: dictionary of calendar evet import window with Import successful msg....
52e44a68190d520ba670fccb72b07ffb20612bf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52e44a68190d520ba670fccb72b07ffb20612bf5/calendar_event_import.py
cr.execute('SELECT SUM('+mode+') '\ 'FROM account_move_line '\ 'WHERE move_id=%s AND id<>%s', (move.id, line_id2))
cr.execute('SELECT SUM(%s) FROM account_move_line WHERE move_id=%%s AND id!=%%s' % (mode,), (move.id, line_id2))
def _centralise(self, cr, uid, move, mode, context=None): if context is None: context = {}
08011d69f0a0fe2e550fd44aa0face6314a50fa5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/08011d69f0a0fe2e550fd44aa0face6314a50fa5/account.py
'process_type_id' :fields.many2one('change.process.type','Type Change'),
'process_type_id' :fields.many2one('document.change.process.type','Type Change'),
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}): res = {} #TODOto calculate latest modified date from all related documents return res
0fee286988daca3188403f8491e42faad892fccb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fee286988daca3188403f8491e42faad892fccb/document_change.py
'user_id':field.many2one('res.users','Change Owner'),
'user_id':fields.many2one('res.users','Change Owner'),
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}): res = {} #TODOto calculate latest modified date from all related documents return res
0fee286988daca3188403f8491e42faad892fccb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0fee286988daca3188403f8491e42faad892fccb/document_change.py
bom_point = sbom_obj.browse(cr, uid, [bom_id])[0]
bom_point = bom_obj.browse(cr, uid, [bom_id])[0]
def change_prod_qty(self, cr, uid, ids, context): """ Changes the Quantity of Product. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of IDs selected @param context: A standard dictionary @return: """ record_id = context and context.get('...
1afb92d56e92dc63e9cc31d1e926b392a75d80f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1afb92d56e92dc63e9cc31d1e926b392a75d80f3/change_production_qty.py
'date': fields.datetime('Created Date'),
'date': fields.datetime('Creation Date'),
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, select=True, help="Location where the system will stock the finished products."), 'address_id': fields.many2one('res.partner.address', 'Dest. Address', help="Address where goods are to be delivered"),
'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True, select=True, help="Location where the system will stock the finished products."), 'address_id': fields.many2one('res.partner.address', 'Destination Address', help="Optional address where goods are to be delivered, specifically ...
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, help="This is the code that will be put on the logistical unit: pallet, box, pack."),
'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, help="Logistical shipping unit: pallet, box, pack ..."),
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
'move_dest_id': fields.many2one('stock.move', 'Dest. Move'), 'move_history_ids': fields.many2many('stock.move', 'stock_move_history_ids', 'parent_id', 'child_id', 'Move History'), 'move_history_ids2': fields.many2many('stock.move', 'stock_move_history_ids', 'child_id', 'parent_id', 'Move History'),
'move_dest_id': fields.many2one('stock.move', 'Destination Move', help="Optional: next stock move when chaining them"), 'move_history_ids': fields.many2many('stock.move', 'stock_move_history_ids', 'parent_id', 'child_id', 'Move History (child moves)'), 'move_history_ids2': fields.many2many('stock.move', 'stock_move_his...
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
if not context: context={} group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Administration / Configuration','Administration / Access Rights'))]) user_obj = self.pool.get('res.users') group=[] user_rec = user_obj.read(cr, uid, uid) for move in self.browse(cr, uid, ids): if move.state=='done': gro...
if uid != 1: for move in self.browse(cr, uid, ids): if move.state == 'done': frozen_fields = set(['product_qty', 'product_uom', 'product_uos_qty', 'product_uos', 'location_id', 'location_dest_id', 'product_id']) if frozen_fields.intersection(vals): raise osv.except_osv(_('Operation forbidden'), _('Quantities, UoMs, Pro...
def write(self, cr, uid, ids, vals, context=None): if not context: context={} group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Administration / Configuration','Administration / Access Rights'))]) user_obj = self.pool.get('res.users') group=[] user_rec = user_obj.read(cr, uid, uid) for move in se...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
def write(self, cr, uid, ids, vals, context=None): if not context: context={} group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Administration / Configuration','Administration / Access Rights'))]) user_obj = self.pool.get('res.users') group=[] user_rec = user_obj.read(cr, uid, uid) for move in se...
a47b49e672b314e5b1d6416498f868e991137407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a47b49e672b314e5b1d6416498f868e991137407/stock.py
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
def _find_next_stage(self, cr, uid, stage_list, index, current_seq, stage_pool, context=None): if index + 1 == len(stage_list): return False print "cul" print index next_stage_id = stage_list[index + 1] next_stage = stage_pool.browse(cr, uid, next_stage_id, context=context) if not next_stage: return False next_seq = n...
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
stages = stage_pool.search(cr, uid, domain, order='sequence')
stages = stage_pool.search(cr, uid, domain, order=order) current_seq = case.stage_id.sequence
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
if index + 1 == len(stages): return False else: next_stage = stages[index + 1] current_seq = case.stage_id.sequence
print stages print "call" next_stage = self._find_next_stage(cr, uid, stages, index, current_seq, stage_pool, context=context)
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
stage = stage_pool.browse(cr, uid, next_stage, context=context) next_seq = stage.sequence if current_seq and (next_seq - current_seq) >= 1: data = {'stage_id': next_stage} if stage.on_change: data.update({'probability': stage.probability})
next_stage_id = next_stage.id data = {'stage_id': next_stage.id} if next_stage.on_change: data.update({'probability': next_stage.probability})
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
return next_stage
return next_stage_id def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security che...
def stage_next(self, cr, uid, ids, context=None): """This function computes next stage for case from its current stage using available stage for that case type @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...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
if not context: context = {} stage_pool = self.pool.get('crm.case.stage') stage_type = context and context.get('stage_type','') for case in self.browse(cr, uid, ids, context): prev_stage = False data = {} domain = [('type', '=', stage_type),('section_ids', '=', case.section_id.id)] if case.section_id and case.section_i...
return self.stage_change(cr, uid, ids, context=context, order='sequence desc')
def stage_previous(self, cr, uid, ids, context=None): """This function computes previous stage for case from its current stage using available stage for that case type @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:...
d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d34186d12f03a2bf0d0f663c6b0f5c9ad16dfbec/crm.py
def onchange_multi_level_bom(self, cr, uid, ids, multi_level_bom, context={}): """ Changes multi_level_bom. @param multi_level_bom: Changed multi_level_bom @return: Dictionary of changed values """ bom_ids = ids and ids[0] bom = self.browse(cr, uid, bom_ids) line_ids = bom and map(lambda x:x.id, bom.bom_lines) if mul...
def onchange_product_id(self, cr, uid, ids, product_id, name, context={}): """ Changes UoM and name if product_id changes. @param name: Name of the field @param product_id: Changed product_id @return: Dictionary of changed values """ if product_id: prod = self.pool.get('product.product').browse(cr, uid, [product_id])[...
b14d68ebc4850f80bf5476b372ac5595cb1165e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b14d68ebc4850f80bf5476b372ac5595cb1165e0/mrp.py
logging.getLogger('test').exception('Tests failed to execute in %s module %s', module_name)
logging.getLogger('test').exception('Tests failed to execute in module %s', module_name)
def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test_disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: logging.getLogger('test').exception('Tests failed to execute in %s module %s', module_name) finally: if tools.config.options['test_commit']: ...
a536adce045486b3546c4a4a3064277530ed6981 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a536adce045486b3546c4a4a3064277530ed6981/__init__.py
cr.execute('ALTER TABLE "%s" DROP COLUMN "%s"'% (self._table, k))
cr.execute('ALTER TABLE "%s" DROP COLUMN "%s" CASCADE'% (self._table, k))
f_pg_def = res[0]
1d5272071d7af6c0680a952cfaa6635cdffacf32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d5272071d7af6c0680a952cfaa6635cdffacf32/orm.py
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.")
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals.get('name', 'n/a')) + _(" with origin")+" '" + vals.get('origin', 'n/a') + "' "+ _("is created.")
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) type_list = { 'out':_('Packing List'), 'in':_('Reception'), 'internal': _('Internal picking'), 'deli...
3cad22e37fcccebcaaf0f736b135161ee21ef3b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3cad22e37fcccebcaaf0f736b135161ee21ef3b7/stock.py
hrs = float(planned / occupation_rate)
hrs = float(planned / float(occupation_rate))
def onchange_planned(self, cr, uid, ids, project, user_id=False, planned=0.0, effective=0.0, date_start=None, occupation_rate=0.0): result = {} if date_start: resource_pool = self.pool.get('resource.resource') project_pool = self.pool.get('project.project') resource_calendar = self.pool.get('resource.calendar') dt_star...
55a89995e14a6a5d15b5c4c50a09a16e914503c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/55a89995e14a6a5d15b5c4c50a09a16e914503c4/project.py
'get_start_date': self.get_start_date, 'get_end_date': self.get_end_date,
'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date,
def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update( { 'time': time, 'lines': self.lines, 'periods': self.periods, 'sum_debit_period': self._sum_debit_per...
aaf2eea2b140750bbf041043db0b87ddc6224cfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aaf2eea2b140750bbf041043db0b87ddc6224cfd/general_journal.py
data = self.browse(cr, uid, ids, context=context)
data = self.browse(cr, uid, ids[0], context=context)
def mass_mail_send(self, cr, uid, ids, context): """ Send Email
eec37bdb7786b497ba7f7af9f35e91fabf80bc51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/eec37bdb7786b497ba7f7af9f35e91fabf80bc51/partner_wizard_spam.py