Hi everyone,
I have two fields in python file.
system_category_id = fields.Selection([
('laptop', 'Laptop'),
('desktop', 'Desktop'),
('mobile', 'Mobile'),
('switches', 'Switch'),
('wifirouters', 'WiFi Router'),
('printers', 'Printer'),
('firewall', 'Firewall'),
], string='Equipment Category',copy=False, index=True, default='laptop')
super_category_id = fields.Selection([
('laptop', 'Laptop'),
('desktop', 'Desktop'),
('mobile', 'Mobile'),
('switches', 'Switch'),
('wifirouters', 'WiFi Router'),
('printers', 'Printers'),
('firewall', 'Firewall'),
('datacard','Data Card'),
('sims','SIMS'),
('workstation','Work Station'),
('accesscards','Access Card'),
], string='Equipment Category',copy=False, index=True, default='laptop')
So in the view whenever i select Laptop,Desktop
model,make,serial_no,ram,hard disk,processor,processor_speed should be mandatory. For that i wrote xml code
<field name ="ram" attrs="{'invisible': ['|',('system_category_id','in',('switches','firewall','wifirouters','printers','mobile')),('super_category_id','in',('switches','firewall','wifirouters','printers','datacard','sims','workstation','accesscards','mobile'))],'required': ['|',('system_category_id','in',('laptop','desktop')),('super_category_id','in',('laptop','desktop'))]}" style="text-transform: uppercase;" groups="asset_management.group_asset_system_admin,asset_management.group_asset_super_admin"/>
But even if i select other asset from super category like mobile still it is showing ram is mandatory even if i give ram only mandatory for laptop n desktop. How to solve this??
Please anyone help me with this