Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Tryton Tryton
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 792
    • Issues 792
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 86
    • Merge requests 86
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Tryton
  • TrytonTryton
  • Issues
  • #7006
Closed
Open
Created Dec 11, 2017 by Albert Cervera@albertca

Shipments and Production assign_try() should work at document level

Currently shipments [1] and productions' [2] implementation of assign_try works as follows:

1. Tries to assign all stock moves of all documents (shipments or productions) supplied in batch
2. Sets all supplied documents as assigned if and only if all moves of all documents have been assigned

In my opinion this is not the expected behaviour and 2. should be changed to work as follows:

"Changes the state to 'assigned' of all documents that have all their moves in assigned state. No matter if stock moves of other documents have been assigned or if there where moves from the existing document already assigned."

Just to get a better understanding of the problem, this is more or less how I think Production's implementation of assign_try should look like IMHO:

def assign_try(cls, productions):
pool = Pool()
Move = pool.get('stock.move')
Move.assign_try([m for p in productions
for m in p.inputs])
to_assign = []
productions = cls.browse(productions)
for production in productions:
for input_ in production.inputs:
if input_.state == 'draft':
break
else:
to_assign.append(production)
cls.assign(to_assign)


[1] http://hg.tryton.org/modules/stock/file/tip/shipment.py#l837
[2] http://hg.tryton.org/modules/production/file/tip/production.py#l603

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking