RML empty datetime returns 'False' instead of Null

Bug #611656 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Bhumika Shrimali

Bug Description

'date_weighing' : fields.datetime('Date Weighing',),

first - this does not conform to the behavior of other fields

second -this makes ugly coding necessary.
[[ (picking.date_weighing != 'False' or picking.number_weighing) and ( (picking.number_weighing or '' ) + ' / ' + ( picking.date_weighing != 'False' and picking.date_weighing or '' ) ) or removeParentNode('para') ]]

instead of

[[ (picking.date_weighing or picking.number_weighing) and ( (picking.number_weighing or '' ) + ' / ' + ( picking.date_weighing or '' ) ) or removeParentNode('para') ]]

Changed in openobject-server:
assignee: nobody → Sbh (Open ERP) (sbh-openerp)
Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :

Hello Dr Ferdinand,

Can you use with formatLang
[[formatLang(picking.date_weighing,date=True) or removeParentNode('para') ]]

Revision history for this message
Ferdinand (office-chricar) wrote :

thanks this works and is probably a good idea to use in this case.

nevertheless I think
[[ (picking.date_weighing or removeParentNode('para') ]]
should work also in case the datetime field should not be formatted.

Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :

Hello Dr Ferdinand,

we have introduced formatLang() to decorate report values.
when you use values without this method, it will display normal OpenERP False value. This is how we return the values from our browse().

However, your idea to support default formatting is appreciable.
we note this and plan to make clearer code.

Thanks

Changed in openobject-server:
status: New → Invalid
Changed in openobject-server:
milestone: none → 5.0.13
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.