diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-24 16:16:36 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-24 16:16:36 +0700 |
| commit | b1c7b43c51c670e42a0dd2399139fbd9a600f121 (patch) | |
| tree | ad6d4f01dc4928c01ed40ae1b32efbe811e3ec94 /indoteknik_custom/models | |
| parent | bdf6d7dbd8850d525809726036c6783b9113028f (diff) | |
<miqdad> is disc item from web
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 5e9fc362..f2799319 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -1,6 +1,9 @@ from odoo import fields, models, api, _ from odoo.exceptions import UserError from datetime import datetime, timedelta +import logging + +__logger = logging.getLogger(__name__) class SaleOrderLine(models.Model): @@ -49,6 +52,17 @@ class SaleOrderLine(models.Model): qty_free_bu = fields.Float(string='Free BU', compute='_get_qty_free_bandengan') desc_updatable = fields.Boolean(string='desc boolean', default=True, compute='_get_desc_updatable') + is_has_disc = fields.Boolean('FlashSale Item', compute='_compute_is_has_disc', default=False) + + @api.depends('discount', 'order_id.source_id') + def _compute_is_has_disc(self): + for line in self: + line.is_has_disc = ( + line.discount > 0 and + line.order_id.source_id and + line.order_id.source_id.id == 59 + ) + def _get_outgoing_incoming_moves(self): outgoing_moves = self.env['stock.move'] incoming_moves = self.env['stock.move'] |
