-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_move_line_lock_qty_done: prevent test cases from other mo…
…dules from failing
- Loading branch information
1 parent
ff4ac9b
commit 101a2bf
Showing
12 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,8 @@ Lock Done Quantity Changes in Stock Moves | |
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module limits the capability to modify the done quantity for stock moves | ||
once they have been validated. | ||
This module can limit the ability to modify the done quantity of stock moves once they are validated, | ||
configurable per company through the settings. | ||
|
||
**Table of contents** | ||
|
||
|
@@ -42,6 +42,8 @@ Configuration | |
To configure this module, you need to add the users allowed to edit the done quntity | ||
for done moves to the group "Can edit done quantity for done stock moves" | ||
|
||
Enable the 'Limit Updates to Done Quantity After Validation' option under 'Inventory > Settings' to restrict the ability to modify the done quantity for validated stock moves. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
|
@@ -64,6 +66,9 @@ Contributors | |
~~~~~~~~~~~~ | ||
|
||
* Souheil Bejaoui <[email protected]> | ||
* `Quartile <https://www.quartile.co>`_: | ||
|
||
* Aung Ko Ko Lin | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from . import res_company | ||
from . import res_config_settings | ||
from . import stock_move_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2024 Quartile | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
lock_qty_done = fields.Boolean( | ||
string="Limit Updates to Done Quantity After Validation", | ||
help="Only users in the 'Can Edit Done Quantity for Done Stock Moves' group" | ||
" are allowed to edit the 'done' quantity for validated transfer.", | ||
) |
16 changes: 16 additions & 0 deletions
16
stock_move_line_lock_qty_done/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024 Quartile | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
lock_qty_done = fields.Boolean( | ||
related="company_id.lock_qty_done", | ||
readonly=False, | ||
string="Limit Updates to Done Quantity After Validation", | ||
help="Only users in the 'Can Edit Done Quantity for Done Stock Moves' group" | ||
" are allowed to edit the 'done' quantity for validated transfer.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
To configure this module, you need to add the users allowed to edit the done quntity | ||
for done moves to the group "Can edit done quantity for done stock moves" | ||
|
||
Enable the 'Limit Updates to Done Quantity After Validation' option under 'Inventory > Settings' to restrict the ability to modify the done quantity for validated stock moves. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
* Souheil Bejaoui <[email protected]> | ||
* `Quartile <https://www.quartile.co>`_: | ||
|
||
* Aung Ko Ko Lin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
This module limits the capability to modify the done quantity for stock moves | ||
once they have been validated. | ||
This module can limit the ability to modify the done quantity of stock moves once they are validated, | ||
configurable per company through the settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
stock_move_line_lock_qty_done/views/res_config_settings_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_stock_config_settings" model="ir.ui.view"> | ||
<field name="name">res.config.settings</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="stock.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='warning_info']" position="after"> | ||
<div class="col-12 col-lg-6 o_setting_box" id="lock_qty_done"> | ||
<div class="o_setting_left_pane"> | ||
<field name="lock_qty_done" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="lock_qty_done" /> | ||
<div class="text-muted"> | ||
Only users in the 'Can Edit Done Quantity for Done Stock Moves' group are allowed to edit the 'done' quantity for validated transfer. | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |