How to bring back import records from favorites to create menu in odoo15 - odoo-15

import records button is moved to favorites menu in odoo15. I want to create import button at create button. How to do it.
from odoo import models
class BaseImport(models.Model):
_name = "base.import"
_inherit = "base_import.import"
I am not able to write views for creating this.

Related

Click button create dynamically new field, Odoo 15

I have a field(binary) named of "others". I want to do this, when i click the button, create new field(binary). Let's say I have 20 files. I want to create 20 field. And I want to upload file for each field. It is possible to do?

How can i fill my Panels with GridLayoutmanager

firstly look at https://imgur.com/a/1r6sK31
I have a project where I wanna show a Table with some data.
it show the data but the panels dont fill verticaly and horizontaly.
I use the GridLayoutManager from com.intellij.uiDesigner.core
thats how it looks right now
The table has its own panel and class where it gets its data
the class below the table is just a baseClass with all buttons (so i dont need to rewrite the class all the time) and a panel for the table, where it should be filled, and the mainView where i wanna add the tableView and fill it in the panel where it should be added. View first Image
Edit:
i add all panels with mainPanel.add(panelToAdd,new GridConstraints());
I found a solution that works.
You need to add GridConstraints and set the LayoutManager to these JPanels
GridConstraints constraints = new GridConstraints();
constraints.setFill(GridConstraints.FILL_BOTH);
this.setLayout(new GridLayoutManager(1,1));
this.add(mainPanel, constraints);

how to add new menu item to an existing odoo module?

I want to add new menu item in human resources module.
I create new module depends of "hr" module.
and I create an xml file to add new menu and field.
this my code:
<menuitem id="menu_new" parent="menu_hr_root" name="new" sequence="30"/>
I update module list and I reload the page but I didn't find the new menu.
thanks for your help.
Just we must need to add the parent id based on your dependent module name then after your depended menu id in your parent Attribute
some think like this
<menuitem name="Performance Appraisal" parent="your_module_name.menu_eval_hr" id="menu_open_per_appri_req"
action="action_menu_perf_app_rel"/>
Menu Attribute
name=name of your menu
id=unique id for each menu item
string = Name of your string which you want display in your view form
not string attribute is not define then the menu string
automatically set as your menu action name
action=name of your action which you want to call
parent=your_dependent_module_name.parent menu id in your child menu
if your parent menu is in your same module then the dependent module name is not needed to add in your parent attribute
sequence =Define the sequence for the menu displaying in your view
I hope this should helpful for you ..:)

OpenERP - Exporting Bill of Materials Structure data to Excel

I want to export Bill of Materials (BOM) Structure data to Excel or PDF.
I am using Odoo v8 on Ubuntu.
I have also installed "web_export_view" and "web_printscreen_zb" modules and none of them displays export buttons on "Bill of Materials Structure" page. It appears that both modules will display buttons only if the active view is "list" view and not "tree" view. For "Bill of Materials Structure" page active view is "tree" view, and the data is displayed in parent, child hierarchical fashion.
The question is how to export to Excel or PDF the "Bill of Materials Structure" page?
When you're signed in as an admin you're always able to export.
Go to the desired model for your export in tree view.
Select the fields you want to export
Click the dropdown "More" (if your Odoo is set to english)
Hit export
Select export all data instead of export import compatible data
Select Excel instead of csv
Select the fields you want to export
Click export to file
This should get you your export file

selecting different options from two different drop down menu in Selenium

How can I select different options from different drop down menus?
after selecting an option from second menu, first drop down menu gets the default value which is first option.
driver.find_element_by_xpath("/html/body/div[1]/div[1]/div[5]/div[2]/div/div[2]/div/div[1]/div[2]/div/form/div/div[1]/div/select/option[2]").click()
driver.find_element_by_xpath("/html/body/div[1]/div[1]/div[5]/div[2]/div/div[2]/div/div[1]/div[2]/div/form/div/div[3]/div/select/option[2]").click()
Try this
import org.openqa.selenium.support.ui.Select;
new Select(driver.findElement(By.xpath("//html/body/div[1]/div[1]/div[5]/div[2]/div/div[2]/div/div[1]/div[2]/div/form/div/div[3]/div"))).selectByIndex(2);
new Select(driver.findElement(By.xpath("//html/body/div[1]/div[1]/div[5]/div[2]/div/div[2]/div/div[1]/div[2]/div/form/div/div[3]/div"))).selectByIndex(2);