콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
126 화면

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
1390
1
6월 25
1033
1
5월 25
995
1
5월 25
1122
1
4월 25
1571