def open_url_for_ebid(self, args=None): ebid_settings = eq_ebid_services.get_ebid_settings(self) if (not ebid_settings or not ebid_settings.homepage): return return { 'type': 'ir.actions.act_url', 'url': ebid_settings.homepage + self.ebid_no, 'target': 'new', }
def open_url_for_ebid(self, args=None): """ Button "Zu Unternehmensverzeichnis.org springen" :param args: :return: """ ebid_settings = eq_ebid_services.get_ebid_settings(self) if (not ebid_settings or not ebid_settings.homepage): return return { 'type': 'ir.actions.act_url', 'url': ebid_settings.homepage + self.ebid_no, 'target': 'new', }
def get_company_data_for_ebid(self, args = None): if (not self): return ebid_settings = eq_ebid_services.get_ebid_settings(self[0]); if (not self[0].settings_ok(ebid_settings)): raise osv.except_osv(_('Error'), _('Check the configuration for EBID')) #eq_ebid_services.check_authentication(ebid_settings) eq_prot_obj = self[0].env['eq.ebid.protocoll'] eq_prot_position_obj = self[0].env['eq.ebid.protocoll.position'] for partner in self: #self.proc_get_ebid_for_address_step(ebid_settings, partner) found_company = eq_ebid_services.get_company_for_ebid(partner.id, partner.eq_ebid_no, ebid_settings) protocol_id = 0 protocoll_for_partner = eq_prot_obj.sudo().search([('eq_res_id','=',partner.id), ('eq_model', '=', 'res.partner')]) if (not protocoll_for_partner): #create prot protocol_id = eq_prot_obj.eq_create_protocoll_entry(found_company) if (found_company.requestOK and (protocol_id > 0)): eq_prot_position_obj.create_position_for_ebid_search(protocol_id, found_company.ebid_search_result) continue else: protocol_id = protocoll_for_partner.ids[0] protocoll_record = eq_prot_obj.sudo().browse(protocoll_for_partner.ids) if (protocoll_record): protocoll_record[0].eq_update_protocoll_entry(found_company) if (not found_company.requestOK): continue #log error prot_position_ids = eq_prot_position_obj.sudo().search([('eq_ebid_protocoll_id','in',protocoll_for_partner.ids), ('ebid_no','=',partner.eq_ebid_no)]) if (not prot_position_ids): eq_prot_position_obj.create_position_for_ebid_search(protocol_id, found_company.ebid_search_result) continue prot_pos = eq_prot_position_obj.sudo().browse(prot_position_ids.ids) if (prot_pos): result= found_company.ebid_search_result prot_pos[0].update_position_for_ebid_search(result)#.write(update_vals)
def get_data_for_ebid_no(self, args=None): """ Button "Adressdaten aus Unternehmensverzeichnis.org laden" :param args: :return: """ settings = eq_ebid_services.get_ebid_settings(self) if (not eq_ebid_services.settings_ok(settings)): raise osv.except_osv(_('Error'), _('Check the configuration for EBID')) search_res = eq_ebid_services.get_company_for_ebid( self.eq_ebid_protocol_id.eq_res_id.id, self.ebid_no, settings) result = search_res.ebid_search_result if (not search_res.requestOK): update_vals = { 'eq_response': search_res.response, } self.write(update_vals) # update für Position if (result): update_vals = { 'eq_company_name': result.company_name, 'eq_street': result.street or None, 'eq_house_no': result.house_no or None, 'eq_city': result.city or None, 'eq_city_part': result.city_part or None, 'eq_zip': result.zip, 'eq_country': result.country, 'eq_phone': result.phone, 'eq_fax': result.fax, 'eq_email': result.email, 'eq_mobile': result.mobile, 'eq_url': result.url, 'eq_ustid_nr': result.ustid_nr, } self.write(update_vals) return