Odoo Help
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.
Display date and time on Invoice
Hi
How can I modify:
<div class="col-xs-3" t-if="o.date_invoice">
<strong>Datum računa:</strong>
<p t-field="o.date_invoice"/>
</div>
To display date and also time of Invoice?
I see that this in sales report shows time:
<div t-if="o.date_order" class="col-xs-3">
<strong t-if="o.state not in ['draft','sent']">Datum narudžbe:</strong>
<strong t-if="o.state in ['draft','sent']">Datum ponude:</strong>
<p t-field="o.date_order"/>
</div>
But how to do it on invoice?
Thanks
This should do the job
from openerp import models, fields, api
class override_date_invoice(models.Model):
_inherit = 'account.invoice'
date_invoice = fields.Datetime(string = 'Invoice Date', readonly = True, states = {'draft': [('readonly', False)]}, index=True,help=’Keep empty to use the current date’,copy = False)
HI Thanks and because I am new in all of this can you just tel me how to add this overrride in template? Thanks
You have to create a new module. https://www.odoo.com/documentation/8.0/howtos/backend.html And write my code in your modul, then install it
Hi I created module but it does not add anything, is there anything else that I need to override?
It should not add something, it should only replace the field.date with a Datetime one, to add the Time also
I have just writen the modul for my system and it works without problems. The field date_invoice in custumer invoice now takes date and time. Have you installed the modul? In your _openerp_.py you have to add account as dependency
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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 7/7/15, 4:02 PM |
Seen: 1247 times |
Last updated: 8/8/15, 2:15 AM |