Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Add a Server Action

Faheem Khan
on 5/5/15, 2:26 AM 409 views

I am trying to add a server action to confirm multiple sale orders, create thier invoices and deliver orders at once. For this purpose I am using sale_fast_confirm module from oerp. This module can cofirm one order only as its "Fast Confirm" button appears only in sale order form. 

To achive the task I am trying to create a Server action, and trying to copy the code from module to server action with no success. can some one please help me. the code is

from openerp import models, api

class sale(models.Model):

_inherit = 'sale.order'


def order_process_now(self):


Confirms order and creates and validates invoice, confirms pickings.


# Process order


inv_id = self.action_invoice_create()

if inv_id:

inv = self.env['account.invoice'].browse(inv_id)


for picking in self.picking_ids:



I had achieved the task. I simply call the button by "exceute" in server action.

Faheem Khan
on 5/5/15, 3:55 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 5/5/15, 2:26 AM
Seen: 409 times
Last updated: 5/5/15, 3:55 AM