diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-07-19 10:31:49 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-07-19 10:31:49 +0700 |
| commit | 7a47f8abf397798ae52b4583bcc2caf4d83db874 (patch) | |
| tree | bbbf8577b8d1271e6df0fbb7a274e0099c8585ff /indoteknik_custom/models | |
| parent | 22fe8df6b70ed2166e2811b74e1b31cbf3b984cb (diff) | |
fix bug fullfillment
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/report_stock_forecasted.py | 7 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/indoteknik_custom/models/report_stock_forecasted.py b/indoteknik_custom/models/report_stock_forecasted.py index d5e48fdc..6058b7e5 100644 --- a/indoteknik_custom/models/report_stock_forecasted.py +++ b/indoteknik_custom/models/report_stock_forecasted.py @@ -10,9 +10,12 @@ class ReplenishmentReport(models.AbstractModel): for line in lines: document_out = line.get('document_out') + model_name = document_out._name - if document_out and "SO/" in document_out.name: + if document_out and model_name == 'sale.order': order_id = document_out.id + if document_out == False: + continue product_id = line.get('product', {}).get('id') query = [('product_id', '=', product_id)] @@ -32,7 +35,7 @@ class ReplenishmentReport(models.AbstractModel): 'qty_fullfillment': quantity, }) - return lines + return lines def _calculate_result(self, line): if line['document_in']: diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index b3787499..3d7d3a80 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -108,7 +108,6 @@ class ProductTemplate(models.Model): "max_discount" : voucher.max_discount_amount } }) - print(document) self.solr().add(docs=[document], softCommit=True) products = self.env['product.product'].search([ |
