pos_session.py 692 B

123456789101112131415161718
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import fields, models
  4. from odoo.osv.expression import OR
  5. class PosSession(models.Model):
  6. _inherit = 'pos.session'
  7. crm_team_id = fields.Many2one('crm.team', related='config_id.crm_team_id', string="Sales Team", readonly=True)
  8. def _loader_params_product_product(self):
  9. result = super()._loader_params_product_product()
  10. result['search_params']['domain'] = OR([result['search_params']['domain'], [('id', '=', self.config_id.down_payment_product_id.id)]])
  11. result['search_params']['fields'].extend(['invoice_policy', 'type'])
  12. return result