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
4576bef8
Commit
4576bef8
authored
3 years ago
by
Rémi - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[ADD] available quants on lots
parent
e777926b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/stock_production_lot.py
+10
-0
10 additions, 0 deletions
models/stock_production_lot.py
views/stock_move_line.xml
+16
-1
16 additions, 1 deletion
views/stock_move_line.xml
with
26 additions
and
1 deletion
models/stock_production_lot.py
+
10
−
0
View file @
4576bef8
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# Copyright 2017 Open For Small Business Ltd
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import
datetime
import
re
...
...
@@ -60,3 +61,12 @@ class FumocStockProductionLot(models.Model):
for
field
,
value
in
dates_dict
.
items
():
setattr
(
self
,
field
,
value
)
# function copied from https://github.com/odoonz/odoonz-addons/tree/14.0/stock_prodlot_qty
# Copyright 2017 Open For Small Business Ltd
def
name_get
(
self
):
res
=
super
().
name_get
()
if
self
.
env
.
context
.
get
(
"
show_qty
"
):
res
=
self
.
browse
([
r
[
0
]
for
r
in
res
]).
mapped
(
lambda
r
:
(
r
.
id
,
r
.
name
+
"
(en stock : %.0f)
"
%
r
.
product_qty
)
)
return
res
This diff is collapsed.
Click to expand it.
views/stock_move_line.xml
+
16
−
1
View file @
4576bef8
...
...
@@ -10,13 +10,28 @@
<field
name=
"inherit_id"
ref=
"product_expiry.view_stock_move_line_detailed_operation_tree_expiry"
/>
<field
name=
"priority"
eval=
"8"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"lot_id"
position=
"attributes"
>
<attribute
name=
"context"
>
{'default_product_id': product_id, 'default_company_id': company_id, 'active_picking_id': picking_id, 'show_qty': True}
</attribute>
</field>
<xpath
expr=
"//field[@name='expiration_date']"
position=
"attributes"
>
<attribute
name=
"string"
>
DLC
</attribute>
<attribute
name=
"attrs"
>
{'column_invisible': [('parent.show_lots_text', '=', True)]}
</attribute>
<attribute
name=
"attrs"
>
{'column_invisible': [('parent.show_lots_text', '=',
True)], 'readonly': [('picking_type_use_existing_lots', '=',
True)]}
</attribute>
<attribute
name=
"widget"
>
date
</attribute>
</xpath>
</field>
</record>
<record
id=
"fumoc_stock_move_line_operation_tree_inherit"
model=
"ir.ui.view"
>
<field
name=
"name"
>
fumoc_sale.stock.move.line.op.tree
</field>
<field
name=
"model"
>
stock.move.line
</field>
<field
name=
"inherit_id"
ref=
"product_expiry.view_stock_move_line_operation_tree_expiry"
/>
<field
name=
"priority"
eval=
"8"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"lot_id"
position=
"attributes"
>
<attribute
name=
"context"
>
{'default_product_id': parent.product_id, 'default_company_id': parent.company_id, 'active_picking_id': picking_id, 'show_qty': True}
</attribute>
</field>
</field>
</record>
</data>
</odoo>
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