rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
ldt = dt | def create_xml(self, cr, uid, ids, datas, context=None): obj_emp = pooler.get_pool(cr.dbname).get('hr.employee') start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d') end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d') first_monday = start_date - relativedelta(days=start_date.date().we... | 05ed5b453100d4d0cbb09af0856be5978df82ce7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05ed5b453100d4d0cbb09af0856be5978df82ce7/timesheet.py | |
proj_exist_id = self.pool.get('project.project').search(cr, uid, [('name','=',proj_name)], context=context) | proj_exist_id = project_obj.search(cr, uid, [('name','=',proj_name)], context=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') content = '' sale_order = self.pool.get('sale.order') so_ref = procurement.name.split(':')[0] order_ids = sale_order.search(cr, uid, [('name','=',so_ref)], context) | 4979159094fe414df0d50f8f9dde19d44525781d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4979159094fe414df0d50f8f9dde19d44525781d/mrp.py |
project_id = self.pool.get('project.project').create(cr, uid, {'name':proj_name,'category_id':analytic_account_id, 'partner_id':partner_id}) | project_id = project_obj.create(cr, uid, {'name':proj_name, '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') content = '' sale_order = self.pool.get('sale.order') so_ref = procurement.name.split(':')[0] order_ids = sale_order.search(cr, uid, [('name','=',so_ref)], context) | 4979159094fe414df0d50f8f9dde19d44525781d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4979159094fe414df0d50f8f9dde19d44525781d/mrp.py |
'account_id': vals['analytic_account_id'], | 'account_id': vals.get('analytic_account_id', False), | def create(self, cr, uid, vals, context=None, check=True): if not context: context={} account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: raise osv.except_osv(_('Bad account!'), _('You ... | ff2277ac3020d8bb9f0f84356b8df589385954b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff2277ac3020d8bb9f0f84356b8df589385954b5/account_move_line.py |
'amount': vals['debit'] or vals['credit'], | 'amount': vals.get('debit', False) or vals.get('credit', False) or 0.0, | def create(self, cr, uid, vals, context=None, check=True): if not context: context={} account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: raise osv.except_osv(_('Bad account!'), _('You ... | ff2277ac3020d8bb9f0f84356b8df589385954b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff2277ac3020d8bb9f0f84356b8df589385954b5/account_move_line.py |
raise osv.except_osv(_('Warning !'), _('There is no stage for won oppportunities defined for this Sale Team.')) | raise osv.except_osv(_('Warning !'), _('There is no stage for won opportunities defined for this Sale Team.')) | def case_close(self, cr, uid, ids, *args): """Overrides close for crm_case for setting probability and close date @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 case Ids @param *args: Tuple Value for additi... | 6b735b672cd7bc8954e370238249896149898448 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6b735b672cd7bc8954e370238249896149898448/crm_opportunity.py |
raise osv.except_osv(_('Warning !'), _('There is no stage for lost oppportunities defined for this Sale Team.')) | raise osv.except_osv(_('Warning !'), _('There is no stage for lost opportunities defined for this Sale Team.')) | def case_mark_lost(self, cr, uid, ids, *args): """Mark the case as lost: state = done and probability = 0% @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 case Ids @param *args: Tuple Value for additional Pa... | 6b735b672cd7bc8954e370238249896149898448 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6b735b672cd7bc8954e370238249896149898448/crm_opportunity.py |
vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') | if work_times: vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') | def write(self, cr, uid, ids, vals, context={}): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') uom_obj = self.pool.get('product.uom') if not context: context = {} if context.get('scheduler',False): return super(project_phase, self).write(cr, uid, ids, vals,... | 717d62066f9193665ec3a54cb50f999a06c4e10e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/717d62066f9193665ec3a54cb50f999a06c4e10e/project_long_term.py |
vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') | if work_times: vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') | def write(self, cr, uid, ids, vals, context={}): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') uom_obj = self.pool.get('product.uom') if not context: context = {} if context.get('scheduler',False): return super(project_phase, self).write(cr, uid, ids, vals,... | 717d62066f9193665ec3a54cb50f999a06c4e10e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/717d62066f9193665ec3a54cb50f999a06c4e10e/project_long_term.py |
result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') | if work_times: result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') | 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 = {} resource = False resource_obj = self.pool.get('resource.resource') project_pool = self.pool.get('project.project') resource_calendar = self.pool.get('resource.calendar') if not... | 717d62066f9193665ec3a54cb50f999a06c4e10e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/717d62066f9193665ec3a54cb50f999a06c4e10e/project_long_term.py |
vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') super(task, self).write(cr, uid, ids, vals, context=context) | if work_times: vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') | def write(self, cr, uid, ids, vals, context={}): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') if not context: context = {} if context.get('scheduler',False): return super(task, self).write(cr, uid, ids, vals, context=context) | 717d62066f9193665ec3a54cb50f999a06c4e10e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/717d62066f9193665ec3a54cb50f999a06c4e10e/project_long_term.py |
vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') super(task, self).write(cr, uid, ids, vals, context=context) | if work_times: vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') | def write(self, cr, uid, ids, vals, context={}): resource_calendar_obj = self.pool.get('resource.calendar') resource_obj = self.pool.get('resource.resource') if not context: context = {} if context.get('scheduler',False): return super(task, self).write(cr, uid, ids, vals, context=context) | 717d62066f9193665ec3a54cb50f999a06c4e10e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/717d62066f9193665ec3a54cb50f999a06c4e10e/project_long_term.py |
'ref': fields.related('move_id', 'ref', type='char', size=64), | 'ref': fields.related('move_id', 'ref', type='char', size=64, store=True), | def _get_move_lines(self, cr, uid, ids, context={}): 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 | cc358558d870ee36fd7c6ed60d5a1599d7c87151 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cc358558d870ee36fd7c6ed60d5a1599d7c87151/account_move_line.py |
'charts':fields.selection(_get_charts, 'Chart of Accounts', readonly=True), | 'charts':fields.selection(_get_charts, 'Chart of Accounts'), | def _if_account(self, cr, uid, ids, context=None): chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] self.logger.notifyChannel( 'installer', netsvc.LOG_DEBUG, 'Addon "account" selected, installing chart of accounts %s'%chart) return [chart] | dda93d798d027c8b7ff5f7236055396ba71134ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/dda93d798d027c8b7ff5f7236055396ba71134ec/installer.py |
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['state'])) | state_dict = {'wait':'Waiting','confirmed':'Confirmed','approved':'Approved','except_picking': 'Shipping Exception','except_invoice': 'Invoice Exception','done': 'Done'} raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!') %_(eval(s['state'],state_dict))) | def unlink(self, cr, uid, ids, context=None): purchase_orders = self.read(cr, uid, ids, ['state']) unlink_ids = [] for s in purchase_orders: if s['state'] in ['draft','cancel']: unlink_ids.append(s['id']) else: raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['s... | 6f6849744f6429023e4d00dfe12f60ad86844e47 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6f6849744f6429023e4d00dfe12f60ad86844e47/purchase.py |
def get_value(cursor, user, recid, message=None, template=None, context=None): """ Evaluates an expression and returns its value @param cursor: Database Cursor @param user: ID of current user @param recid: ID of the target record under evaluation @param message: The expression to be evaluated @param template: BrowseRec... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
help="The Recipient of email. " | help="The Recipient of email. " | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
'reply_to':fields.char('Reply-To', size=250, | 'reply_to':fields.char('Reply-To', size=250, | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
'message_id':fields.char('Message-ID', size=250, | 'message_id':fields.char('Message-ID', size=250, | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
This is useful for CRM leads for example"), | This is useful for CRM leads for example"), | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
help="the signature from the User details" | help="the signature from the User details" | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
"so they will be added in all emails created from this template"), | "so they will be added in all emails created from this template"), | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
help="Action that will open this email template on Resource records", | help="Action that will open this email template on Resource records", | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
help="Button in the side bar of the form view of this Resource that will invoke the Window Action", | help="Button in the side bar of the form view of this Resource that will invoke the Window Action", | def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
def change_model(self, cursor, user, ids, object_name, context=None): if object_name: mod_name = self.pool.get('ir.model').read( cursor, user, object_name, ['model'], context)['model'] else: mod_name = False return { 'value':{'model_int_name':mod_name} } | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def delete_action(self, cr, uid, ids, context): self.unlink_action(cr, uid, ids, context) return True | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def unlink(self, cr, uid, ids, context=None): self.unlink_action(cr, uid, ids, context) return super(email_template, self).unlink(cr, uid, ids, context) | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() old = self.read(cr, uid, id, ['name'], context=context) new_name = _("Copy of template ") + old.get('name', 'No Name') check = self.search(cr, uid, [('name', '=', new_name)], context=context) if check: new... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
expression += "|default: '''%s'''" % null_value | expression += "|default: '''%s'''" % null_value | def build_expression(self, field_name, sub_field_name, null_value, template_language='mako'): """ Returns a template expression based on data provided @param field_name: field name @param sub_field_name: sub field name (M2O) @param null_value: default value if the target value is empty @param template_language: name of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
return expression | return expression | def build_expression(self, field_name, sub_field_name, null_value, template_language='mako'): """ Returns a template expression based on data provided @param field_name: field name @param sub_field_name: sub field name (M2O) @param null_value: default value if the target value is empty @param template_language: name of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
def onchange_model_object_field(self, cr, uid, ids, model_object_field, template_language, context=None): if not model_object_field: return {} result = {} field_obj = self.pool.get('ir.model.fields').browse(cr, uid, model_object_field, context) #Check if field is relational if field_obj.ttype in ['many2one', 'one2many'... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def _add_attachment(self, cursor, user, mailbox_id, name, data, filename, context=None): """ Add an attachment to a given mailbox entry. :param data: base64 encoded attachment data to store """ attachment_obj = self.pool.get('ir.attachment') attachment_data = { 'name': (name or '') + _(' (Email Attachment)'), 'datas'... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def generate_attach_reports(self, cursor, user, template, record_id, mail, context=None): """ Generate report to be attached and attach it to the email, and add any directly attached files as well. @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
@param mail: Browse record of email object @return: True | @param mail: Browse record of email object @return: True | def generate_attach_reports(self, cursor, user, template, record_id, mail, context=None): """ Generate report to be attached and attach it to the email, and add any directly attached files as well. @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
context) | context) | def generate_attach_reports(self, cursor, user, template, record_id, mail, context=None): """ Generate report to be attached and attach it to the email, and add any directly attached files as well. @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
def generate_attach_reports(self, cursor, user, template, record_id, mail, context=None): """ Generate report to be attached and attach it to the email, and add any directly attached files as well. @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def _generate_mailbox_item_from_template(self, cursor, user, template, record_id, context=None): """ Generates an email from the template for record record_id of target object @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of the target model for ... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
@return: ID of created object | @return: ID of created object | def _generate_mailbox_item_from_template(self, cursor, user, template, record_id, context=None): """ Generates an email from the template for record record_id of target object @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of the target model for ... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
def _generate_mailbox_item_from_template(self, cursor, user, template, record_id, context=None): """ Generates an email from the template for record record_id of target object @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of the target model for ... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def _generate_mailbox_item_from_template(self, cursor, user, template, record_id, context=None): """ Generates an email from the template for record record_id of target object @param cursor: Database Cursor @param user: ID of User @param template: Browse record of template @param record_id: ID of the target model for ... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def generate_mail(self, cursor, user, template_id, record_ids, context=None): if context is None: context = {} template = self.browse(cursor, user, template_id, context=context) if not template: raise Exception("The requested template could not be loaded") result = True mailbox_obj = self.pool.get('email_template.mailb... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
def _default_model(self, cursor, user, context=None): """ Returns the default value for model field @param cursor: Database Cursor @param user: ID of current user @param context: OpenERP Context """ return self.pool.get('email.template').read( cursor, user, context['template_id'], ['object_name'], context)['object_name... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
'reply_to':fields.char('Reply-To', size=250, | 'reply_to':fields.char('Reply-To', size=250, | def _default_model(self, cursor, user, context=None): """ Returns the default value for model field @param cursor: Database Cursor @param user: ID of current user @param context: OpenERP Context """ return self.pool.get('email.template').read( cursor, user, context['template_id'], ['object_name'], context)['object_name... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
'message_id':fields.char('Message-ID', size=250, | 'message_id':fields.char('Message-ID', size=250, | def _default_model(self, cursor, user, context=None): """ Returns the default value for model field @param cursor: Database Cursor @param user: ID of current user @param context: OpenERP Context """ return self.pool.get('email.template').read( cursor, user, context['template_id'], ['object_name'], context)['object_name... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py |
def on_change_ref(self, cr, uid, ids, rel_model_ref, context=None): if context is None: context = {} if not rel_model_ref: return {} vals = {} if context == {}: context = self.context template = self.pool.get('email.template').browse(cr, uid, context['template_id'], context) #Search translated template lang = get_value... | c73e17329c92d262f57a45e57664e059f5ce62c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c73e17329c92d262f57a45e57664e059f5ce62c3/email_template.py | ||
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['From']), body['body']) | self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), body['body'], self._decode_header(msg['From']), False, {'model' : self.model}) | def msg_user(self, msg, id): body = self.msg_body_get(msg) | ac53d556dbca1adf7eff94ce678b8ae1ae1fdd3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac53d556dbca1adf7eff94ce678b8ae1ae1fdd3d/openerp_mailgate.py |
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['From']), message['body']) | self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), message['body'], self._decode_header(msg['From']), False, {'model' : self.model}) | def msg_partner(self, msg, id): message = self.msg_body_get(msg) body = message['body'] act = 'case_open' self.rpc(self.model, act, [id]) #body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) #data = { # 'description':body, #} #self.rpc(self.model, 'write', [id], data) attachments = message['attachment... | ac53d556dbca1adf7eff94ce678b8ae1ae1fdd3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac53d556dbca1adf7eff94ce678b8ae1ae1fdd3d/openerp_mailgate.py |
defines the list of date/time exceptions for arecurring calendar component."), | defines the list of date/time exceptions for a recurring calendar component."), | def _get_rulestring(self, cr, uid, ids, name, arg, context=None): """ Gets Recurrence rule string according to value type RECUR of iCalendar from the values given. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard di... | edb6830d8601d335797ccf7ef8378ab1b6e22f5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/edb6830d8601d335797ccf7ef8378ab1b6e22f5b/base_calendar.py |
if not line.location_src_id: self.write(cr, uid, procurement.id, {'message': _('No source location defined to generate the picking !')}) | def check_move(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: if not line.location_src_id: self.write(cr, uid, procurement.id, {'message': _('No source location defined to generate the picki... | bb3b2ab637eeb259b96e8298995dd86aa5c1cb93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb3b2ab637eeb259b96e8298995dd86aa5c1cb93/procurement_pull.py | |
def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False): | def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, address_id=False): | def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False): if not prod_id: return {} product = self.pool.get('product.product').browse(cr, uid, [prod_id])[0] uos_id = product.uos_id and product.uos_id.id or False result = { 'name': product.partner_ref, 'product_uom': product.uom_id.id... | d79db3f73a64108b6353660443186e6e27796164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d79db3f73a64108b6353660443186e6e27796164/stock.py |
product = self.pool.get('product.product').browse(cr, uid, [prod_id])[0] | lang = False if address_id: addr_rec = self.pool.get('res.partner.address').browse(cr, uid, address_id) if addr_rec: lang = addr_rec.partner_id and addr_rec.partner_id.lang or False ctx = {'lang': lang} product = self.pool.get('product.product').browse(cr, uid, [prod_id], context=ctx)[0] | def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False): if not prod_id: return {} product = self.pool.get('product.product').browse(cr, uid, [prod_id])[0] uos_id = product.uos_id and product.uos_id.id or False result = { 'name': product.partner_ref, 'product_uom': product.uom_id.id... | d79db3f73a64108b6353660443186e6e27796164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d79db3f73a64108b6353660443186e6e27796164/stock.py |
message = email.message_from_string(str(msg)) subject = "[%s] %s" %(res_id, self._decode_header(message['Subject'])) | message = email.message_from_string(tools.ustr(msg).encode('utf-8')) subject = "[%s] %s" %(res_id, message['Subject']) | def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @... | f5a6adca75121226c34767ea5512dbb52968df44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f5a6adca75121226c34767ea5512dbb52968df44/mail_gateway.py |
def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @... | f5a6adca75121226c34767ea5512dbb52968df44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f5a6adca75121226c34767ea5512dbb52968df44/mail_gateway.py | ||
""") %(self._decode_header(message['From']), res_id, message['body']) | """) %(message['From'], res_id, message['body']) | def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @... | f5a6adca75121226c34767ea5512dbb52968df44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f5a6adca75121226c34767ea5512dbb52968df44/mail_gateway.py |
temp_msg = '[%s] %s'%(res_id, self._decode_header(message['Subject'])) | temp_msg = '[%s] %s'%(res_id, message['Subject']) | def email_send(self, cr, uid, model, res_id, msg, from_email=False, email_default=False): """This function Sends return email on submission of Fetched email in OpenERP database @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @... | f5a6adca75121226c34767ea5512dbb52968df44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f5a6adca75121226c34767ea5512dbb52968df44/mail_gateway.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 process_report(self, node): values = {} for dest, f in (('name','string'), ('model','model'), ('report_name','name')): values[dest] = getattr(node, f) assert values[dest], "Attribute %s of report is empty !" % (f,) for field,dest in (('rml','report_rml'),('file','report_file'),('xml','report_xml'),('xsl','report_xs... | b7d9aa6a50d72d1aea553b00394a4228411a4f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b7d9aa6a50d72d1aea553b00394a4228411a4f0c/yaml_import.py |
'file_type': fields.char('Content Type', size=32), | 'file_type': fields.char('Content Type', size=64), | def _data_set(self, cr, uid, id, name, value, arg, context): if not value: return True fbro = self.browse(cr, uid, id, context=context) nctx = nodes.get_node_context(cr, uid, context) fnode = nodes.node_file(None, None, nctx, fbro) res = fnode.set_data(cr, base64.decodestring(value), fbro) return res | 43f356ec67f042ef97ac70e332913fd82a472276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/43f356ec67f042ef97ac70e332913fd82a472276/document.py |
from tools import yaml_tag | def doc_createXElement(xdoc, tagName): e = xElement(tagName) e.ownerDocument = xdoc return e | 828b21de250497a7caa8b508fe37d477a10ea3d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/828b21de250497a7caa8b508fe37d477a10ea3d9/base_module_record.py | |
fname = model_pool._columns[key]._fields_id | model_pool._columns[key]._fields_id | def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False): data_pool = self.pool.get('ir.model.data') model_pool = self.pool.get(model) record = doc.createElement('record') record.setAttribute("id", record_id) record.setAttribute("model", model) record_list = [record] lids = data_pool.search(cr,... | 828b21de250497a7caa8b508fe37d477a10ea3d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/828b21de250497a7caa8b508fe37d477a10ea3d9/base_module_record.py |
fname = model_pool._inherit_fields[key][2]._fields_id | model_pool._inherit_fields[key][2]._fields_id | def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False): data_pool = self.pool.get('ir.model.data') model_pool = self.pool.get(model) record = doc.createElement('record') record.setAttribute("id", record_id) record.setAttribute("model", model) record_list = [record] lids = data_pool.search(cr,... | 828b21de250497a7caa8b508fe37d477a10ea3d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/828b21de250497a7caa8b508fe37d477a10ea3d9/base_module_record.py |
'product_id': fields.many2one('product.product', 'Product', required=True, select=True), | 'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')]), | 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... | 05f2617d1b90c053574ff7cd3597c9fa398b37f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05f2617d1b90c053574ff7cd3597c9fa398b37f0/stock.py |
tax_obj.compute(cr, uid, line.product_id.taxes_id, | tax_obj.compute_all(cr, uid, line.product_id.taxes_id, | def _amount_all(self, cr, uid, ids, name, args, context=None): tax_obj = self.pool.get('account.tax') res={} for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_paid': 0.0, 'amount_return':0.0, 'amount_tax':0.0, } for payment in order.statement_ids: res[order.id]['amount_paid'] += payment.amount for paym... | ef9361f19d298217d92797dd1ba798b5b36f407c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef9361f19d298217d92797dd1ba798b5b36f407c/pos.py |
(1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) | (1-(line.discount or 0.0)/100.0), line.qty)['taxes'], res[order.id]['amount_tax']) | def _amount_all(self, cr, uid, ids, name, args, context=None): tax_obj = self.pool.get('account.tax') res={} for order in self.browse(cr, uid, ids): res[order.id] = { 'amount_paid': 0.0, 'amount_return':0.0, 'amount_tax':0.0, } for payment in order.statement_ids: res[order.id]['amount_paid'] += payment.amount for paym... | ef9361f19d298217d92797dd1ba798b5b36f407c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef9361f19d298217d92797dd1ba798b5b36f407c/pos.py |
computed_taxes = account_tax_obj.compute( cr, uid, taxes, line.price_unit, line.qty) | computed_taxes = account_tax_obj.compute_all( cr, uid, taxes, line.price_unit, line.qty)['taxes'] | 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 | ef9361f19d298217d92797dd1ba798b5b36f407c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef9361f19d298217d92797dd1ba798b5b36f407c/pos.py |
computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty) | computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes'] | def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context): res = {} account_tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty) for tax in... | ef9361f19d298217d92797dd1ba798b5b36f407c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ef9361f19d298217d92797dd1ba798b5b36f407c/pos.py |
try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next'... | cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=%s', (res['id'], True)) if res['number_next']: re... | def get_id(self, cr, uid, sequence_id, test='id=%s', context=None): try: cr.execute('SELECT id, number_next, prefix, suffix, padding FROM ir_sequence WHERE '+test+' AND active=%s FOR UPDATE', (sequence_id, True)) res = cr.dictfetchone() if res: cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment... | 470f5bf1258947b8fe1439f1143bc4d7c665e1c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/470f5bf1258947b8fe1439f1143bc4d7c665e1c8/ir_sequence.py |
_order = "name" | _order = "project_id, date_start, sequence, name" | def _get_default_uom_id(self, cr, uid): model_data_obj = self.pool.get('ir.model.data') model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour') return model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id'] | 0cb1ed9f96b2f313b649c542540fa9ec269d35a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb1ed9f96b2f313b649c542540fa9ec269d35a2/project_long_term.py |
logger.notifyChannel('orm', netsvc.LOG_ERROR, "the columns %s on object must be set as ondelete='cascasde'" % (self._name, self._parent_name)) | logger.notifyChannel('orm', netsvc.LOG_ERROR, "The column %s on object %s must be set as ondelete='cascade'" % (self._parent_name, self._name)) | def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if not hasattr(self, "_auto") or self._auto: cr.execute("SELECT relname FROM pg_class WHERE relkind in ('r','v') AND relname='%s'" % self._table) if not cr.rowcount:... | 0d836ea56e5a5530ad558ac634da4b4240de0aeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d836ea56e5a5530ad558ac634da4b4240de0aeb/orm.py |
partner = (picking.purchase_id and picking.purchase_id.partner_id) or (picking.sale_id and picking.sale_id.partner_id) or (picking.address_id and picking.address_id.partner_id) | partner = picking.address_id and picking.address_id.partner_id | def action_invoice_create(self, cr, uid, ids, journal_id=False, group=False, type='out_invoice', context=None): """ Creates invoice based on the invoice state selected for picking. @param journal_id: Id of journal @param group: Whether to create a group invoice or not @param type: Type invoice to be created @return: Id... | 6d84b87556364fbc31973fd7e2a9832f40568cbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6d84b87556364fbc31973fd7e2a9832f40568cbe/stock.py |
if line.location_id==proc.location_id: | if line.location_id == proc.location_id: | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
picking_id =picking_obj.create(cr, uid, { | picking_id = picking_obj.create(cr, uid, { | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
'note': line.name, | 'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s ( | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
move_id =move_obj.create(cr, uid, { | move_id = move_obj.create(cr, uid, { | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
'note': line.name, | 'note': _('Move for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s ( | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
self.write(cr, uid, [proc.id], {'state':'running','message':_('Moved from other location')}) | wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
procurement_order() | procurement_order() | def action_move_create(self, cr, uid, ids,context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in proc.p... | cf533b524f70d5d46e370195c895a4dc2270de18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf533b524f70d5d46e370195c895a4dc2270de18/mrp_pull.py |
if line.account_id.currency_id: if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id): | if line.account_id.currency_id and line.currency_id: if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id): | def validate(self, cr, uid, ids, context={}): if context and ('__last_update' in context): del context['__last_update'] | 480182a68d4bac88eea048f7327d3de55dad9c25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/480182a68d4bac88eea048f7327d3de55dad9c25/account.py |
def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}): res = super(product_product, self)._product_available(cr, uid, ids, field_names, arg, context) for f in field_names: c = context.copy() if f=='stock_value': c.update({ 'states':('done',), 'what':('in', 'out') }) stock = self.get_produc... | 3071ddcd55e22bf9cf96c0fe9d545bada6272309 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3071ddcd55e22bf9cf96c0fe9d545bada6272309/product_price_unit.py | ||
_constraints = [ (_check_allow_negative_stock, 'Error: Negative stock quantities are not allowed for this product or product category', ['name']), ] | _constraints = [(_check_allow_negative_stock, 'Error: Negative stock quantities are not allowed for this product or product category', ['name']),] | def _check_allow_negative_stock(self, cr, uid, ids): for product in self.browse(cr, uid, ids): if product.qty_available < 0.0: allow_negative = product.allow_negative_stock if not allow_negative: allow_neagtive = product.categ_id.allow_negative_stock if allow_negative != True : return False return True | 3071ddcd55e22bf9cf96c0fe9d545bada6272309 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3071ddcd55e22bf9cf96c0fe9d545bada6272309/product_price_unit.py |
if product_obj.price_unit_id.coefficient != 1.0: | if product_obj.price_unit_id and product_obj.price_unit_id.coefficient != 1.0: | def product_id_change(self, cr, uid, ids, pricelist, price_unit_id, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You h... | 3071ddcd55e22bf9cf96c0fe9d545bada6272309 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3071ddcd55e22bf9cf96c0fe9d545bada6272309/product_price_unit.py |
super(Function, self).__init__(**kwargs) | super(Report, self).__init__(**kwargs) | def __init__(self, model, name, string, **kwargs): self.model = model self.name = name self.string = string super(Function, self).__init__(**kwargs) | 0421c587f183da6e60f9ef84c07a6f6dab5c82fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0421c587f183da6e60f9ef84c07a6f6dab5c82fb/yaml_test.py |
purchase_price = self.pool.get('product.product').browse(cr, uid, product).standard_price res['value'].update({'purchase_price':purchase_price}) | if product: purchase_price = self.pool.get('product.product').browse(cr, uid, product).standard_price res['value'].update({'purchase_price':purchase_price}) | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=... | a2a631f4cec45576356aa23f27793de3d0a2d399 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a2a631f4cec45576356aa23f27793de3d0a2d399/sale_margin.py |
company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False) if company_id: vals['company_id'] = company_id[0] | if vals.get('move_id', False): company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False) if company_id: vals['company_id'] = company_id[0] | def create(self, cr, uid, vals, context=None, check=True): account_obj = self.pool.get('account.account') tax_obj = self.pool.get('account.tax') move_obj = self.pool.get('account.move') cur_obj = self.pool.get('res.currency') journal_obj = self.pool.get('account.journal') if context is None: context = {} company_id = s... | d366367ff2a62c6684f43d883f7e3432c2fc5dcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d366367ff2a62c6684f43d883f7e3432c2fc5dcc/account_move_line.py |
d1 = datetime.strptime(line[f],'%y-%m-%d') | d1 = datetime.strptime(line[f],'%Y-%m-%d') | def _append_node(name, text): n = etree.SubElement(config, name) n.text = text | 48668137260b06b3e5846d6550db9580dce6cc91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/48668137260b06b3e5846d6550db9580dce6cc91/ps_list.py |
self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode) | self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode, context=context) | def process_record(self, node): import osv record, fields = node.items()[0] model = self.get_model(record.model) if isinstance(model, osv.osv.osv_memory): record_dict=self.create_osv_memory_record(record, fields) else: self.validate_xml_id(record.id) if self.isnoupdate(record) and self.mode != 'init': id = self.pool.ge... | 73bbce205b018e5d0b6c3a2db5fb56c0e59718b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/73bbce205b018e5d0b6c3a2db5fb56c0e59718b4/yaml_import.py |
files = [opj(a,'/'.join(f.split('/')[1:])) for f in zip.namelist()] | files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()] res = '/'.join(args) | def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) res = a and opj(a, *args) or False if zipfile.is_zipfile( a +'.zip') : zip = zip... | f9eb2e0260ba98475860e4daef7d12814fd40b5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f9eb2e0260ba98475860e4daef7d12814fd40b5e/__init__.py |
return res else: if os.path.isfile(res): return res | return opj(a, res) elif os.path.isfile(res): return res | def get_module_resource(module, *args): """Return the full path of a resource of the given module. @param module: the module @param args: the resource path components @return: absolute path to the resource """ a = get_module_path(module) res = a and opj(a, *args) or False if zipfile.is_zipfile( a +'.zip') : zip = zip... | f9eb2e0260ba98475860e4daef7d12814fd40b5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f9eb2e0260ba98475860e4daef7d12814fd40b5e/__init__.py |
message_id = case.history_line[0].message_id | if len(case.history_line): message_id = case.history_line[0].message_id | def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """ | 6e1b51ca4238a71f95708f91ea2e5becf3828204 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e1b51ca4238a71f95708f91ea2e5becf3828204/crm_send_email.py |
'References':"%s" % (message_id), | def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """ | 6e1b51ca4238a71f95708f91ea2e5becf3828204 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e1b51ca4238a71f95708f91ea2e5becf3828204/crm_send_email.py | |
getattr(self.pool.get('document.directory.content'), 'process_write_'+self.node.content.extension[1:])(cr, self.uid, self.node, self.getvalue()) | getattr(self.pool.get('document.directory.content'), 'process_write')(cr, self.uid, self.node, self.getvalue()) | def close(self, *args, **kwargs): db,pool = pooler.get_db_and_pool(self.dbname) cr = db.cursor() cr.commit() try: getattr(self.pool.get('document.directory.content'), 'process_write_'+self.node.content.extension[1:])(cr, self.uid, self.node, self.getvalue()) finally: cr.commit() cr.close() StringIO.StringIO.close(self,... | a056b92602dbe59daee8e439c8dfb645581f0316 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a056b92602dbe59daee8e439c8dfb645581f0316/abstracted_fs.py |
res[order.id] = min(dates_list) | if dates_list: res[order.id] = min(dates_list) | def _get_commitment_date(self, cr, uid, ids, name, arg, context={}): res = {} dates_list = [] for order in self.browse(cr, uid, ids): dates_list = [] for line in order.order_line: dt=DateTime.strptime(order.date_order, '%Y-%m-%d') + DateTime.RelativeDateTime(days=line.delay or 0.0) dt_s = dt.strftime('%Y-%m-%d') dates_... | 39adfe070f8f41cc7cf2aa8fbd4f8d7221b9986a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39adfe070f8f41cc7cf2aa8fbd4f8d7221b9986a/sale.py |
company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context) | company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context) | def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}): res = {} | f0503973adfb15f83176d7c37958da8c66489f18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f0503973adfb15f83176d7c37958da8c66489f18/hr_timesheet.py |
args2 = (os.path.basename(prog),) + args | args2 = (prog,) + args | def exec_pg_command(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) args2 = (os.path.basename(prog),) + args return subprocess.call(args2, executable=prog) | 592d666e51767eb751e2f842798148245eb10d3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/592d666e51767eb751e2f842798148245eb10d3f/misc.py |
return subprocess.call(args2, executable=prog) | return subprocess.call(args2) | def exec_pg_command(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) args2 = (os.path.basename(prog),) + args return subprocess.call(args2, executable=prog) | 592d666e51767eb751e2f842798148245eb10d3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/592d666e51767eb751e2f842798148245eb10d3f/misc.py |
pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, | pop = subprocess.Popen((prog,) + args, bufsize= -1, | def exec_pg_command_pipe(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) return (pop.stdin, pop.stdout) | 592d666e51767eb751e2f842798148245eb10d3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/592d666e51767eb751e2f842798148245eb10d3f/misc.py |
pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, | pop = subprocess.Popen((prog,) + args, bufsize= -1, | def exec_command_pipe(name, *args): prog = find_in_path(name) if not prog: raise Exception('Couldn\'t find %s' % name) pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) return (pop.stdin, pop.stdout) | 592d666e51767eb751e2f842798148245eb10d3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/592d666e51767eb751e2f842798148245eb10d3f/misc.py |
def _query_get(self, cr, uid, obj='l', context={}): | def _query_get(self, cr, uid, obj='l', context=None): | def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] initial_bal = context.get('initial_bal', False) company_clause = "" if context.get('company_id', False): company_clause = ... | da427c55dcdef3c0bba01290d14e1695423bb6ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da427c55dcdef3c0bba01290d14e1695423bb6ed/account_move_line.py |
where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')" | where_move_lines_by_date = " OR " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')" | def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] initial_bal = context.get('initial_bal', False) company_clause = "" if context.get('company_id', False): company_clause = ... | da427c55dcdef3c0bba01290d14e1695423bb6ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da427c55dcdef3c0bba01290d14e1695423bb6ed/account_move_line.py |
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause,where_move_state,where_move_lines_by_date) | query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause, where_move_state, where_move_lines_by_date) | def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] initial_bal = context.get('initial_bal', False) company_clause = "" if context.get('company_id', False): company_clause = ... | da427c55dcdef3c0bba01290d14e1695423bb6ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da427c55dcdef3c0bba01290d14e1695423bb6ed/account_move_line.py |
required=True, select=True), | required=True, select=True, ondelete='cascade'), | def price_get(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.pool.get('product.product') supp... | b67c51749708ea411a780f062aae8e5e0032f2f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b67c51749708ea411a780f062aae8e5e0032f2f1/pricelist.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.