diff options
| -rwxr-xr-x | indoteknik_custom/models/purchase_pricelist.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 27 |
2 files changed, 5 insertions, 24 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py index 6a8a4650..3607defe 100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -28,7 +28,7 @@ class PurchasePricelist(models.Model): else: self.human_last_update = current_time - @api.constrains('vendor_id', 'product_id','human_last_update','write_date') + @api.constrains('vendor_id', 'product_id') def _check_duplicate_purchase_pricelist(self): for price in self: domain = [ diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 8e8c1e79..90963e1c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -289,34 +289,15 @@ class StockPicking(models.Model): if self.group_id.sale_id.payment_status != 'settlement': raise UserError('Uang belum masuk (settlement), mohon konfirmasi ke sales atau finance') - # for distribute calendar only - # if self.is_internal_use: - # stock_move_lines = self.env['stock.move.line'].search([ - # ('picking_id', '!=', False), - # ('product_id', '=', 236805), - # ('picking_id.partner_id', '=', self.partner_id.id), - # ('qty_done', '>', 0), - # ]) - # list_state = ['confirmed', 'done'] - # for stock_move_line in stock_move_lines: - # if stock_move_line.picking_id.state not in list_state: - # continue - # raise UserError('Sudah pernah dikirim kalender') - - # if self.picking_type_id.code == 'outgoing': - # for line in self.move_line_ids_without_package: - # if line.move_id.sale_line_id.qty_delivered + line.qty_done > line.move_id.sale_line_id.product_uom_qty: - # raise UserError("Qty Delivered akan lebih dari Qty SO") - # elif self.picking_type_id.code == 'incoming': - # for line in self.move_ids_without_package: - # if line.purchase_line_id.qty_received + line.quantity_done > line.purchase_line_id.product_qty: - # raise UserError('Qty Received akan lebih dari Qty PO') - if self.is_internal_use: self.approval_status = 'approved' elif self.picking_type_id.code == 'incoming': self.approval_receipt_status = 'approved' + for product in self.move_line_ids_without_package.product_id: + if product: + product.product_tmpl_id._create_solr_queue('_sync_product_template_to_solr') + res = super(StockPicking, self).button_validate() self.calculate_line_no() return res |
