GoodERP
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
1.5KB

  1. from odoo import fields, models, api
  2. class CustomerGoods(models.Model):
  3. _name = 'customer.goods'
  4. _description = '客户供货价格表'
  5. _order = 'sequence,date desc,min_qty desc'
  6. sequence = fields.Integer('优先级')
  7. goods_id = fields.Many2one('goods', '商品', required=True, ondelete='cascade', help='商品')
  8. customer_id = fields.Many2one(
  9. string='客户',
  10. required=True,
  11. comodel_name='partner',
  12. domain=[('c_category_id', '!=', False)],
  13. ondelete='cascade',
  14. help='客户',
  15. )
  16. price = fields.Float('价格', digits='Price', help='给客户供货的价格')
  17. code = fields.Char('客户品号', help='客户提供的商品编号')
  18. name = fields.Char('客户品名', help='客户提供的商品名称')
  19. min_qty = fields.Float('起订量', digits='Quantity', help='销售商品时,大于或等于起订量时,商品的价格才取该行的销售价')
  20. date = fields.Date('生效日期')
  21. note = fields.Text('备注')
  22. company_id = fields.Many2one('res.company', '公司', change_default=True, default=lambda self: self.env.company)
  23. class Partner(models.Model):
  24. _inherit = 'partner'
  25. customer_goods_ids = fields.One2many('customer.goods', 'customer_id', '销售商品', help='给客户的基于起订量的销售商品价格表')
  26. class Goods(models.Model):
  27. _inherit = 'goods'
  28. customer_ids = fields.One2many('customer.goods', 'goods_id', '销售价格', help='给各客户的基于起订量的销售价格表')
上海开阖软件有限公司 沪ICP备12045867号-1