Hi everybody, I hope that you are doing well,
I'm coming to you because i need your help. We are losing a lot of time fullfiling manually the done quantity in our purchase module when clicking on "receive products"
So what i tried to do (with my really really basic skills about Odoo) is to create a button related to an action that would take the value of the "demand" field and copy it to the "done" filed so we would just have to modify the done field for the products that didnt arrived and not for all of the products.
What I did to try it is first create a server action that is obviously not working, then I created a button :
I didnt found the proper way to set the action, so when i click on the button named "remplissage" a code error appears.
I have tried two different things to make the action work :
First it was with the update record. I settled it this way :
model = stock.move action to do = update the record
data to write
Field = quantity_done Evaluation type = Value or Python expression
then value or python code = record.product_uom_qty
Please don't laugh about what I have done, i started to work on Odoo in setpember and i'm learning by myself.
The second thing i have tried is to try the python code I had found on this topic :
"@api.onchange('')
def onchange_func(self):
if self.:
self. = self."
so I replaced field whose value need to be taken by field.
and field to wich you need value by field.
It wasn't working.
If any of you could help me thank you a lot for reading.
I really hope that it is understandable, do not hesitate if it's not I will try to make it clearer.
Have a nice day