diff options
| author | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-11-11 11:51:27 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-11-11 11:51:27 +0700 |
| commit | 0373d7545ec889d8cdfee6d09bb93123df5a60cb (patch) | |
| tree | 346b8f25a0ba5f78748ec50256e1fa2fcda6923c | |
| parent | ffe4551ea6eaf0fa97d1a72cbc56596b33825cee (diff) | |
| parent | 4497a43c6a65921902e611f6787341a180cc29f3 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/coretax_fatur.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 26 |
3 files changed, 18 insertions, 15 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index ce0328c4..4b0ce325 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -284,7 +284,8 @@ class AutomaticPurchase(models.Model): 'ending_price': line.last_price, 'taxes_id': [(6, 0, [line.taxes_id.id])] if line.taxes_id else False, 'so_line_id': sales_match.sale_line_id.id if sales_match else None, - 'so_id': sales_match.sale_id.id if sales_match else None + 'so_id': sales_match.sale_id.id if sales_match else None, + 'show_description': False if vendor_id == 5571 else True, } new_po_line = self.env['purchase.order.line'].create(param_line) line.current_po_id = new_po.id diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index ce94306f..7e0de919 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -147,6 +147,8 @@ class CoretaxFaktur(models.Model): subtotal = line_price_subtotal quantity = line_quantity total_discount = round(line_discount, 2) + coretax_id = line.product_uom_id.coretax_id + uom_name = line.product_uom_id.name # Calculate other tax values otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 @@ -159,7 +161,7 @@ class CoretaxFaktur(models.Model): ET.SubElement(good_service, 'Opt').text = 'A' ET.SubElement(good_service, 'Code').text = '000000' ET.SubElement(good_service, 'Name').text = line_name - ET.SubElement(good_service, 'Unit').text = 'UM.0018' + ET.SubElement(good_service, uom_name).text = coretax_id # ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0' ET.SubElement(good_service, 'Price').text = str(price_per_unit) ET.SubElement(good_service, 'Qty').text = str(quantity) diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index 38cf0199..cac88287 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -22,12 +22,12 @@ class StockMove(models.Model): partial = fields.Boolean('Partial?', default=False) # Ambil product uom dari SO line - # @api.model - # def create(self, vals): - # if vals.get('sale_line_id'): - # sale_line = self.env['sale.order.line'].browse(vals['sale_line_id']) - # vals['product_uom'] = sale_line.product_uom.id - # return super().create(vals) + @api.model + def create(self, vals): + if vals.get('sale_line_id'): + sale_line = self.env['sale.order.line'].browse(vals['sale_line_id']) + vals['product_uom'] = sale_line.product_uom.id + return super().create(vals) # @api.model_create_multi # def create(self, vals_list): @@ -282,10 +282,10 @@ class StockMoveLine(models.Model): picking.delivery_status = 'none' # Ambil uom dari stock move - # @api.model - # def create(self, vals): - # if 'move_id' in vals and 'product_uom_id' not in vals: - # move = self.env['stock.move'].browse(vals['move_id']) - # if move.product_uom: - # vals['product_uom_id'] = move.product_uom.id - # return super().create(vals)
\ No newline at end of file + @api.model + def create(self, vals): + if 'move_id' in vals and 'product_uom_id' not in vals: + move = self.env['stock.move'].browse(vals['move_id']) + if move.product_uom: + vals['product_uom_id'] = move.product_uom.id + return super().create(vals)
\ No newline at end of file |
