Reputation: 95
In the sales module in odoo, when the client wants to create a new sales quotation, the Quotation date is not visible. 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?
Upvotes: 1
Views: 1048
Reputation: 26768
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.
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:
<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'])]}"/>
Upvotes: 2