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.

41 lines
1.2 KiB

  1. from odoo import api, models, fields
  2. class PosConfig(models.Model):
  3. _inherit = "pos.config"
  4. iface_tare_method = fields.Selection(
  5. [
  6. ("manual", "Input the tare manually"),
  7. ("barcode", "Scan a barcode to set the tare"),
  8. ("both", "Manual input and barcode"),
  9. ],
  10. string="Tare Input Method",
  11. default="both",
  12. required=True,
  13. help="Select tare method:\n"
  14. "* 'manual' : the scale screen has an extra tare input field;\n"
  15. "* 'barecode' : (scan a barcode to tare the selected order line;\n"
  16. "* 'both' : manual input and barcode methods are enabled;",
  17. )
  18. iface_gross_weight_method = fields.Selection(
  19. [
  20. ("manual", "Input the Gross Weight manually"),
  21. ("scale", "Input Gross Weight via Scale")
  22. ],
  23. string="Gross Weight Input Method",
  24. default="scale",
  25. required=True,
  26. )
  27. iface_tare_uom_id = fields.Many2one(
  28. string="Unit of Measure of the tare",
  29. comodel_name="uom.uom",
  30. default=lambda s: s._default_iface_tare_uom_id(),
  31. required=True,
  32. )
  33. @api.model
  34. def _default_iface_tare_uom_id(self):
  35. return self.env.ref("uom.product_uom_kgm")