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

Button Save and Close doesn't appears

By
Sandro Regis
on 8/3/14, 10:12 PM 1,398 views

Hello friends, this is Sandro Regis and thanks fo read my question. So I did a new module that inherits PAYMENT.LINE create some new methods, override some fields in the wizard view, but... the buttons [Save and New] / [Save and Close] / [Cancel] are not being shown. Ah.. this is Openerp 6.1 version in use.

Below my xml view file:

<?xml version="1.0"?>
<openerp>
<data>
    <record model="ir.ui.view" id="view_wizard_payment_order_form">
        <field name="name">wizard.payment.order.form</field>
        <field name="model">payment.line</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="account_payment.view_payment_line_form" />
        <field name="arch" type="xml">
            <data>
                <xpath expr="//field[@name='communication']" position="replace">
                    <field name="communication" string="Faturas" select="0"/>
                </xpath>
                <xpath expr="//field[@name='communication2']" position="replace">
                    <field name="communication2" string="Sale Orders" select="0" help="Sale orders numbers"/>
                </xpath>
                
                <xpath expr="//field[@name='amount_currency']" position="replace">
                    <field name="amount_currency" select="0"/>
                </xpath>
                <xpath expr="//field[@name='order_id']" position="replace">
                    <field name="order_id" select="0" on_change="onchange_order_id(context)"/>
                </xpath>
                <xpath expr="//field[@name='partner_id']" position="replace">
                    <field name="employee_id" select="1"/>
                </xpath>
            </data>
        </field>
    </record>
</data>
</openerp>

Please could some friend give some hint on how to make the buttons appears like in the original inherit view

Thank you so much!

1

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/4/14, 2:18 AM

You can add new button by add field something like this

<button name="save" string="Save" />

and new method "save" in the model. I think you can do this in your new model without modifying account_payment module.

0
Sandro Regis
On 8/4/14, 12:11 PM

Hi Ben Bernard, thanks for your hint, but it doesn't works.

Regards,

Yes Bernard, you are right, the problem was at my xml format, now its solved exactly as your hint. Thank you so much!

Sandro Regis
on 8/4/14, 7:03 PM

I think you can create new view which consist a button (inherit from account_payment.view_payment_line_form). Then you inherit the wizard from this view. As far as I know standard button in form view is not part of view definition. Or you can change action_next button to save, something like <xpath expr="//button[@name='action_next']" position="attributes"> Save Then override the execute method [1]. [1] https://doc.odoo.com/6.1/developer/04_wizard/#more-extensive-view-customization

Sandro Regis
on 8/4/14, 7:04 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

1 follower(s)

Stats

Asked: 8/3/14, 10:12 PM
Seen: 1398 times
Last updated: 3/16/15, 8:10 AM