53.Odoo Server Action || Add New Action To Action Button In Odoo || Odoo 14 Development

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • How to add new action to action button in Odoo 14. How to create a server action in Odoo. Different type of actions in Odoo. Steps to create server action in Odoo. Steps to add new action to odoo action button. Odoo 14 development tutorials, how to add new server action in Odoo 14.
    Server Action:
    Server actions model. Server action work on a base model and offer various type of actions that can be executed automatically, for example using base action rules, of manually, by adding the action in the ‘More’ contextual menu.
    Since Odoo 8.0 a button ‘Create Menu Action’ button is available on the action form view. It creates an entry in the More menu of the base model. This allows to create server actions and run them in mass mode easily through the interface.
    The available actions are :
    ‘Execute Python Code’: a block of python code that will be executed
    ‘Create a new Record’: create a new record with new values
    ‘Write on a Record’: update the values of a record
    ‘Execute several actions’: define an action that triggers several other server actions
    llow triggering complex server code from any valid action location. Only two fields are relevant to clients:
    id
    the in-database identifier of the server action to run
    context (optional)
    context data to use when running the server action
    In-database records are significantly richer and can perform a number of specific or generic actions based on their state. Some fields (and corresponding behaviors) are shared between states:
    model_id
    Odoo model linked to the action.
    state
    code: Executes python code given through the code argument.
    object_create: Creates a new record of model crud_model_id following fields_lines specifications.
    object_write: Updates the current record(s) following fields_lines specifications
    multi: Executes several actions given through the child_ids argument.
    State fields
    Depending on its state, the behavior is defined through different fields. The concerned state is given after each field.
    code (code)
    Specify a piece of Python code to execute when the action is called
    Odoo 14 Playlist: • 2. How To Create Modul...
    Module: apps.odoo.com/...
    Website: www.odoomates....
    Github: github.com/odo...
    Email : odoomates@gmail.com
    Facebook: / odoomate
    Twitter: / odoomates
    Support Us in Ko Fi : ko-fi.com/odoo...

КОМЕНТАРІ • 23

  • @kenwoychesko2163
    @kenwoychesko2163 2 роки тому +2

    Perfect! Exactly what I needed! Thank you!

  • @kassimgoulamaly9905
    @kassimgoulamaly9905 3 роки тому +1

    Sir, how can we change the way price_subtotal is computed in a purchase order please?
    Instead of unit_price * product_qty, I would like to make it unit_price * product_qty * time_period
    P.S: Your videos are so helpful. Thank you so much sir! May god bless you :)

    • @OdooMates
      @OdooMates  3 роки тому

      Hi, you have to override the compute function that computes the value and apply the new logic

    • @kassimgoulamaly9905
      @kassimgoulamaly9905 3 роки тому

      Odoo Mates Couldn’t find it anywhere. Looks like that function depends on another one from account module

    • @OdooMates
      @OdooMates  3 роки тому

      @@kassimgoulamaly9905 see the field definition: price_subtotal = fields.Monetary(compute='_compute_amount', string='Subtotal', store=True)
      function name is _compute_amount

    • @kassimgoulamaly9905
      @kassimgoulamaly9905 3 роки тому +1

      Odoo Mates yess!
      Thank you so much for your answer! ❤️

    • @OdooMates
      @OdooMates  3 роки тому

      @@kassimgoulamaly9905 welcome :)

  • @eyachallouf7657
    @eyachallouf7657 3 роки тому +1

    Thanks, that helps me a lot 🤗🤗

    • @OdooMates
      @OdooMates  3 роки тому +1

      happy that it helps :)

  • @bonjourmonde1500
    @bonjourmonde1500 2 роки тому +1

    .. well done, thank you ..

  • @alishahab8964
    @alishahab8964 2 роки тому +1

    Hey, i am adding a action button in purchase.order but its not showing in action button any specific reason?

    • @OdooMates
      @OdooMates  2 роки тому

      see this sample: github.com/odoomates/odooapps/pull/70/files

  • @ituw-d6s
    @ituw-d6s 9 місяців тому

    any idea how to override "Save & New" button in odoo 14?

  • @williamedu2786
    @williamedu2786 2 роки тому +1

    Thanks!!🙌👏🙏

    • @OdooMates
      @OdooMates  2 роки тому

      Welcome ❤️❤️❤️

  • @kajalmaheshwari9908
    @kajalmaheshwari9908 2 роки тому

    How can we update multiple values on sever action using wizard?

  • @melvinguerra9563
    @melvinguerra9563 2 роки тому +1

    Is there a way to trigger wizard when clicking on the action?

    • @OdooMates
      @OdooMates  2 роки тому

      You mean how to return wizard from server action?

    • @melvinguerra9563
      @melvinguerra9563 2 роки тому

      @@OdooMates i just tried to do it by the frontend but realized I can't since I can't apply xml id to the view when creating it through the front end

  • @uchihaobito723
    @uchihaobito723 Рік тому

    actually i didnt understand the code part of create appointment . that is if record: this part

    • @OdooMates
      @OdooMates  Рік тому

      learning orm will help brother: ua-cam.com/video/8V-uOG8KkKA/v-deo.html