mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add new module patches to add quantity_field in compute_quantities_query()
This commit is contained in:
parent
24f02e006d
commit
dfd05fa963
32
sale_number_of_packages.diff
Normal file
32
sale_number_of_packages.diff
Normal file
|
@ -0,0 +1,32 @@
|
|||
diff -r 8eadb6e76468 trytond/trytond/modules/sale_number_of_packages/stock.py
|
||||
--- a/trytond/trytond/modules/sale_number_of_packages/stock.py Mon Dec 03 16:38:23 2018 +0100
|
||||
+++ b/trytond/trytond/modules/sale_number_of_packages/stock.py Wed Dec 12 14:45:49 2018 +0100
|
||||
@@ -179,7 +179,8 @@
|
||||
|
||||
@classmethod
|
||||
def compute_quantities_query(cls, location_ids, with_childs=False,
|
||||
- grouping=('product',), grouping_filter=None):
|
||||
+ grouping=('product',), grouping_filter=None,
|
||||
+ quantity_field='internal_quantity'):
|
||||
pool = Pool()
|
||||
Lot = pool.get('stock.lot')
|
||||
lot = Lot.__table__()
|
||||
@@ -187,7 +188,8 @@
|
||||
if not Transaction().context.get('normalized_number_of_packages'):
|
||||
return super(Move, cls).compute_quantities_query(
|
||||
location_ids, with_childs=with_childs, grouping=grouping,
|
||||
- grouping_filter=grouping_filter)
|
||||
+ grouping_filter=grouping_filter,
|
||||
+ quantity_field=quantity_field)
|
||||
|
||||
new_grouping = grouping[:]
|
||||
new_grouping_filter = (grouping_filter[:] if grouping_filter != None
|
||||
@@ -199,7 +201,8 @@
|
||||
|
||||
query = super(Move, cls).compute_quantities_query(
|
||||
location_ids, with_childs=with_childs, grouping=new_grouping,
|
||||
- grouping_filter=new_grouping_filter)
|
||||
+ grouping_filter=new_grouping_filter,
|
||||
+ quantity_field=quantity_field)
|
||||
if not query:
|
||||
return query
|
9
series
9
series
|
@ -19,8 +19,13 @@ improve_performance_on_try_assign.diff # [stock] change browse of product to get
|
|||
|
||||
issue240_631.diff # [stock_lot] stock_by_locations get all locations with that lot.
|
||||
issue10467.diff # stock_lot: add lot to grouping if lot it's required on product
|
||||
issue53451002_1_10001.diff #stock: Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
stock_lot_sled.diff #stock_lot_sled: Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
|
||||
issue53451002_1_10001.diff # [stock] Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
sale_number_of_packages.diff # [sale_number_of_packages] Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
stock_external_party.diff # [stock_external_party] Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
stock_lot_deactivatable.diff # [stock_lot_deactivatable] Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
stock_lot_sled.diff # [stock_lot_sled] Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages
|
||||
|
||||
issue7826.diff # [stock_package] Total packages moves are all
|
||||
lock_stock_move.diff # [stock] Function to overwrite if lock table or not
|
||||
issue7856.diff # [stock] Can't move qty from a parent location to child location
|
||||
|
|
22
stock_external_party.diff
Normal file
22
stock_external_party.diff
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff -r f7f8e7da9dd8 trytond/trytond/modules/stock_external_party/stock.py
|
||||
--- a/trytond/trytond/modules/stock_external_party/stock.py Tue Dec 04 13:36:33 2018 +0100
|
||||
+++ b/trytond/trytond/modules/stock_external_party/stock.py Wed Dec 05 16:24:09 2018 +0100
|
||||
@@ -155,7 +155,8 @@
|
||||
|
||||
@classmethod
|
||||
def compute_quantities_query(cls, location_ids, with_childs=False,
|
||||
- grouping=('product',), grouping_filter=None):
|
||||
+ grouping=('product',), grouping_filter=None,
|
||||
+ quantity_field='internal_quantity'):
|
||||
context = Transaction().context
|
||||
|
||||
new_grouping = grouping[:]
|
||||
@@ -168,7 +169,7 @@
|
||||
|
||||
query = super(Move, cls).compute_quantities_query(
|
||||
location_ids, with_childs=with_childs, grouping=new_grouping,
|
||||
- grouping_filter=new_grouping_filter)
|
||||
+ grouping_filter=new_grouping_filter, quantity_field=quantity_field)
|
||||
return query
|
||||
|
||||
@classmethod
|
20
stock_lot_deactivatable.diff
Normal file
20
stock_lot_deactivatable.diff
Normal file
|
@ -0,0 +1,20 @@
|
|||
diff -r c8f4cfc59666 trytond/trytond/modules/stock_lot_deactivatable/stock.py
|
||||
--- a/trytond/trytond/modules/stock_lot_deactivatable/stock.py Wed Dec 12 15:46:19 2018 +0100
|
||||
+++ b/trytond/trytond/modules/stock_lot_deactivatable/stock.py Wed Dec 12 15:50:28 2018 +0100
|
||||
@@ -82,13 +82,14 @@
|
||||
|
||||
@classmethod
|
||||
def compute_quantities_query(cls, location_ids, with_childs=False,
|
||||
- grouping=('product',), grouping_filter=None):
|
||||
+ grouping=('product',), grouping_filter=None,
|
||||
+ quantity_field='internal_quantity'):
|
||||
pool = Pool()
|
||||
Lot = pool.get('stock.lot')
|
||||
Period = pool.get('stock.period')
|
||||
query = super(Move, cls).compute_quantities_query(
|
||||
location_ids, with_childs=with_childs, grouping=grouping,
|
||||
- grouping_filter=grouping_filter)
|
||||
+ grouping_filter=grouping_filter, quantity_field=quantity_field)
|
||||
|
||||
if not query or 'lot' not in grouping:
|
||||
return query
|
Loading…
Reference in a new issue