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 ..:)
Related
I have problem with add new custom field to search in blocklayered Prestashop.
How I can add new search field with custom type such as:
add textbox to search product by name
add textbox to search product by producer
add textbox to search product by quality
I tried to add custom field but it did not work.
in this case it's necessary to rebuild search functions located in Search.php class (classes/Search.php)
it's necessary to include these fields to search queries.
i want to hide Manufacturing ==> Bill Of Materials form a specific user. can i do that in view part by inheriting Menuview?
Yes, you can hide by using security groups. Create one group and include all other users except this user. Then goto "Settings >> Technical >> User Interface >> Menu Items". Then choose "Bill of Materials" and add the new group created. Now it will be hidden for the other user.
To do it in xml of your custom module, inherit the action "mrp_bom_form_action" and menu item with id "menu_mrp_bom_form_action" from mrp. add groups attribute to the menu item and give the newly created group.
i am creating a list of value by selection fields and giving values for user select by selection option property . but when i am doing for three or four item . it is going to good . but when i want to add more items in selection option then i am unable to do this task . selection option property is not giving me more space for adding new value.
so please any one give me solution so i'll add more values .
and other problem is that i've created a button in form . but i want that whenever any user press this button , a another fields should be display . and when again user will click on this button , a 3rd fields should be display.
i've created this 3 fields namely one,two,there.
syntax:-
if click "my" button , a another fields "two" should be display .
thank you
If you have more values in "Selection" field then you should create a class for those selection values and make your selection filed many2one. In your xml file make your field as selection using widget="selection"
For example:
class ur_class(osv.osv):
_columns = {'ur_field_name': fields.many2one('select.type', 'Select')}
ur_class()
class select_type(osv.osv):
_name = 'select.type'
_columns = {'name': fields.char('Type', size=50)}
select_type()
Now in ur xml use widget='selection' like this:
<field name="ur_field_name" widget="selection"/>
Now about your 2nd question to show fields from button click:
If you are changing state in button's method then you can use "attrs" attribute in your xml. You can find examples in addons.
Thank You,
I have a Windows application written in Progress. I'm working with version 10.1C. I would like to add MRU functionality to the menu, i.e. I want to add, remove and modify menu items in the application's File menu, to show the user's most recent files in the order in which they were used. I've done this often enough in a number of other languages, it's a pretty common feature and very easy to do.
But how would one do this in Progress? In another language I could have created 10 menu items and simply made the unused ones invisible, but you can't do that in Progress. I can't imagine why.
Alternatively, I should be able to dynamically create menu items as needed and add them to the end of the MRU list in the File menu, but I can't seem do that either: Firstly, I can't specify where in the File menu the item must be added, it always adds it to the bottom, and secondly, I can't add dynamic menus to static menus, so I can't add my MRU menus to the existing File menu. I can do it if I make the whole File menu dynamic (which I really don't want to do), but then I can't add the dynamic File menu to the static menu bar. This leaves me with the unacceptable option of making the entire menu structure dynamic.
Does anybody have any ideas?
Using Ade's answer below, here is a brief example of how I achieved it. Changing the labels and values of the MRU items doesn't require any fiddling, just set the appropriate attributes, but in order to add new MRU items, I have to remove and recreate the Exit menu item:
/* Remove the RULE and Exit menu items */
IF VALID-HANDLE(ghMenuRule) THEN DELETE OBJECT ghMenuRule.
IF VALID-HANDLE(ghMenuExit) THEN DELETE OBJECT ghMenuExit.
/*
...
Coding to add MRU items.
...
*/
/* Create the RULE and Exit menu items */
CREATE MENU-ITEM ghMenuRule
ASSIGN
SUBTYPE = "RULE"
PARENT = MENU m_File:HANDLE IN MENU MENU-BAR-C-Win.
CREATE MENU-ITEM ghMenuExit
ASSIGN
PARENT = MENU m_File:HANDLE IN MENU MENU-BAR-C-Win
LABEL = "E&xit"
TRIGGERS:
ON CHOOSE PERSISTENT RUN ExitApp IN THIS-PROCEDURE.
END TRIGGERS.
The actual MRU items are created just like the Exit menu is created here, except that I store the handles in a temp-table.
The result is a menu like this:
File
New
Open
--------
Print Setup
Print
--------
1 Mru item
2 Mru Item
3 Mru Item
--------
Exit
create a static menu MENU-BAR-C-Win.
add static sub-menu "File" m_file.
add static menu-item (use ">>") "Exit" (m_Exit) to m_file.
define....
DEFINE VARIABLE hMRU#1 AS HANDLE NO-UNDO.
create a button to dynamically...
CREATE MENU-ITEM hMRU#1
ASSIGN
PARENT = MENU m_File:HANDLE IN MENU MENU-BAR-C-Win
LABEL = "MRU#1"
TRIGGERS:
ON CHOOSE PERSISTENT RUN SomeThing IN THIS-PROCEDURE.
END TRIGGERS.
you'll want to keep track of your handles (temp-table?) some how.
how to get current used list name. my scnerio is: i have a list said config. i have create one column say "test" whose datatype is "Managed Metadata". now after add this column.now when i edit this item and click on icon near to "test" column one dialog is open which is webtaggig.aspx something like that.
now, i had open my custom control in this page. when page opened , my control is loaded.
now on my custom control page load i want to get the list name programatically.
can any one suggest me how can i do this?
Have a look at the SPContext object. You would need something like SPContext.Current.List.Title to get the name or title of the current list.