Skip to content

Commit

Permalink
temp rebasing PR 455 (2c9d2da)
Browse files Browse the repository at this point in the history
  • Loading branch information
roboadhoc committed Mar 4, 2024
2 parents 9c6905d + 2c9d2da commit 46e0c6d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions stock_orderpoint_manual_update/models/stock_orderpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@ def _get_orderpoint_products(self):

return self.env['product.product'].search(domain)



class StockLocation(models.Model):
_inherit = "stock.location"

# Heredamos método search para filtrar las ubicaciones que se usan en _get_orderpoint_action().
# TODO: mejorar si Odoo mezcla PR: https://github.com/odoo/odoo/pull/150256
@api.model
def search(self, domain, offset=0, limit=None, order=None, count=False):
def _get_orderpoint_locations(self):
domain = [('replenish_location', '=', True)]
# Filter by locations
location_ids = self._context.get('filter_locations')
if location_ids:
domain.append(('id', 'in', location_ids))
return super().search(domain, offset=offset, limit=limit, order=order, count=count)
return self.env['stock.location'].search(domain)

0 comments on commit 46e0c6d

Please sign in to comment.