Add product_cost_warehouse module
issue9312 review291641002
This commit is contained in:
1 parent
f0d5d5b117
commit
7a45f6dbee
2 files changed
+10
-3
No files matched your search
@@ -8,6 +8,10 @@ class AssignError(UserError):
|
||||
pass
|
||||
|
||||
|
||||
class MoveValidationError(ValidationError):
|
||||
pass
|
||||
|
||||
|
||||
class LocationValidationError(ValidationError):
|
||||
pass
|
||||
|
||||
|
||||
+6
-3
@@ -285,13 +285,16 @@ class Product(StockMixin, object, metaclass=PoolMeta):
|
||||
('state', '=', 'done'),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def _domain_storage_quantity(cls):
|
||||
"Returns the domain for locations to use in cost computation"
|
||||
return [('type', '=', 'storage')]
|
||||
|
||||
def _get_storage_quantity(self, date=None):
|
||||
pool = Pool()
|
||||
Location = pool.get('stock.location')
|
||||
|
||||
locations = Location.search([
|
||||
('type', '=', 'storage'),
|
||||
])
|
||||
locations = Location.search(self._domain_storage_quantity())
|
||||
if not date:
|
||||
date = datetime.date.today()
|
||||
location_ids = [l.id for l in locations]
|
||||
|
||||
Reference in new issue
Block a user