GoodERP
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

32 Zeilen
1.0KB

  1. # -*- coding: utf-8 -*-
  2. from odoo import models, fields, api
  3. class ReportStockTransceive(models.TransientModel):
  4. _inherit = 'report.stock.transceive'
  5. specification = fields.Char('规格型号', help='规格型号,如果商品有产品图纸,此处填写产品图号', translate=True)
  6. def select_sql(self, sql_type='out'):
  7. res = super().select_sql(sql_type)
  8. return res + ',goods.specification as specification '
  9. def group_sql(self, sql_type='out'):
  10. res = super().group_sql(sql_type)
  11. return res + ',goods.specification '
  12. def get_record_key(self, record, sql_type='out'):
  13. return (
  14. str(record.get('goods', '')),
  15. str(record.get('uom', '')),
  16. str(record.get('warehouse', '')),
  17. record.get('attribute', ''),
  18. record.get('code', ''),
  19. str(record.get('specification', {}) or {}))
  20. def unzip_record_key(self, key):
  21. res = super().unzip_record_key(key)
  22. res.update({'specification': key[5]})
  23. return res
上海开阖软件有限公司 沪ICP备12045867号-1