İçereği Atla
Menü
Bu soru işaretlendi
4252 Görünümler

I use the command line to create a custom app

"c:\Program Files (x86)\Odoo 11.0\python\python.exe" "c:\Program Files (x86)\Odoo 11.0\server\odoo-bin" scaffold custom5 "C:\Users\user1\Downloads\1"

In odoo.conf , I had append the directory to addons_path.

addons_path = C:\Program Files (x86)\Odoo 11.0\server\odoo\addons,C:\Users\user1\Downloads\1

When I click custom5/Menu2/Server to list, Odoo display the Odoo Server Error as below:

ValueError: <class 'NameError'>: "name 'self' is not defined" while evaluating
'action = {\n          "type": "ir.actions.act_window",\n          "view_mode": "tree,form",\n          "res_model": self._name,\n        }'

I modified the self._name with "custom5.custom5", and then compile and run successfully.

I click the Menu2/Server to list, there is no any error message. But the name above "Create" and "Import" buttons is showed as "Unnamed". The name should be "custom5 server".

Does someone meet the same problem? How do I solve this problem?

    <!-- server action to the one above -->
  <record model="ir.actions.server" id="custom5.action_server">
  <field name="name">custom5 server</field>
  <field name="model_id" ref="model_custom5_custom5"/>
  <field name="state">code</field>
  <field name="code">
  action = {
  "type": "ir.actions.act_window",
  "view_mode": "tree,form",
  "res_model": "custom5.custom5",
  }
  </field>
  </record>


Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Mar 18
8823
0
Mar 18
3883
3
Oca 18
4355
4
Nis 20
27482
4
Eki 20
8566