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

How to load data in one2many field (current showing form) when button is clicked, in OpenERP7?

By
Yulybaseball
on 8/27/14, 12:18 PM 1,043 views

Hi buddies:

I have a TransientModel class (credit.card.reconciliation.wz) with a field defined like this:

'voucher_payment_ids': fields.one2many('voucher.payment', 'wizard_id', 'Payments', readonly=True),

In my view file I have the following fields (among others):

...

<field name="period_id" domain="[('fiscalyear_id', '=', fiscal_year)]" />
                        <button name="action_execute_reconciled" icon="gtk-execute" type="object" string="Reconciled"/>
                        <button name="action_execute_not_reconciled" icon="gtk-execute" type="object" string="Not Reconciled"/>
                    </group>
                    <separator string="Payments" colspan="4"/>
                    <group>
                        <field name="voucher_payment_ids" nolabel="1">
                            <tree>
                                <field name="date" string="Date"/>
                                <field name="amount" string="Amount" widget="currency"/>
                                <field name="commission" string="Comission"/>
                                <field name="bank_id" string="Bank"/>
                                <field name="date_rc" string="Date RC"/>
                            </tree>
                        </field>
                    </group> 

...

I wanna load data in the tree (field voucher_payment_ids) when <button name="action_execute_reconciled" ...> is clicked. I need the current form to stay open, and show data in the tree view for users to select (checkboxes) the records they want to submit later.

The records I want to load (to show in tree view field) will be retrieved using a domain, according to values of another fields in my view.

So, how to load/show data in current form, in that one2many field?

I am using OpenERP 7.

Cheers.

 

 

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: 8/27/14, 12:18 PM
Seen: 1043 times
Last updated: 3/16/15, 8:10 AM