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.

15 lines
501 B

  1. # copyright 2020 Akretion David BEAL
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import api, models
  4. class PosOrder(models.Model):
  5. _inherit = "pos.order"
  6. @api.model
  7. def create(self, vals):
  8. session = self.env["pos.session"].browse(vals.get("session_id"))
  9. if session.config_id.default_partner_id and not vals.get("partner_id"):
  10. vals["partner_id"] = session.config_id.default_partner_id.id
  11. return super().create(vals)