Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
124 Zobrazení

I have this code in my view:

<record id="view_packing_order_form" model="ir.ui.view">

        <field name="name">packing.order.form</field>

        <field name="model">packing.order</field>

        <field name="arch" type="xml">

            <form string="Packing Order">

                <sheet>

​...

​ <footer>

                        <button name="action_start_packing"

                                type="object"

                                string="Start packing"

                                class="btn-primary"

                                invisible="state != 'draft'"/>

                        <button name="action_cancel_order"

                                type="object"

                                string="Cancel"

                                class="btn-secondary"

                                invisible="state == 'cancel'"/>

                    </footer>

And this code in my model:

def action_start_packing(self):

        self.write({'state': 'in_progress'})

def action_cancel_order(self):

        return {

            'type': 'ir.actions.act_window',

            'res_model': 'packing.order.cancel.reason.wizard',

            'view_mode': 'form',

            'target': 'new',

            'context': {'active_id': self.id},

        }

I get no errors but I see no buttons where they should be (in draft packing order).

How can I fix it?



Avatar
Zrušit
Nejlepší odpověď

Following these steps should make it work:

  1. Place this inside your <sheet> tag: <field name="state" invisible="1"/>
  1. After that, upgrade the exact module where this code is applied.


Avatar
Zrušit
Autor Nejlepší odpověď

Thank you. It seems to work

Avatar
Zrušit
Nejlepší odpověď

Thank Hasan, I got the same problem, it's helpful.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
srp 25
1390
1
čvn 25
1032
1
kvě 25
995
1
kvě 25
1122
1
dub 25
1571