NameError: name 'datetime' is not defined

Bug #1085221 reported by Andrea Garcia
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Incomplete
Undecided
Unassigned

Bug Description

When you enter to Accounting/Configuration/Analytic in the webclient

THIS ERROR appears

Uncaught Error: QWeb2 - template['ListView.rows']: Runtime Error: Error: QWeb2 - template['ListView.row']: Runtime Error: Error: NameError: name 'datetime' is not defined

The error appears in module "account_analytic_default",
xml field "account_analytic_default_view.xml" line "9"

Incorrect line
<tree string="Analytic Defaults" colors="grey:date_stop and (date_stop &lt; (datetime.date.today().strftime('%%Y-%%m-%%d)))">

SOLUTION:

The colors structure is wrong and you have to change that with :

<tree string="Analytic Defaults" colors="grey:'date_stop','and',('date_stop','&lt;',(datetime.date.today().strftime('%%Y-%%m-%%d')))">

Solved by David Romero and Andrea Garcia
TREScloud
www.trescloud.com

description: updated
description: updated
description: updated
information type: Private Security → Public
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Andrea,

I have checked your issue with latest trunk build :
   (Build 915)
 - server (4627)
 - addons (8182)
 - web (3544)

But, I did not face any issue which you define in your report, So, Would you please try with latest code or provide us a proper information about your report?

Thanks for reporting..!!!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

> When you enter to Accounting/Configuration/Analytic in the webclient

As far as i can tell, the Analytic Defaults tree view does not have any @colors, at least in the latest trunk

> The colors structure is wrong

No, it is not. @colors is a bunch of Python expression, not weird things which kinda sorta looks like domains but aren't actually domains.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.