Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][MIG] stock reserve #883

Closed
wants to merge 87 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
5ce92f5
[ADD] started a generic stock reservation module (stock_reserve), it …
guewen Sep 5, 2013
74ab8e6
[IMP] stock_reserve: add views, now able to reserve and release a mov…
guewen Sep 5, 2013
04c0d81
[IMP] stock_reserve: views, keep the stock reservation after release
guewen Sep 5, 2013
54764bb
[ADD] cron which lift the reservation with an passed validity date
guewen Sep 5, 2013
9c22a5a
[ADD] security file
guewen Sep 5, 2013
524da55
[ADD] button to open the reservation move
guewen Sep 5, 2013
5d7b19a
[FIX] open the reservation move in form view
guewen Sep 5, 2013
8658add
[CHG] views refinements
guewen Sep 5, 2013
603bf81
[ADD] link on the form view to display or create the stock reservations
guewen Sep 5, 2013
25c32bd
[CHG] the location_id and location_dest_id are now only default value…
guewen Sep 5, 2013
db8f04a
[ADD] started stock_reserve_sale to reserve lines of quotations
guewen Sep 5, 2013
f6024aa
[FIX] the move should be assigned and not done: items are not physica…
guewen Sep 6, 2013
9d4c156
[IMP] continued the stock_reserve_sale module
guewen Sep 6, 2013
aebac44
[ADD] test for the reservation
guewen Sep 9, 2013
b65c6af
[IMP] description in __openerp__.py
guewen Sep 10, 2013
787221f
mark unported module as uninstallable
gurneyalex Jul 1, 2014
aa32a66
reactivate module stock_reserve
yvaucher Sep 1, 2014
8320e38
port models and method to api 8.0
yvaucher Sep 1, 2014
83640a6
port onchanges
yvaucher Sep 1, 2014
c66f961
change type to stock.picking.type
yvaucher Sep 1, 2014
3197683
improve descriptor
yvaucher Sep 1, 2014
6c38cfd
improve action_view_reservations from product
yvaucher Sep 1, 2014
bfddc37
replace product_qty by product_uom_qty
yvaucher Sep 1, 2014
8a2039b
fix default_get to ensure product_qty is not set
yvaucher Sep 3, 2014
0780497
some products' fields moved in stock_accout. removing them to make th…
yvaucher Sep 3, 2014
f2bfd91
fix flake8 warnings
gurneyalex Sep 8, 2014
f577220
update test
gurneyalex Sep 8, 2014
f89803d
more stock_reserve tests
gurneyalex Sep 8, 2014
52c979c
product_reserve: test orderpoint
gurneyalex Sep 8, 2014
fc2875e
fix typo in docstring
gurneyalex Sep 8, 2014
0a7ba36
add test for expiration of reservations
gurneyalex Sep 8, 2014
6031c82
fix button to open related move
yvaucher Sep 8, 2014
8629bc6
fix domain using list instead of string
yvaucher Sep 8, 2014
8c6005b
the reservation should reserve a quant
lepistone Nov 26, 2014
5f14ced
refactor: get rid of move_recs
lepistone Nov 26, 2014
126b434
[UPD] move out from unported to 8 for update
gfcapalbo Nov 18, 2014
1c0371f
[ADD] removed view
gfcapalbo Feb 18, 2015
f4ef9a9
[FIX] Stock_reserve change revert
gfcapalbo Feb 25, 2015
8e2a55b
Update product.xml
gfcapalbo Feb 25, 2015
39ff073
Update product.xml
gfcapalbo Feb 25, 2015
9aa0252
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
94d3262
fix #42: reserve location should be outside WH
lepistone Mar 17, 2015
c05e737
bump and migrate
lepistone Mar 20, 2015
d4f7c99
find XML id by module, name
lepistone Mar 24, 2015
5fc7bc0
make stock_reserve owner-aware
lepistone Mar 17, 2015
2d55c52
fix crash: excepted singleton
lepistone Mar 20, 2015
41ef21e
fix reservation_count computation
lepistone Mar 30, 2015
828254d
refactor: delegate to variants, use self.id
lepistone Mar 30, 2015
fa2233c
refactor tests, improve failures
lepistone Mar 30, 2015
8313733
Added the translation template file and Finnish translations to stock…
mlaitinen Apr 23, 2015
52fca5b
show reservation location in tree and groupby
lepistone May 11, 2015
371494a
Add README.rst and remove description from __openerp__.py
Jun 1, 2015
62ebc30
Multiple reservations can now be released at once. This fixes issue #50.
mlaitinen Apr 25, 2015
fb7bda4
Replaced for loop in release() with mapped()
mlaitinen Jul 19, 2015
30e16eb
Add Spanish translation of stock reserve modules
Jul 30, 2015
1243db5
Change translation stock/existencias
Jul 30, 2015
b3b2964
update travis config, setup transifex
gurneyalex Sep 15, 2015
d54d3f6
force recomputation of stock.location hierachy
gurneyalex Sep 15, 2015
31b8287
OCA Transbot updated translations from Transifex
oca-transbot Oct 5, 2015
fc70d15
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
fcde867
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
0cfe03c
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
0d92d3c
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
b5bc09d
stock_reserve: migration to 10.0
Jan 5, 2017
f8f4663
stock_reserve: new way of getting action in python code
Jan 6, 2017
b0ecf39
stock_reserve: Take Picking Out as default type as internal pickings …
Jan 6, 2017
e2c5907
stock_reserve: show reservation button on product for stockable only
Jan 6, 2017
dbf60d4
stock_reserve: test migration to 10.0
Jan 6, 2017
8555bbc
stock_reserve: fix wrong inherit template for product form
Apr 24, 2017
d4d29c9
stock_reserve: drop superfluous None for dicts .get
Apr 24, 2017
d47c148
stock_reserve: add option for Employees to read stock.reservation. Wi…
Apr 24, 2017
c2a2398
OCA Transbot updated translations from Transifex
oca-transbot Jul 29, 2017
d54815a
OCA Transbot updated translations from Transifex
oca-transbot Dec 2, 2017
ecfceab
OCA Transbot updated translations from Transifex
oca-transbot Jan 17, 2018
90c2e1b
OCA Transbot updated translations from Transifex
oca-transbot Mar 3, 2018
c8cc263
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
72b7d82
[UPD] Update stock_reserve.pot
oca-travis Jun 18, 2018
7a7f022
[UPD] Update stock_reserve.pot
oca-travis Jan 29, 2019
d5fb364
Update translation files
oca-transbot Jan 29, 2019
d421b48
[UPD] Update stock_reserve.pot
oca-travis Feb 8, 2019
d836811
Update translation files
oca-transbot Feb 8, 2019
9735c19
[ADD] icon.png
OCA-git-bot Apr 3, 2019
d9bfe00
[UPD] Update stock_reserve.pot
oca-travis Sep 30, 2019
4b585e8
Update translation files
oca-transbot Sep 30, 2019
13a4597
[MIG] stock_reserve: Migration to 11.0
RodrigoBM Apr 16, 2020
582c643
[FIX] stock_reserve
RodrigoBM Apr 17, 2020
2a968ac
[FIX] stock_reserve: fix reserve deleted records
Aug 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions stock_reserve/README.rst
Expand Up @@ -84,6 +84,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_request>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
7 changes: 6 additions & 1 deletion stock_reserve/model/product.py
Expand Up @@ -25,6 +25,8 @@ def action_view_reservations(self):
action_dict['domain'] = [('product_id', 'in', product_ids)]
action_dict['context'] = {
'search_default_draft': 1,
'search_default_partially_available': 1,
'search_default_confirmed': 1,
'search_default_reserved': 1
}
return action_dict
Expand All @@ -42,7 +44,8 @@ def _compute_reservation_count(self):
for product in self:
domain = [
('product_id', '=', product.id),
('state', 'in', ['draft', 'assigned'])]
('state', 'in', [
'draft', 'partially_available', 'confirmed', 'assigned'])]
reservations = self.env['stock.reservation'].search(domain)
product.reservation_count = sum(reservations.mapped('product_qty'))

