Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
151 Vizualizări

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?



Imagine profil
Abandonează
Cel mai bun răspuns

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.


Imagine profil
Abandonează
Autor Cel mai bun răspuns

Thank you. It seems to work

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
aug. 25
1393
1
iun. 25
1035
1
mai 25
998
1
mai 25
1122
1
apr. 25
1573