Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4840 Widoki

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sie 23
2592
0
wrz 21
4
1
sie 25
284
2
lip 25
473
1
lip 25
423