From 159123ceee4c61c5a9bb0c98a66cf893d2f231e5 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Sun, 10 Dec 2023 17:51:40 -0500 Subject: [PATCH] [MIG] stock_request: Migration to 17.0 --- stock_request/__manifest__.py | 2 +- .../15.0.1.4.0/noupdate_changes.xml | 14 -- .../migrations/15.0.1.4.0/post-migration.py | 10 - stock_request/models/__init__.py | 2 +- stock_request/models/stock_move.py | 4 +- stock_request/models/stock_move_line.py | 8 +- stock_request/models/stock_picking.py | 4 +- stock_request/models/stock_request.py | 127 +++++++------ .../models/stock_request_abstract.py | 15 +- stock_request/models/stock_request_order.py | 32 ++-- ...stock_location_route.py => stock_route.py} | 4 +- stock_request/models/stock_rule.py | 2 +- stock_request/tests/test_stock_request.py | 54 +++--- .../views/res_config_settings_views.xml | 175 +++++++----------- stock_request/views/stock_picking_views.xml | 2 +- .../views/stock_request_order_views.xml | 61 +++--- stock_request/views/stock_request_views.xml | 64 ++++--- 17 files changed, 281 insertions(+), 299 deletions(-) delete mode 100644 stock_request/migrations/15.0.1.4.0/noupdate_changes.xml delete mode 100644 stock_request/migrations/15.0.1.4.0/post-migration.py rename stock_request/models/{stock_location_route.py => stock_route.py} (91%) diff --git a/stock_request/__manifest__.py b/stock_request/__manifest__.py index 48ade0a0..81a0b83c 100644 --- a/stock_request/__manifest__.py +++ b/stock_request/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Request", "summary": "Internal request for stock", - "version": "15.0.1.7.0", + "version": "17.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-request", "author": "ForgeFlow, Odoo Community Association (OCA)", diff --git a/stock_request/migrations/15.0.1.4.0/noupdate_changes.xml b/stock_request/migrations/15.0.1.4.0/noupdate_changes.xml deleted file mode 100644 index 165527dd..00000000 --- a/stock_request/migrations/15.0.1.4.0/noupdate_changes.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - stock_request multi-company - ['|',('company_id','=',False),('company_id', 'in', company_ids)] - - - ['|',('company_id','=',False),('company_id', 'in', company_ids)] - - diff --git a/stock_request/migrations/15.0.1.4.0/post-migration.py b/stock_request/migrations/15.0.1.4.0/post-migration.py deleted file mode 100644 index 2f8cda8f..00000000 --- a/stock_request/migrations/15.0.1.4.0/post-migration.py +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2023 Tecnativa - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.load_data( - env.cr, "stock_request", "migrations/15.0.1.4.0/noupdate_changes.xml" - ) diff --git a/stock_request/models/__init__.py b/stock_request/models/__init__.py index 679c50a8..e6cf792f 100644 --- a/stock_request/models/__init__.py +++ b/stock_request/models/__init__.py @@ -10,5 +10,5 @@ from . import res_config_settings from . import stock_warehouse from . import stock_location -from . import stock_location_route +from . import stock_route from . import res_company diff --git a/stock_request/models/stock_move.py b/stock_request/models/stock_move.py index 930a3314..6019d260 100644 --- a/stock_request/models/stock_move.py +++ b/stock_request/models/stock_move.py @@ -26,7 +26,7 @@ def _compute_stock_request_ids(self): rec.stock_request_ids = rec.allocation_ids.mapped("stock_request_id") def _merge_moves_fields(self): - res = super(StockMove, self)._merge_moves_fields() + res = super()._merge_moves_fields() res["allocation_ids"] = [(4, m.id) for m in self.mapped("allocation_ids")] return res @@ -65,7 +65,7 @@ def copy_data(self, default=None): }, ) ) - return super(StockMove, self).copy_data(default) + return super().copy_data(default) def _action_cancel(self): """Apply sudo to prevent requests ACL errors if the user does not have diff --git a/stock_request/models/stock_move_line.py b/stock_request/models/stock_move_line.py index f935de28..5bb73244 100644 --- a/stock_request/models/stock_move_line.py +++ b/stock_request/models/stock_move_line.py @@ -36,17 +36,17 @@ def _prepare_message_data(self, ml, request, allocated_qty): return { "request_name": request.name, "picking_name": ml.picking_id.name, - "product_name": ml.product_id.name_get()[0][1], + "product_name": ml.product_id.display_name, "product_qty": allocated_qty, "product_uom": ml.product_uom_id.name, - "location_name": ml.location_dest_id.name_get()[0][1], + "location_name": ml.location_dest_id.display_name, } def _action_done(self): - res = super(StockMoveLine, self)._action_done() + res = super()._action_done() for ml in self.filtered(lambda m: m.exists() and m.move_id.allocation_ids): qty_done = ml.product_uom_id._compute_quantity( - ml.qty_done, ml.product_id.uom_id + ml.quantity, ml.product_id.uom_id ) # We do sudo because potentially the user that completes the move diff --git a/stock_request/models/stock_picking.py b/stock_request/models/stock_picking.py index 85ea9b09..e9f386b2 100644 --- a/stock_request/models/stock_picking.py +++ b/stock_request/models/stock_picking.py @@ -16,10 +16,10 @@ class StockPicking(models.Model): "Stock Request #", compute="_compute_stock_request_ids" ) - @api.depends("move_lines") + @api.depends("move_ids") def _compute_stock_request_ids(self): for rec in self: - rec.stock_request_ids = rec.move_lines.mapped("stock_request_ids") + rec.stock_request_ids = rec.move_ids.mapped("stock_request_ids") rec.stock_request_count = len(rec.stock_request_ids) def action_view_stock_request(self): diff --git a/stock_request/models/stock_request.py b/stock_request/models/stock_request.py index 376bcd78..54bbfc86 100644 --- a/stock_request/models/stock_request.py +++ b/stock_request/models/stock_request.py @@ -19,7 +19,7 @@ def _get_default_requested_by(self): def _get_expected_date(): return fields.Datetime.now() - name = fields.Char(states={"draft": [("readonly", False)]}) + name = fields.Char() state = fields.Selection( selection=[ ("draft", "Draft"), @@ -43,8 +43,6 @@ def _get_expected_date(): expected_date = fields.Datetime( index=True, required=True, - readonly=True, - states={"draft": [("readonly", False)]}, help="Date when you expect to receive the goods.", ) picking_policy = fields.Selection( @@ -54,8 +52,6 @@ def _get_expected_date(): ], string="Shipping Policy", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default="direct", ) move_ids = fields.One2many( @@ -102,24 +98,14 @@ def _get_expected_date(): string="Stock Request Allocation", ) order_id = fields.Many2one("stock.request.order", readonly=True) - warehouse_id = fields.Many2one( - states={"draft": [("readonly", False)]}, readonly=True - ) - location_id = fields.Many2one( - states={"draft": [("readonly", False)]}, readonly=True - ) - product_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True) - product_uom_id = fields.Many2one( - states={"draft": [("readonly", False)]}, readonly=True - ) - product_uom_qty = fields.Float( - states={"draft": [("readonly", False)]}, readonly=True - ) - procurement_group_id = fields.Many2one( - states={"draft": [("readonly", False)]}, readonly=True - ) - company_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True) - route_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True) + warehouse_id = fields.Many2one() + location_id = fields.Many2one() + product_id = fields.Many2one() + product_uom_id = fields.Many2one() + product_uom_qty = fields.Float() + procurement_group_id = fields.Many2one() + company_id = fields.Many2one() + route_id = fields.Many2one() _sql_constraints = [ ("name_uniq", "unique(name, company_id)", "Stock Request name must be unique") @@ -148,7 +134,7 @@ def _compute_picking_ids(self): "allocation_ids", "allocation_ids.stock_move_id.state", "allocation_ids.stock_move_id.move_line_ids", - "allocation_ids.stock_move_id.move_line_ids.qty_done", + "allocation_ids.stock_move_id.move_line_ids.quantity", ) def _compute_qty(self): for request in self: @@ -180,41 +166,70 @@ def _compute_qty(self): @api.constrains("order_id", "requested_by") def check_order_requested_by(self): - if self.order_id and self.order_id.requested_by != self.requested_by: - raise ValidationError(_("Requested by must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.requested_by != stock_request.requested_by + ): + raise ValidationError(_("Requested by must be equal to the order")) @api.constrains("order_id", "warehouse_id") def check_order_warehouse_id(self): - if self.order_id and self.order_id.warehouse_id != self.warehouse_id: - raise ValidationError(_("Warehouse must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.warehouse_id != stock_request.warehouse_id + ): + raise ValidationError(_("Warehouse must be equal to the order")) @api.constrains("order_id", "location_id") def check_order_location(self): - if self.order_id and self.order_id.location_id != self.location_id: - raise ValidationError(_("Location must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.location_id != stock_request.location_id + ): + raise ValidationError(_("Location must be equal to the order")) @api.constrains("order_id", "procurement_group_id") def check_order_procurement_group(self): - if ( - self.order_id - and self.order_id.procurement_group_id != self.procurement_group_id - ): - raise ValidationError(_("Procurement group must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.procurement_group_id + != stock_request.procurement_group_id + ): + raise ValidationError(_("Procurement group must be equal to the order")) @api.constrains("order_id", "company_id") def check_order_company(self): - if self.order_id and self.order_id.company_id != self.company_id: - raise ValidationError(_("Company must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.company_id != stock_request.company_id + ): + raise ValidationError(_("Company must be equal to the order")) @api.constrains("order_id", "expected_date") def check_order_expected_date(self): - if self.order_id and self.order_id.expected_date != self.expected_date: - raise ValidationError(_("Expected date must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.expected_date != stock_request.expected_date + ): + raise ValidationError(_("Expected date must be equal to the order")) @api.constrains("order_id", "picking_policy") def check_order_picking_policy(self): - if self.order_id and self.order_id.picking_policy != self.picking_policy: - raise ValidationError(_("The picking policy must be equal to the order")) + for stock_request in self: + if ( + stock_request.order_id + and stock_request.order_id.picking_policy + != stock_request.picking_policy + ): + raise ValidationError( + _("The picking policy must be equal to the order") + ) def _action_confirm(self): self._action_launch_procurement_rule() @@ -329,7 +344,8 @@ def _action_use_stock_available(self): pending_qty -= qty_move # Create allocation + done move allocation_model.create(self._prepare_stock_request_allocation(move)) - move.quantity_done = move.product_uom_qty + move.quantity = move.product_uom_qty + move.picked = True move._action_done() def _action_launch_procurement_rule(self): @@ -405,19 +421,22 @@ def action_view_transfer(self): action["res_id"] = pickings.id return action - @api.model - def create(self, vals): - upd_vals = vals.copy() - if upd_vals.get("name", "/") == "/": - upd_vals["name"] = self.env["ir.sequence"].next_by_code("stock.request") - if "order_id" in upd_vals: - order_id = self.env["stock.request.order"].browse(upd_vals["order_id"]) - upd_vals["expected_date"] = order_id.expected_date - else: - upd_vals["expected_date"] = self._get_expected_date() - return super().create(upd_vals) + @api.model_create_multi + def create(self, vals_list): + vals_list_upd = [] + for vals in vals_list: + upd_vals = vals.copy() + if upd_vals.get("name", "/") == "/": + upd_vals["name"] = self.env["ir.sequence"].next_by_code("stock.request") + if "order_id" in upd_vals: + order_id = self.env["stock.request.order"].browse(upd_vals["order_id"]) + upd_vals["expected_date"] = order_id.expected_date + else: + upd_vals["expected_date"] = self._get_expected_date() + vals_list_upd.append(upd_vals) + return super().create(vals_list_upd) def unlink(self): if self.filtered(lambda r: r.state != "draft"): raise UserError(_("Only requests on draft state can be unlinked")) - return super(StockRequest, self).unlink() + return super().unlink() diff --git a/stock_request/models/stock_request_abstract.py b/stock_request/models/stock_request_abstract.py index 32ef1687..13f163e6 100644 --- a/stock_request/models/stock_request_abstract.py +++ b/stock_request/models/stock_request_abstract.py @@ -12,7 +12,7 @@ class StockRequest(models.AbstractModel): @api.model def default_get(self, fields): - res = super(StockRequest, self).default_get(fields) + res = super().default_get(fields) warehouse = None if "warehouse_id" not in res and res.get("company_id"): warehouse = self.env["stock.warehouse"].search( @@ -94,14 +94,14 @@ def _compute_product_qty(self): "res.company", "Company", required=True, default=lambda self: self.env.company ) route_id = fields.Many2one( - "stock.location.route", + "stock.route", string="Route", domain="[('id', 'in', route_ids)]", ondelete="restrict", ) route_ids = fields.Many2many( - "stock.location.route", + "stock.route", string="Routes", compute="_compute_route_ids", readonly=True, @@ -113,16 +113,14 @@ def _compute_product_qty(self): @api.depends("product_id", "warehouse_id", "location_id") def _compute_route_ids(self): - route_obj = self.env["stock.location.route"] + route_obj = self.env["stock.route"] routes = route_obj.search( [("warehouse_ids", "in", self.mapped("warehouse_id").ids)] ) routes_by_warehouse = {} for route in routes: for warehouse in route.warehouse_ids: - routes_by_warehouse.setdefault( - warehouse.id, self.env["stock.location.route"] - ) + routes_by_warehouse.setdefault(warehouse.id, self.env["stock.route"]) routes_by_warehouse[warehouse.id] |= route for record in self: routes = route_obj @@ -133,8 +131,9 @@ def _compute_route_ids(self): if record.warehouse_id and routes_by_warehouse.get(record.warehouse_id.id): routes |= routes_by_warehouse[record.warehouse_id.id] parents = record.get_parents().ids + # ruff: noqa: B023 record.route_ids = routes.filtered( - lambda r: any(p.location_id.id in parents for p in r.rule_ids) + lambda r: any(p.location_dest_id.id in parents for p in r.rule_ids) ) def get_parents(self): diff --git a/stock_request/models/stock_request_order.py b/stock_request/models/stock_request_order.py index f7a15c99..74da83ea 100644 --- a/stock_request/models/stock_request_order.py +++ b/stock_request/models/stock_request_order.py @@ -39,7 +39,6 @@ def _get_default_requested_by(self): copy=False, required=True, readonly=True, - states={"draft": [("readonly", False)]}, default="/", ) state = fields.Selection( @@ -63,20 +62,16 @@ def _get_default_requested_by(self): comodel_name="stock.warehouse", string="Warehouse", check_company=True, - readonly=True, ondelete="cascade", required=True, - states={"draft": [("readonly", False)]}, ) location_id = fields.Many2one( comodel_name="stock.location", string="Location", domain="not allow_virtual_location and " "[('usage', 'in', ['internal', 'transit'])] or []", - readonly=True, ondelete="cascade", required=True, - states={"draft": [("readonly", False)]}, ) allow_virtual_location = fields.Boolean( related="company_id.stock_request_allow_virtual_loc", readonly=True @@ -84,8 +79,6 @@ def _get_default_requested_by(self): procurement_group_id = fields.Many2one( "procurement.group", "Procurement Group", - readonly=True, - states={"draft": [("readonly", False)]}, help="Moves created through this stock request will be put in this " "procurement group. If none is given, the moves generated by " "procurement rules will be grouped into one big picking.", @@ -94,16 +87,12 @@ def _get_default_requested_by(self): "res.company", "Company", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default=lambda self: self.env.company, ) expected_date = fields.Datetime( default=fields.Datetime.now, index=True, required=True, - readonly=True, - states={"draft": [("readonly", False)]}, help="Date when you expect to receive the goods.", ) picking_policy = fields.Selection( @@ -113,8 +102,6 @@ def _get_default_requested_by(self): ], string="Shipping Policy", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default="direct", ) move_ids = fields.One2many( @@ -277,14 +264,17 @@ def action_view_stock_requests(self): action["res_id"] = self.stock_request_ids.id return action - @api.model - def create(self, vals): - upd_vals = vals.copy() - if upd_vals.get("name", "/") == "/": - upd_vals["name"] = self.env["ir.sequence"].next_by_code( - "stock.request.order" - ) - return super().create(upd_vals) + @api.model_create_multi + def create(self, vals_list): + vals_list_upd = [] + for vals in vals_list: + upd_vals = vals.copy() + if upd_vals.get("name", "/") == "/": + upd_vals["name"] = self.env["ir.sequence"].next_by_code( + "stock.request.order" + ) + vals_list_upd.append(upd_vals) + return super().create(vals_list_upd) def unlink(self): if self.filtered(lambda r: r.state != "draft"): diff --git a/stock_request/models/stock_location_route.py b/stock_request/models/stock_route.py similarity index 91% rename from stock_request/models/stock_location_route.py rename to stock_request/models/stock_route.py index 97063ab8..6bfb4cd0 100644 --- a/stock_request/models/stock_location_route.py +++ b/stock_request/models/stock_route.py @@ -5,8 +5,8 @@ from odoo.exceptions import ValidationError -class StockLocationRoute(models.Model): - _inherit = "stock.location.route" +class StockRoute(models.Model): + _inherit = "stock.route" @api.constrains("company_id") def _check_company_stock_request(self): diff --git a/stock_request/models/stock_rule.py b/stock_request/models/stock_rule.py index f304bd89..3722641a 100644 --- a/stock_request/models/stock_rule.py +++ b/stock_request/models/stock_rule.py @@ -18,7 +18,7 @@ def _get_stock_move_values( company_id, values, ): - result = super(StockRule, self)._get_stock_move_values( + result = super()._get_stock_move_values( product_id, product_qty, product_uom, diff --git a/stock_request/tests/test_stock_request.py b/stock_request/tests/test_stock_request.py index d7486395..9ab5d7ab 100644 --- a/stock_request/tests/test_stock_request.py +++ b/stock_request/tests/test_stock_request.py @@ -91,7 +91,7 @@ def setUp(self): "name": "Transfer", "route_id": self.route.id, "location_src_id": self.ressuply_loc.id, - "location_id": self.warehouse.lot_stock_id.id, + "location_dest_id": self.warehouse.lot_stock_id.id, "action": "pull", "picking_type_id": self.warehouse.int_type_id.id, "procure_method": "make_to_stock", @@ -104,7 +104,7 @@ def setUp(self): "name": "Transfer", "route_id": self.route_2.id, "location_src_id": self.ressuply_loc_2.id, - "location_id": self.wh2.lot_stock_id.id, + "location_dest_id": self.wh2.lot_stock_id.id, "action": "pull", "picking_type_id": self.wh2.int_type_id.id, "procure_method": "make_to_stock", @@ -123,7 +123,7 @@ def _create_product(self, default_code, name, company_id, **vals): default_code=default_code, uom_id=self.env.ref("uom.product_uom_unit").id, company_id=company_id, - type="product", + detailed_type="product", **vals, ) ) @@ -151,7 +151,7 @@ def _create_location(self, **vals): return self.env["stock.location"].create(dict(usage="internal", **vals)) def _create_location_route(self, **vals): - return self.env["stock.location.route"].create( + return self.env["stock.route"].create( dict( product_categ_selectable=False, product_selectable=True, @@ -715,7 +715,8 @@ def test_create_request_01(self): picking.with_user(self.stock_request_manager).action_assign() self.assertEqual(picking.origin, order.name) packout1 = picking.move_line_ids[0] - packout1.qty_done = 5 + packout1.quantity = 5 + packout1.picked = True picking.with_user(self.stock_request_manager)._action_done() self.assertEqual(stock_request.qty_in_progress, 0.0) self.assertEqual(stock_request.qty_done, stock_request.product_uom_qty) @@ -760,7 +761,8 @@ def test_create_request_02(self): self.assertEqual(stock_request.qty_done, 0.0) picking.with_user(self.stock_request_manager).action_assign() packout1 = picking.move_line_ids[0] - packout1.qty_done = 1 + packout1.quantity = 1 + packout1.picked = True picking.with_user(self.stock_request_manager)._action_done() self.assertEqual(stock_request.qty_in_progress, 0.0) self.assertEqual(stock_request.qty_done, stock_request.product_uom_qty) @@ -813,7 +815,8 @@ def test_create_request_03(self): self.assertEqual(stock_request_2.qty_done, 0) self.assertEqual(stock_request_2.qty_cancelled, 0) packout1 = picking.move_line_ids[0] - packout1.qty_done = 4 + packout1.quantity = 4 + packout1.picked = True self.env["stock.backorder.confirmation"].with_context( button_validate_picking_ids=[picking.id] ).create({"pick_ids": [(4, picking.id)]}).process_cancel_backorder() @@ -1137,9 +1140,9 @@ def test_cancellation(self): group = self.env["procurement.group"].create({"name": "Procurement group"}) product2 = self._create_product("SH2", "Shoes2", False) product3 = self._create_product("SH3", "Shoes3", False) - self.product.type = "consu" - product2.type = "consu" - product3.type = "consu" + self.product.detailed_type = "consu" + product2.detailed_type = "consu" + product3.detailed_type = "consu" vals = { "company_id": self.main_company.id, "warehouse_id": self.warehouse.id, @@ -1195,9 +1198,10 @@ def test_cancellation(self): picking = order.picking_ids self.assertEqual(1, len(picking)) picking.action_assign() - self.assertEqual(3, len(picking.move_lines)) - line = picking.move_lines.filtered(lambda r: r.product_id == self.product) - line.quantity_done = 1 + self.assertEqual(3, len(picking.move_ids)) + line = picking.move_ids.filtered(lambda r: r.product_id == self.product) + line.quantity = 1 + line.picked = True sr1 = order.stock_request_ids.filtered(lambda r: r.product_id == self.product) sr2 = order.stock_request_ids.filtered(lambda r: r.product_id == product2) sr3 = order.stock_request_ids.filtered(lambda r: r.product_id == product3) @@ -1207,9 +1211,9 @@ def test_cancellation(self): self.env["stock.backorder.confirmation"].with_context( button_validate_picking_ids=[picking.id] ).create({"pick_ids": [(4, picking.id)]}).process() - sr1.refresh() - sr2.refresh() - sr3.refresh() + sr1.invalidate_recordset() + sr2.invalidate_recordset() + sr3.invalidate_recordset() self.assertNotEqual(sr1.state, "done") self.assertNotEqual(sr2.state, "done") self.assertNotEqual(sr3.state, "done") @@ -1218,17 +1222,19 @@ def test_cancellation(self): ) self.assertEqual(1, len(picking)) picking.action_assign() - self.assertEqual(3, len(picking.move_lines)) - line = picking.move_lines.filtered(lambda r: r.product_id == self.product) - line.quantity_done = 4 - line = picking.move_lines.filtered(lambda r: r.product_id == product2) - line.quantity_done = 1 + self.assertEqual(3, len(picking.move_ids)) + line = picking.move_ids.filtered(lambda r: r.product_id == self.product) + line.quantity = 4 + line.picked = True + line = picking.move_ids.filtered(lambda r: r.product_id == product2) + line.quantity = 1 + line.picked = True self.env["stock.backorder.confirmation"].with_context( button_validate_picking_ids=[picking.id] ).create({"pick_ids": [(4, picking.id)]}).process_cancel_backorder() - sr1.refresh() - sr2.refresh() - sr3.refresh() + sr1.invalidate_recordset() + sr2.invalidate_recordset() + sr3.invalidate_recordset() self.assertEqual(sr1.state, "done") self.assertEqual(sr1.qty_done, 5) self.assertEqual(sr1.qty_cancelled, 0) diff --git a/stock_request/views/res_config_settings_views.xml b/stock_request/views/res_config_settings_views.xml index c2412a95..e2bb4be6 100644 --- a/stock_request/views/res_config_settings_views.xml +++ b/stock_request/views/res_config_settings_views.xml @@ -9,150 +9,117 @@ res.config.settings - -
+

Orders & Configuration

-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
+ +

Purchases

-
-
-
- -
-
-
-
+ +

Manufacturing

-
-
-
- -
-
-
-
+ +

Kanban

-
-
-
- -
-
-
-
+ +

Analytic

-
-
-
- -
-
-
-
-
+ + + diff --git a/stock_request/views/stock_picking_views.xml b/stock_request/views/stock_picking_views.xml index a35f92ec..bdfa22db 100644 --- a/stock_request/views/stock_picking_views.xml +++ b/stock_request/views/stock_picking_views.xml @@ -12,7 +12,7 @@ name="action_view_stock_request" class="oe_stat_button" icon="fa-chain" - attrs="{'invisible':[('stock_request_ids', '=', [])]}" + invisible="stock_request_ids == []" >