Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
5506 Visualizações

I want to know the def of this button where can i find this?? anyone please help thanks in advance..



 

Avatar
Cancelar
Melhor resposta

It is part of account workflow...

Look under: Settings -> Technical -> Workflow -> account.invoice.basic 
Check : open , that is  the state to wich invoice transfers, and befor that it executes 4 python actions:
action_date_assign()
action_move_create()
action_number()
invoice_validate()

In general, buttons can have
type="object" -> meaning it starts a python method where name="name_of_method"
type="action" -> meaning it starts %(action_external_id)s

OR type is not present ( not defined ) , and in that case it is part of workflow, (usualy transition or activity ) 

hope it helps : )

may the source be with you !
 

Avatar
Cancelar
Autor

thanks Bole

Melhor resposta

Hi,

Here Validate button is type of workflow by default. Because if you are not specify any type into button then it will default take "workflow" type.

So, based on that button it will trigger one signal "invoice_open". Based on this signal "invoice_open" workflow will trigger activity and it will be "act_draft" to "act_open" and invoice will be moved from "Draft" to "Open".

And system will trigger functions of the destination activity. In this case desination activity is "act_open". According to the "act_open" activity there is four different function will be called when you press "Validate" button.

        <record id="act_open" model="workflow.activity">
            <field name="wkf_id" ref="wkf"/>
            <field name="name">open</field>
            <field name="action">action_date_assign()
action_move_create()
action_number()
invoice_validate()</field>
            <field name="kind">function</field>
        </record>

Here you can see that 1) action_date_assign(), 2) action_move_create(), 3) action_number(), 4) invoice_validate() will called.

I hope it is easy to understand and you will get what you want.

Avatar
Cancelar
Autor

thanks Empiro