Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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.
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>
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:
Please comment back if you run into any issues and i'd be glad to help.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/6/15, 8:28 AM|
|Seen: 1184 times|
|Last updated: 3/27/15, 6:13 PM|