Expand All @@ -54,6 +57,8 @@ def action_view_reservations(self):
action_dict['domain'] = [('product_id', '=', self.id)]
action_dict['context'] = {
'search_default_draft': 1,
'search_default_partially_available': 1,
'search_default_confirmed': 1,
'search_default_reserved': 1
}
return action_dict
4 changes: 2 additions & 2 deletions stock_reserve/model/stock_reserve.py
Expand Up @@ -120,7 +120,7 @@ def reserve(self):
A date until which the product is reserved can be specified.
"""
self.write({'date_expected': fields.Datetime.now()})
self.mapped('move_id')._action_confirm()
self.mapped('move_id')._action_confirm(merge=False)
self.mapped('move_id.picking_id').action_assign()
return True

Expand All @@ -137,7 +137,7 @@ def release_validity_exceeded(self, ids=None):
""" Release all the reservation having an exceeded validity date """
domain = [
('date_validity', '<', fields.date.today()),
('state', '=', 'assigned')]
('state', 'in', ('assigned', 'partially_available', 'confirmed'))]
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RodrigoBM Why changing this ?

if ids:
domain.append(('id', 'in', ids))
self.search(domain).release()
Expand Down
17 changes: 12 additions & 5 deletions stock_reserve/view/stock_reserve.xml
Expand Up @@ -14,11 +14,11 @@
<button name="release" type="object"
string="Release"
class="oe_highlight"
states="assigned,confirmed,done"/>
states="assigned,partially_available,confirmed,done"/>
<button name="open_move" type="object"
string="View Reservation Move"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,assigned"/>
statusbar_visible="draft,assigned,cancel"/>
</header>
<sheet>
<group>
Expand Down Expand Up @@ -55,8 +55,7 @@
<field name="name">stock.reservation.tree</field>
<field name="model">stock.reservation</field>
<field name="arch" type="xml">
<tree string="Stock Reservations"
colors="blue:state == 'draft';grey:state == 'cancel'" >
<tree string="Stock Reservations" >
<field name="name" />
<field name="product_id" />
<field name="move_id" />
Expand All @@ -76,7 +75,7 @@
type="object"
help="Release"
icon="fa-cogs"
states="assigned,confirmed,done"
states="assigned,partially_available,confirmed,done"
/>
</tree>
</field>
Expand All @@ -90,6 +89,12 @@
<filter name="draft" string="Draft"
domain="[('state', '=', 'draft')]"
help="Not already reserved"/>
<filter name="partially_available" string="Partially Available"
domain="[('state', '=', 'partially_available')]"
help="Partially Available"/>
<filter name="confirmed" string="Waiting Availability"
domain="[('state', '=', 'confirmed')]"
help="Waiting Availability"/>
<filter name="reserved" string="Reserved"
domain="[('state', '=', 'assigned')]"
help="Moves are reserved."/>
Expand Down Expand Up @@ -126,6 +131,8 @@
<field name="search_view_id" ref="view_stock_reservation_search"/>
<field name="context">{
'search_default_draft': 1,
'search_default_partially_available': 1,
'search_default_confirmed': 1,
'search_default_reserved': 1,
'search_default_groupby_product': 1}</field>
<field name="help" type="html">
Expand Down