← Back to team overview

openerp-community team mailing list archive

Re: server action OpenERP v6.1

 

Hy Houssine,

Thanks for your answer.
For this specific need, I succeed in changing the workflow.
I only add a transition between draft activity and open_activity of the invoice WF.
I set the condition to true and add a "group condition".

Now it works!

Thanks

Le 18/12/2012 11:54, Houssine BAKKALI a écrit :
Hi Florent,

I'm not sure of what you're trying to do but if you need to confirm automatically a new fresh created invoice.

You need to override the function "draft" called by the activity "act_draft"

and to add the following code

        wf_service = netsvc.LocalService("workflow")
        wf_service.trg_validate(uid, 'sd.incident', ids[0], 'open', cr)
        return True

It needs maybe to be adapted I didn't tried this on 7.0

Houssine


2012/12/18 Florent THOMAS <mailinglist@xxxxxxx <mailto:mailinglist@xxxxxxx>>

    Hy,

    So I made some few more tests :
    0 - Create a *server action as trigger* like this :




    1 - Then I put this server action in the invoice activity of the
    order workflow :



    Unfortunately, it doesn't validate the invoice after saving.

    2- I try to put this same server action in the draft activity of
    the invoice workflow without success. I even have a /bool Error :
    'bool' object is unsubscriptable/

    3 - I try to change the server action into a trigger on the
    invoice like below : no more success



    4 - I tried with a write action that set the state to open for the
    invoice. I put this into the draft activity of the invoice
    workflow. It sets the state to open but no invoice number is
    generated.

    Idon't know how to properly manage this server action so I would
    appreciate any help.

    regards


    Le 17/12/2012 23:18, Florent THOMAS a écrit :
    Hy all of you,

    I read carefully the documentation here :
    http://doc.openerp.com/v6.1/developer/06_actions.html
    I would like to do something that it's almost the same : confirm
    invoice just after the creation from the sale order.
    So I was expecting that the form will be identic in web.
    Unfortunately, I have this screen :


    What I have to put in the relation field.

    I was expecting something like that :
    ../_images/trigger_action.png
    Where is the workflow on in the web 6.1? and the trigger on?

    Thanks for your help


    _______________________________________________
    Mailing list:https://launchpad.net/~openerp-community  <https://launchpad.net/%7Eopenerp-community>
    Post to     :openerp-community@xxxxxxxxxxxxxxxxxxx  <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe :https://launchpad.net/~openerp-community  <https://launchpad.net/%7Eopenerp-community>
    More help   :https://help.launchpad.net/ListHelp


    _______________________________________________
    Mailing list: https://launchpad.net/~openerp-community
    <https://launchpad.net/%7Eopenerp-community>
    Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
    <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~openerp-community
    <https://launchpad.net/%7Eopenerp-community>
    More help   : https://help.launchpad.net/ListHelp




References