diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-15 09:13:39 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-15 09:13:39 +0700 |
| commit | c5415d7d3b063af9375600896db308315f34c2a4 (patch) | |
| tree | 55f0ea94929622ea5efff64a195ca1a088617f9d | |
| parent | cc31429011b566c64792898b63d1e62d723ab127 (diff) | |
push
| -rw-r--r-- | fixco_custom/models/upload_ginee.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/fixco_custom/models/upload_ginee.py b/fixco_custom/models/upload_ginee.py index 6806a28..9830383 100644 --- a/fixco_custom/models/upload_ginee.py +++ b/fixco_custom/models/upload_ginee.py @@ -168,16 +168,20 @@ class UploadGinee(models.Model): def action_get_order_id_and_create_detail_order(self): self.date_upload = datetime.utcnow() - for line in self.ginee_lines: - queue_job = self.env['queue.job'].search([('res_id', '=', line.id), ('method_name', '=', 'get_order_id_and_create_detail_order'), ('state', '!=', 'error')], limit=1) - if queue_job: - continue - self.env['queue.job'].create({ - 'name': f'Get Order Ginee {line.invoice_marketplace}', - 'model_name': 'upload.ginee.line', - 'method_name': 'get_order_id_and_create_detail_order', - 'res_id': line.id, - }) + if self.upload_type == 'rehit': + for line in self.ginee_lines: + queue_job = self.env['queue.job'].search([('res_id', '=', line.id), ('method_name', '=', 'get_order_id_and_create_detail_order'), ('state', '!=', 'error')], limit=1) + if queue_job: + continue + self.env['queue.job'].create({ + 'name': f'Get Order Ginee {line.invoice_marketplace}', + 'model_name': 'upload.ginee.line', + 'method_name': 'get_order_id_and_create_detail_order', + 'res_id': line.id, + }) + else: + self.ginee_lines.get_order_id() + self.ginee_lines.create_so_and_detail_order() class UploadGineeLine(models.Model): _name = "upload.ginee.line" |
