Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fumoc_sale
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Fumaison Occitane
fumoc_sale
Commits
2009c99e
Commit
2009c99e
authored
3 years ago
by
jordan
Browse files
Options
Downloads
Patches
Plain Diff
[fix] bug on compute expiration_date in stock_move_line because of specific compute from lot_id
parent
658c0221
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/__init__.py
+1
-0
1 addition, 0 deletions
models/__init__.py
models/stock_move_line.py
+20
-0
20 additions, 0 deletions
models/stock_move_line.py
with
21 additions
and
0 deletions
models/__init__.py
+
1
−
0
View file @
2009c99e
...
...
@@ -7,6 +7,7 @@ from . import res_company
from
.
import
res_config_settings
from
.
import
sale_order
from
.
import
stock_move
from
.
import
stock_move_line
from
.
import
stock_picking
from
.
import
stock_production_lot
from
.
import
stock_quant
This diff is collapsed.
Click to expand it.
models/stock_move_line.py
0 → 100644
+
20
−
0
View file @
2009c99e
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from
odoo
import
models
,
api
class
StockMoveLine
(
models
.
Model
):
_inherit
=
'
stock.move.line
'
@api.depends
(
'
product_id
'
,
'
picking_type_use_create_lots
'
)
def
_compute_expiration_date
(
self
):
"""
We need to overide this compute to get expiration_date compute in
lot_id instead of basic calcul made by odoo
"""
for
move_line
in
self
:
if
move_line
.
lot_id
:
move_line
.
expiration_date
=
move_line
.
lot_id
.
expiration_date
else
:
super
(
StockMoveLine
,
self
).
_compute_expiration_date
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment