合并销售订单列,修改必填*展示方法,

This commit is contained in:
hyyy
2025-02-17 16:03:14 +08:00
parent 1e3f8f005e
commit 69c5996db7
6 changed files with 66 additions and 16 deletions

View File

@@ -28,6 +28,7 @@
'web.assets_backend': [
'sf_sale/static/js/setTableWidth.js',
'sf_sale/static/src/css/purchase_list.css',
'sf_sale/static/lib/*',
]
},
'demo': [

View File

@@ -0,0 +1,18 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { registry } from "@web/core/registry";
export class MergeField extends Component {
get mergeValue() {
const data = this.props.record.data;
const v = data?.product_uom_qty
const unit = data?.product_uom[1]
return `${v} ${unit}`
}
}
MergeField.template = "jikimo_sf.MergeField";
registry.category("fields").add("merge_field", MergeField);

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="jikimo_sf.MergeField" owl="1">
<span t-esc="mergeValue"/>
</t>
</templates>

View File

@@ -123,6 +123,13 @@
<field name="manual_quotation" readonly="1"/>
<field name="is_incoming_material" readonly="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom_qty']" position="replace">
<field name="product_uom_qty" string="数量" widget="merge_field" optional="show" />
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<field name="user_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>