summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-04 11:24:24 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-04 11:24:24 +0700
commit1094670e6fc35e5150b612b32e1f497b36c022b3 (patch)
tree4482491680db1554c28fb380480ada5282fac8f0 /indoteknik_custom/models/purchase_order_line.py
parentc631620706a24426faea6b43c2a0602eebf9a5e4 (diff)
parentdbe24b9cd600c7b5a9d0587f80a782ed93c9a761 (diff)
Merge branch 'production' into iman/telegram
# Conflicts: # indoteknik_custom/models/__init__.py # indoteknik_custom/models/stock_picking.py
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 7af84b48..9e7d7e81 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -3,6 +3,7 @@ from odoo.exceptions import AccessError, UserError, ValidationError
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
import logging
from dateutil.relativedelta import relativedelta
+from bs4 import BeautifulSoup
from datetime import datetime
_logger = logging.getLogger(__name__)
@@ -37,11 +38,18 @@ class PurchaseOrderLine(models.Model):
is_ltc = fields.Boolean(string='Sudah di LTC', default=False, help='centang ini jika barang sudah di LTC')
note = fields.Char(string='Note')
sale_automatic_id = fields.Many2one('sale.order', string='SO')
-
+ image_small = fields.Binary("Product Image", related="product_id.image_1920")
+ clean_website_description_product = fields.Char(string='Clean Website Description Product', compute='_get_clean_website_description_product')
qty_reserved = fields.Float(string='Qty Reserved', compute='_compute_qty_reserved')
delete_line = fields.Boolean(string='Delete', default=False, help='centang ini jika anda ingin menghapus line ini')
is_edit_product_qty = fields.Boolean(string='Is Edit Product Qty', compute='_compute_is_edit_product_qty')
+ def _get_clean_website_description_product(self):
+ for line in self:
+ description = line.product_id.website_description
+ description_clean = BeautifulSoup(description or '', "html.parser").get_text()
+ line.clean_website_description_product = description_clean
+
def _prepare_stock_move_vals(self, picking, price_unit, product_uom_qty, product_uom):
self.ensure_one()
product = self.product_id.with_context(lang=self.order_id.dest_address_id.lang or self.env.user.lang)