Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] stuck pos picking #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions 31_validate_wrong_pos_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
import erppeek
from cfg_secret_configuration import odoo_configuration_user


###############################################################################
# Odoo Connection
###############################################################################
def init_openerp(url, login, password, database):
openerp = erppeek.Client(url)
uid = openerp.login(login, password=password, database=database)
user = openerp.ResUsers.browse(uid)
tz = user.tz
return openerp, uid, tz, database


openerp, uid, tz, db = init_openerp(
odoo_configuration_user['url'],
odoo_configuration_user['login'],
odoo_configuration_user['password'],
odoo_configuration_user['database'])

###############################################################################
# Script
###############################################################################


def validate_wrong_pos_picking():
# Update product_type for stock.quant
ids = openerp.PosOrder.search([
('picking_id.state', 'not in', ['done', 'cancel']),
])
pos_orders = openerp.PosOrder.browse(ids)
pos_orders.create_job_to_validate_wrong_pos_picking()

return True


# Run the update function
if not openerp:
print ">>>>>>>> Cannot connect to Server <<<<<<<<<"
else:
validate_wrong_pos_picking()