コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
134 ビュー

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?



アバター
破棄
最善の回答

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.


アバター
破棄
著作者 最善の回答

Thank you. It seems to work

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
4
8月 25
1391
1
6月 25
1033
1
5月 25
996
1
5月 25
1122
1
4月 25
1572