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.

22 lines
787 B

  1. # Copyright 2020 Coop IT Easy - Manuel Claeys Bouuaert
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import fields, models
  4. class PosConfig(models.Model):
  5. _inherit = 'pos.config'
  6. pos_price_to_weight_price_field_id = fields.Many2one(
  7. string="Price To Weight Field",
  8. comodel_name="ir.model.fields",
  9. domain=[("model", "=", "product.product"), ("ttype", "=", "float")],
  10. required=True,
  11. default=lambda x: x._default_pos_price_to_weight_price_field_id(),
  12. )
  13. pos_price_to_weight_price_field_name = fields.Char(
  14. related="pos_price_to_weight_price_field_id.name")
  15. def _default_pos_price_to_weight_price_field_id(self):
  16. return self.env.ref("product.field_product_product__list_price")