简体   繁体   English

如何在 odoo 15 中使不可见的字段再次可见

[英]How to make an invisible field visible again in odoo 15

In the sales module in odoo, when the client wants to create a new sales quotation, the Quotation date is not visible.在odoo的销售模块中,当客户想要创建新的销售报价时,报价日期是不可见的。 So in developer mode, i went into the form view and realised it had an attribute attached to it with an invisible attribute.所以在开发人员模式下,我进入表单视图并意识到它有一个附加到它的属性和一个不可见的属性。 I tried deleting the whole attribute but that doesn't seem to work, i only see it in developer mode.我尝试删除整个属性,但这似乎不起作用,我只能在开发人员模式下看到它。 How do i make this field visible for the client to input a quotation date so it reflects in the frontend?我如何使此字段对客户可见以输入报价日期,以便它反映在前端? Below is the code:下面是代码:

<field name="date_order" nolabel="1" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>

And this is the group it is added to:这是它添加到的组:

<group name="order_details">
                            <field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
                            <div class="o_td_label" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}">
                                <label for="date_order" string="Quotation Date"/>
                            </div>
                            <field name="date_order" nolabel="1" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
                            <div class="o_td_label" attrs="{'invisible': [('state', 'in', ['draft', 'sent'])]}">
                                <label for="date_order" string="Order Date"/>
                            </div>
                            <field name="date_order" attrs="{'required': [('state', 'in', ['sale', 'done'])], 'invisible': [('state', 'in', ['draft', 'sent'])]}" nolabel="1"/>
                            <field name="show_update_pricelist" invisible="1"/>
                            <label for="pricelist_id" groups="product.group_product_pricelist"/>
                            <div groups="product.group_product_pricelist" class="o_row">
                                <field name="pricelist_id" options="{'no_open':True,'no_create': True}"/>
                                <button name="update_prices" type="object" string=" Update Prices" help="Recompute all prices based on this pricelist" class="btn-link mb-1 px-0" icon="fa-refresh" confirm="This will update all unit prices based on the currently set pricelist." attrs="{'invisible': ['|', ('show_update_pricelist', '=', False), ('state', 'in', ['sale', 'done','cancel'])]}"/>
                            </div>
                            <field name="currency_id" invisible="1"/>
                            <field name="tax_country_id" invisible="1"/>
                            <field name="payment_term_id" options="{'no_open':True,'no_create': True}"/>
                        </group>```

Is there a way i could make the quotation date visible or it's an access right thing?

The first label and date field are used to show the quotation date for users who belong to the Technical Features group and the second label and date field are used to show the order date for users who has access to the sale order.第一个label 和日期字段用于显示属于Technical Features组的用户的报价日期,第二个label 和日期字段用于显示有权访问销售订单的用户的订单日期。

It is supposed to have the creation date of the draft/sent quotations (does not need to be edited).它应该有草稿/发送报价的创建日期(不需要编辑)。

You can make the field visible for those users by removing the group attribute, adding a user to the Technical features group, or by adding a new group like following:您可以通过删除group属性、将用户添加到Technical features组或通过添加如下所示的新组来使该字段对这些用户可见:

<div class="o_td_label" groups="base.group_no_one,{GROUP_EXTERNAL_ID}" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}">
    <label for="date_order" string="Quotation Date"/>
</div>
<field name="date_order" nolabel="1" groups="base.group_no_one,{GROUP_EXTERNAL_ID}" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM