You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
744 B

  1. # Copyright (C) 2018 - Today: GRAP (http://www.grap.coop)
  2. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import api, fields, models
  5. class StockPicking(models.Model):
  6. _inherit = 'stock.picking'
  7. # Columns section
  8. partner_name = fields.Char(
  9. related='partner_id.name', store=True)
  10. @api.model
  11. def _prepare_filter_query_for_pos(self, pos_session_id, query):
  12. # Overwrite original function, replacing
  13. # partner_id field by partner_name
  14. return [
  15. '|', '|',
  16. ('name', 'ilike', query),
  17. ('origin', 'ilike', query),
  18. ('partner_name', 'ilike', query),
  19. ]