0

I have created a kanban view for Document management system to show folders and files. To do this i have created an action. Each time i click on folder the document path above the save button displays the action name instead folder name. i need to display the folder name please help!! Code:

<record model="ir.actions.act_window" id="action_ams_document_file_directory_form1">
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">document.directory</field>
        <field name="name">Folder</field>
        <field name="view_type">form</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="view_id"
            ref="3e_apartment_management.view_document_sub_directory_kanban" />
        <field name="domain">[('parent_id','=',active_id)]</field>
        <field name="context">{'parent_id':active_id}</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                This folder is empty.
            </p>
            <p>
                Click on 'Create' button to add new folder.
            </p>
        </field>
    </record>

Attached screen shots: enter image description here

enter image description here

KbiR
  • 4,047
  • 6
  • 37
  • 103

1 Answers1

0

You could try using the name_get method. This will set the name that will be displayed on top of the page.

In the following code "%s" % (record.name) can be changed to your own value or method that returns the value for the record

example old api

def name_get(self, cr, uid, ids, context=None):
    return [(record.id, "%s" % (record.name))
    for record in self.browse(cr, uid, ids, context=context)]

example new api

@api.multi
def name_get(self):
    return [(record.id, "%s" % (record.name))
            for record in self]
JordyRitzen
  • 592
  • 5
  • 21
  • thank you programme... now i getting an error "TypeError: not enough arguments for format string" – KbiR Mar 21 '16 at 10:09
  • Thanks for your update, i just added above code in py file but nothing happen... pls help – KbiR Mar 21 '16 at 10:48
  • No error messages. If i click on 'Documents' the path on top should be 'Documents' structure/ Documents'. now it shows 'Documents' structure/Folder', the 'Folder' is name of an action. – KbiR Mar 21 '16 at 11:22
  • Odoo creates that path using java script in web module named as view.js ` – KbiR Mar 21 '16 at 11:24
  • well you should edit the code so it shows you the correct path. I'd suggest that you create a new method to find that path. This method is just to change that text – JordyRitzen Mar 21 '16 at 11:56