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