Odoo Help

2

2
6 Answers
0
Travis Waelbroeck United States
4/25/16, 12:08 PM

Hello,

I was trying to accomplish the same as you when I got this error, but I found the solution.

In order to change the date_confirm attribute into a datetime field (instead of just date), we have to change the field definition in two places:


The obvious place is in the sale module's sale.py file:

    'date_confirm': fields.datetime('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed.", copy=False),


However, you must also change in the sale module's sale_report.py file:

    'date_confirm': fields.datetime('Date Confirm', readonly=True),


(This is obviously v7 API version, but same can be achieved easily with v8 API)

A proper inherited model would look similar to the following:

from openerp.osv import osv, fields

from datetime import datetime

class sale_order(osv.osv):

_inherit = 'sale.order'

_columns = {

'date_confirm': fields.datetime('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed.", copy=False),

}

class sale_report(osv.osv):

_inherit = "sale.report"

_columns = {

'date_confirm': fields.datetime('Date Confirm', readonly=True),

}

0
Edy Kendengis Indonesia
4/4/16, 3:16 PM

Hi All

I found the cause of the same error in my custom module, below is the part that caused the error.

class sale_order(models.Model):

_inherit ='sale.order'

.......

date_confirm = fields.Datetime('Confirmation Date', readonly=True, help="Date on which sales order is payment confirmed.", copy=False)

...........

I tried to replace the official field type from the date to datetime in field date_confirm.

if I do not replace this field type, then update the sale module, everything will be normal.

I hope this can help a little solution

0
julien rey United Kingdom
3/25/14, 7:28 PM

I'm facing same issue, Did you fix it ?

1 Comment
julien rey United Kingdom
3/25/14, 7:34 PM

I have just checked into database and it seems the view sale_report doesn't exist anymore ! I have exectued an update of sale module, and now the sales analysis works fine. A quick check in the database and the view is here now ! I'm going to investigate to check which parameter/modules have dropped this view.

Ask a Question
Writer
Keep Informed
3 follower(s)
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