summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-25 08:47:36 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-25 08:47:36 +0700
commit9fa80c62cdffec5b91aaf2a2899d70d0f507c2e4 (patch)
tree93ae8d82f774345f650bc8d072dea759c6e33363 /indoteknik_custom/models/purchase_order_line.py
parenta21c5fe37529b2d2259d3b86d8e98730b2bc8513 (diff)
parenta7be93f4825967807f12e6bfbebcf090af8500fa (diff)
Merge branch 'production' into iman/switch-account
# Conflicts: # indoteknik_api/controllers/api_v1/user.py # indoteknik_custom/models/user_company_request.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)