تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
28787 أدوات العرض

I searched through the old forums and didn't find any decent answers. Is it possible to click on a record in a one2many list and have it open the full page, rather than just the popup?

I'm trying to access attachments/reports/links associated with that record, and that's not possible if I'm only ever getting a popup window.

Thanks for your input.

الصورة الرمزية
إهمال
أفضل إجابة

Another option is to add a button in the list view of type "object" that executes the "get_formview_action" which already exists on every model.

<button type="object" name="get_formview_action" string="Open" icon="fa-edit"/>
الصورة الرمزية
إهمال
أفضل إجابة

You can create a type='object' button in the tree view. The button method should return an action to open the selected line. You have to click on the button, not anywhere in the line.

class mymodule_model(osv.osv):
    _name = 'my_module.model'
    ...
    ...
    def open_line(self, cr, uid, id, context=None):
        return {
            'type': 'ir.actions.act_window',
            'name': 'Model Title', 
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': self._name,
            'res_id': id[0],
            'target': 'current',
        }
الصورة الرمزية
إهمال

Glad it worked. _() is the string translation function. If you want to translate the action title, you should use it and add from openerp.tools.translate import _ to your module.

الكاتب

Ahh, that makes sense. Thanks again, that one has been bugging me for a while.

I updated the answer to prevent confusion. Actually I'm not sure if it is required to do the translation on server side or the client would translate it.

Mohammad Ali, is it possible to do this without adding a new button and just directing the original 'Add an item' button to return a full page?

No. But you can disable list view editing and always get the form dialog for editing.

What if you wanted to open a related object (many2one) instead of the current object. For instance, open the product from the mrp.bom.line

أفضل إجابة

In the Tree view we can put editable="bottom", now we can edit in the same form,

                          <field name="One2many_field_name" >
                                    <tree editable="bottom">
                                        <field name="name"/>                                       
                                    </tree>
                                </field>

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 23
1429
2
نوفمبر 20
17794
9
سبتمبر 19
27847
7
ديسمبر 23
34130
1
يناير 16
14664