-
-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] product_lot_sequence: add lot_sequence_padding configuration,vi…
…ews adjustment - Make number of digits to be set on products for sequence generation configurable. - Fix a minor issue of _compute_display_lot_sequence_fields() not running before product is created. - Make lot_sequence_prefix and lot_sequence_padding invisible when lot_sequence_id is assigned to the product (since these values are no longer relevant once the sequence is generated.
- Loading branch information
1 parent
6465bf9
commit 70524bc
Showing
11 changed files
with
125 additions
and
21 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ Product Lot Sequence | |
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:043a59e32b82ffdcafdd494fdb97e28127e8489913d173aefed770e79efc18ce | ||
!! source digest: sha256:b40154ba5f1de85d89cb1c8da85a999bd0cd850538e477e4eb0d9a7272af0bbd | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
|
@@ -38,6 +38,9 @@ Adds ability to define a lot sequence from the product which will be proposed up | |
Configuration | ||
============= | ||
|
||
Lot Sequence policy | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
There are two ways you can configure this module through the use of System Parameter | ||
`product_lot_sequence.policy`: | ||
|
||
|
@@ -52,6 +55,12 @@ If any other value is used for this System Parameter, then you will get the defa | |
behaviour from odoo 15.0 which will look for the last lot number for each product and | ||
will increment it. | ||
|
||
Default Number of Digits for Product Sequence Generation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The default is 7 digits. To change that to something else, go to the inventory | ||
configuration, find "Sequence Number of Digits" and change the number. | ||
|
||
Usage | ||
===== | ||
|
||
|
@@ -103,6 +112,9 @@ Contributors | |
* Adria Gil Sorribes <[email protected]> | ||
* Domantas Girdžiūnas <[email protected]> | ||
* Akim Juillerat <[email protected]> | ||
* `Quartile <https://www.quartile.co>`__: | ||
|
||
* Yoshi Tashiro | ||
|
||
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,3 +1,5 @@ | ||
from . import res_company | ||
from . import res_config_settings | ||
from . import product | ||
from . import stock_production_lot | ||
from . import stock_move |
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,10 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
lot_sequence_padding = fields.Integer("Sequence Number of Digits", default=7) |
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,13 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
lot_sequence_padding = fields.Integer( | ||
related="company_id.lot_sequence_padding", | ||
readonly=False, | ||
) |
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,3 +1,6 @@ | ||
* Adria Gil Sorribes <[email protected]> | ||
* Domantas Girdžiūnas <[email protected]> | ||
* Akim Juillerat <[email protected]> | ||
* `Quartile <https://www.quartile.co>`__: | ||
|
||
* Yoshi Tashiro |
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
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.stock</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='production_lot_info']" position="inside"> | ||
<div class="col-12 col-lg-6 o_setting_box"> | ||
<div class="o_setting_right_pane"> | ||
<label for="lot_sequence_padding" /> | ||
<span | ||
class="fa fa-lg fa-building-o" | ||
title="Values set here are company-specific." | ||
aria-label="Values set here are company-specific." | ||
groups="base.group_multi_company" | ||
/> | ||
<div class="text-muted"> | ||
Default number of digits to be set on products for product lot/serial sequence generation. | ||
</div> | ||
<div class="content-group"> | ||
<div class="mt16"> | ||
<span><field | ||
name="lot_sequence_padding" | ||
class="oe_inline" | ||
/> digits</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |