解决冲突

This commit is contained in:
胡尧
2025-02-20 13:51:24 +08:00
55 changed files with 760 additions and 751 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

@@ -132,7 +132,7 @@ class ReSaleOrder(models.Model):
'name': '%s/%s/%s/%s/%s/%s' % (
self.format_float(product.model_long),
self.format_float(product.model_width),
self.format_float(product.model_height),
self.format_float(product.model_height),
self.format_float(product.model_volume),
machining_accuracy_name,
product.materials_id.name),

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

@@ -1,3 +1,11 @@
.purchase_order_list_name {
min-width: 62px !important;
}
.o_list_renderer .o_list_table .o_data_row td.o_data_cell.o_field_cell.o_list_char.section_and_note_text, .section_and_note_text span{
white-space: wrap!important;
overflow: auto!important;
text-overflow: unset!important;
word-wrap: break-word;
word-break: break-all;
}

View File

@@ -139,7 +139,7 @@
</field>
<xpath expr="//field[@name='date_order']" position="after">
<field name="payment_term_id" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}" options="{'no_create': True}"/>
<field name="contract_summary"/>
<!-- <field name="contract_summary"/>-->
</xpath>
<field name="partner_ref" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['purchase'])]}

View File

@@ -112,6 +112,7 @@
<xpath expr="//field[@name='order_line']/tree/field[@name='product_template_id']" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
<attribute name="context">{'is_sale_order_line': True }</attribute>
<attribute name="class">section_and_note_text</attribute>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
@@ -122,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>