val
val

Reputation: 359

Can't remove top "Save" button from Odoo

I want to remove the top "Save" button from the formview of my custom module. I know that we perform this by setting write/create to false in the XML, which I did and can't figure out why it is still there.

My view:

     <record id="view_module_genall_form" model="ir.ui.view">
          <field name="name">module.genall.form</field>
          <field name="model">module.genall</field>
          <field name="arch" type="xml">
              <form string="Automatically generate bills" edit="false" create="false" delete="false" write="false">
                  <button name="generate_all" type="object" string="Generate bills" icon="oe_highlight"/>
              </form>
          </field>
      </record>

The related action:

      <record model="ir.actions.act_window" id="action_module_genall">
          <field name="name">Automatically generate bills</field>
          <field name="res_model">alkivi.genall</field>
          <field name="view_type">form</field>
         <field name="view_mode">form</field>
         <field name="view_id" ref="view_module_genall_form" />
     </record>

Do you have an idea ? Thanks!

Upvotes: 0

Views: 1283

Answers (1)

Daniel Reis
Daniel Reis

Reputation: 13342

From it's title it looks like the purpose of your form is to run a server method to perform some business logic.

For that you should use a Wizard instead of a regular Model: for that the module.genalshould be a models.TransientModel instead of a models.Model.

Upvotes: -1

Related Questions