Siobhan
(Shiv)
August 29, 2024, 4:11pm
1
I already make a submenu Company Location
but when I clicked it it doesn’t show anything:
This is my attendance.xml for Company Location
:
<record model="ir.action.act_window" id="act_company_geo">
<field name="name">Company Location</field> <!-- Nama aksi jendela -->
<field name="res_model">company.geo</field>
</record>
<record model="ir.ui.view" id="geo_company_form">
<field name="model">company.geo</field>
<field name="type">form</field>
<field name="name">geo_form</field>
</record>
<record model="ir.action.act_window.view" id="act_geo_company">
<field name="sequence" eval="20"/>
<field name="view" ref="geo_company_form"/>
<field name="act_window" ref="act_company_geo"/>
</record>
<record model="ir.model.access" id="access_company_geo">
<field name="model" search="[('model', '=', 'company.geo')]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<menuitem
action="act_company_geo"
parent="menu_configuration"
sequence="20"
id="menu_geo_company"
icon="tryton-list"/>
This is my
geo_form.xml
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="company"/>
<field name="company "/>
<label name="address"/>
<field name="address"/>
<label name ="longitude"/>
<field name="longitude"/>
</form>
ced
(Cédric Krier)
August 29, 2024, 7:59pm
2
It does not seem you have define a tree view so it can only open empty form.
Siobhan
(Shiv)
August 30, 2024, 2:23am
3
But I just want to show form ui, not tree ui. Like in Production > Configuration
ced
(Cédric Krier)
August 30, 2024, 6:36am
4
If it is not a singleton, it will be difficult to manage.
Any way did you check the JS console for any error message?
Siobhan
(Shiv)
August 30, 2024, 6:40am
5
Yeah, something like this.
ced
(Cédric Krier)
August 30, 2024, 6:52am
6
Nothing related, these are expected errors.
Siobhan
(Shiv)
August 30, 2024, 7:04am
7
I finally added ModelSingleton but it still wont show anything:
class CompanyGeo(ModelSingleton, ModelSQL, ModelView):
'Company Geo'
__name__ = 'company.geo'
company = fields.Many2One('company.company', "Company",
required=True, help="The company the geolocatong is associated with.")
address = fields.Char('Address')
longitude = fields.Float('Longitude', readonly=True)
latitude = fields.Float('Latitude', readonly=True)
ced
(Cédric Krier)
August 30, 2024, 7:06am
8
Could you be precise about what you mean?
Siobhan
(Shiv)
August 30, 2024, 7:19am
9
you said that so i added ModelSingleton
in CompanyGeo
parameter.
Siobhan
(Shiv)
August 30, 2024, 1:20pm
11
I mean when i clicked the sub menu: Company Location
it shown nothing like this:
ced
(Cédric Krier)
August 30, 2024, 1:41pm
12
Well it is strange that there is no error message anywhere.
Siobhan
(Shiv)
August 31, 2024, 4:00am
13
Hello, still the same problem. When I clicked the submenu I cannot se anything this is the submenu:
I cannot open the Company Location:
When I called trytond-admin -c trytond.conf -d database --all it does not show any error.
This is the geo_company.xml
<tryton>
<data>
<record model="ir.ui.view" id="geo_company_view_form">
<field name="model">company.geo</field>
<field name="type">form</field>
<field name="name">geo_form</field>
</record>
<record model="ir.action.act_window" id="act_geo_company_form">
<field name="name">Company Location</field>
<field name="res_model">company.geo</field>
</record>
<record model="ir.action.act_window.view"
id="act_geo_company_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="geo_company_view_form"/>
<field name="act_window" ref="act_geo_company_form"/>
</record>
<menuitem
parent="menu_configuration"
action="act_geo_company_form"
sequence="20"
id="menu_geo_company"
icon="tryton-list"/>
<record model="ir.model.access" id="access_company_geo">
<field name="model" search="[('model', '=', 'company.geo')]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.access" id="access_company_geo_attendance_admin">
<field name="model" search="[('model', '=', 'company.geo')]"/>
<field name="group" ref="group_attendance_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
</data>
</tryton>