mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[14.0][MIG] stock_inventory_discrepancy: black, isort, prettier
This commit is contained in:
committed by
Carolina Fernandez
parent
6088ede5a8
commit
3f51453f3c
@@ -28,7 +28,9 @@ class StockInventoryLine(models.Model):
|
||||
help="Maximum Discrepancy Rate Threshold",
|
||||
compute="_compute_discrepancy_threshold",
|
||||
)
|
||||
has_over_discrepancy = fields.Boolean(compute="_compute_has_over_discrepancy",)
|
||||
has_over_discrepancy = fields.Boolean(
|
||||
compute="_compute_has_over_discrepancy",
|
||||
)
|
||||
|
||||
@api.depends("theoretical_qty", "product_qty")
|
||||
def _compute_discrepancy(self):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
odoo.define("stock_inventory_discrepancy.InventoryValidationController", function(
|
||||
odoo.define("stock_inventory_discrepancy.InventoryValidationController", function (
|
||||
require
|
||||
) {
|
||||
"use strict";
|
||||
@@ -13,7 +13,7 @@ odoo.define("stock_inventory_discrepancy.InventoryValidationController", functio
|
||||
* @override
|
||||
* @see displayNotification
|
||||
*/
|
||||
do_notify: function(title, message, sticky, className) {
|
||||
do_notify: function (title, message, sticky, className) {
|
||||
var self = this;
|
||||
if (this.modelName === "stock.inventory.line") {
|
||||
this._rpc({
|
||||
@@ -21,13 +21,13 @@ odoo.define("stock_inventory_discrepancy.InventoryValidationController", functio
|
||||
method: "read",
|
||||
args: [this.inventory_id, ["state"]],
|
||||
})
|
||||
.then(function(res) {
|
||||
.then(function (res) {
|
||||
if (res[0].state === "pending") {
|
||||
title = _t("Pending to Approve");
|
||||
message = _t("The inventory needs to be approved");
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
.finally(function () {
|
||||
return self.displayNotification({
|
||||
type: "warning",
|
||||
title: title,
|
||||
|
||||
@@ -102,8 +102,7 @@ class TestInventoryDiscrepancy(TransactionCase):
|
||||
starting_inv.action_force_done()
|
||||
|
||||
def test_compute_discrepancy(self):
|
||||
"""Tests if the discrepancy is correctly computed.
|
||||
"""
|
||||
"""Tests if the discrepancy is correctly computed."""
|
||||
inventory = self.obj_inventory.create(
|
||||
{
|
||||
"name": "Test Discrepancy Computation",
|
||||
|
||||
Reference in New Issue
Block a user