Odoo Help

Welcome!

This community 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.

1

Set default invoiced date to current date

By
Andreas Marpmann
on 9/6/13, 4:44 PM 9,406 views

At Quotation we set --> Create Invoice: On Delivery Order

After the delivery a popup window appears to create the invoice, by default the invoiced date field is empty.

I want to change it to:

After I click create invoice, the invoice date field will display the current date.

Create Invoice On Delivery Order

1

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 9/6/13, 5:08 PM

This is a wizard that is located on stock/wizard/stock_invoice_onshipping.

You can inherit it with this:

from datetime import date
from openerp.osv import fields, osv
from openerp.tools.translate import _

class stock_invoice_onshipping(osv.osv_memory):

    _inherit = "stock.invoice.onshipping"

    _defaults={
        invoice_date': date.today().strftime('%Y-%m-%d'),
    }

Or you can add that line on defaults to the original file, but this is no recommended because if you want to update your OpenERP version you have to check all your changes and modify them on the new version. do this as a new module and it's going to work.

I've just tested it on the RunBot. The date is set when the invoice is validated

Metrolux Gmbh, Andreas Marpmann
on 9/6/13, 5:10 PM

Can you tell me in what file that is entered?

Metrolux Gmbh, Andreas Marpmann
on 9/9/13, 4:59 AM

Sorry I don't understand your question. what do you mean?

GH Mediacloud, Grover Menacho
on 9/9/13, 11:13 PM

OK. Your code looks like the part of a custom module. You dont edit account_invoice.py? Please see, i have edit my question.

Metrolux Gmbh, Andreas Marpmann
on 9/10/13, 4:59 AM

Answer edited too.

GH Mediacloud, Grover Menacho
on 9/10/13, 9:23 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/6/13, 4:44 PM
Seen: 9406 times
Last updated: 3/16/15, 8:10 AM