summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/automatic_purchase.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-05-23 09:57:19 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-05-23 09:57:19 +0700
commit1ce12e1b817079a1fd74c892a880bd8efff72e41 (patch)
tree3ebf33463948b5bd7be15b18450f36227ad7cac9 /indoteknik_custom/models/automatic_purchase.py
parentcc6e4b9e48752ee54b42db2c16fae7cd5d5af1c4 (diff)
parentd27999cacee59a115ae3c6c46542c2e20cfe176b (diff)
Merge branch 'odoo-backup' into cr/purchasing_job_manufacturing_order
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
-rw-r--r--indoteknik_custom/models/automatic_purchase.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 518dc74c..4feec307 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -720,18 +720,17 @@ class SaleNotInMatchPO(models.Model):
tools.drop_view_if_exists(self.env.cr, self._table)
self.env.cr.execute("""
CREATE OR REPLACE VIEW %s AS(
- SELECT apsm.id, apsm.automatic_purchase_id, apsm.automatic_purchase_line_id,
- apsm.sale_id, apsm.sale_line_id, apsm.picking_id, apsm.move_id,
- apsm.partner_id, apsm.partner_invoice_id, apsm.salesperson_id,
- apsm.product_id, apsm.qty_so, apsm.qty_po, apsm.create_uid,
- apsm.create_date, apsm.write_uid, apsm.write_date, apsm.purchase_price,
- apsm.purchase_tax_id, apsm.note_procurement
- FROM automatic_purchase_sales_match apsm
- WHERE apsm.sale_line_id NOT IN (
- SELECT distinct coalesce(posm.sale_line_id,0)
- FROM purchase_order_sales_match posm
- JOIN purchase_order po ON po.id = posm.purchase_order_id
- WHERE po.state NOT IN ('cancel')
+ select apsm.id, apsm.automatic_purchase_id, apsm.automatic_purchase_line_id, apsm.sale_id, apsm.sale_line_id,
+ apsm.picking_id, apsm.move_id, apsm.partner_id,
+ apsm.partner_invoice_id, apsm.salesperson_id, apsm.product_id, apsm.qty_so, apsm.qty_po, apsm.create_uid,
+ apsm.create_date, apsm.write_uid, apsm.write_date, apsm.purchase_price,
+ apsm.purchase_tax_id, apsm.note_procurement
+ from automatic_purchase_sales_match apsm
+ where apsm.sale_line_id not in (
+ select distinct coalesce(posm.sale_line_id,0)
+ from purchase_order_sales_match posm
+ join purchase_order po on po.id = posm.purchase_order_id
+ where po.state not in ('cancel')
)
)
- """ % self._table)
+ """ % self._table) \ No newline at end of file