diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2025-05-23 09:38:02 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2025-05-23 09:38:02 +0700 |
| commit | dbf09bbf792809e84d2d0330a992e42b3a5c6994 (patch) | |
| tree | 9a27b4e0e6571c639ba173df5ae25a2e7014aefd /indoteknik_custom/models/automatic_purchase.py | |
| parent | 4fc520a9b0d1e2e809033b35562fd80fffad472d (diff) | |
Revert "Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup"
This reverts commit 43313db30da73b87843425c01c723f66ee982886, reversing
changes made to f6f59e660af6c4229ada54f7313d68867df1ba15.
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index ff10b814..b66121e1 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -696,42 +696,21 @@ class SaleNotInMatchPO(models.Model): purchase_tax_id = fields.Many2one('account.tax', string='Purchase Tax') note_procurement = fields.Many2one(string='Note Procurement') - # 1. yang bug - # def init(self): - # 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') - # ) - # ) - # """ % self._table) - def init(self): 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 posm.sale_line_id - 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)
\ No newline at end of file + """ % self._table) |
