コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5016 ビュー

i have a Model have 3 fields 


class CreateViewSql(models.Model):
    _name = "create.view.sql"

    email = fields.Char(string='Email')
    name = fields.Char(string='Name')
    phone = fields.Char(string='Phone')

and xml file
<odoo>
  <!-- Form View Car -->
  <record id="car_form" model="ir.ui.view">
    <field name="name">view.sql.form</field>
    <field name="model">create.view.sql</field>
    <field name="arch" type="xml">
      <form>
        <group>
          <field name="name"/>
          <field name="phone"/>
          <field name="email"/>
          <!-- <field name="type_of"/> -->
        </group>
      </form>
    </field>
  </record>
  <!--  -->

  <!-- Tree View Car -->
  <record id="car_tree" model="ir.ui.view">
    <field name="name">view.sql.tree</field>
    <field name="model">create.view.sql</field>
    <field name="arch" type="xml">
      <tree>
        <field name="name"/>
        <field name="phone"/>
        <field name="email"/>
        <!-- <field name="type_of"/> -->
      </tree>
    </field>
  </record>
  <!--  -->
  <!-- Action For Car -->
  <record id="action_view_sql" model="ir.actions.act_window">
    <field name="name">ViewSql</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">create.view.sql</field>
    <field name="view_mode">tree,form</field>
  </record>
  <!--  -->

  <!-- Menu Car -->
  <menuitem id="view_sql" name="ViewSql" sequence="2" action="action_view_sql"/>
</odoo>

i try add _auto: False in model to not create table in DB then i cant access menu and treeview
Have any solution to store TEMP data in model and can access menu and treeview
アバター
破棄
最善の回答

Hi,

The reason why you are not seeing the menu is that you may not given Security / Access Rights

If You are a Super User  you can see the menu even without adding the security , The Super User has unrestricted access to all models

Activate Developer Mode > Debug Button (Near Login user name on top right) > Became a Super User


You can use TransientModel for storing temporary data ,TransientModel stores data in the database temporary and is automatically cleaned up on a defined period of time 

アバター
破棄
著作者

i used TransientModel but this data i need to store from my custom search module and TransientModel store data to long. Can i delete that data after f5 treeview page.

There is scheduled action to clean up the data , You can find it in Settings >> Technical >> Automation >> Schedule Actions >> Auto-vacuum internal data , you can adjust action intervel there

関連投稿 返信 ビュー 活動
13
4月 23
59181
2
3月 18
8011
1
4月 15
3956
4
12月 21
12222
2
5月 21
4088