Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4804 Zobrazení

Hello,

Version : Odoo 12.0 Community Edition

I recently made a module. I've added some fields, and status to account.payment model. and also inherited the same fields to Payment in account.invoice.

So my problem now, is when I added the status to Odoo from my Module. I need also to change the workflow in account.view_account_payment_form (I did read that you cannot work with workflow in Odoo 11 and above) but I don't think there's no solution for this.

From Confirming Payment from Draft Status to Another Status. I mean

Current : Draft ----(When you hit Confirm button you can confirm )--> Posted.

TO  : confirm payment only in a specific status ----> Posted

Avatar
Zrušit
Autor Nejlepší odpověď

Thank you Joyce Assaad-Veen for your reply,

The problem is the "confirm" button is related to a post function inside account Odoo module, So if I added button to start confirming Payment i should call "post" function.

Image : https://i.imgur.com/Onczffk.png

I tried to change "post" function to be able to confirm from a different status, I was able to do it, but the problem is the other classes, like "Account Invoice" they use the same function, in results I can't confirm the payment. also this function is used to calculate  other things.

Why, because I simply inheriting the same fields into two different Classes "Account Paymet" and "Invoice Payment".


I think if I am able to change work flow from confirming from draft status to another status. If you have any other idea you're more than welcome to share it.


Also I am not expert, So I use only my logic and my limited knowledge to fix this issue.

Avatar
Zrušit
Nejlepší odpověď

Hello,

If I understood your case well, that you need to add a state between draft and posted, I think you need to:

- create a new button that is shown on draft state so when you click this new button it will change the state to the specific state. So in python you add a method to do this change and you call this method on the button click.

- modify the invisible condition of the button that let it become posted, so you show it only in the specific state, not anymore on draft.

- you need to set which group can see each of the buttons, especially your new button, who is allowed to move it to the new specific state.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
srp 23
2565
0
zář 21
4
1
srp 25
140
2
čvc 25
406
1
čvc 25
378