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

Hi,

I need to produce a file to order our logisticien to pack and send goods to some of our retailers.

I want this to occur as soon as a stock.picking has a status "available", this means, for example, when :

- I validate a sale order and every items are available (new stock.picking state is "assigned")

- A sale order previously validated created a stock picking operation, but in another sate and this state becomes "assigned" after other inventory operations (next to productions or purchases, for example)


The thing is the state field is calculated and does not reflect a state changing from a value to another, instead it's a real time state obtained on request.

Is there a method I can override in stock.picking or any other Class to achieve this?


Thanks.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

I found a solution by extending the stock.picking class and adding this :

@api.contrains('state')
def _constrains_state(self):
  for record in self:
    if record.state == 'assigned':
      # Extra actions
      pass


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lis 24
19700
1
cze 24
3669
0
sie 22
13005
3
gru 19
7361
1
maj 19
3601