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.

29 lines
1.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import models, api
  5. class ResConfigSettings(models.TransientModel):
  6. _inherit = 'res.config.settings'
  7. def _partner_names_order_selection(self):
  8. options = super(
  9. ResConfigSettings, self)._partner_names_order_selection()
  10. new_labels = {
  11. 'last_first': 'Lastname SecondLastname Firstname',
  12. 'last_first_comma': 'Lastname SecondLastname, Firstname',
  13. 'first_last': 'Firstname Lastname SecondLastname',
  14. }
  15. return [(k, new_labels[k]) if k in new_labels else (k, v)
  16. for k, v in options]
  17. @api.multi
  18. def _partners_for_recalculating(self):
  19. return self.env['res.partner'].search([
  20. ('is_company', '=', False),
  21. '|', '&', ('firstname', '!=', False), ('lastname', '!=', False),
  22. '|', '&', ('firstname', '!=', False), ('lastname2', '!=', False),
  23. '&', ('lastname', '!=', False), ('lastname2', '!=', False),
  24. ])