Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tryton
Tryton
Commits
b13df33881c7
Commit
b13df338
authored
Dec 25, 2022
by
Cédric Krier
Browse files
Do not copy number of lot with sequence
Closes
#11593
parent
0ec4f9595cbc
Pipeline
#60046
passed with stages
in 15 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
modules/stock_lot/CHANGELOG
View file @
b13df338
* Do not copy number of lot with sequence
Version 6.6.0 - 2022-10-31
--------------------------
* Bug fixes (see mercurial logs for details)
...
...
modules/stock_lot/stock.py
View file @
b13df338
...
...
@@ -132,6 +132,14 @@
return
self
.
product
.
default_uom
.
digits
@
classmethod
def
copy
(
cls
,
lots
,
default
=
None
):
default
=
default
.
copy
()
if
default
else
{}
has_sequence
=
{
l
.
id
:
l
.
has_sequence
for
l
in
lots
}
default
.
setdefault
(
'number'
,
lambda
o
:
None
if
has_sequence
[
o
[
'id'
]]
else
o
[
'number'
])
return
super
().
copy
(
lots
,
default
=
default
)
@
classmethod
def
create
(
cls
,
vlist
):
vlist
=
[
v
.
copy
()
for
v
in
vlist
]
for
values
in
vlist
:
...
...
modules/stock_lot/tests/scenario_stock_lot_number.rst
View file @
b13df338
...
...
@@ -51,3 +51,17 @@
>>> lot.number
'1'
Copy set a new number::
>>> lot2, = lot.duplicate()
>>> lot2.number
'2'
Copy without sequence keep same number::
>>> template.lot_sequence = None
>>> template.save()
>>> lot3, = lot.duplicate()
>>> lot3.number
'1'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment