-
-
Notifications
You must be signed in to change notification settings - Fork 816
Expand file tree
/
Copy pathstock_lot.py
More file actions
24 lines (19 loc) · 640 Bytes
/
stock_lot.py
File metadata and controls
24 lines (19 loc) · 640 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (C) 2025 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class StockLot(models.Model):
_name = "stock.lot"
_inherit = ["stock.lot", "base_multi_image.owner", "image.mixin"]
image_1920 = fields.Binary(
compute="_compute_image_1920",
store=True,
)
@api.depends("image_ids")
def _compute_image_1920(self):
"""
Compute main image of lots
"""
for lot in self:
lot.image_1920 = fields.first(
lot.with_context(bin_size=False).image_ids
).image_1920