Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3624 Vizualizări

Where is Pagination python script is located in openerp-7. I want to give pagination for tabs as shown in figure.

We can give pagination for main menus. But how can i give pagination for tabs as shown below Image. Now i have written static code in xml i need to hard code dynamic pagination in python script.

<page string="History"> <div style="float:right"> <div class="oe_pager_value"> <span class="oe_list_pager_state"> <span class="oe_form_pager_state">1 / 8</span> </span> </div> <ul class="oe_pager_group"> <li> <a class="oe_i" type="button" data-pager-action="previous">(</a> </li> <li> <a class="oe_i" type="button" data-pager-action="next">)</a> </li> </ul> </div> <field name="history_line" readonly="context.get('ctx', False)"> <tree string="History Order Lines" create="false" delete="false"> <field name = "s_no"/> <field name = "date_created"/> <field name = "created_by"/> <field name = "last_update"/> <field name = "last_update_by"/> <field name = "date_status_change"/> <field name = "status_change_by"/> </tree> </field> </page>

Where is Pagination python script is located in openerp-7. I want to give pagination for tabs as shown in figure.

We can give pagination for main menus. But how can i give pagination for tabs as shown below Image. Now i have written static code in xml i need to hard code dynamic pagination in python script.

<page string="History"> <div style="float:right"> <div class="oe_pager_value"> <span class="oe_list_pager_state"> <span class="oe_form_pager_state">1 / 8</span> </span> </div> <ul class="oe_pager_group"> <li> <a class="oe_i" type="button" data-pager-action="previous">(</a> </li> <li> <a class="oe_i" type="button" data-pager-action="next">)</a> </li> </ul> </div> <field name="history_line" readonly="context.get('ctx', False)"> <tree string="History Order Lines" create="false" delete="false"> <field name = "s_no"/> <field name = "date_created"/> <field name = "created_by"/> <field name = "last_update"/> <field name = "last_update_by"/> <field name = "date_status_change"/> <field name = "status_change_by"/> </tree> </field> </page>

So if i get pagination python script location in OpenERP 7 i will get some clues.

 

Imagine profil
Abandonează
Cel mai bun răspuns

use on_change on the 2 fields (binder_in_use and tablet_in_use):

XML:

<field name="binder_in_use" on_change="onchange_primary(binder_in_use, tablet_in_use)"  />
<field name="tablet_in_use" on_change="onchange_primary(binder_in_use, tablet_in_use)"  />
<field name="primary" />

PY:

    def onchange_primary(self, cr, uid, ids, binder_in_use, tablet_in_use context=None):
        values = {}
        warning = {}
        if binder_in_use and tablet_in_use:
                warning = {
                    'title': _('Warning!'),
                    'message': _('Cannot select both Options.')
                }            
        if binder_in_use:
            values['primary']='Binder'
        if tablet_in_use:
            values['primary']='Tablet'

        return {'value' values, 'warning': warning}

Imagine profil
Abandonează
Autor

Thanks