From e46be164dc1e419cdbfd0c0cf587fadc63beef3e Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 8 Jul 2025 15:24:11 +0700 Subject: reordering rules and manage stock --- fixco_custom/models/manage_stock.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fixco_custom/models/manage_stock.py (limited to 'fixco_custom/models/manage_stock.py') diff --git a/fixco_custom/models/manage_stock.py b/fixco_custom/models/manage_stock.py new file mode 100644 index 0000000..4375ad2 --- /dev/null +++ b/fixco_custom/models/manage_stock.py @@ -0,0 +1,21 @@ +from odoo import models, api, fields +from odoo.exceptions import AccessError, UserError, ValidationError +from datetime import timedelta, date +import logging + +_logger = logging.getLogger(__name__) + +class ManageStock(models.Model): + _name = "manage.stock" + _description = "Manage Stock" + _inherit = ['mail.thread'] + _rec_name = 'product_id' + + product_id = fields.Many2one('product.product', string="Product", required=True) + min_stock = fields.Float(string='Min Stock', required=True) + buffer_stock = fields.Float(string='Buffer Stock', required=True) + vendor_id = fields.Many2one('res.partner', string="Vendor", required=True) + + _sql_constraints = [ + ('product_unique', 'unique (product_id)', 'This product already has a stock management rule!'), + ] \ No newline at end of file -- cgit v1.2.3