rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context) if 'product_id' in fields: res.update({'product_id': move.product_id.id}) if 'product_uom' in fields: res.update({'product_uom': move.product_uom.id}) if 'qty' in fields: res.update({'qty': move.product_qty}) if 'use_exist' in fie... | if context.get('active_id'): move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context) if 'product_id' in fields: res.update({'product_id': move.product_id.id}) if 'product_uom' in fields: res.update({'product_uom': move.product_uom.id}) if 'qty' in fields: res.update({'qty': move.produc... | def default_get(self, cr, uid, fields, context=None): """ Get default values @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for default value @param context: A standard dictionary @return: Default values of fields """ |
HOST = config.get('ftp_server_address', detect_ip_addr()) PORT = int(config.get('ftp_server_port', '8021')) address = (HOST, PORT) ftpd = ftpserver.FTPServer(address, ftpserver.FTPHandler) | ftpd = ftpserver.FTPServer((HOST, PORT), ftpserver.FTPHandler) | def run(self): autho = authorizer.authorizer() ftpserver.FTPHandler.authorizer = autho ftpserver.max_cons = 300 ftpserver.max_cons_per_ip = 50 ftpserver.FTPHandler.abstracted_fs = abstracted_fs.abstracted_fs if PASSIVE_PORTS: ftpserver.FTPHandler.passive_ports = PASSIVE_PORTS |
ds = ftp_server() ds.start() | if HOST.lower() == 'none': netsvc.Logger().notifyChannel("FTP", netsvc.LOG_INFO, "\n Server FTP Not Started\n") else: netsvc.Logger().notifyChannel("FTP", netsvc.LOG_INFO, "\n Serving FTP on %s:%s\n" % (HOST, PORT)) ds = ftp_server() ds.start() | def run(self): autho = authorizer.authorizer() ftpserver.FTPHandler.authorizer = autho ftpserver.max_cons = 300 ftpserver.max_cons_per_ip = 50 ftpserver.FTPHandler.abstracted_fs = abstracted_fs.abstracted_fs if PASSIVE_PORTS: ftpserver.FTPHandler.passive_ports = PASSIVE_PORTS |
cr.execute('select sum(nb_register) from event_registration where id IN %s', (tuple(reg_ids),)) number = cr.fetchone() | number = 0.0 if reg_ids: cr.execute('select sum(nb_register) from event_registration where id IN %s', (tuple(reg_ids),)) number = cr.fetchone() | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o... |
res[event.id]['register_current'] = number and number[0] or 0.0 | res[event.id]['register_current'] = number and number[0] | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o... |
res[event.id]['register_prospect'] = number and number[0] or 0.0 | res[event.id]['register_prospect'] = number and number[0] | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o... |
if data['form']['period_from'] == False or data['form']['period_to'] == False: | if not data['form']['period_from'] or not data['form']['period_to']: | def _build_context(self, cr, uid, ids, data, context=None): if context is None: context = {} result = {} result['fiscalyear'] = data['form']['fiscalyear_id'] and data['form']['fiscalyear_id'] or False if data['form']['filter'] == 'filter_date': result['date_from'] = data['form']['date_from'] result['date_to'] = data['f... |
hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') | hr_evaluation_interview_obj = self.pool.get('hr.evaluation.interview') | def send_mail(self, cr, uid, ids, context=None): hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') if context is None: context = {} evaluation_data = self.read(cr, uid, ids, context=context)[0] for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_requ... |
for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids: if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email : msg = " Hello %s, \n\n Kindly post your response for %s survey. \n\n Thanks," %(waiting_id.user_to_review_id.n... | current_interview = hr_evaluation_interview_obj.browse(cr, uid, evaluation_data.get('evaluation_id')) if current_interview.state == "waiting_answer" and current_interview.user_to_review_id.work_email : msg = " Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks," %(current_interview.user_to... | def send_mail(self, cr, uid, ids, context=None): hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') if context is None: context = {} evaluation_data = self.read(cr, uid, ids, context=context)[0] for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_requ... |
move.write(cr, uid, [move.id], {'state': 'done'}) | move.write({'state': 'done'}) | def test_finished(self, cr, uid, ids): """ Tests whether the move is in done or cancel state or not. @return: True or False """ move_ids = self.pool.get('stock.move').search(cr, uid, [('picking_id', 'in', ids)]) for move in self.pool.get('stock.move').browse(cr, uid, move_ids): if move.state not in ('done', 'cancel'): ... |
'description' : """ * Save the Thunderbird plugin. \n * Follow the Steps to configure OpenERP in Thunderbird. \n -> 1. Go to Tools > OpenERP Synchronization. \n -> 2. check data (configured by default). \n -> 3. Click Test Connection. \n -> 4. A message appears with state of your connection. \n -> 5. If your connec... | 'description' : """ * Save the Thunderbird plugin. \n * Follow the Steps to configure OpenERP in Thunderbird. \n -> 1. Go to Tools > OpenERP Synchronization. \n -> 2. check data (configured by default). \n -> 3. Click Test Connection. \n -> 4. A message appears with state of your connection. \n -> 5. If your connec... | def default_get(self, cr, uid, fields, context={}): data = super(thunderbird_installer, self).default_get(cr, uid, fields, context) pdf_file = open(config['addons_path'] + "/thunderbird/doc/Installation Guide to OpenERP Thunderbid Plug-in.pdf", 'r') data['pdf_file'] = base64.encodestring(pdf_file.read()) file = open(co... |
fiscal_date_start = fiscal_obj.browse(cr, uid, [data['form']['fiscalyear_id']], context=context)[0].date_start result_initial_bal['empty_fy_allow'] = True result_initial_bal['fiscalyear'] = fiscal_obj.search(cr, uid, [('date_stop', '<', fiscal_date_start), ('state', '=', 'draft')], context=context) result_initial_bal['... | if data['form']['fiscalyear_id']: fiscal_date_start = fiscal_obj.browse(cr, uid, [data['form']['fiscalyear_id']], context=context)[0].date_start result_initial_bal['empty_fy_allow'] = True result_initial_bal['fiscalyear'] = fiscal_obj.search(cr, uid, [('date_stop', '<', fiscal_date_start), ('state', '=', 'draft')], con... | def _build_contexts(self, cr, uid, ids, data, context=None): if context is None: context = {} result = {} period_obj = self.pool.get('account.period') fiscal_obj = self.pool.get('account.fiscalyear') result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] or False result['journal_ids'] ... |
for vals in self.read(cr, uid, ids, context=context): user = vals.get('user_id') | for vals in self.browse(cr, uid, ids, context=context): user = vals.user_id | def do_accept(self, cr, uid, ids, context=None, *args): """ Update state which value is accepted. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar attendee’s IDs. @return: True """ if not context: context = {} for vals in self.re... |
ref = vals.get('ref', None) if ref: if ref.user_id.id != user[0]: defaults = {'user_id': user[0]} new_event = model_obj.copy(cr, uid, event, default=defaults, context=context) self.write(cr, uid, ids, {'state': 'accepted'}, context) | mod_obj = self.pool.get(vals.ref._name) if vals.ref: if vals.ref.user_id.id != user.id: defaults = {'user_id': user.id} new_event = mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context) self.write(cr, uid, vals.id, {'state': 'accepted'}, context) | def do_accept(self, cr, uid, ids, context=None, *args): """ Update state which value is accepted. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar attendee’s IDs. @return: True """ if not context: context = {} for vals in self.re... |
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'), | 'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'), | def _get_data(self, cr, uid, ids, field_name, arg, context={}): |
if self.date_lst and data['form']['initial_balance'] : | if data['form']['initial_balance']: | def set_context(self, objects, data, ids, report_type=None): PARTNER_REQUEST = '' if (data['model'] == 'res.partner'): ## Si on imprime depuis les partenaires if ids: #PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")" PARTNER_REQUEST = "AND line.partner_id IN %s",(tuple(ids),) # Transformat... |
else: | def set_context(self, objects, data, ids, report_type=None): PARTNER_REQUEST = '' if (data['model'] == 'res.partner'): ## Si on imprime depuis les partenaires if ids: #PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")" PARTNER_REQUEST = "AND line.partner_id IN %s",(tuple(ids),) # Transformat... | |
if self.date_lst_string: self.cr.execute( "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit,l.amount_currency,c.code AS currency_code " \ "FROM account_move_line l " \ "LEFT JOIN account_journal j " \ "ON (l.journal_id = j.id) " \ "LEFT JOIN res_currency c on (l.currency_id=c.id)" \ "WHERE l.partner_id = %s ... | self.cr.execute( "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit,l.amount_currency,c.code AS currency_code " \ "FROM account_move_line l " \ "LEFT JOIN account_journal j " \ "ON (l.journal_id = j.id) " \ "LEFT JOIN res_currency c on (l.currency_id=c.id)" \ "WHERE l.partner_id = %s " \ "AND l.account_id IN ... | def lines(self, partner,data): full_account = [] if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND l.reconcile_id IS NULL" |
if self.date_lst_string: self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id = %s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")" , (partner.id,tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp ... | self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line AS l " \ "WHERE partner_id = %s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (partner.id,tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp =... | def _sum_debit_partner(self, partner, data): result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id = %s " \ "AND acco... |
if self.date_lst_string: self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id=%s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")", (partner.id, tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp =... | self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line AS l " \ "WHERE partner_id=%s " \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (partner.id, tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else: result_tmp =... | def _sum_credit_partner(self, partner, data): result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id=%s " \ "AND acco... |
if self.date_lst_string: self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")",(tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: ... | self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line AS l " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 else:... | def _sum_debit(self, data): if not self.ids: return 0.0 result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" ... |
if self.date_lst_string: self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND date IN (" + self.date_lst_string + ")",(tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None... | self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line AS l " \ "WHERE partner_id IN %s" \ "AND account_id IN %s" \ " " + RECONCILE_TAG + " " \ "AND " + self.query + " " , (tuple(self.partner_ids), tuple(self.account_ids),)) contemp = self.cr.fetchone() if contemp != None: result_tmp = contemp[0] or 0.0 els... | def _sum_credit(self, data): if not self.ids: return 0.0 result_tmp = 0.0 if data['form']['reconcil'] : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.date_lst and data['form']['initial_balance'] : self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ "WHERE partner_id IN %s... |
cr.execute(""" create or replace view report_timesheet_task_user as ( | tools.drop_view_if_exists(cr, 'report_timesheet_task_user') cr.execute(""" create or replace view report_timesheet_task_user as ( | def init(self, cr): cr.execute(""" create or replace view report_timesheet_task_user as ( select ((r.id*12)+to_number(months.m_id,'99'))::integer as id, months.name as name, r.id as user_id, to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') as year, to_char(to_date(months.name, 'YYYY/MM/DD'),'MM') as month from res_us... |
data.update({'date': context['date']}) | def do_print(self, cr, uid, ids, context=None): if context is None: context = {} data = self.read(cr, uid, ids, [])[0] res = self._get_partners_followp(cr, uid, ids, context)['to_update'] to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and cont... | |
return user.context_project_id | return user.context_project_id.id | def _get_project(self, cr, uid, context): user = self.pool.get('res.users').browse(cr,uid,uid, context=context) if user.context_project_id: return user.context_project_id return False |
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_... | def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id... | def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}): domain = [] if product_id: domain += ['|',('product_id','=',product_id)] domain += [('product_id','=',False)] if partner_id: domain += ['|',('partner_id','=',partner_id)] domain += [('partner_id','=',False)] if user_i... |
lines = move.line_id if lines: ref_line = lines[0] ref_chart_account = _get_chart_account(cursor, user, ref_line.account_id) parent_left = ref_chart_account.parent_left parent_right = ref_chart_account.parent_right result = True for line in lines[1:]: if not (line.account_id.parent_left > parent_left and line.account_i... | top = None for line in move.line_id: account = line.account_id while account: account2 = account account = account.parent_id if not top: top = account2.id elif top<>account2.id: raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !')) | def _get_chart_account(cursor, user, account): if account.parent_id: chart_account = _get_chart_account(cursor, user, account.parent_id) else: chart_account = account return chart_account |
if move.picking_id and move.picking_id.type=="internal": return True | def _check_tracking(self, cr, uid, ids): """ Checks if production lot is assigned to stock move or not. @return: True or False """ for move in self.browse(cr, uid, ids): if move.picking_id and move.picking_id.type=="internal": return True if not move.prodlot_id and \ (move.state == 'done' and \ ( \ (move.product_id.t... | |
(move.product_id.track_production and move.location_id.usage=='production') or \ (move.product_id.track_production and move.location_dest_id.usage=='production') or \ (move.product_id.track_incoming and move.location_id.usage in ('supplier','internal')) or \ (move.product_id.track_outgoing and move.location_dest_id.usa... | (move.product_id.track_production and move.location_id.usage == 'production') or \ (move.product_id.track_production and move.location_dest_id.usage == 'production') or \ (move.product_id.track_incoming and move.location_id.usage == 'supplier') or \ (move.product_id.track_outgoing and move.location_dest_id.usage == 'cu... | def _check_tracking(self, cr, uid, ids): """ Checks if production lot is assigned to stock move or not. @return: True or False """ for move in self.browse(cr, uid, ids): if move.picking_id and move.picking_id.type=="internal": return True if not move.prodlot_id and \ (move.state == 'done' and \ ( \ (move.product_id.t... |
'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), | 'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), | def _col_get(self, cr, user, context={}): result = [] cols = self.pool.get('account.move.line')._columns for col in cols: if col in ('period_id', 'journal_id'): continue |
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, help="Link to the automatically generated Journal Items."), | 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', help="Link to the automatically generated Journal Items."), | def _get_invoice_from_reconcile(self, cr, uid, ids, context=None): move = {} for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context): for line in r.line_partial_ids: move[line.move_id.id] = True for line in r.line_id: move[line.move_id.id] = True |
res = super(event_make_invoice, self).default_get(cr, uid, fields_list, context) return res | return super(event_make_invoice, self).default_get(cr, uid, fields_list, context) | def default_get(self, cr, uid, fields_list, context=None): res = super(event_make_invoice, self).default_get(cr, uid, fields_list, context) return res |
def make_invoice(self, cr, uid, ids, context={}): | def make_invoice(self, cr, uid, ids, context=None): | def make_invoice(self, cr, uid, ids, context={}): |
mod_obj =self.pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter') id = mod_obj.read(cr, uid, result, ['res_id']) | form_id = mod_obj._get_id(cr, uid, 'account', 'invoice_form') form_res = mod_obj.browse(cr, uid, form_id, context=context).res_id tree_id = mod_obj._get_id(cr, uid, 'account', 'invoice_tree') tree_res = mod_obj.browse(cr, uid, tree_id, context=context).res_id | def make_invoice(self, cr, uid, ids, context={}): |
'search_view_id': id['id'] | def make_invoice(self, cr, uid, ids, context={}): | |
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), | 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), | def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}): result = {} for record in self.browse(cr, uid, ids, context): if record.child_parent_ids: result[record.id] = [x.id for x in record.child_parent_ids] else: result[record.id] = [] |
if self._debug: self._doclog.debug("Trying to read \"%s\".."% fpath) | def get_file(self, cr, uid, id, file_node, mode, context=None): if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise RuntimeError('media offline') ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context) if boo.type == 'filestore': if not ira... | |
if self._debug: self._doclog.debug("Trying to obtain db_datas for ir.attachment[%d]", ira.id) | def get_file(self, cr, uid, id, file_node, mode, context=None): if context is None: context = {} boo = self.browse(cr, uid, id, context) if not boo.online: raise RuntimeError('media offline') ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context) if boo.type == 'filestore': if not ira... | |
data['badge_title'] = contact_id.title | data['badge_title'] = contact_id.title.name | def onchange_contact_id(self, cr, uid, ids, contact, partner): data ={} if not contact: return data |
if data_event.user_id.id: return {'value': {'user_id':data_event.user_id.id}} | def onchange_event(self, cr, uid, ids, event_id, partner_invoice_id): context={} if not event_id: return {'value': {'unit_price': False, 'event_product': False}} data_event = self.pool.get('event.event').browse(cr, uid, event_id) context['currency_id'] = data_event.currency_id.id if data_event.product_id: if not par... | |
tracking = context.get('tracking', False) last_track = [line.tracking_id.id for line in self.browse(cr, uid, ids)[0].picking_id.move_lines if line.tracking_id] if not last_track: last_track = tracking_obj.create(cr, uid, {}, context=context) else: last_track.sort() last_track = last_track[-1] self.write(cr, uid, ids, {... | for line in self.browse(cr, uid, ids, context=context): last_track = None if line.picking_id: tracking_ids = [l.tracking_id.id for l in line.picking_id.move_lines if l.tracking_id] if tracking_ids: last_track = max(tracking_ids) if not last_track: last_track = tracking_obj.create(cr, uid, {}, context=context) self.writ... | def setlast_tracking(self, cr, uid, ids, context=None): tracking_obj = self.pool.get('stock.tracking') tracking = context.get('tracking', False) last_track = [line.tracking_id.id for line in self.browse(cr, uid, ids)[0].picking_id.move_lines if line.tracking_id] if not last_track: last_track = tracking_obj.create(cr, u... |
part_ids.append(res['id']) | if res: part_ids.append(res['id']) | def assign_partner(self, cr, uid, ids, context=None): ok = False for part in self.browse(cr, uid, ids, context=context): if not part.country_id: continue addr = ', '.join(filter(None, [part.street, (part.zip or '')+' '+(part.city or ''), part.state_id and part.state_id.name, part.country_id and part.country_id.name])) ... |
WHERE journal_id = %s \ ORDER BY date DESC,id DESC LIMIT 1', (journal_id,)) | WHERE journal_id = %s AND NOT state = %s \ ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft')) | def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): if not journal_id: return {'value': {'currency': False}} |
original = [header, sender, to, sentdate, desc] | if case.user_id.signature: signature = '--\n' + case.user_id.signature original = [header, sender, to, sentdate, desc, signature] | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] |
cr, uid, ids, tax, vals={'account_paid_id': account}) | cr, uid, id, tax, vals={'account_paid_id': account}) | def on_change_paid(self, cr, uid, id, tax, account): return self._on_change( cr, uid, ids, tax, vals={'account_paid_id': account}) |
'date_expected': fields.datetime('Scheduled Date', required=True, help="Scheduled date for the processing of this move"), | 'date_expected': fields.datetime('Scheduled Date', states={'done': [('readonly', True)]},required=True, help="Scheduled date for the processing of this move"), | 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... |
tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), '/tmp/output.pdf', result) self.obj = external_pdf(file('/tmp/output.pdf').read()) | tmp_file = tempfile.mkstemp(".pdf")[1] try: tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) with open(tmp_file, "r") as ofile: self.obj = external_pdf(ofile.read()) finally: try: os.remove(tmp_file) except: pass | def create(self, cr, uid, ids, datas, context=None): |
except Exception, e: | except Exception: | def create(self, cr, uid, ids, datas, context=None): |
recs = obj_move_line.read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) | recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id','reconcile_partial_id']) | def trans_unrec(self, cr, uid, ids, context=None): obj_move_line = self.pool.get('account.move.line') obj_move_reconcile = self.pool.get('account.move.reconcile') if context is None: context = {} recs = obj_move_line.read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) unlink_ids = [] full_recs = filter(... |
'fiscal_position': o.partner_id.property_account_position.id, | 'fiscal_position': o.fiscal_position.id or o.partner_id.property_account_position.id, | def action_invoice_create(self, cr, uid, ids, *args): res = False |
return format_body(body % data) | return self.format_body(body % data) | def format_mail(self, obj, body): data = { 'object_id': obj.id, 'object_subject': hasattr(obj, 'name') and obj.name or False, 'object_date': hasattr(obj, 'date') and obj.date or False, 'object_description': hasattr(obj, 'description') and obj.description or False, 'object_user': hasattr(obj, 'user_id') and (obj.user_id... |
parent_ids = [x[0] for x in cr.fetchall()] | parent_ids = [x[0] for x in cr.fetchall() if x[0]] | def _parent_compute(self, cr, uid, ids, name, args, context=None): if context is None: context = {} result = {} obj_dept = self.pool.get('hr.department') for user_id in ids: emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', user_id)]) cr.execute('SELECT emp.department_id FROM hr_employee AS emp \... |
signature = '' if case.user_id.signature: signature = '--\n' + case.user_id.signature | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] | |
original = '\n'.join(original) res['text']=original | res['text']= '\n'.join(original) | def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] |
obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) | if not hasattr(obj_pool, 'base_action_ruled'): obj_pool.create = self._create(obj_pool.create, model, context=context) obj_pool.write = self._write(obj_pool.write, model, context=context) obj_pool.base_action_ruled = True | def _register_hook(self, cr, uid, ids, context=None): if not context: context = {} for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.model_id.model obj_pool = self.pool.get(model) obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__(... |
price = price_obj.price_get(self.cr, self.uid, [lines[id].pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].pricelist_id.id] | price = price_obj.price_get(self.cr, self.uid, [lines[id].account_id.pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].account_id.pricelist_id.id] | def _lines_a(self, general_account_id, account_id, date1, date2): self.cr.execute("SELECT aal.id AS id, aal.name AS name, aal.code AS code, aal.amount AS balance, aal.date AS date, aaj.code AS cj, aal.unit_amount AS quantity \ FROM account_analytic_line AS aal, account_analytic_journal AS aaj \ WHERE (aal.general_accou... |
mid = objid._get_id(cr, uid, 'caldav', 'document_directory_calendars0') | mid = objid._get_id(cr, uid, 'document', 'dir_calendars') | def _get_root_calendar_directory(self, cr, uid, context=None): objid = self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'caldav', 'document_directory_calendars0') if not mid: return False root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] root_cal_dir = self.browse(cr,uid, root_id, context=context... |
} | } val=0.0 cur_obj = self.pool.get('res.currency') cur = order.pricelist_id.currency_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... |
res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] | for c in self.pool.get('account.tax').compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']: val += c['amount'] res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val) | 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... |
name, | production.name, | def action_confirm(self, cr, uid, ids): """ Confirms production order. @return: Newly generated picking Id. """ picking_id = False proc_ids = [] seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') move_obj = self.pool.get('stock.move') proc_obj = self.pool.get('procurement.order') wf_servic... |
('picking', 'Invoice from Picking'), | ('picking', 'Invoice from Delivery'), | def _get_order(self, cr, uid, ids, context=None): if context is None: context = {} result = {} for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True return result.keys() |
res[event.id]['register_current'] = len(reg_ids) | res[event.id]['register_current'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o... |
res[event.id]['register_prospect'] = len(reg_ids) | res[event.id]['register_prospect'] = number and number[0] or 0.0 | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary o... |
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.") | message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.") | def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): seq_obj_name = 'stock.picking.' + vals['type'] vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) type_list = { 'out':_('Packing List'), 'in':_('Reception'), 'internal': _('Internal picking'), 'deli... |
for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to']): | for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to', 'type']): | def _check_date(self, cr, uid, ids): for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to']): if rec['number_of_days_temp'] < 0: return False date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S') date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S') if date_from > date_to: re... |
'progress': fields.related('task_id', 'progress', string='Progress (%)',group_operator="avg", store=True), | 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', group_operator="avg", help="Computed as: Time Spent / Total Time.", store = { 'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['task_id'], 10), 'project.task': (_get_issue_task, ['progress'], 10), 'project.task.work': (_g... | def _compute_day(self, cr, uid, ids, fields, args, context=None): if context is None: context = {} """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A st... |
request_pool = self.pool.get('res.request') | request = self.pool.get('res.request') | def do_close(self, cr, uid, ids, context=None): """ Close Task """ if context is None: context = {} request_pool = self.pool.get('res.request') for task in self.browse(cr, uid, ids, context=context): project = task.project_id if project: # Send request to project manager if project.warn_manager and project.user_id and ... |
'date_deadline': fields.datetime('Deadline', help="Deadline Date is automatically computed from Start Date + Duration"), | def _set_attendee_data(self, cr, uid, id, name, value, arg, context): if not value: return eventdata = self.browse(cr, uid, id, context=context) att_len = len(eventdata.attendee_ids) if att_len == len(value.split(',')): return if att_len > len(value.split(',')): for attendee in eventdata.attendee_ids[len(value.split(',... | |
self.do_alarm_create(cr, uid, ids) | self.do_alarm_create(cr, uid, new_ids) | def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if isinstance(ids, (str, int, long)): select = [ids] else: select = ids new_ids = [] for id in select: id = common.caldav_id2real_id(id) if not id in new_ids: new_ids.append(id) if 'case_id' in vals: vals['case_id'] = common.caldav_id2rea... |
date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): | date_invoice=False, payment_term=False, partner_bank=False, company_id=False): | def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): """ Function that is call when the partner of the invoice is changed it will retriev and set the good bank partner bank""" res = super(account_invoice, self).onchange_partner_i... |
if partner_bank_id != bank_id: | if partner_bank != bank_id: | def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): """ Function that is call when the partner of the invoice is changed it will retriev and set the good bank partner bank""" res = super(account_invoice, self).onchange_partner_i... |
base = cur_obj.compute(cr, uid, currency_id, company_currency, base, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | base = cur_obj.compute(cr, uid, currency_id, company_currency, base*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] ... |
tax_sign = 1 | factor = 1 | def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False tax_sign = 1 if ids: tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0... |
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0: tax_sign = -1 elif tax_amount == 0: tax_sign = 0 | factor = self.read(cr, uid, ids[0], ['factor_tax'])['factor_tax'] | def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False tax_sign = 1 if ids: tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0... |
amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*tax_sign, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) | def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False tax_sign = 1 if ids: tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] if tax_amount < 0... |
'name': fields.char('Name', size=64, required=True), | 'name': fields.char('Name', size=64, required=True, states={'confirm': [('readonly', True)]}), | def _currency(self, cursor, user, ids, name, args, context=None): res = {} res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') default_currency = res_users_obj.browse(cursor, user, user, context=context).company_id.currency_id for statement in self.browse(cursor, user, ids, conte... |
'email': cal_data.value.replace('MAILTO:',''), | 'email': cal_data.value.lower().replace('mailto:',''), | def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values ... |
if valid_moves: for move in self.browse(cr, uid, valid_moves): if move.name =='/': new_name = False journal = move.journal_id if invoice and invoice.internal_number: new_name = invoice.internal_number | if not valid_moves: raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !')) for move in self.browse(cr, uid, valid_moves): if move.name =='/': new_name = F... | def post(self, cr, uid, ids, context=None): invoice = context.get('invoice', False) valid_moves = self.validate(cr, uid, ids, context) if valid_moves: for move in self.browse(cr, uid, valid_moves): if move.name =='/': new_name = False journal = move.journal_id |
if journal.sequence_id: c = {'fiscalyear_id': move.period_id.fiscalyear_id.id} new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c) else: raise osv.except_osv(_('Error'), _('No sequence defined in the journal !')) if new_name: self.write(cr, uid, [move.id], {'name':new_name}) cr.... | raise osv.except_osv(_('Error'), _('No sequence defined on the journal !')) if new_name: self.write(cr, uid, [move.id], {'name':new_name}) cr.execute('UPDATE account_move '\ 'SET state=%s '\ 'WHERE id IN %s', ('posted', tuple(valid_moves),)) | def post(self, cr, uid, ids, context=None): invoice = context.get('invoice', False) valid_moves = self.validate(cr, uid, ids, context) if valid_moves: for move in self.browse(cr, uid, valid_moves): if move.name =='/': new_name = False journal = move.journal_id |
amount = currency_obj.compute(cursor, user, line.currency_id.id, | amount = currency_obj.compute(cr, user, line.currency_id.id, | def populate_statement(self, cr, uid, ids, context=None): |
amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id, | amount = currency_obj.compute(cr, user, line.invoice.currency_id.id, | def populate_statement(self, cr, uid, ids, context=None): |
rec = anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) | rec = anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, sale_line.order_id.user_id.id, time.strftime('%Y-%m-%d'), context) | def invoice_line_create(self, cr, uid, ids, context=None): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) if not ids: return create_ids sale_line = self.browse(cr, uid, ids[0], context) inv_line_obj = self.pool.get('account.invoice.line') anal_def_obj = self.pool.get('account.analyt... |
db = pooler.get_db_only(db_name) cr = db.cursor() cr.execute("select id from ir_module_module where name = 'document' and state='installed' ") res=cr.fetchone() if res and len(res): self.db_name_list.append(db_name) cr.close() | cr = None try: db = pooler.get_db_only(db_name) cr = db.cursor() cr.execute("SELECT id FROM ir_module_module WHERE name = 'document' AND state='installed' ") res=cr.fetchone() if res and len(res): self.db_name_list.append(db_name) except Exception, e: self.parent.log_error("Exception in db list: %s" % e) finally: if cr... | def db_list(self): s = netsvc.ExportService.getService('db') result = s.exp_list() self.db_name_list=[] for db_name in result: db = pooler.get_db_only(db_name) cr = db.cursor() cr.execute("select id from ir_module_module where name = 'document' and state='installed' ") res=cr.fetchone() if res and len(res): self.db_nam... |
class res_users(osv.osv): _inherit = 'res.users' def _get_group(self, cr, uid, context=None): result = super(res_users, self)._get_group(cr, uid, context=context) dataobj = self.pool.get('ir.model.data') try: dummy,group_id = dataobj.get_object_reference(cr, 1, 'product', 'group_product_manager') result.append(group_id... | def price_get(self, cr, uid, supplier_ids, product_id, product_qty=1, context=None): """ Calculate price from supplier pricelist. @param supplier_ids: Ids of res.partner object. @param product_id: Id of product. @param product_qty: specify quantity to purchase. """ if type(supplier_ids) in (int,long,): supplier_ids = [... | |
if hours.get(task.id, 0.0) > res[task.id]['total_hours']: res[task.id]['progress'] = round(100 - (max(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 100)) % 100, 2) | if task.state =='done': res[task.id]['progress'] = 100.0 | def _hours_get(self, cr, uid, ids, field_names, args, context=None): res = {} cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) for task in self.browse(cr, uid, ids, context=context): res[task.id] = {'effective_hours': ... |
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 100),2) | res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2) | def _hours_get(self, cr, uid, ids, field_names, args, context=None): res = {} cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id =ANY(%s) GROUP BY task_id",(ids,)) hours = dict(cr.fetchall()) for task in self.browse(cr, uid, ids, context=context): res[task.id] = {'effective_hours': ... |
event.add('dtend').value = ics_datetime(event_obj.date_deadline) | if not event_obj.date_deadline[10:]: short = True else: short = False event.add('dtend').value = ics_datetime(event_obj.date_deadline, short) | def ics_datetime(idate, short=False): if idate: if short: return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) else: return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S') else: return False |
msg['subject'] = ' '.join(map(lambda (x, y): unicode(x, y or 'ascii'), decode_header(msg_txt.get('Subject')))) | msg['subject'] = _decode_header(msg_txt.get('Subject')) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
msg['from'] = msg_txt.get('From') | msg['from'] = _decode_header(msg_txt.get('From')) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
msg['to'] = msg_txt.get('Delivered-To') | msg['to'] = _decode_header(msg_txt.get('Delivered-To')) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
msg['cc'] = msg_txt.get('Cc') | msg['cc'] = _decode_header(msg_txt.get('Cc')) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
msg['reply'] = msg_txt.get('Reply-To') | msg['reply'] = _decode_header(msg_txt.get('Reply-To')) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
if part.get_content_subtype() == 'html': body = html2plaintext(content) elif part.get_content_subtype() == 'plain': body = content | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) | |
attachents[filename] = part.get_payload(decode=True) | attachents[filename] = content else: if encoding: content = unicode(content, encoding) if part.get_content_subtype() == 'html': body = html2plaintext(content) elif part.get_content_subtype() == 'plain': body = content | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
body += part.get_payload(decode=True) | res = part.get_payload(decode=True) if encoding: res = res.decode(encoding).encode('utf-8') body += res | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) |
encoding = msg_txt.get_content_charset('utf-8') msg['body'] = msg['body'].decode(encoding).encode('utf-8') | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) | |
val = property_obj.browse(cr, uid,prop_ids[0]).value | val = property_obj.browse(cr, uid,prop_ids[0]).value_reference | def create_returns2(self, cr, uid, ids, context): record_id = context.get('record_id', False) order_obj =self.pool.get('pos.order') line_obj = self.pool.get('pos.order.line') picking_obj = self.pool.get('stock.picking') stock_move_obj = self.pool.get('stock.move') property_obj= self.pool.get("ir.property") uom_obj =sel... |
stock_dest_id = int(val.split(',')[1]) | stock_dest_id = val.id | def create_returns2(self, cr, uid, ids, context): record_id = context.get('record_id', False) order_obj =self.pool.get('pos.order') line_obj = self.pool.get('pos.order.line') picking_obj = self.pool.get('stock.picking') stock_move_obj = self.pool.get('stock.move') property_obj= self.pool.get("ir.property") uom_obj =sel... |
val = property_obj.browse(cr, uid,prop_ids[0]).value | val = property_obj.browse(cr, uid,prop_ids[0]).value_reference | def select_product(self, cr, uid, ids, context): """ To get the product and quantity and add in order . @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return : Retrun the add product form again for adding more product "... |
stock_dest_id = int(val.split(',')[1]) | stock_dest_id = val.id | def select_product(self, cr, uid, ids, context): """ To get the product and quantity and add in order . @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return : Retrun the add product form again for adding more product "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.