From a9ac4073cf6c42f59973c4f0c3ce730464dd41ec Mon Sep 17 00:00:00 2001 From: Mqdd Date: Mon, 26 Jan 2026 09:19:23 +0700 Subject: fix list error upload ginee --- fixco_custom/models/upload_ginee.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fixco_custom/models/upload_ginee.py b/fixco_custom/models/upload_ginee.py index 19aa965..e86a175 100644 --- a/fixco_custom/models/upload_ginee.py +++ b/fixco_custom/models/upload_ginee.py @@ -241,8 +241,10 @@ class UploadGineeLine(models.Model): 'data': [{ **base_order, 'items': combined_items, - 'externalOrderId': ', '.join(lines.mapped('invoice_marketplace')), - 'orderId': ', '.join(order_ids), + # 'externalOrderId': ', '.join(lines.mapped('invoice_marketplace')), + # 'orderId': ', '.join(order_ids), + 'externalOrderId': ', '.join(l.invoice_marketplace for l in lines), + 'orderId': ', '.join(l.order_id for l in lines), }] } -- cgit v1.2.3 From a136db83129f0f428c5baf600e8f1ed35fdcca08 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Mon, 26 Jan 2026 12:11:12 +0700 Subject: add permission stock locations --- fixco_custom/models/__init__.py | 3 ++- fixco_custom/models/stock_location.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 fixco_custom/models/stock_location.py diff --git a/fixco_custom/models/__init__.py b/fixco_custom/models/__init__.py index de92dc0..f7559c8 100755 --- a/fixco_custom/models/__init__.py +++ b/fixco_custom/models/__init__.py @@ -39,4 +39,5 @@ from . import upload_cancel_picking from . import product_supplierinfo from . import queue_job from . import purchase_order_multi_bills -from . import account_payment \ No newline at end of file +from . import account_payment +from . import stock_location \ No newline at end of file diff --git a/fixco_custom/models/stock_location.py b/fixco_custom/models/stock_location.py new file mode 100644 index 0000000..e0e1264 --- /dev/null +++ b/fixco_custom/models/stock_location.py @@ -0,0 +1,21 @@ +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + +class StockLocation(models.Model): + _inherit = 'stock.location' + + @api.model_create_multi + def create(self, vals_list): + if self.env.user.id not in [15, 27, 10, 2]: + raise UserError(_("Only the administrator can create new stock locations.")) + return super().create(vals_list) + + def write(self, vals): + if self.env.user.id not in [15, 27, 10, 2]: + raise UserError(_("Only the administrator can modify stock locations.")) + return super().write(vals) + + def unlink(self): + if self.env.user.id not in [15, 27, 10, 2]: + raise UserError(_("Only the administrator can delete stock locations.")) + return super().unlink() -- cgit v1.2.3 From 6ddc8876d34b9f85e3b8f546221feadd5fce43b0 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Mon, 26 Jan 2026 13:34:20 +0700 Subject: add date canceled stock picking --- fixco_custom/models/stock_picking.py | 6 ++++++ fixco_custom/views/stock_picking.xml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/fixco_custom/models/stock_picking.py b/fixco_custom/models/stock_picking.py index 56bb913..04d9504 100755 --- a/fixco_custom/models/stock_picking.py +++ b/fixco_custom/models/stock_picking.py @@ -67,6 +67,12 @@ class StockPicking(models.Model): type_sku = fields.Selection([('single', 'Single SKU'), ('multi', 'Multi SKU')], string='Type SKU') list_product = fields.Char(string='List Product') is_dispatched = fields.Boolean(string='Is Dispatched', default=False, compute='_compute_is_dispatched', readonly=True) + date_canceled = fields.Datetime(string='Date Canceled', tracking=True) + + def action_cancel(self): + for picking in self: + picking.date_canceled = fields.Datetime.now() + return super(StockPicking, self).action_cancel() def check_qty_bundling_product(self): for line in self.move_ids_without_package: diff --git a/fixco_custom/views/stock_picking.xml b/fixco_custom/views/stock_picking.xml index 875e50a..11a2dc7 100755 --- a/fixco_custom/views/stock_picking.xml +++ b/fixco_custom/views/stock_picking.xml @@ -15,6 +15,7 @@ + @@ -55,6 +56,7 @@ + -- cgit v1.2.3 From 87abb539133d4f97c8a9cb9708a472c00a64e069 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 28 Jan 2026 11:07:14 +0700 Subject: change status --- fixco_custom/models/reordering_rule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixco_custom/models/reordering_rule.py b/fixco_custom/models/reordering_rule.py index f1e0f9d..c95e611 100644 --- a/fixco_custom/models/reordering_rule.py +++ b/fixco_custom/models/reordering_rule.py @@ -105,13 +105,13 @@ class ReorderingRule(models.Model): COALESCE(SUM(sq.quantity), 0.0) + vmsbm.incoming_qty ) < vmsbm.min_stock - THEN 'MINUS STOCK' + THEN 'BUY' WHEN ( COALESCE(SUM(sq.quantity), 0.0) + vmsbm.incoming_qty ) <= (vmsbm.min_stock + vmsbm.buffer_stock) - THEN 'LOW STOCK' + THEN 'HOLD' ELSE 'READY STOCK' END AS stock_status -- cgit v1.2.3