rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
amount_unit=move.product_id.price_get(cr, uid, ids, pricetype.field, context)
amount_unit=move.product_id.price_get(pricetype.field, context)[move.product_id.id]
def action_done(self, cr, uid, ids, context=None): track_flag = False for move in self.browse(cr, uid, ids): if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting',...
9388c1b1f1e60139bcbee299df0359ab36da722b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9388c1b1f1e60139bcbee299df0359ab36da722b/stock.py
'sum_currency_amount_account': self._sum_currency_amount_account, 'get_filter': self._get_filter,
'sum_currency_amount_account': self._sum_currency_amount_account, 'get_filter': self._get_filter,
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...
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
'get_end_date':self._get_end_date, 'get_currency ':self.get_currency
'get_end_date':self._get_end_date, 'get_currency ':self._get_currency
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...
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
return currency_total
return currency_total
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()
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
return super(journal_print ,self)._get_account(data)
return super(journal_print ,self)._get_account(data)
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)
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
return super(journal_print ,self)._get_fiscalyear(data)
return super(journal_print ,self)._get_fiscalyear(data)
def _get_fiscalyear(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name return super(journal_print ,self)._get_fiscalyear(data)
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
return data['form']['amount_currency']
return data['form']['amount_currency']
def _get_currency(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).journal_id.currency or False return data['form']['amount_currency']
83bae2679c9e2a2e5d9ead04648b1f0162029f38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/83bae2679c9e2a2e5d9ead04648b1f0162029f38/general_journal.py
self.list[obj.code]=str(obj.amount)
self.list[str(obj.code)]=str(obj.amount)
def find_child(obj): self.list[obj.code]=str(obj.amount) if obj.child_ids: for child in obj.child_ids: find_child(child) return True
0560297729b16c7892c1ef80cb138315c4bfa8a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0560297729b16c7892c1ef80cb138315c4bfa8a7/account_report_print_indicators_with_pdf.py
continue
if not isinstance(field,fields.property): continue
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
9186fb8144f7c214dbd230f677231a28bdcf353e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9186fb8144f7c214dbd230f677231a28bdcf353e/expression.py
def _balance_search(self, cursor, user, obj, name, args):
def _balance_search(self, cursor, user, obj, name, args, domain=None, context=None): if context is None: context = {}
def _balance_search(self, cursor, user, obj, name, args): if not len(args): return [] where = ' and '.join(map(lambda x: '(abs(sum(debit-credit))'+x[1]+str(x[2])+')',args)) cursor.execute('select id, sum(debit-credit) from account_move_line \ group by id,debit,credit having '+where) res = cursor.fetchall() if not len(r...
222ab7cd116bfbee0f4f7b0bb80bd8239a89e863 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/222ab7cd116bfbee0f4f7b0bb80bd8239a89e863/account_move_line.py
self._handle_one_foreign(hnd,npath, vdir.auth_provider)
try: self._handle_one_foreign(hnd,npath, vdir.auth_provider) except IOError, e: if e.errno == errno.EPIPE: self.log_message("Could not complete request %s," \ "client closed connection", self.rlpath.rstrip()) else: raise
def handle_one_request(self): """Handle a single HTTP request. Dispatch to the correct handler. """ self.request.setblocking(True) self.raw_requestline = self.rfile.readline() if not self.raw_requestline: self.close_connection = 1 # self.log_message("no requestline, connection closed?") return if not self.parse_rawline...
1fed78619fa71675f3ae902abbafe65526a04f7c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1fed78619fa71675f3ae902abbafe65526a04f7c/websrv_lib.py
if form['journal_ids'][0][2]: journal = " in (" + ','.join(map(lambda x: str(x), form['journal_ids'][0][2])) + ")"
if form['journal_ids']: journal = " in (" + ','.join(map(lambda x: str(x), form['journal_ids'])) + ")"
def _ref_lines(self,form): result = [] res = {} acc_id = [] final = [] acc_pool = self.pool.get('account.analytic.account') line_pool = self.pool.get('account.analytic.line')
9e18e480f8e205f9a8c3ca1a039109ab483c438e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e18e480f8e205f9a8c3ca1a039109ab483c438e/crossovered_analytic.py
if form['journal_ids'][0][2]: journal=" in (" + ','.join(map(lambda x: str(x), form['journal_ids'][0][2])) + ")"
if form['journal_ids']: journal=" in (" + ','.join(map(lambda x: str(x), form['journal_ids'])) + ")"
def _lines(self,form,ids={}): if not ids: ids = self.ids
9e18e480f8e205f9a8c3ca1a039109ab483c438e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e18e480f8e205f9a8c3ca1a039109ab483c438e/crossovered_analytic.py
elif pick.state in ['confirmed','assigned']:
elif pick.state in ['confirmed','assigned', 'draft']:
def unlink(self, cr, uid, ids, context=None): for pick in self.browse(cr, uid, ids, context=context): if pick.state in ['done','cancel']: raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,)) elif pick.state in ['confirmed','assigned']: ids2 = [move.id for move in pic...
9f31cb419c4813367d2423edb42cd29e36c49cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f31cb419c4813367d2423edb42cd29e36c49cbc/stock.py
context.update({'call_unlink':True}) self.pool.get('stock.move').action_cancel(cr, uid, ids2, context) else: continue
ctx = context.copy() ctx.update({'call_unlink':True}) if pick.state != 'draft': move_obj.action_cancel(cr, uid, ids2, ctx) move_obj.unlink(cr, uid, ids2, ctx)
def unlink(self, cr, uid, ids, context=None): for pick in self.browse(cr, uid, ids, context=context): if pick.state in ['done','cancel']: raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,)) elif pick.state in ['confirmed','assigned']: ids2 = [move.id for move in pic...
9f31cb419c4813367d2423edb42cd29e36c49cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f31cb419c4813367d2423edb42cd29e36c49cbc/stock.py
data_of_file = '<?xml version="1.0"?>\n<VATSENDING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MultiDeclarationTVA-NoSignature-14.xml">'
data_of_file = '<?xml version="1.0"?>\n<VATSENDING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MultiDeclarationTVA-NoSignature-16.xml">'
def create_xml(self, cr, uid, ids, context=None): obj_fyear = self.pool.get('account.fiscalyear') obj_tax_code = self.pool.get('account.tax.code') obj_acc_period = self.pool.get('account.period') obj_user = self.pool.get('res.users') mod_obj = self.pool.get('ir.model.data')
8394924cc02566fb6a9e25d08332a11c750d5e22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8394924cc02566fb6a9e25d08332a11c750d5e22/l10n_be_account_vat_declaration.py
def create_xml(self, cr, uid, ids, context=None): obj_fyear = self.pool.get('account.fiscalyear') obj_tax_code = self.pool.get('account.tax.code') obj_acc_period = self.pool.get('account.period') obj_user = self.pool.get('res.users') mod_obj = self.pool.get('ir.model.data')
8394924cc02566fb6a9e25d08332a11c750d5e22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8394924cc02566fb6a9e25d08332a11c750d5e22/l10n_be_account_vat_declaration.py
'dir_id': fields.many2one('document.directory', 'Directory', required=True),
'dir_id': fields.many2one('document.directory', 'Directory', required=True, ondelete="cascade"),
# TODO def unlink(...
0bdc45e068d584220d2a1b399d5f0389fcd6e092 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0bdc45e068d584220d2a1b399d5f0389fcd6e092/document_directory.py
task_obj.write(cr, uid, data['id'], {
task_obj.write(cr, uid, [data['id']], {
def _do_assign(self, cr, uid, data, context): task_obj = pooler.get_pool(cr.dbname).get('project.task') task = task_obj.browse(cr, uid, data['id'], context) newname = data['form']['prefix'] or '' task_obj.copy(cr, uid, data['id'], { 'name': data['form']['name'], 'user_id': data['form']['user_id'], 'planned_hours': data...
294632110d8ae9fabb3ad2abcf15968f0cb68a4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/294632110d8ae9fabb3ad2abcf15968f0cb68a4b/task_delegate.py
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S") if start_date and start_date <= event_date: start_date = event_date
start_date = event_date
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): """ @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 base_start_date: Get Start Date @param base_until_date: Get End Date @param l...
b82c556ee9032c493f2cbb0194a68a904410153a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b82c556ee9032c493f2cbb0194a68a904410153a/base_calendar.py
cr.execute("""select p.id, p.name from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \
cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \
def compute_refund(self, cr, uid, ids, mode='refund', context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs
bcb30ec9c070cb47a98de3493a655ad105df8328 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcb30ec9c070cb47a98de3493a655ad105df8328/account_invoice_refund.py
active_id=str("active_id")
active_id = str("active_id")
# def ref() added because , if context has ref('id') eval wil use this ref
0a0103521c3329e5c6429634a9c0dfd976a9fde3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a0103521c3329e5c6429634a9c0dfd976a9fde3/convert.py
context=eval(context) domain=eval(domain)
context = eval(context)
def ref(str_id): return self.id_get(cr, None, str_id)
0a0103521c3329e5c6429634a9c0dfd976a9fde3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a0103521c3329e5c6429634a9c0dfd976a9fde3/convert.py
def list_web(self, cr, uid, context=False):
def list_web(self, cr, uid, context=None):
def list_web(self, cr, uid, context=False): """ list_web(cr, uid, context) -> [module_name] Lists all the currently installed modules with a web component.
60f6882c37c9473de9e0bfc1588fa203e700b7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60f6882c37c9473de9e0bfc1588fa203e700b7e2/module.py
def get_web(self, cr, uid, names, context=False):
def _web_dependencies(self, cr, uid, module, context=None): for dependency in module.dependencies_id: (parent,) = self.browse(cr, uid, self.search(cr, uid, [('name', '=', dependency.name)], context=context), context=context) if parent.web: yield parent.name else: self._web_dependencies( cr, uid, parent, context=context...
def get_web(self, cr, uid, names, context=False): """ get_web(cr, uid, [module_name], context) -> [{name, depends, content}]
60f6882c37c9473de9e0bfc1588fa203e700b7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60f6882c37c9473de9e0bfc1588fa203e700b7e2/module.py
'depends': [dep.name for dep in module.dependencies_id if self.search(cr, uid, [ ('name', '=', dep.name), ('web', '=', True) ], context=context)],
'depends': list(self._web_dependencies( cr, uid, module, context=context)),
def get_web(self, cr, uid, names, context=False): """ get_web(cr, uid, [module_name], context) -> [{name, depends, content}]
60f6882c37c9473de9e0bfc1588fa203e700b7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60f6882c37c9473de9e0bfc1588fa203e700b7e2/module.py
print 'login'
def login(db, login, password): print 'login' pool = pooler.get_pool(db) user_obj = pool.get('res.users') res = user_obj.login(db, login, password) print 'login end' return res
56e1e6cd2a8f82c2b78c7a99f10eabe6305e75ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e1e6cd2a8f82c2b78c7a99f10eabe6305e75ec/security.py
res = user_obj.login(db, login, password) print 'login end' return res
return user_obj.login(db, login, password)
def login(db, login, password): print 'login' pool = pooler.get_pool(db) user_obj = pool.get('res.users') res = user_obj.login(db, login, password) print 'login end' return res
56e1e6cd2a8f82c2b78c7a99f10eabe6305e75ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56e1e6cd2a8f82c2b78c7a99f10eabe6305e75ec/security.py
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)'), 'category_holiday_id': fields.many2one('hr.holidays', 'Holiday', help='For allocation By Employee Category...
def _employee_get(obj, cr, uid, context=None): if context is None: context = {} ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context) if ids: return ids[0] return False
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
def holidays_validate2(self, cr, uid, ids, *args): vals = {'state':'validate1'} self.check_holidays(cr, uid, ids) ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)]) if ids2: vals['manager_id'] = ids2[0] else: raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.')) r...
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
self._create_resource_leave(cr, uid, vals)
for leave_id in self.search(cr, uid, [('category_holiday_id', '=', record.id)]): wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
def holidays_validate(self, cr, uid, ids, *args): obj_emp = self.pool.get('hr.employee') data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) vals = {'state':'validate'} ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)]) if ids2: if data_holiday[0].state == 'validate1': vals['manager_id2'] = ...
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id })
self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id})
def holidays_confirm(self, cr, uid, ids, *args): obj_hr_holiday_status = self.pool.get('hr.holidays.status') for record in self.browse(cr, uid, ids): user_id = False leave_asked = record.number_of_days_temp if record.holiday_type == 'employee' and record.type == 'remove': if record.employee_id and not record.holiday_st...
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
ids2 = obj_emp.search(cr, uid, [('user_id','=', uid)])
def holidays_refuse(self, cr, uid, ids, *args): vals = {'state': 'refuse'} ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) if ids2: vals['manager_id'] = ids2[0] self.write(cr, uid, ids, vals) return True
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
self._remove_resouce_leave(cr, uid, ids)
leave_ids = self._get_category_leave_ids(cr, uid, ids) if leave_ids: self.unlink(cr, uid, leave_ids)
def holidays_cancel(self, cr, uid, ids, *args): self._update_user_holidays(cr, uid, ids) self.write(cr, uid, ids, {'state': 'cancel'}) self._remove_resouce_leave(cr, uid, ids) return True
8319012fca94b6f066e6d1f4e857737563eee7cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8319012fca94b6f066e6d1f4e857737563eee7cb/hr_holidays.py
res.update({'subject': str(context.get('subject', case.name) or '')})
res.update({'subject': ustr(context.get('subject', case.name) or '')})
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {}
3e195a7ceebfff3a4c72b23f842f60522549e126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e195a7ceebfff3a4c72b23f842f60522549e126/crm_send_email.py
if res and res[0][0] < 0:
if res and res[0][0] and res[0][0] < 0:
def _check_date(self, cr, uid, ids): if ids: cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')') res = cr.fetchall() if res and res[0][0] < 0: return False return True
418ac79d942f403b3b59edfe46559f9a225fe259 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/418ac79d942f403b3b59edfe46559f9a225fe259/hr_holidays.py
def _check_has_start(self, cr, uid, ids, context=None): for campaign in self.browse(cr, uid, ids, context=context): if not any(a.start for a in campaign.activity_ids): return False return True
def __str__(self): return self._str
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
_constraints = [(_check_has_start, 'Please mark at least one activity as a start activity', ['Activities'])]
def _check_has_start(self, cr, uid, ids, context=None): for campaign in self.browse(cr, uid, ids, context=context): if not any(a.start for a in campaign.activity_ids): return False return True
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") activity_ids = [ act_id.id for act_id in campaign.activity_ids] if not activity_ids: raise osv.except_osv(_("Error"), _("The campaign cannot be started : there are no activities in it")) act_obj = self.pool.get('mar...
if not campaign.activity_ids: raise osv.except_osv(_("Error"), _("The campaign cannot be started: there are no activities in it")) has_start = False has_signal_without_from = False for activity in campaign.activity_ids: if activity.start: has_start = True if activity.signal and len(activity.from_ids) == 0: has_signa...
def state_running_set(self, cr, uid, ids, *args): # TODO check that all subcampaigns are running campaign = self.browse(cr, uid, ids[0]) if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") activity_ids = [ act_id.id for act_id in campaign.activity_ids] if not activity...
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
if activity.email_template_id.enforce_from_account.state != 'approved' :
if activity.email_template_id.enforce_from_account.state != 'approved':
def state_running_set(self, cr, uid, ids, *args): # TODO check that all subcampaigns are running campaign = self.browse(cr, uid, ids[0]) if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") activity_ids = [ act_id.id for act_id in campaign.activity_ids] if not activity...
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
self.write(cr, uid, ids, {'state': 'running'}) return True
if not has_start and not has_signal_without_from: raise osv.except_osv(_("Error"), _("The campaign hasn't any starting activity nor any activity with a signal and no previous activity.")) return self.write(cr, uid, ids, {'state': 'running'})
def state_running_set(self, cr, uid, ids, *args): # TODO check that all subcampaigns are running campaign = self.browse(cr, uid, ids[0]) if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") activity_ids = [ act_id.id for act_id in campaign.activity_ids] if not activity...
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
inv_amount_company_currency = invoice.move_id.amount
inv_amount_company_currency = 0 for aml in invoice.move_id.line_id: if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'): inv_amount_company_currency += aml.debit inv_amount_company_currency -= aml.credit inv_amount_company_currency = abs(inv_amount_company_currency)
def _wo_check(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context) journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context) cur_obj = pool.get('res.currency') # Here we need that: # The invoice to...
e5be0142c4e4a8caaf79687a87089a10e781f98c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5be0142c4e4a8caaf79687a87089a10e781f98c/wizard_pay_invoice.py
select min(pt.id) as id, a.name as project, sum(pt.remaining_hours) as remaining_hours, a.state, pu.uid from project_task as pt, project_project as p, account_analytic_account as a, project_user_rel as pu where pt.project_id=p.id and p.category_id = a.id and pu.project_id=p.id group by a.name,a.state,pu.uid
select min(pt.id) as id, aaa.name as project, CASE WHEN pu.uid is null THEN aaa.user_id ELSE pu.uid END as uid, sum(pt.remaining_hours) as remaining_hours, aaa.state from project_task pt left join project_project as pp ON (pt.project_id=pp.id) left join account_analytic_account as aaa ON (pp.category_id=aaa.id) left jo...
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours') cr.execute(""" create or replace view project_vs_remaining_hours as ( select min(pt.id) as id, a.name as project, sum(pt.remaining_hours) as remaining_hours, a.state, pu.uid from project_task as pt, project_project as p, account_analyti...
d4a4ee06d7e670eb0600ea3d44507dd639bad859 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4a4ee06d7e670eb0600ea3d44507dd639bad859/project_report.py
result[id] = obj.datas[id][name]
result[id] = obj.datas[id].get(name, False)
def get_memory(self, cr, obj, ids, name, user=None, context=None, values=None): result = {} for id in ids: result[id] = obj.datas[id][name] return result
71e504345d769fb2448585267d67fbe7f66e209d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/71e504345d769fb2448585267d67fbe7f66e209d/fields.py
def set_context(self, objects, data, ids, report_type = None):
def set_context(self, objects, data, ids, report_type=None):
def set_context(self, objects, data, ids, report_type = None): new_ids = ids if (data['model'] == 'ir.ui.menu'): new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) self.query_get_clause = data['form']['query_li...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) self.query_get_clause = data['form']['query_line'] or '' super(journal_print, self).set_context(objects, data, new_ids, report_type)
self.query_get_clause = 'AND ' self.query_get_clause += data['form']['query_line'] or '' self.sort_selection = data['form']['sort_selection'] objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (t...
def set_context(self, objects, data, ids, report_type = None): new_ids = ids if (data['model'] == 'ir.ui.menu'): new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) self.query_get_clause = data['form']['query_li...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def __init__(self, cr, uid, name, context={}):
def __init__(self, cr, uid, name, context=None): if context is None: context = {}
def __init__(self, cr, uid, name, context={}): super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def lines(self, period_id, journal_id, sort_selection='date', *args):
def lines(self, period_id, journal_id=[]):
def lines(self, period_id, journal_id, sort_selection='date', *args): obj_jperiod = self.pool.get('account.journal.period') obj_mline = self.pool.get('account.move.line') self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draf...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draft'))
self.cr.execute('update account_journal_period set state=%s where journal_id IN %s and period_id=%s and state=%s', ('printed', self.journal_ids, period_id, 'draft'))
def lines(self, period_id, journal_id, sort_selection='date', *args): obj_jperiod = self.pool.get('account.journal.period') obj_mline = self.pool.get('account.move.line') self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draf...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
self.cr.execute('SELECT id FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s ORDER BY %s', (period_id, journal_id, sort_selection))
self.cr.execute('SELECT id FROM account_move_line l WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' ORDER BY '+ self.sort_selection + '' ,(period_id, self.journal_ids ))
def lines(self, period_id, journal_id, sort_selection='date', *args): obj_jperiod = self.pool.get('account.journal.period') obj_mline = self.pool.get('account.move.line') self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draf...
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def _sum_debit(self, period_id, journal_id): self.cr.execute('SELECT SUM(debit) FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s', (period_id, journal_id))
def _sum_debit(self, period_id, journal_id=[]): self.cr.execute('SELECT SUM(debit) FROM account_move_line l WHERE period_id=%s AND journal_id IN %s '+ self.query_get_clause +'', (period_id, self.journal_ids))
def _sum_debit(self, period_id, journal_id): self.cr.execute('SELECT SUM(debit) FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def _sum_credit(self, period_id, journal_id): self.cr.execute('SELECT SUM(credit) FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s', (period_id, journal_id))
def _sum_credit(self, period_id, journal_id=[]): self.cr.execute('SELECT SUM(credit) FROM account_move_line l WHERE period_id=%s AND journal_id IN %s '+ self.query_get_clause +'', (period_id, self.journal_ids))
def _sum_credit(self, period_id, journal_id): self.cr.execute('SELECT SUM(credit) FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def _sum_credit(self, period_id, journal_id): self.cr.execute('SELECT SUM(credit) FROM account_move_line l WHERE '+self.query_get_clause+' AND period_id=%s AND journal_id=%s', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name
if 'period_from' in form and form['period_from']: return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name return ''
def get_start_period(self, form): return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name
if 'period_to' in form and form['period_to']: return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name return ''
def get_end_period(self, form): return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr,self.uid,form['chart_account_id']).name
if 'chart_account_id' in form and form['chart_account_id']: return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr,self.uid,form['chart_account_id']).name return ''
def get_account(self, form): return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr,self.uid,form['chart_account_id']).name
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.py
def get_account(self, form): return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr,self.uid,form['chart_account_id']).name
af7c1f1bbe12cb2d916d673dd7c4ab1da7072471 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/af7c1f1bbe12cb2d916d673dd7c4ab1da7072471/account_journal.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. """
6aa18c41c77d3c041436ca6877fe31a88e2c753a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6aa18c41c77d3c041436ca6877fe31a88e2c753a/board.py
'share_root_url': lambda self, cr, uid, context, *a: context.get('share_root_url', _('Please specify "share_root_url" in server configuration or in context')),
'share_root_url': lambda self, cr, uid, context, *a: context.get('share_root_url') or _('Please specify "share_root_url" in context'),
def generate_random_pass(): pass_chars = RANDOM_PASS_CHARACTERS[:] random.shuffle(pass_chars) return ''.join(pass_chars[0:10])
9566084f4588118ec566b80948d30dffa7f68415 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9566084f4588118ec566b80948d30dffa7f68415/share_wizard.py
'audit':fields.boolean('Audit Complete ?', required=False),
'audit': fields.related('move_id','to_check', type='boolean', relation='account.move', string='Audit Complete ?'),
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]
aede150c10fa6c95b52865953c6a910e20e68047 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aede150c10fa6c95b52865953c6a910e20e68047/voucher.py
'amount':total, 'state':'proforma'
'amount':total
def open_voucher(self, dbcr, uid, ids, context={}): cr = 0.0 dr = 0.0 total = 0.0 new_line = [] position_pool = self.pool.get('account.fiscal.position') voucher_pool = self.pool.get('account.voucher') voucher_line_pool = self.pool.get('account.voucher.line') partner_pool = self.pool.get('res.partner') tax_pool = self....
aede150c10fa6c95b52865953c6a910e20e68047 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aede150c10fa6c95b52865953c6a910e20e68047/voucher.py
res[r[self._fields_id]].append(r['id'])
if r[self._fields_id] in res: 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 = {}
2d426ad6cef57dcf62cccf333d6ff8e1f66f1f67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2d426ad6cef57dcf62cccf333d6ff8e1f66f1f67/fields.py
description = email_last
description = case.email_last
def add_reply(self, cursor, user, ids, context=None): for case in self.browse(cursor, user, ids, context=context): if case.email_last: description = email_last self.write(cursor, user, case.id, { 'description': '> ' + description.replace('\n','\n> '), }, context=context) return True
16f184db93c7ee55f73681177f5f4cb230f8c95b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f184db93c7ee55f73681177f5f4cb230f8c95b/crm.py
""" Note /may/ be called with ndir_node = None, to rename the document root. """
""" Move directory. This operation is simple, since the present node is only used for static, simple directories. Note /may/ be called with ndir_node = None, to rename the document root. """
def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
3580708a49a60def7d61747274f7515047f344d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3580708a49a60def7d61747274f7515047f344d3/nodes.py
def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
3580708a49a60def7d61747274f7515047f344d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3580708a49a60def7d61747274f7515047f344d3/nodes.py
val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value
val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value_reference
def create_picking(self, cr, uid, ids, context={}): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking')
5c1695e248ceeebf30dca9326b5795053141124d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c1695e248ceeebf30dca9326b5795053141124d/pos.py
stock_dest_id = int(val.split(',')[1])
stock_dest_id = val.id
def create_picking(self, cr, uid, ids, context={}): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking')
5c1695e248ceeebf30dca9326b5795053141124d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c1695e248ceeebf30dca9326b5795053141124d/pos.py
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
5c1695e248ceeebf30dca9326b5795053141124d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c1695e248ceeebf30dca9326b5795053141124d/pos.py
order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
5c1695e248ceeebf30dca9326b5795053141124d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c1695e248ceeebf30dca9326b5795053141124d/pos.py
def price_get_multi_old(self, cr, uid, product_map, context=None): """multi products 'price_get' @param context: { 'date': Date of the pricelist (%Y-%m-%d), @return: a dict with product_id as key and the product price as value } """ def _create_parent_category_list(id, lst): if not id: return [] parent = product_categ...
def price_get_multi_old(self, cr, uid, product_map, context=None): """multi products 'price_get' @param context: { 'date': Date of the pricelist (%Y-%m-%d), @return: a dict with product_id as key and the product price as value } """
1d78ae166ba2ab9323049a83a16e403e5cd4f91c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d78ae166ba2ab9323049a83a16e403e5cd4f91c/pricelist.py
break
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
1d78ae166ba2ab9323049a83a16e403e5cd4f91c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d78ae166ba2ab9323049a83a16e403e5cd4f91c/pricelist.py
break
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
1d78ae166ba2ab9323049a83a16e403e5cd4f91c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d78ae166ba2ab9323049a83a16e403e5cd4f91c/pricelist.py
def create_entries(self, cr, uid, ids, context=None): account_model_obj = self.pool.get('account.model') account_period_obj = self.pool.get('account.period') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data') if context is...
d0ff4985386b3b20c754b8446aa15a4f25a03c70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d0ff4985386b3b20c754b8446aa15a4f25a03c70/account_use_model.py
context2=context.copy()
context2 = context.copy()
def do_create(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') analytic_account_obj = self.pool.get('account.analytic.account') res_partner_obj = self.pool.get('res.partner') account_payment_term_obj = self.pool.get('account.payment.term') invoices = []
f46f7a770b2d814434573b77e25d0d05332000c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f46f7a770b2d814434573b77e25d0d05332000c7/hr_timesheet_invoice_create.py
cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN %s AND product_id=%s and to_invoice=%s", (account.id, tuple(data['ids']), product_id, factor_id))
cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN %s AND product_id=%s and to_invoice=%s ORDER BY account_analytic_line.date", (account.id, tuple(data['ids']), product_id, factor_id))
def do_create(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') analytic_account_obj = self.pool.get('account.analytic.account') res_partner_obj = self.pool.get('res.partner') account_payment_term_obj = self.pool.get('account.payment.term') invoices = []
f46f7a770b2d814434573b77e25d0d05332000c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f46f7a770b2d814434573b77e25d0d05332000c7/hr_timesheet_invoice_create.py
details.append("%s %s" % (line['unit_amount'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
details.append("%s %s" % (line['unit_amount'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']],context2)[0].name))
def do_create(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') analytic_account_obj = self.pool.get('account.analytic.account') res_partner_obj = self.pool.get('res.partner') account_payment_term_obj = self.pool.get('account.payment.term') invoices = []
f46f7a770b2d814434573b77e25d0d05332000c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f46f7a770b2d814434573b77e25d0d05332000c7/hr_timesheet_invoice_create.py
urls.append(dict(url=url, tag=str(link), title=title)) html = soup.__str__()
urls.append(dict(url=ustr(url), tag=ustr(link), title=ustr(title))) html = ustr(soup.__str__())
def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) s...
acd4c9b04d186a5f448a9c4de0b1f77c730dad18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acd4c9b04d186a5f448a9c4de0b1f77c730dad18/misc.py
html += '[%s] %s\n' % (i+1, url)
html += ustr('[%s] %s\n') % (i+1, url)
def desperate_fixer(g): #print >>sys.stderr, "failed to clean up %s" % str(g.group()) return ' '
acd4c9b04d186a5f448a9c4de0b1f77c730dad18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acd4c9b04d186a5f448a9c4de0b1f77c730dad18/misc.py
html = body_mako_tpl.render( helper=helper, css=css, _=self.translate_call, **self.parser_instance.localcontext )
try : html = body_mako_tpl.render( helper=helper, css=css, _=self.translate_call, **self.parser_instance.localcontext ) except : raise Exception(exceptions.html_error_template().render())
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" if context is None: context={} if report_xml.report_type != 'webkit': return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
cdaef22f14104878cf21aba391c444cfe83e1abb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdaef22f14104878cf21aba391c444cfe83e1abb/webkit_report.py
head = head_mako_tpl.render( company=company, time=time, helper=helper, css=css, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, _debug=False )
try : head = head_mako_tpl.render( company=company, time=time, helper=helper, css=css, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, _debug=False ) except : raise Exception(exceptions.html_error_template().render())
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" if context is None: context={} if report_xml.report_type != 'webkit': return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
cdaef22f14104878cf21aba391c444cfe83e1abb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdaef22f14104878cf21aba391c444cfe83e1abb/webkit_report.py
foot = foot_mako_tpl.render( company=company, time=time, helper=helper, css=css, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, )
try : foot = foot_mako_tpl.render( company=company, time=time, helper=helper, css=css, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, ) except: raise Exception(exceptions.html_error_template().render())
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" if context is None: context={} if report_xml.report_type != 'webkit': return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
cdaef22f14104878cf21aba391c444cfe83e1abb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdaef22f14104878cf21aba391c444cfe83e1abb/webkit_report.py
deb = head_mako_tpl.render( company=company, time=time, helper=helper, css=css, _debug=html, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, )
try : deb = head_mako_tpl.render( company=company, time=time, helper=helper, css=css, _debug=html, formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, ) except : raise Exception(exceptions.html_error_template().render())
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" if context is None: context={} if report_xml.report_type != 'webkit': return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
cdaef22f14104878cf21aba391c444cfe83e1abb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cdaef22f14104878cf21aba391c444cfe83e1abb/webkit_report.py
'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='Salesman'),
'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesman'),
def _number_packages(self, cr, uid, ids, field_name, arg, context=None): if context is None: context = {} res = {} for line in self.browse(cr, uid, ids, context=context): try: res[line.id] = int((line.product_uom_qty+line.product_packaging.qty-0.0001) / line.product_packaging.qty) except: res[line.id] = 1 return res
ce1481d3d80c62bfb244a22a617e3a573439c917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ce1481d3d80c62bfb244a22a617e3a573439c917/sale.py
for file in self.browse(cr, uid, ids):
for file in self.browse(cr, uid, ids):
def _check_duplication(self, cr, uid, vals, ids=[], op='create'): name = vals.get('name', False) parent_id = vals.get('parent_id', False) res_model = vals.get('res_model', False) res_id = vals.get('res_id', 0) if op == 'write': for file in self.browse(cr, uid, ids): if not name: name = file.name if not parent_id: paren...
530932640babacde4973fd47f2a9632c1d70bd3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/530932640babacde4973fd47f2a9632c1d70bd3d/document.py
if fbro.parent_id != vals['parent_id']:
if fbro.parent_id.id != vals['parent_id']:
def write(self, cr, uid, ids, vals, context=None): if not isinstance(ids, list): ids = [ids] res = self.search(cr, uid, [('id', 'in', ids)]) if not len(res): return False if not self._check_duplication(cr, uid, vals, ids, 'write'): raise osv.except_osv(_('ValidateError'), _('File name must be unique!')) if 'parent_id' ...
530932640babacde4973fd47f2a9632c1d70bd3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/530932640babacde4973fd47f2a9632c1d70bd3d/document.py
t.type,
t.type_id,
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task_user') cr.execute(""" CREATE view report_project_task_user as SELECT (select 1 ) AS nbr, t.id as id, to_char(date_start, 'YYYY') as year, to_char(date_start, 'MM') as month, to_char(date_start, 'YYYY-MM-DD') as day, date_trunc('day',t.date_start...
233223b2a5102d950d6803b118283109f97dbb94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/233223b2a5102d950d6803b118283109f97dbb94/project_report.py
t.type
t.type_id
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'report_project_task_user') cr.execute(""" CREATE view report_project_task_user as SELECT (select 1 ) AS nbr, t.id as id, to_char(date_start, 'YYYY') as year, to_char(date_start, 'MM') as month, to_char(date_start, 'YYYY-MM-DD') as day, date_trunc('day',t.date_start...
233223b2a5102d950d6803b118283109f97dbb94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/233223b2a5102d950d6803b118283109f97dbb94/project_report.py
def onchange_type(self, cr, uid, ids, type, currency):
def onchange_type(self, cr, uid, ids, type, currency, context=None):
def onchange_type(self, cr, uid, ids, type, currency): obj_data = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users')
333f5b21c26f5547ebf8e53e16de2ce8c145bbf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/333f5b21c26f5547ebf8e53e16de2ce8c145bbf8/account.py
def onchange_type(self, cr, uid, ids, type, currency): obj_data = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users')
333f5b21c26f5547ebf8e53e16de2ce8c145bbf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/333f5b21c26f5547ebf8e53e16de2ce8c145bbf8/account.py
new_ids = ids
new_ids = 'active_ids' in data['form']['context'] and data['form']['context']['active_ids'] or []
def set_context(self, objects, data, ids, report_type = None): ## self.borne_date = self.get_min_date(data['form']) ## new_ids = [] if (data['model'] == 'account.account'): new_ids = ids else: new_ids.append(data['form']['Account_list'])
84830accf59d5cada276919684fe767f46a1eb70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/84830accf59d5cada276919684fe767f46a1eb70/general_ledger.py
cr.sql_log=1
def __init__(self, cr, uid, name, context): super(general_ledger, self).__init__(cr, uid, name, context=context) cr.sql_log=1 self.date_borne = {} self.query = "" self.child_ids = "" self.tot_currency = 0.0 self.period_sql = "" self.sold_accounts = {} self.localcontext.update( { 'time': time, 'lines': self.lines, 'sum_...
84830accf59d5cada276919684fe767f46a1eb70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/84830accf59d5cada276919684fe767f46a1eb70/general_ledger.py
total_fixed = (total_fixed * 100) / inv.amount_total
total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
def action_move_create(self, cr, uid, ids, *args): """Creates invoice related analytics and financial move lines""" ait_obj = self.pool.get('account.invoice.tax') cur_obj = self.pool.get('res.currency') context = {} for inv in self.browse(cr, uid, ids): if not inv.journal_id.sequence_id: raise osv.except_osv(_('Error !...
396c02cf429f49e16fb7ce87aa3b3f70f5ba824b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/396c02cf429f49e16fb7ce87aa3b3f70f5ba824b/invoice.py
if res: return res[0] else: return False
return res and res[0] or False
def _get_def_cparent(self, cr, uid, context): acc_obj=self.pool.get('account.account') tmpl_obj=self.pool.get('account.account.template') #print "Searching for ",context tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']],['parent_id']) if not tids or not tids[0]['parent_id']: return False ptids = tmpl_obj.read(cr, uid, ...
d497f5c6e979971f6221480b3578714f0b07ee72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d497f5c6e979971f6221480b3578714f0b07ee72/account.py
getattr(socket, 'SHUT_RDWR', 2)
getattr(socket, 'SHUT_RDWR', 2))
def stop(self): self.running = False if os.name != 'nt': try: self.server.socket.shutdown( getattr(socket, 'SHUT_RDWR', 2) except socket.error, e: if e.errno != 57: raise # OSX, socket shutdowns both sides if any side closes it # causing an error 57 'Socket is not connected' on shutdown # of the other side (or somethin...
0f27fbeb51d4d0a9200696604634f0363708b394 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0f27fbeb51d4d0a9200696604634f0363708b394/http_server.py
fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout return _to_unicode(fp.read())
pop = Popen(['antiword', fname], shell=False, stdout=PIPE) (data, _) = pop.communicate() return _to_unicode(data)
def _doIndexFile(self,fname): fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout return _to_unicode(fp.read())
f551479a9bd379204197947dbcbaac04972eb7ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f551479a9bd379204197947dbcbaac04972eb7ba/std_index.py
fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout return _to_unicode( fp.read())
pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE) (data, _) = pop.communicate() return _to_unicode(data)
def _doIndexFile(self,fname): fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout return _to_unicode( fp.read())
f551479a9bd379204197947dbcbaac04972eb7ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f551479a9bd379204197947dbcbaac04972eb7ba/std_index.py
if curr_id:
if curr_id and company_id:
def onchange_currency_id(self, cr, uid, ids, curr_id, company_id): if curr_id: currency = self.pool.get('res.currency').browse(cr, uid, curr_id) if currency.company_id.id != company_id: raise osv.except_osv(_('Configration Error !'), _('Can not select currency that is not related to current company.\nPlease select acco...
5d62f3debfa1ad3f816f9ef2a562589d2cd59b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5d62f3debfa1ad3f816f9ef2a562589d2cd59b52/invoice.py
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line):
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id):
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line): val={} dom={} if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable and partner_obj.property_account_receivable: if partner_obj.pro...
5d62f3debfa1ad3f816f9ef2a562589d2cd59b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5d62f3debfa1ad3f816f9ef2a562589d2cd59b52/invoice.py
period_obj = self.pool.get('account.period')
def _default_get(self, cr, uid, fields, context={}): # Compute simple values data = super(account_move_line, self).default_get(cr, uid, fields, context) # Starts: Manual entry from account.move form if context.get('lines',[]):
308981d14e239ae74e0d59514fc7117ce3457267 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/308981d14e239ae74e0d59514fc7117ce3457267/account_move_line.py
data_res_id = _get_id(model_name, line[i], current_module, 'id')
try: data_res_id = _get_id(model_name, line[i], current_module, 'id') except ValueError, e: pass xml_id = line[i]
def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0, skip=0): line = datas[position] row = {} warning = [] data_res_id = False nbrmax = position+1
21b9caa46b03594f484dc2233bc0a5c93c706cf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21b9caa46b03594f484dc2233bc0a5c93c706cf5/orm.py