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.

49 lines
1.8KB

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