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 would you do that ?

By
Alkivi SAS
on 2/5/14, 1:41 PM 656 views

Hi there,

new to openerp, I'm developping my first module :) So far, basic views and object declaration are ok. Let's move to more advanced stuff.

I have an object A with a column like

'account_move_line_id': fields.many2one('account.move.line', 'Account Move Line'),

I've got a form that look like

<!-- Transaction Form View -->
<record model="ir.ui.view" id="view_linxo_transaction_form">
    <field name="name">linxo.transaction.form</field>
    <field name="model">linxo.transaction</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <form string="Transaction Info">
            <group colspan="4" col="2">
                <field name="date" readonly="1"/>
                <field name="label" readonly="1"/>
                <field name="notes" readonly="1"/>
                <field name="amount" readonly="1"/>
                <field name="account_move_line_id" widget="many2one_list" domain="[('journal_id','=',journal_id),'|', ('debit','=', abs(amount)), ('credit','=', abs(amount))]"/>
                <field name="journal_id" readonly="1"/>
                <button name="search_account_move_line" string="Search account moves" type="workflow" attrs="{'invisible':[('account_move_line_id','!=',False)]}"/>
            </group>
        </form>
    </field>
</record>

The goal is to perform a search for account.move.line, using criteria such as :

  • amount between this and that
  • date close to that

The user will then pick from that list the correct account.move.line to associated to object A.

I'm struggling with the road to take :

  • Custom widget and precise search (something like the default widget search more option)
  • Dynamically update domain to perform correct search in basic widget
  • Create a popup view not related to any model, perform search and take return of the popup to fix account_move_line_id (my favorite, but dont know where to start)

Any pointers would be appreciated :)

"How would you do that" is not a good title - it forces people to open your question before they know if they can help.

Bista Solutions US, Ray Carnes
on 2/5/14, 5:31 PM

Good point, going to try to rephrase the question.

Alkivi SAS
on 2/5/14, 6:06 PM

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

0 follower(s)

Stats

Asked: 2/5/14, 1:41 PM
Seen: 656 times
Last updated: 3/16/15, 8:10 AM