[14.0][MIG] stock_inventory_discrepancy: black, isort, prettier

This commit is contained in:
Mateu Griful
2021-09-09 15:34:03 +02:00
committed by Carolina Fernandez
parent 6088ede5a8
commit 3f51453f3c
3 changed files with 8 additions and 7 deletions

View File

@@ -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):

View File

@@ -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,

View File

@@ -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",