mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
pre-commit update
This commit is contained in:
committed by
Mateu Griful
parent
adac6490e3
commit
214f74ba49
@@ -1,29 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="group_stock_inventory_validation" model="res.groups">
|
||||
<field name="name">Validate Inventory Adjustments Under Threshold</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
<field name="category_id" ref="base.module_category_usability" />
|
||||
</record>
|
||||
<record id="group_stock_inventory_validation_always" model="res.groups">
|
||||
<field name="name">Validate All inventory Adjustments</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
<field name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
<field name="category_id" ref="base.module_category_usability" />
|
||||
<field
|
||||
name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation'))]"
|
||||
/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]" />
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="stock.group_stock_user">
|
||||
<field name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation'))]"/>
|
||||
<field
|
||||
name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation'))]"
|
||||
/>
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="stock.group_stock_manager">
|
||||
<field name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation_always'))]"/>
|
||||
<field
|
||||
name="implied_ids"
|
||||
eval="[(4, ref('stock_inventory_discrepancy.group_stock_inventory_validation_always'))]"
|
||||
/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,38 +1,41 @@
|
||||
odoo.define('stock_inventory_discrepancy.InventoryValidationController', function (require) {
|
||||
odoo.define("stock_inventory_discrepancy.InventoryValidationController", function(
|
||||
require
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
var InventoryValidationController = require('stock.InventoryValidationController');
|
||||
var core = require("web.core");
|
||||
var InventoryValidationController = require("stock.InventoryValidationController");
|
||||
|
||||
var _t = core._t;
|
||||
|
||||
InventoryValidationController.include({
|
||||
|
||||
/**
|
||||
* @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({
|
||||
model: 'stock.inventory',
|
||||
method: 'read',
|
||||
args: [this.inventory_id, ['state']],
|
||||
}).then(function (res) {
|
||||
if (res[0].state === "pending") {
|
||||
title = _t("Pending to Approve");
|
||||
message = _t("The inventory needs to be approved");
|
||||
}
|
||||
}).finally(function () {
|
||||
return self.displayNotification({
|
||||
type: 'warning',
|
||||
title: title,
|
||||
message: message,
|
||||
sticky: sticky,
|
||||
className: className,
|
||||
model: "stock.inventory",
|
||||
method: "read",
|
||||
args: [this.inventory_id, ["state"]],
|
||||
})
|
||||
.then(function(res) {
|
||||
if (res[0].state === "pending") {
|
||||
title = _t("Pending to Approve");
|
||||
message = _t("The inventory needs to be approved");
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
return self.displayNotification({
|
||||
type: "warning",
|
||||
title: title,
|
||||
message: message,
|
||||
sticky: sticky,
|
||||
className: className,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<template id="stock_assets_backend" name="stock_inventory assets" inherit_id="web.assets_backend">
|
||||
<template
|
||||
id="stock_assets_backend"
|
||||
name="stock_inventory assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/stock_inventory_discrepancy/static/src/js/inventory_validate_button_controller.js"></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/stock_inventory_discrepancy/static/src/js/inventory_validate_button_controller.js"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_inventory_form" model="ir.ui.view">
|
||||
<field name="name">Inventory form view - discrepancy extension </field>
|
||||
<field name="model">stock.inventory</field>
|
||||
<field name="inherit_id" ref="stock.view_inventory_form"/>
|
||||
<field name="inherit_id" ref="stock.view_inventory_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="attributes">
|
||||
<attribute name="statusbar_visible">
|
||||
@@ -17,42 +15,55 @@
|
||||
{"pending":"red"}
|
||||
</attribute>
|
||||
</field>
|
||||
<xpath expr="//button[@name='action_validate']"
|
||||
position="attributes">
|
||||
<attribute name="groups">stock_inventory_discrepancy.group_stock_inventory_validation</attribute>
|
||||
<xpath expr="//button[@name='action_validate']" position="attributes">
|
||||
<attribute
|
||||
name="groups"
|
||||
>stock_inventory_discrepancy.group_stock_inventory_validation</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_validate']"
|
||||
position="after">
|
||||
<button name="action_force_done"
|
||||
string="Force Validation" type="object"
|
||||
class="oe_highlight"
|
||||
groups="stock_inventory_discrepancy.group_stock_inventory_validation_always"
|
||||
attrs="{'invisible': ['|',('state', '!=', 'pending'),('over_discrepancy_line_count', '=', 0)]}"/>
|
||||
<xpath expr="//button[@name='action_validate']" position="after">
|
||||
<button
|
||||
name="action_force_done"
|
||||
string="Force Validation"
|
||||
type="object"
|
||||
class="oe_highlight"
|
||||
groups="stock_inventory_discrepancy.group_stock_inventory_validation_always"
|
||||
attrs="{'invisible': ['|',('state', '!=', 'pending'),('over_discrepancy_line_count', '=', 0)]}"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_open_inventory_lines']" position="attributes">
|
||||
<xpath
|
||||
expr="//button[@name='action_open_inventory_lines']"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute name="states">pending,confirm</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_cancel_draft'][2]" position="attributes">
|
||||
<xpath
|
||||
expr="//button[@name='action_cancel_draft'][2]"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute name="states">pending,confirm</attribute>
|
||||
</xpath>
|
||||
<field name="company_id" position="before">
|
||||
<field name="over_discrepancy_line_count" attrs="{'invisible': [('state', '!=', 'pending')]}"/>
|
||||
<field
|
||||
name="over_discrepancy_line_count"
|
||||
attrs="{'invisible': [('state', '!=', 'pending')]}"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_inventory_line_tree2" model="ir.ui.view">
|
||||
<field name="name">stock.inventory.line.tree2</field>
|
||||
<field name="model">stock.inventory.line</field>
|
||||
<field name="inherit_id" ref="stock.stock_inventory_line_tree2"/>
|
||||
<field name="inherit_id" ref="stock.stock_inventory_line_tree2" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_qty" position="after">
|
||||
<field name="discrepancy_qty"/>
|
||||
<field name="discrepancy_percent"/>
|
||||
<field name="discrepancy_threshold"/>
|
||||
<field name="discrepancy_qty" />
|
||||
<field name="discrepancy_percent" />
|
||||
<field name="discrepancy_threshold" />
|
||||
</field>
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="decoration-danger">theoretical_qty < 0 or discrepancy_percent > discrepancy_threshold or "product_qty != theoretical_qty"</attribute>
|
||||
<attribute
|
||||
name="decoration-danger"
|
||||
>theoretical_qty < 0 or discrepancy_percent > discrepancy_threshold or "product_qty != theoretical_qty"</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_location_form" model="ir.ui.view">
|
||||
<field name="name">Location form - cycle count extension</field>
|
||||
<field name="model">stock.location</field>
|
||||
<field name="inherit_id" ref="stock.view_location_form"/>
|
||||
<field name="inherit_id" ref="stock.view_location_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="return_location" position="after">
|
||||
<label for="discrepancy_threshold"/>
|
||||
<label for="discrepancy_threshold" />
|
||||
<div>
|
||||
<field name="discrepancy_threshold" class="oe_inline"/> %
|
||||
<field name="discrepancy_threshold" class="oe_inline" /> %
|
||||
</div>
|
||||
<field name="propagate_discrepancy_threshold"/>
|
||||
<field name="propagate_discrepancy_threshold" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_warehouse" model="ir.ui.view">
|
||||
<field name="name">Warehouse form - Inventory Discrepancy
|
||||
extension</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="inherit_id" ref="stock.view_warehouse" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="after">
|
||||
<label for="discrepancy_threshold"/>
|
||||
<label for="discrepancy_threshold" />
|
||||
<div>
|
||||
<field name="discrepancy_threshold" class="oe_inline"/> %
|
||||
<field name="discrepancy_threshold" class="oe_inline" /> %
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user