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.

1

Connecting res.partner.form to account.invoice.form

v7
By
wasis85
on 2/12/13, 2:44 AM 1,474 views

Hi guys.. i want to connect res.partner.form to account.invoice.form in order to partner can make directly go to account.invoice.form. i create button type="action", this is the xml..

<button name="278" string="Create Invoice" type="action" class="oe_highlight" attrs="{'invisible': [('state','=','draft')]}" groups="base.group_user"/>

then this button will go to xml "action_view_sale_advance_payment_inv":

<record id="action_view_sale_advance_payment_inv" model="ir.actions.act_window">
            <field name="name">Invoice Order</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.advance.payment.inv</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>
        </record>

then .. go to account.invoice.form. The problem is partner name is not directly inserted to partner_id xml field in account.invoice.form, whereas in the header of account.invoice.form already writed partner name, here the example..

Customers / wasis / New

wasis is partner name..

what should i do with this problem? really need your help guys..

2

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 2/12/13, 3:59 AM

Add this in your xml:

<field name="context">{'default_partner_id': active_id}</field>

This will set the default value of the partner_id field to the active record (the partner you come from).

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/12/13, 2:44 AM
Seen: 1474 times
Last updated: 3/16/15, 8:10 AM