|
- # -*- coding: utf-8 -*-
-
- from odoo import models, fields, api
-
-
- class ReportStockTransceive(models.TransientModel):
- _inherit = 'report.stock.transceive'
-
- specification = fields.Char('规格型号', help='规格型号,如果商品有产品图纸,此处填写产品图号', translate=True)
-
- def select_sql(self, sql_type='out'):
- res = super().select_sql(sql_type)
- return res + ',goods.specification as specification '
-
- def group_sql(self, sql_type='out'):
- res = super().group_sql(sql_type)
- return res + ',goods.specification '
-
- def get_record_key(self, record, sql_type='out'):
- return (
- str(record.get('goods', '')),
- str(record.get('uom', '')),
- str(record.get('warehouse', '')),
- record.get('attribute', ''),
- record.get('code', ''),
- str(record.get('specification', {}) or {}))
-
- def unzip_record_key(self, key):
- res = super().unzip_record_key(key)
- res.update({'specification': key[5]})
- return res
|