配合前端列数修改
This commit is contained in:
@@ -140,6 +140,8 @@ class QualityCheck(models.Model):
|
|||||||
# 总数量,值为调拨单_产品明细_数量
|
# 总数量,值为调拨单_产品明细_数量
|
||||||
total_qty = fields.Char('总数量', compute='_compute_total_qty')
|
total_qty = fields.Char('总数量', compute='_compute_total_qty')
|
||||||
|
|
||||||
|
column_nums = fields.Integer('测量值列数', default=1)
|
||||||
|
|
||||||
@api.depends('picking_id')
|
@api.depends('picking_id')
|
||||||
def _compute_total_qty(self):
|
def _compute_total_qty(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -204,7 +206,7 @@ class QualityCheck(models.Model):
|
|||||||
], string='发布状态', default='draft')
|
], string='发布状态', default='draft')
|
||||||
|
|
||||||
def add_measure_line(self):
|
def add_measure_line(self):
|
||||||
self.total_qty = self.total_qty + 1
|
self.column_nums = self.column_nums + 1
|
||||||
"""
|
"""
|
||||||
新增测量值,如果测量值有5列了,则提示“最多只能有5列测量值”
|
新增测量值,如果测量值有5列了,则提示“最多只能有5列测量值”
|
||||||
"""
|
"""
|
||||||
@@ -216,7 +218,7 @@ class QualityCheck(models.Model):
|
|||||||
# })
|
# })
|
||||||
|
|
||||||
def remove_measure_line(self):
|
def remove_measure_line(self):
|
||||||
self.total_qty = self.total_qty - 1
|
self.column_nums = self.column_nums - 1
|
||||||
"""
|
"""
|
||||||
删除测量值
|
删除测量值
|
||||||
"""
|
"""
|
||||||
@@ -770,7 +772,7 @@ class QualityCheckMeasureLine(models.Model):
|
|||||||
measure_value5 = fields.Char('测量值5')
|
measure_value5 = fields.Char('测量值5')
|
||||||
|
|
||||||
# 展示列数
|
# 展示列数
|
||||||
show_colomn_number = fields.Integer('展示列数', default=1)
|
column_nums = fields.Integer('列数', related='check_id.column_nums')
|
||||||
|
|
||||||
# 判定结果
|
# 判定结果
|
||||||
measure_result = fields.Selection([
|
measure_result = fields.Selection([
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ patch(ListRenderer.prototype, 'custom_measure_line_tree_patch', {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const $dom = $(this.__owl__.bdom.el)
|
const $dom = $(this.__owl__.bdom.el)
|
||||||
const $thead = $dom.find('thead').find('th');
|
const $thead = $dom.find('thead').find('th');
|
||||||
const $total_qty = this.props.list.records[0].data.total_qty;
|
const $total_qty = this.props.list.records[0].data.column_nums;
|
||||||
const hideKey = []
|
const hideKey = []
|
||||||
const width = $dom.find('[data-name=measure_value1]').width();
|
const width = $dom.find('[data-name=measure_value1]').width();
|
||||||
$thead.each(function () {
|
$thead.each(function () {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="sequence"/>
|
<field name="sequence"/>
|
||||||
<field name="total_qty"/>
|
<field name="column_nums"/>
|
||||||
<field name="measure_item"/>
|
<field name="measure_item"/>
|
||||||
<field name="measure_value1"/>
|
<field name="measure_value1"/>
|
||||||
<field name="measure_value2"/>
|
<field name="measure_value2"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user