diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-28 15:27:31 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-28 15:27:31 +0700 |
| commit | e9b9be0af8edef9b3ae26143c1783870e099d262 (patch) | |
| tree | 79b0e90f2e7b9f5bc9f43aa9aab4ef5b4f84852c | |
| parent | 7fd85b36543e6f1cc9e55a90bbee2743ca129d5f (diff) | |
| parent | 87abb539133d4f97c8a9cb9708a472c00a64e069 (diff) | |
Merge branch 'main' of bitbucket.org:altafixco/fixco-addons
pull
| -rwxr-xr-x | fixco_custom/models/__init__.py | 3 | ||||
| -rw-r--r-- | fixco_custom/models/reordering_rule.py | 4 | ||||
| -rw-r--r-- | fixco_custom/models/stock_location.py | 21 | ||||
| -rwxr-xr-x | fixco_custom/models/stock_picking.py | 6 | ||||
| -rw-r--r-- | fixco_custom/models/upload_ginee.py | 6 | ||||
| -rwxr-xr-x | fixco_custom/views/stock_picking.xml | 2 |
6 files changed, 37 insertions, 5 deletions
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/reordering_rule.py b/fixco_custom/models/reordering_rule.py index c38864e..e4a4dec 100644 --- a/fixco_custom/models/reordering_rule.py +++ b/fixco_custom/models/reordering_rule.py @@ -107,13 +107,13 @@ class ReorderingRule(models.Model): COALESCE(SUM(sq.quantity), 0.0) + vmsbm.incoming_qty - vmsbm.outgoing_qty ) < vmsbm.min_stock - THEN 'MINUS STOCK' + THEN 'BUY' WHEN ( COALESCE(SUM(sq.quantity), 0.0) + vmsbm.incoming_qty - vmsbm.outgoing_qty ) <= (vmsbm.min_stock + vmsbm.buffer_stock) - THEN 'LOW STOCK' + THEN 'HOLD' ELSE 'READY STOCK' END AS stock_status 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() 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/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), }] } 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 @@ <field name="create_date" optional="hide"/> <field name="shipment_group_id" optional="hide"/> <field name="is_dispatched" optional="hide"/> + <field name="date_canceled" optional="hide"/> </field> </field> </record> @@ -55,6 +56,7 @@ <field name="ginee_task_id" readonly="1"/> <field name="pdf_label_url" readonly="1" widget="url"/> <field name="pdf_label_preview" widget="pdf_viewer"/> + <field name="date_canceled" readonly="1"/> </group> <group string="Shipping" name="shipping_infos"> <field name="ginee_delivery_type" readonly="1"/> |
