Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
5 Antwoorden
13935 Weergaven

Hi,

I want to set to draft the stock picking out when state is cancel. How can I do that?

I know that is possible create a button and set the state to draft, but in this particulary case change the state isn't enough because it has movement of products in stock move and in stock inventory.

I have created a button "Set to Confirmed":

image description

This button call this function:

def set_to_confirmed(self, cr, uid, ids, context=None):
    """ Changes picking state to delivered.
    @return: True
    """      
    for stock_picking_out_ids in ids:

        stock_picking_out_obj = self.browse(cr, uid, stock_picking_out_ids, context)
        move_lines = stock_picking_out_obj.move_lines

        for move_lines_obj in move_lines:

            self.pool.get('stock.move').write(cr, uid, move_lines_obj.id, {'state': 'confirmed'} )

    self.write(cr, uid, ids, {'state': 'confirmed'})
    return True

This works and change the state to confirmed but after this I can't continue the workflow, in others words, the button that appears in this state "Check Availability" and "Force Availability" doesn't work and give me a error:

Not enough stock, unable to reserve the products

Any ideia the steps that I have to do to this functionality works?

Avatar
Annuleer

will you share your module for community

Beste antwoord

Hi Bati,

thank you for sharing stock_picking_back_to_draft link. I wish to try this, however the link takes to an error page. Can you post the correct link ?

Thanks


Avatar
Annuleer
Beste antwoord

I think the correct answer to the question described in the title is: using a module like

stock_picking_back_to_draft

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 16
5207
1
nov. 24
18745
5
dec. 24
33217
0
aug. 22
12114
1
apr. 20
5161