تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5007 أدوات العرض

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
أبريل 23
59169
2
مارس 18
8001
1
أبريل 15
3954
4
ديسمبر 21
12212
2
مايو 21
4074