Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profit organisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to paste code into forum without losing return characters?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
codeforumformatting
2 Antwoorden
5221 Weergaven
Avatar
hesham@elmahdy.info

when I try to include code into a question in his forum I lose all carriage returns so the code block apprears to be all in one line.

 

How to paste code into forum without losing return characters?

1
Avatar
Annuleer
hesham@elmahdy.info
Auteur

I am sorry, it seems I was not clear enough. the block quote used to work well but not anymore. please see my reply below.

E.M.

I have the same behaviour, latest Firefox and Windows 10 here. It is really annoying and impacts posts quality.

Avatar
Larry Marshall
Beste antwoord

Hesham, when creating your post, notice the bar above beginning with "B". Hover over each of the choices in the bar to see the explanation of each. The fifth one from the left is "Block Quote". Position your cursor anywhere in this reply box where you want your code to go and press the "Block Quote" button. As a result you'll see an indented vertical bar on the left, with the cursor positioned just to the right of that bar and in the middle of its vertical height. Then paste your code. That should do it.

def translate_state_code_to_database_id(state_code):
    state_dict = {'AL': '1',
                  'AK': '2',
                  'AZ': '3',
                  'AR': '4',
                  'CA': '5',
                  'CO': '6',
                  'CT': '7',
                  'DE': '8',
                  'DC': '9',
                  'FL': '10',
                  'GA': '11',
                  'HI': '12',
                  'ID': '13',
                  'IL': '14',
                  'IN': '15',
                  'IA': '16',
                  'KS': '17',
                  'KY': '18',
                  'LA': '19',
                  'ME': '20',
                  'MT': '21',
                  'NE': '22',
                  'NV': '23',
                  'NH': '24',
                  'NJ': '25',
                  'NM': '26',
                  'NY': '27',
                  'NC': '28',
                  'ND': '29',
                  'OH': '30',
                  'OK': '31',
                  'OR': '32',
                  'MD': '33',
                  'MA': '34',
                  'MI': '35',
                  'MN': '36',
                  'MS': '37',
                  'MO': '38',
                  'PA': '39',
                  'RI': '40',
                  'SC': '41',
                  'SD': '42',
                  'TN': '43',
                  'TX': '44',
                  'UT': '45',
                  'VT': '46',
                  'VA': '47',
                  'WA': '48',
                  'WV': '49',
                  'WI': '50',
                  'WY': '51'}

    return 'base.state_us_{}'.format(state_dict.get(state_code))

0
Avatar
Annuleer
hesham@elmahdy.info
Auteur

Thank you Larry. I already do that and this is the result. It used to work well but not anymore. Please see next reply

E.M.

It is the same here.

Avatar
hesham@elmahdy.info
Auteur Beste antwoord

Thanks. I already do that and this is the result:

 

@api.constrains('name') # this means the following method defines constraint(s). in our case: duplication. argument passed is the field which you want make it unique def check_duplicate_rec(self): students = self.search([('name', '=', self.name)]) if len(students) > 1: # if only 1 record is found means we are ok. we just found the record we are creating. raise Warning("The student record is already exists!") # if raise XXX is called the method will exit from here and will not continue return True print "students :::::::::::", students

0
Avatar
Annuleer
Larry Marshall

What browser are you using and what OS?

hesham@elmahdy.info
Auteur

Chrome on Ubuntu

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Forum not showing code?:)
code forum
Avatar
Avatar
Avatar
3
jul. 25
4018
Markup code for forum posts?
forum formatting codes
Avatar
0
sep. 23
4964
[meta] Code formatting in Odoo forum?
meta code forum odoo
Avatar
Avatar
Avatar
Avatar
Avatar
8
mrt. 15
11005
Line Spacing in Odoo 17 Opgelost
formatting
Avatar
Avatar
Avatar
3
sep. 25
3521
Me falta la app de foro
forum
Avatar
0
feb. 25
1589
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now