Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Pagination in Openerp 7

By
supreeth
on 10/14/14, 11:40 PM 1,002 views

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.

 

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3918
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 10/24/14, 6:14 AM

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}

Thanks

supreeth
on 10/24/14, 7:14 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/14/14, 11:40 PM
Seen: 1002 times
Last updated: 3/16/15, 8:10 AM