Skip to Content
Menu
This question has been flagged
1 Reply
2389 Views

Hi everyone,

I'm developping a custom module for Odoo and I'm using some default Odoo fields such as "create_date" and "write_date". My problem is that I dont want these fields to be displayed in the form view during creation and edition; but displayed when users consult it.

I've tried to do it through javascript but I dont know QWeb and though I read several documentations, I lack examples to understand the way widgets work. For instance, with jQuery(I only know the basics of this API) I don't know how to select the <div> inside my form view.

 Below are 2 screens to illustrate my problem. Thank you in advance for any help.

http://hpics.li/478100e  I dont want to display both date fields.

http://hpics.li/82b0112 I want to keep this.

Avatar
Discard
Best Answer

Hi

YoU HaVTO redefine the field:

Class res_partner (osv.osv):

    _inherit = 'res.partner'

    _columns = {'create_date': fields.datetime ('Create Date', readonly = True),}


And Create tree view/Inherit view like:

<Field name = "create_date" />

Let me know if this is also not working.


Thanks,

Avatar
Discard
Author

I've tried your solution but the field is still displayed and editable.

Author

I thought the easiest solution would be to hide the corresponding <div> through javascript but I don't succeed in selecting them.