diff --git a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js b/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js index 836ee6d8..2be3365c 100644 --- a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js +++ b/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js @@ -11,7 +11,6 @@ export class Many2OneRadioField extends RadioField { // 你自己的代码 } - onImageClick(event) { // 放大图片逻辑 // 获取图片元素 @@ -47,7 +46,6 @@ export class Many2OneRadioField extends RadioField { return []; } } - } Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField" diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js index 5845dbae..a3053b72 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -15,23 +15,24 @@ export class MyCustomWidget extends Many2ManyCheckboxesField { // 放大图片逻辑 // 获取图片元素 const img = event.target; - const close = img.nextSibling + const close = img.nextSibling; // 实现放大图片逻辑 // 比如使用 CSS 放大 img.parentElement.classList.add('zoomed'); - close.classList.add('img_close') + close.classList.add('img_close'); } onCloseClick(event) { const close = event.target; - const img = close.previousSibling - img.parentElement.classList.remove('zoomed') - close.classList.remove('img_close') + const img = close.previousSibling; + img.parentElement.classList.remove('zoomed'); + close.classList.remove('img_close'); } } -MyCustomWidget.template = "jikimo_frontend.MyCustomWidget" +MyCustomWidget.template = "jikimo_frontend.MyCustomWidget"; // MyCustomWidget.supportedTypes = ['many2many']; registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget); + diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index a5f68479..c1ba8248 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -3,7 +3,7 @@ import {patch} from '@web/core/utils/patch'; // import { Dialog } from "@web/core/dialog/dialog"; import {_t} from "@web/core/l10n/translation"; -import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator" +import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator"; var Dialog = require('web.Dialog'); // var {patch} = require("web.utils") 这句话也行 diff --git a/jikimo_frontend/static/src/list/custom_width.js b/jikimo_frontend/static/src/list/custom_width.js index 31fd23ca..f7c1c55d 100644 --- a/jikimo_frontend/static/src/list/custom_width.js +++ b/jikimo_frontend/static/src/list/custom_width.js @@ -1,7 +1,7 @@ /** @odoo-module */ import {patch} from '@web/core/utils/patch'; -import {ListRenderer} from "@web/views/list/list_renderer" +import {ListRenderer} from "@web/views/list/list_renderer"; // var {patch} = require("web.utils") 这句话也行 @@ -17,7 +17,7 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { const table = this.tableRef.el; const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")]; - const column_num = headers.length + const column_num = headers.length; if (!this.columnWidths || !this.columnWidths.length) { // no column widths to restore @@ -66,8 +66,8 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { // } // 判断 this.state.columns 是否存在且长度大于零 - if (this.state.columns && this.state.columns.length > 0 && - this.state.columns[0].name === "sequence") { + if (this.state.columns && this.state.columns.length > 0 + && this.state.columns[0].name === "sequence") { widths[1] = { type: "relative", value: 0.1 }; } diff --git a/jikimo_frontend/static/src/views/list_nums/list_nbCols.js b/jikimo_frontend/static/src/views/list_nums/list_nbCols.js index b0bacb02..1403544f 100644 --- a/jikimo_frontend/static/src/views/list_nums/list_nbCols.js +++ b/jikimo_frontend/static/src/views/list_nums/list_nbCols.js @@ -8,4 +8,4 @@ patch(ListRenderer.prototype, '/jikimo_frontend/static/src/views/list_nums/list_ const nbCols = this._super(...arguments); return nbCols + 1; } -}); \ No newline at end of file +}); diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py index 493e739f..4ccb0db6 100644 --- a/sf_bf_connect/models/jd_eclp.py +++ b/sf_bf_connect/models/jd_eclp.py @@ -3,9 +3,9 @@ import logging from datetime import datetime import requests import cpca -from odoo.exceptions import UserError -from odoo.exceptions import ValidationError -from odoo import api, fields, models, SUPERUSER_ID, _ +# from odoo.exceptions import UserError +# from odoo.exceptions import ValidationError +from odoo import api, fields, models _logger = logging.getLogger(__name__) @@ -40,9 +40,22 @@ class JdEclp(models.Model): # bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf') # bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas') bill_show = fields.Binary(string='物流面单展示', readonly=True) + check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out') + + @api.depends('name') + def _check_is_out(self): + """ + 判断是否为出库单 + """ + if self.name: + is_check_out = self.name.split('/') + self.check_out = is_check_out[1] @api.depends('carrier_tracking_ref') def query_bill_pdf(self): + """ + 查询物流面单,并赋值给bill + """ self.bill = self.env['ir.attachment'].sudo().search([('name', '=', self.carrier_tracking_ref)]) @api.depends('origin') @@ -77,7 +90,6 @@ class JdEclp(models.Model): self.receiverTownName = self.receiverTownName except Exception as e: print(f"Error address is none: {e}") - pass def create_order(self): # sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)]) diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index f7b7dccd..d79b3369 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -212,7 +212,7 @@ class FinishStatusChange(models.Model): action['context'] = {'default_picking_ids': self.ids} return action - out_start_time = str(datetime.now()) + # out_start_time = str(datetime.now()) json2 = { 'params': { 'model_name': 'jikimo.process.order', diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml index a8236456..c4f0e446 100644 --- a/sf_bf_connect/views/view.xml +++ b/sf_bf_connect/views/view.xml @@ -1,14 +1,27 @@ + + 增加一个check_out字段 + stock.picking + + + + + + + + 物流 stock.picking - -