How to display button and status bar items in line - odoo

How to display below mentioned two group(marked in red circle) in line?
relevant code for the same is given below
<header>
<button name="mymod_assigned" class="oe_highlight" type="workflow" string="Assigned" state="new" />
<button name="mymod_negotiation" class="oe_highlight" type="workflow" string="In Negotiation" state="assigned" />
<button name="mymod_won" class="oe_highlight" type="workflow" string="Won" state="negotiating"/>
<button name="mymod_lost" class="oe_highlight" type="workflow" string="Lost" state="negotiating"/>
<field name="state" widget="statusbar"
statusbar_visible="new,assigned,negotiation,won,lost"
statusbar_colors='{
"new":"blue",
"assigned":"blue",
"negotiation":"blue",
"won":"red",
"lost":"red"
}'
/>
</header>

Try putting left group of buttons in one div with float:left and right group in another div with float:right.

Related

Special="save" button doesn't work in odoo16 form view

When I add my "save" button and "discard" button as following:
<footer>
<button string="Save" special="save" class="btn-primary" close="1" />
<button string="Discard" class="btn-secondary" special="cancel"/>
</footer>
Both buttons dont work and when I click them, nothing happends.

how hide button if have same name with different field based on user selection

For example below mentioned code
<button name="invoice_recreate" string="Recreate Invoice"/>
<button name="invoice_corrected" string="Ignore Exception" />
Add the field selection to the view and the attrs attribute to the button like this:
<field name="selection_field" invisible="1" />
<button name="invoice_recreate"
string="Recreate Invoice"
attrs="{'invisible': [('selection_field', '=', 'value')]}" />
<button name="invoice_corrected"
string="Ignore Exception"
attrs="{'invisible': [('selection_field', '!=', 'value')]}" />
I am not sure if this is what you are asking for, let me know if you are asking anything different

How to hide button "Approve" in from view of odoo without coding?

Please, I need to hide the "Approve" button that is in the "Expense Reports to Approve" view without any code changes, I use odoo 11 and, the module I installed is hr_expense. Here is part of the code for this view:
<form string="Expense Reports" class="o_expense_sheet" modifiers="{}">
<header modifiers="{}">
<button name="approve_expense_sheets" states="submit" string="Approve" type="object" class="oe_highlight o_expense_sheet_approve" modifiers="{'invisible':[['state','not in',['submit']]]}" options="{}"/>
<button name="action_sheet_move_create" states="approve" string="Post Journal Entries" type="object" class="oe_highlight o_expense_sheet_post" modifiers="{'invisible':[['state','not in',['approve']]]}" options="{}"/>
<button name="248" type="action" string="Register Payment" class="oe_highlight o_expense_sheet_pay" attrs="{'invisible': [('state', '!=', 'post')]}" context="{'default_amount': total_amount, 'partner_id': address_id}" modifiers="{'invisible':[['state','!=','post']]}" options="{}"/>
<button name="reset_expense_sheets" states="cancel" string="Resubmit" type="object" modifiers="{'invisible':[['state','not in',['cancel']]]}" options="{}"/>
<button name="247" states="submit,approve" context="{'hr_expense_refuse_model':'hr.expense.sheet'}" string="Refuse" type="action" modifiers="{'invisible':[['state','not in',['submit','approve']]]}" options="{}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,submit,approve,post,done" on_change="1" modifiers="{'readonly':true,'required':true}"/>
</header>
<sheet modifiers="{}">
<div class="oe_button_box" modifiers="{}">
<button name="action_get_attachment_view" class="oe_stat_button" icon="fa-book" type="object" modifiers="{}" options="{}">
<field name="attachment_number" widget="statinfo" string="Documents" modifiers="{'readonly':true}"/>
</button>
</div>

How can I change boolean_button terminology?

I have defined a button with the boolean_button widget
<button name="toggle_enable" type="object" class="oe_stat_button" icon="fa-unlink">
<field name="enabled" widget="boolean_button" options='{"terminology": "active"}'/>
</button>
I've tried to change the terminology to Exported / Not exported but I have not succeeded. Can someone tell me if it is possible to define a new terminology?
In Odoo v10, you can do it as following :
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-check-square" >
<field name="active" widget="boolean_button" options='{"terminology": {
"string_true": "Production Environment",
"hover_true": "Switch to test environment",
"string_false": "Test Environment",
"hover_false": "Switch to production environment"
}}'/>
</button>
</div>
But in Odoo v9, by default it is not there.

How to add icon in list view Odoo?

Is it possible add icon instead text in list view?
Example:
<field name="status" />
If status = phone display (icon="fa-phone) else status = fax display (icon="fa-fax).
Field display with string fax or phone.
You need to change icon name.
Try with this:
<field name="status" invisible='1'/>
<button name="status" icon="fa-check text-success" attrs="{'invisible': ['|',('status','=','phone')]}" />
<button name="status" icon="fa-times-circle text-danger" attrs="{'invisible': ['|',('status','=','fax')]}" />