How can I format date in Odoo 10 QWeb report?
t-field-option is not working.
I have tried
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
qweb odoo-10
add a comment |
t-field-option is not working.
I have tried
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
qweb odoo-10
add a comment |
t-field-option is not working.
I have tried
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
qweb odoo-10
t-field-option is not working.
I have tried
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
qweb odoo-10
qweb odoo-10
edited Dec 17 '16 at 5:55
Bhavesh Odedra
7,71872149
7,71872149
asked Dec 15 '16 at 14:25
user5256523
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
Try this.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
add a comment |
According to my experience, you have used the correct way to format Qweb date, but sometimes there is problem in other thing and odoo gives error somewhere else. Hope trying this code may be helpful.
<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>
also use this code
<span t-field="o.date_order" t-field-options="{'format': 'yyyy-MM-dd'}" />
You can also do one thing as formatting the date variable in the model itself and then show it on your QWeb report.
add a comment |
To display localized date strings. Try the following:
<span t-field="o.date_invoice" t-options="{'widget': 'date'}" />
add a comment |
For those who arrive here from search engines, you can control display of date in form fields using widgets.
<field name="date_planned" widget="date"/>
or,
<field name="date_planned" widget="datetime"/>
add a comment |
Instead of using
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
use
<span t-field="o.date_invoice" t-options='{"format": "MM/dd/yyyy"}'/>
Hope that helps!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41166536%2fhow-can-i-format-date-in-odoo-10-qweb-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
add a comment |
Try this.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
add a comment |
Try this.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
Try this.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
edited Jul 19 at 6:35
Pang
6,8601563101
6,8601563101
answered May 28 at 8:54
Er.Ankit H Gandhi
544
544
add a comment |
add a comment |
According to my experience, you have used the correct way to format Qweb date, but sometimes there is problem in other thing and odoo gives error somewhere else. Hope trying this code may be helpful.
<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>
also use this code
<span t-field="o.date_order" t-field-options="{'format': 'yyyy-MM-dd'}" />
You can also do one thing as formatting the date variable in the model itself and then show it on your QWeb report.
add a comment |
According to my experience, you have used the correct way to format Qweb date, but sometimes there is problem in other thing and odoo gives error somewhere else. Hope trying this code may be helpful.
<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>
also use this code
<span t-field="o.date_order" t-field-options="{'format': 'yyyy-MM-dd'}" />
You can also do one thing as formatting the date variable in the model itself and then show it on your QWeb report.
add a comment |
According to my experience, you have used the correct way to format Qweb date, but sometimes there is problem in other thing and odoo gives error somewhere else. Hope trying this code may be helpful.
<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>
also use this code
<span t-field="o.date_order" t-field-options="{'format': 'yyyy-MM-dd'}" />
You can also do one thing as formatting the date variable in the model itself and then show it on your QWeb report.
According to my experience, you have used the correct way to format Qweb date, but sometimes there is problem in other thing and odoo gives error somewhere else. Hope trying this code may be helpful.
<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>
also use this code
<span t-field="o.date_order" t-field-options="{'format': 'yyyy-MM-dd'}" />
You can also do one thing as formatting the date variable in the model itself and then show it on your QWeb report.
edited Oct 22 at 1:42
Nwawel A Iroume
422921
422921
answered Jul 15 at 18:08
Abhay Singh Rathore
342
342
add a comment |
add a comment |
To display localized date strings. Try the following:
<span t-field="o.date_invoice" t-options="{'widget': 'date'}" />
add a comment |
To display localized date strings. Try the following:
<span t-field="o.date_invoice" t-options="{'widget': 'date'}" />
add a comment |
To display localized date strings. Try the following:
<span t-field="o.date_invoice" t-options="{'widget': 'date'}" />
To display localized date strings. Try the following:
<span t-field="o.date_invoice" t-options="{'widget': 'date'}" />
edited Oct 22 at 4:21
Nwawel A Iroume
422921
422921
answered Jun 21 at 0:17
spacebiker
2,55732139
2,55732139
add a comment |
add a comment |
For those who arrive here from search engines, you can control display of date in form fields using widgets.
<field name="date_planned" widget="date"/>
or,
<field name="date_planned" widget="datetime"/>
add a comment |
For those who arrive here from search engines, you can control display of date in form fields using widgets.
<field name="date_planned" widget="date"/>
or,
<field name="date_planned" widget="datetime"/>
add a comment |
For those who arrive here from search engines, you can control display of date in form fields using widgets.
<field name="date_planned" widget="date"/>
or,
<field name="date_planned" widget="datetime"/>
For those who arrive here from search engines, you can control display of date in form fields using widgets.
<field name="date_planned" widget="date"/>
or,
<field name="date_planned" widget="datetime"/>
answered Nov 13 at 6:09
Tirtha R
3231313
3231313
add a comment |
add a comment |
Instead of using
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
use
<span t-field="o.date_invoice" t-options='{"format": "MM/dd/yyyy"}'/>
Hope that helps!
add a comment |
Instead of using
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
use
<span t-field="o.date_invoice" t-options='{"format": "MM/dd/yyyy"}'/>
Hope that helps!
add a comment |
Instead of using
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
use
<span t-field="o.date_invoice" t-options='{"format": "MM/dd/yyyy"}'/>
Hope that helps!
Instead of using
<span t-field="o.date_invoice" t-field-options='{"format": "MM/dd/yyyy"}'/>
use
<span t-field="o.date_invoice" t-options='{"format": "MM/dd/yyyy"}'/>
Hope that helps!
answered Nov 20 at 6:39
Perino
246317
246317
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41166536%2fhow-can-i-format-date-in-odoo-10-qweb-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown