How to add new button near the create button in odoo 16 community? [closed] - odoo

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
I'm new to odoo and i want to add button near odoo create button like in picture.
Somebody, please can help me.
Thank you
i don't find a possibility to implement that in my xml tree view

In tree/list views you can add action buttons next to the create button by defining a header right after the <tree> node.
For example from the purchase app of Odoo 16, which adds a button for bills creation:
<tree string="Purchase Order" decoration-info="state in ['draft', 'sent']" decoration-muted="state == 'cancel'" class="o_purchase_order" js_class="purchase_dashboard_list" sample="1">
<header>
<button name="action_create_invoice" type="object" string="Create Bills"/>
</header>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<!-- ... -->
</tree>

Near create button you cannot add from xml, if you want that you have to add it from js.

Related

How make my custom module visible in app switcher odoo12 through code

I am new to the odoo and I developed a small custom module in odoo12. The problem is I am not able to see my custom module in the app switcher page after installing the module. (Below I gave the image link, where I am not able to see the module I have created after installing).
This is the link
The first step is you must define a menuitem, if you do not set a "parent" it will be a root menu and will therefore appear in the app drawer.
<menuitem
id="model_menu_root"
name="Module Menu"
web_icon="module_name,static/description/icon.png"
groups="base.group_user"
sequence="6"
/>
You will probably want to have submenus to access your models, they will use this menu as their parent.
<menuitem name="Model Name" id="menu_1_list" parent="model_menu_root"
action="action_window"/>
And the menu refers to the window action, which controls how your model is displayed.
<record model="ir.actions.act_window" id="action_window">
<field name="name">Model Name</field>
<field name="res_model">module_name.model_name</field>
<field name="view_mode">tree,form</field>
</record>
You will need to define some security rules, otherwise the menu will not appear. These are controlled in the ir.model.access.csv file which must be declared in the __manifest__.py file. In previous versions skipping this step would be fine for testing purposes as the admin user would be able to see all models but this seems to have changed in v12 and you will need to define security rules before the menu becomes visible. Security rules are explained in the odoo developer docs https://www.odoo.com/documentation/12.0/reference/security.html
By the way, for a problem like this, usually the first place I would look would be the Odoo source code on GitHub. You can see how they have implemented the root menu and security rules on each of their modules and emulate it for your module.

Extend list view and add custom styling [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I am working with one2many list view and there is a state column in that i want to add custom css based on state of the object. Like if state is Completed make the text bold and background green somthing like that for other states. I tried but didn't found any way to add custom css or css classes based on condition. So i am now trying to extend list view in javascript and then i will loop through all rows and then add colors on them . Is this possible in Odoo ?
This can help if you want to change the entire row:
<field name="line_ids" >
<tree string="Lines" colors="red:state=='completed'" fonts="bold:state=='completed'">
<field name="name"/>
<field name="employee_id"/>
<field name="state"/>
</tree>
</field>
But if you want to change just one column maybe this post can help you: Bold in listview for many records
I hope I've helped.

How to show download link for ir.attachment in Kanban card for Odoo 8?

I want to show the download link for ir.attachment in Kanban card (as in the form view), below the attachment name. Can anyone help me?
You can use the url widget.
<field name="url" widget="url"/>
Example

How to add a custom fields created in Employee Module to Leave Request Module in openerp 8?

I had created two new fields in for Employee Model via the database structure and modified the form view of employee model to display both the fields. They are displaying perfectly. Now I want to refer to these new fields in the Leave Request Module. I don't know how to display it. I tried adding it similarly like I did for Employee Model but it doesn't help. Could you help in achieving this?
what is the code you've got so far?
are you using xpath?
this might be the solulation for your problem.
<xpath expr="//field[#name='thenameofthefieldfromcurrentview']" position="after">
<field name="thenameofthefieldyouwanthere"/>
</xpath>

Correct way of doing navigation [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am creating a wordpress website with multi-level of navigation.
When i say multi-level the parent link also has <a href="#">. I have this link for nothing. And this is creating issues when I check for Link quality in chrome extention "SEO Site Tools" It gave me I have over 200 links in my homepage and this is bad seo.
Is there anyway I can replace parent item link <a href="#"> to <span>? If I do will search engine make my website as scam? This is the structure I am trying to implement.
<ul>
<li>
<span>Products</span>
<ul>
<li>Product 1</li>
<li>Product 2</li>
</ul>
</ul>
I wrote seo site tools. The 200 links per page is really more of a rule of thumb... Im sure you will be fine. if you send the domain along ill take a look but I dont understand why you are listing all your products in the menu. the other thing you could do is for the deepest pages write the nav code out with javascript and then google wouldnt see all the links to every page on every other page. If you choose to go that way make sure google will still have a way to navigate to those pages (this is usually done with category listing pages)