diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-07-22 11:17:13 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-07-22 11:17:13 +0700 |
| commit | 6de8fcdd262895c14cc8a4e3e16f35a0d05e82ff (patch) | |
| tree | bfb7e0e7b5640abdeb152c76d9f0356311891478 | |
| parent | 737d6932676242ad4aae7f7c175ea98d5b00f437 (diff) | |
fix bug
| -rw-r--r-- | fixco_custom/models/automatic_purchase.py | 2 | ||||
| -rw-r--r-- | fixco_custom/models/purchasing_job.py | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/fixco_custom/models/automatic_purchase.py b/fixco_custom/models/automatic_purchase.py index 98a4136..d2d6830 100644 --- a/fixco_custom/models/automatic_purchase.py +++ b/fixco_custom/models/automatic_purchase.py @@ -126,7 +126,7 @@ class AutomaticPurchase(models.Model): if partner_id != 270: key = (partner_id,) - elif brand_id == 3: + elif brand_id == 3: # ryu key = (partner_id, brand_id, category_id) else: key = (partner_id, brand_id) diff --git a/fixco_custom/models/purchasing_job.py b/fixco_custom/models/purchasing_job.py index 2c7138a..1a8ccb1 100644 --- a/fixco_custom/models/purchasing_job.py +++ b/fixco_custom/models/purchasing_job.py @@ -17,7 +17,7 @@ class PurchasingJob(models.Model): action = fields.Char(string='Action') product_id = fields.Many2one('product.product', string='Product') vendor_id = fields.Many2one('res.partner', string='Vendor') - brand_id = fields.Many2one('brands', string='Brand') + # brand_id = fields.Many2one('brands', string='Brand') def create_automatic_purchase(self): if not self: @@ -86,8 +86,7 @@ class PurchasingJob(models.Model): ELSE 'cukup' END AS action, a.product_id, - pp2.vendor_id, - b.id AS brand_id + pp2.vendor_id FROM ( SELECT COALESCE(pp.default_code, pt.default_code) AS item_code, @@ -95,8 +94,7 @@ class PurchasingJob(models.Model): get_qty_onhand(pp.id::numeric) AS onhand, get_qty_incoming(pp.id::numeric) AS incoming, get_qty_outgoing(pp.id::numeric) AS outgoing, - pp.id AS product_id, - pp.brand_id + pp.id AS product_id FROM stock_move sm JOIN stock_picking sp ON sp.id = sm.picking_id JOIN product_product pp ON pp.id = sm.product_id @@ -104,9 +102,8 @@ class PurchasingJob(models.Model): WHERE sp.state IN ('draft', 'waiting', 'confirmed', 'assigned') AND sp.name LIKE '%%OUT%%' AND sm.location_id = 55 - GROUP BY pp.id, pp.default_code, pt.default_code, pt.name, pp.brand_id + GROUP BY pp.id, pp.default_code, pt.default_code, pt.name ) a - LEFT JOIN brands b ON b.id = a.brand_id LEFT JOIN LATERAL ( SELECT vendor_id FROM purchase_pricelist |
