GoodERP
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.

47 lines
1.8KB

  1. # Copyright 2016 上海开阖软件有限公司 (http://www.osbzr.com)
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import fields, models, api
  4. class BuyOrderTrack(models.TransientModel):
  5. _name = 'buy.order.track'
  6. _description = '采购订单跟踪表'
  7. goods_code = fields.Char('商品编码')
  8. goods_id = fields.Many2one('goods', '商品名称')
  9. attribute = fields.Char('属性')
  10. uom = fields.Char('单位')
  11. date = fields.Date('订单日期')
  12. order_name = fields.Char('采购订单编号')
  13. partner_id = fields.Many2one('partner', '供应商')
  14. warehouse_dest_id = fields.Many2one('warehouse', '仓库')
  15. goods_state = fields.Char('状态')
  16. qty = fields.Float('数量',
  17. digits='Quantity')
  18. amount = fields.Float('采购额',
  19. digits='Amount') # 商品的价税合计
  20. qty_not_in = fields.Float('未入库数量',
  21. digits='Quantity')
  22. planned_date = fields.Date('要求交货日期')
  23. wh_in_date = fields.Date('入库日期')
  24. note = fields.Char('备注')
  25. type = fields.Selection([('buy', '采购'),('return', '退货')], string='单据类型')
  26. def view_detail(self):
  27. '''查看明细按钮'''
  28. self.ensure_one()
  29. order = self.env['buy.order'].search([('name', '=', self.order_name)])
  30. if order:
  31. view = self.env.ref('buy.buy_order_form')
  32. return {
  33. 'name': '采购订单',
  34. '': 'form',
  35. 'view_mode': 'form',
  36. 'view_id': False,
  37. 'views': [(view.id, 'form')],
  38. 'res_model': 'buy.order',
  39. 'type': 'ir.actions.act_window',
  40. 'res_id': order.id,
  41. }
上海开阖软件有限公司 沪ICP备12045867号-1