Good day
Setup… multi-company on single instance. ( Company A, Company B )
Would like to make only the Company A usable and visible.
So I did the following:
Created user default for Company A
Created Global default for Company A
Also set a user-permission - Allow “Company” ; “For value” = Company A
I checked this setup on Mat req, Stock entry, Pur Ord , Pur Inv, Sales ord , Sales Inv etc…
Works well. i.e.
- Company A is loaded as default
- even if you try and select the other company , it is not visible.
The above is true for all the docs I tested EXCEPT
Item master
In V13, in the following table in item master
Sales Purchase Accounting defaults
And in V14, under
Accounting, also in the item master,
i can still select both Company A and Company B
I suspect this is not a bug but intentional since the items must be available to both
companies.
Is there something else I can do to limit even the item-master to Company A?
Will it help if I do a custom script for the item master
frappe.ui.form.on('Item', {
refresh(frm) {
"filters": [
{
"fieldname":"company",
"label": "Company",
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_user_default("Company") || frappe.defaults.get_global_default("company")
}
]
}
})