Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Comments field in Shopping Cart?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
3 Respostes
6870 Vistes
Avatar
Bart Criel

How can I show an editable text field in the Shopping cart ? The field is properly defined as a field.text on the Sales Order object, and is visible and editable in the Quotations and Sales Order views in the backend.

I tried entering

    <p>Enter your remarks here:</p>
    <p t-field="website_sale_order.comments" placeholder="Enter your comments here..."/>

just after the table in the 'total' thing of the Shopping Cart, but that shows only the label 'Enter your remarks here:' and no editable text field.

1
Avatar
Descartar
michel Guénard

do you need an editable text that the customers can use or a text from our side?

Bart Criel
Autor

The purpose of the field is that the customer can enter some additional comments to her/his order; I want to store that information in a text field on the Sales Order. So I need an editable text that the customers can use.

Avatar
Sébastien Theys (seb)
Best Answer

"<p t-field=..."
This is just displaying the value of the field in a paragraph, if you need the user to enter something, you need to create some kind of input or textarea in a form. And then you need to override the route to handle the additional parameter.

Note that the feature you want to create already exists, if you click on "customize" as admin during the checkout flow, you have "extra step option".

0
Avatar
Descartar
Avatar
michel Guénard
Best Answer

I have a similar need: how to add a product attribute to the shopping cart (just below the product name)

My 2cents if it can help you.

below is the html code generated by Odoo for the comments block that is attached to the blog web pages


<?xml version="1.0"?>
<data name="Allow Comments">
<xpath expr="//ul[@id='comments-list']" position="before">
<section class="mb32 css_editable_mode_hidden">
<form id="comment" t-attf-action="/blogpost/comment" method="POST">
<input name="blog_post_id" t-att-value="blog_post.id" type="hidden"/>
<img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&field=image_small&id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
<div class="pull-left mb32" style="width: 75%">
<textarea rows="3" name="comment" class="form-control" placeholder="Ecrire vos observations..."/>
<button type="submit" class="btn btn-primary mt8">Publier</button>
</div>
</form>
</section>
<div class="clearfix"/>
</xpath>
</data>

0
Avatar
Descartar
Avatar
Luke Branch
Best Answer

@Bart,

I'll also be needing this for my own project.

I think your issue may be due to the fact you don't seem to be using your t-for-each's t-as attribute. Here's the code that controls the foreach loop:

 <t t-foreach="website_sale_order.website_order_line" t-as="line">

I think in your situation you need to add "line" to your t-field like this:

<p t-field="line.website_sale_order.comments" placeholder="Enter your comments here..."/>

Without seeing the rest of your custom code it's hard to say if this is definitely the problem, however from a brief look at your issue I have a feeling it is.

Check out the developer documenation here, specifically the section on loops:

https://www.odoo.com/documentation/8.0/reference/qweb.html

Please comment back if you run into any issues and i'd be glad to help.

0
Avatar
Descartar
Bart Criel
Autor

Thank you for your remarks, but as far as I can see, your solution works for a Sales Order Line, while I need something on Sales Order level. I probably need to add some form-related xml; I'll try to see how stuff is done in the next screen of the Order Processing.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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