-
-
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 ba4bd44
Showing
12 changed files
with
85 additions
and
4 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 |
---|---|---|
|
@@ -42,6 +42,9 @@ 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" | ||
|
||
|
||
If necessary, update the "Limit Updates to Done Quantity After Validation" under "Inventory > Settings" to enable or disable limits the capability to modify the done quantity for validated stock moves (enabled by default). | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
|
@@ -64,6 +67,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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<function model="res.company" name="write"> | ||
<value model="res.company" search="[]" /> | ||
<value eval="{'lock_qty_done': False}" /> | ||
</function> |
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,15 @@ | ||
# 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( | ||
default=True, | ||
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,5 @@ | ||
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" | ||
|
||
|
||
If necessary, update the "Limit Updates to Done Quantity After Validation" under "Inventory > Settings" to enable or disable limits the capability to modify the done quantity for validated stock moves (enabled by default). |
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
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> |