This question has been flagged
1 Reply
23925 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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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

Author

Can you tell me in what file that is entered?

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

Author

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

Answer edited too.