Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
9410732f
提交
9410732f
authored
9月 11, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
打印,单独打印没问题
上级
e0821e42
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
159 行增加
和
75 行删除
+159
-75
cc_big_package_view.xml
ccs_base/views/cc_big_package_view.xml
+1
-0
__init__.py
ccs_pallet/__init__.py
+1
-0
__manifest__.py
ccs_pallet/__manifest__.py
+2
-2
cc_pallet.py
ccs_pallet/models/cc_pallet.py
+1
-0
__init__.py
ccs_pallet/reports/__init__.py
+5
-0
pallet_label_report.xml
ccs_pallet/reports/pallet_label_report.xml
+0
-68
pallet_label_report_templates.xml
ccs_pallet/reports/pallet_label_report_templates.xml
+75
-0
report_pallet.py
ccs_pallet/reports/report_pallet.py
+19
-0
report_pallet_labe.xml
ccs_pallet/reports/report_pallet_labe.xml
+33
-0
cc_pallet_view.xml
ccs_pallet/views/cc_pallet_view.xml
+19
-0
associate_pallet_wizard.py
ccs_pallet/wizard/associate_pallet_wizard.py
+3
-5
没有找到文件。
ccs_base/views/cc_big_package_view.xml
浏览文件 @
9410732f
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<field
name=
"ship_package_qty"
string=
"Packages Qty"
/>
<field
name=
"ship_package_qty"
string=
"Packages Qty"
/>
<field
name=
"goods_qty"
string=
"Goods Qty"
/>
<field
name=
"goods_qty"
string=
"Goods Qty"
/>
<field
name=
"is_cancel"
string=
"Cancelled"
/>
<field
name=
"is_cancel"
string=
"Cancelled"
/>
<field
name=
"next_provider_name"
/>
<field
name=
"pallet_number"
/>
<field
name=
"pallet_number"
/>
<field
name=
"pallet_usage_date"
/>
<field
name=
"pallet_usage_date"
/>
<field
name=
"tally_state"
optional=
"show"
/>
<field
name=
"tally_state"
optional=
"show"
/>
...
...
ccs_pallet/__init__.py
浏览文件 @
9410732f
from
.
import
models
from
.
import
models
from
.
import
wizard
from
.
import
wizard
from
.
import
reports
ccs_pallet/__manifest__.py
浏览文件 @
9410732f
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
'wizard/pallet_batch_wizard_view.xml'
,
'wizard/pallet_batch_wizard_view.xml'
,
'wizard/pallet_print_wizard_view.xml'
,
'wizard/pallet_print_wizard_view.xml'
,
'wizard/associate_pallet_wizard_views.xml'
,
'wizard/associate_pallet_wizard_views.xml'
,
'reports/pallet_label_report.xml'
,
"reports/report_pallet_labe.xml"
,
'reports/pallet_label_report_templates.xml'
,
'views/cc_pallet_view.xml'
,
'views/cc_pallet_view.xml'
,
# 'views/cc_big_package_view.xml',
'views/menu_view.xml'
,
'views/menu_view.xml'
,
],
],
'installable'
:
True
,
'installable'
:
True
,
...
...
ccs_pallet/models/cc_pallet.py
浏览文件 @
9410732f
...
@@ -16,6 +16,7 @@ class CcPallet(models.Model):
...
@@ -16,6 +16,7 @@ class CcPallet(models.Model):
_inherit
=
[
'mail.thread'
,
'mail.activity.mixin'
]
_inherit
=
[
'mail.thread'
,
'mail.activity.mixin'
]
# 模型描述
# 模型描述
_description
=
'Pallet'
_description
=
'Pallet'
_order
=
'create_date desc'
@api.model
@api.model
def
create
(
self
,
vals
):
def
create
(
self
,
vals
):
...
...
ccs_pallet/reports/__init__.py
0 → 100644
浏览文件 @
9410732f
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from
.
import
report_pallet
ccs_pallet/reports/pallet_label_report.xml
deleted
100644 → 0
浏览文件 @
e0821e42
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- 托盘标签纸张格式 -->
<record
id=
"paperformat_pallet_label"
model=
"report.paperformat"
>
<field
name=
"name"
>
托盘标签 (10x15cm)
</field>
<field
name=
"default"
eval=
"True"
/>
<field
name=
"format"
>
custom
</field>
<field
name=
"orientation"
>
Portrait
</field>
<field
name=
"margin_top"
>
0
</field>
<field
name=
"margin_bottom"
>
0
</field>
<field
name=
"margin_left"
>
0
</field>
<field
name=
"margin_right"
>
0
</field>
<field
name=
"header_line"
eval=
"False"
/>
<field
name=
"header_spacing"
>
0
</field>
<field
name=
"dpi"
>
90
</field>
<field
name=
"page_width"
>
10
</field>
<field
name=
"page_height"
>
15
</field>
</record>
<!-- 托盘标签打印报告 -->
<record
id=
"action_pallet_label_report"
model=
"ir.actions.report"
>
<field
name=
"name"
>
托盘标签
</field>
<field
name=
"model"
>
cc.pallet
</field>
<field
name=
"report_type"
>
qweb-pdf
</field>
<field
name=
"report_name"
>
ccs_pallet.pallet_label_report
</field>
<field
name=
"report_file"
>
ccs_pallet.pallet_label_report
</field>
<field
name=
"paperformat_id"
ref=
"paperformat_pallet_label"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_pallet"
/>
<field
name=
"binding_type"
>
report
</field>
</record>
<!-- 托盘标签模板 -->
<template
id=
"pallet_label_report"
>
<t
t-call=
"web.html_container"
>
<t
t-foreach=
"docs"
t-as=
"pallet"
>
<div
class=
"page"
style=
"width: 100%; height: 100%; margin: 0; padding: 0.3cm; page-break-after: always; font-family: 'DejaVu Sans', Arial, sans-serif; box-sizing: border-box; position: relative;"
>
<!-- 客户名称和快递简称 -->
<div
style=
"text-align: center; height: 2cm; display: flex; align-items: center; justify-content: center; margin-bottom: 0.2cm;"
>
<h2
style=
"margin: 0; font-size: 18px; font-weight: bold; line-height: 1.2;"
>
<t
t-esc=
"pallet.partner_id.name or 'TIKTOK'"
/>
/
<t
t-esc=
"pallet.express_company_id.name or 'RM'"
/>
</h2>
</div>
<!-- 条形码区域 -->
<div
style=
"text-align: center; height: 8cm; border: 2px dashed #999; background-color: #f9f9f9; display: flex; flex-direction: column; justify-content: center; margin-bottom: 0.2cm;"
>
<div
style=
"font-size: 14px; color: #666; margin-bottom: 0.5cm;"
>
<!-- 托盘号作为条形码 -->
<t
t-if=
"pallet.name"
>
<div
t-out=
"pallet.name"
style=
"padding:0; margin-bottom: 0.3cm;"
t-options=
"{'widget': 'barcode', 'quiet': 0, 'symbology': 'auto', 'width': 2, 'height': 60}"
/>
<div
class=
"o_label_name"
style=
"height:1.2em;background-color: transparent; font-size: 12px;"
>
<span
t-out=
"pallet.name"
/>
</div>
</t>
</div>
</div>
<!-- 托盘号 -->
<div
style=
"text-align: center; height: 3cm; display: flex; align-items: center; justify-content: center;"
>
<h1
style=
"margin: 0; font-size: 22px; font-weight: bold; line-height: 1.2;"
>
<t
t-esc=
"pallet.name"
/>
</h1>
</div>
</div>
</t>
</t>
</template>
</odoo>
ccs_pallet/reports/pallet_label_report_templates.xml
0 → 100644
浏览文件 @
9410732f
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template
id=
"report_palletlabel"
>
<t
t-call=
"web.html_container"
>
<t
t-set=
"barcode_size"
t-value=
"'width:80mm;height:30mm'"
/>
<t
t-set=
"table_style"
t-value=
"'width:100mm;height:150mm;'"
/>
<t
t-set=
"padding_page"
t-value=
"'padding: 5mm'"
/>
<t
t-set=
"pallets"
t-value=
"pallets"
/>
<t
t-foreach=
"pallets"
t-as=
"pallet"
>
<t
t-call=
"ccs_pallet.report_simple_pallet_barcode"
/>
</t>
</t>
</template>
<!-- 托盘标签模板 -->
<template
id=
"report_simple_pallet_barcode"
>
<div
class=
"o_label_sheet o_label_dymo"
t-att-style=
"padding_page"
>
<div
class=
"o_label_full"
t-att-style=
"table_style"
style=
"display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;"
>
<!-- 顶部标题 -->
<div
style=
"flex: 0 0 auto; margin-bottom: 10mm; text-align: center;"
>
<div
style=
"font-size: 24px; font-weight: bold; line-height: 1.2; font-family: Arial, sans-serif;"
>
<t
t-esc=
"pallet.partner_id.name or 'TIKTOK'"
/>
/
<t
t-esc=
"pallet.express_company_id.abbreviation"
/>
</div>
</div>
<!-- 中间条形码区域 -->
<div
style=
"flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;"
>
<t
t-if=
"pallet.name"
>
<div
t-out=
"pallet.name"
style=
"padding:0; margin: 0 auto;"
t-options=
"{'widget': 'barcode', 'quiet': 0, 'symbology': 'auto', 'img_style': barcode_size}"
/>
</t>
</div>
<!-- 底部托盘号 -->
<div
style=
"flex: 0 0 auto; margin-top: 10mm; text-align: center;"
>
<div
style=
"font-size: 32px; font-weight: bold; line-height: 1.2; font-family: Arial, sans-serif;"
>
<span
t-field=
"pallet.name"
/>
</div>
</div>
</div>
</div>
<!-- <div class="o_label_sheet o_label_dymo" t-att-style="padding_page">
<div class="o_label_full" t-att-style="table_style" style="position: relative; box-sizing: border-box;">
<table style="width: 100%; height: 100%; border-collapse: collapse;">
<tr>
<td style="height: 20mm; text-align: center; vertical-align: middle; padding: 0; margin: 0;">
<div style="font-size: 24px; font-weight: bold; line-height: 1.2; font-family: Arial, sans-serif;">
<t t-esc="pallet.partner_id.name or 'TIKTOK'"/> / <t t-esc="pallet.express_company_id.abbreviation"/>
</div>
</td>
</tr>
<tr>
<td style="height: 60mm; text-align: center; vertical-align: middle; padding: 5mm; background-color: #f0f0f0; border: 1px solid #ddd;">
<t t-if="pallet.name">
<div style="text-align: center; font-size: 12px; color: #666;">
<div t-out="pallet.name"
t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': barcode_size}"
style="margin: 10px 0;"/>
</div>
</t>
</td>
</tr>
<tr>
<td style="height: 30mm; text-align: center; vertical-align: middle; padding: 0; margin: 0;">
<div style="font-size: 32px; font-weight: bold; line-height: 1.2; font-family: Arial, sans-serif;">
<span t-field="pallet.name"/>
</div>
</td>
</tr>
</table>
</div>
</div> -->
</template>
</odoo>
ccs_pallet/reports/report_pallet.py
0 → 100644
浏览文件 @
9410732f
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from
odoo
import
api
,
models
,
_
from
odoo.exceptions
import
UserError
class
ReportPallet
(
models
.
AbstractModel
):
_name
=
'report.ccs_pallet.report_palletlabel'
_description
=
'Pallet report'
@api.model
def
_get_report_values
(
self
,
docids
,
data
=
None
):
# Overriding data values here since used also in _get_routes.
pallets
=
self
.
env
[
'cc.pallet'
]
.
browse
(
docids
)
return
{
'pallets'
:
pallets
,
}
\ No newline at end of file
ccs_pallet/reports/report_pallet_labe.xml
0 → 100644
浏览文件 @
9410732f
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- 托盘标签纸张格式 -->
<record
id=
"paperformat_pallet_label"
model=
"report.paperformat"
>
<field
name=
"name"
>
托盘标签 (10x15cm)
</field>
<field
name=
"default"
eval=
"True"
/>
<field
name=
"format"
>
custom
</field>
<field
name=
"orientation"
>
Portrait
</field>
<field
name=
"margin_top"
>
0
</field>
<field
name=
"margin_bottom"
>
0
</field>
<field
name=
"margin_left"
>
0
</field>
<field
name=
"margin_right"
>
0
</field>
<field
name=
"header_line"
eval=
"False"
/>
<field
name=
"header_spacing"
>
0
</field>
<field
name=
"dpi"
>
90
</field>
<field
name=
"page_width"
>
100
</field>
<field
name=
"page_height"
>
150
</field>
</record>
<!-- 托盘标签打印报告 -->
<record
id=
"action_pallet_label_report"
model=
"ir.actions.report"
>
<field
name=
"name"
>
托盘标签
</field>
<field
name=
"model"
>
cc.pallet
</field>
<field
name=
"report_type"
>
qweb-pdf
</field>
<field
name=
"report_name"
>
ccs_pallet.report_palletlabel
</field>
<field
name=
"report_file"
>
ccs_pallet.report_palletlabel
</field>
<field
name=
"paperformat_id"
ref=
"paperformat_pallet_label"
/>
<!-- <field name="binding_model_id" ref="model_cc_pallet"/> -->
<field
name=
"binding_model_id"
eval=
"False"
/>
<field
name=
"binding_type"
>
report
</field>
</record>
</odoo>
ccs_pallet/views/cc_pallet_view.xml
浏览文件 @
9410732f
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
<field
name=
"express_company_id"
required=
"1"
options=
"{'no_create': True, 'no_quick_create': True}"
/>
<field
name=
"express_company_id"
required=
"1"
options=
"{'no_create': True, 'no_quick_create': True}"
/>
<field
name=
"partner_id"
options=
"{'no_create': True, 'no_quick_create': True}"
/>
<field
name=
"partner_id"
options=
"{'no_create': True, 'no_quick_create': True}"
/>
<field
name=
"delivery_plate_number"
/>
<field
name=
"delivery_plate_number"
/>
<field
name=
"create_uid"
readonly=
"1"
string=
"Create By"
/>
<field
name=
"create_date"
readonly=
"1"
string=
"Create Date"
/>
</group>
</group>
<group
string=
"Status Information"
>
<group
string=
"Status Information"
>
<field
name=
"print_state"
readonly=
"1"
/>
<field
name=
"print_state"
readonly=
"1"
/>
...
@@ -61,6 +63,8 @@
...
@@ -61,6 +63,8 @@
<field
name=
"delivery_time"
/>
<field
name=
"delivery_time"
/>
<field
name=
"package_count"
/>
<field
name=
"package_count"
/>
<field
name=
"delivery_plate_number"
/>
<field
name=
"delivery_plate_number"
/>
<field
name=
"create_uid"
string=
"Create By"
/>
<field
name=
"create_date"
string=
"Create Date"
/>
</tree>
</tree>
</field>
</field>
</record>
</record>
...
@@ -109,4 +113,18 @@
...
@@ -109,4 +113,18 @@
</p>
</p>
</field>
</field>
</record>
</record>
<!-- 增加server action,批量打印标签 -->
<record
id=
"action_print_labels_pallet_server"
model=
"ir.actions.server"
>
<field
name=
"name"
>
Print Labels
</field>
<field
name=
"groups_id"
eval=
"[(4, ref('ccs_pallet.group_pallet_manager'))]"
/>
<field
name=
"model_id"
ref=
"model_cc_pallet"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_pallet"
/>
<field
name=
"binding_view_types"
>
list
</field>
<field
name=
"state"
>
code
</field>
<field
name=
"code"
>
if records:
action = records.action_print_labels()
</field>
</record>
</odoo>
</odoo>
\ No newline at end of file
ccs_pallet/wizard/associate_pallet_wizard.py
浏览文件 @
9410732f
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from
datetime
import
date
from
odoo
import
models
,
fields
,
_
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
from
odoo.exceptions
import
Warning
,
ValidationError
class
AssociatePalletWizard
(
models
.
TransientModel
):
class
AssociatePalletWizard
(
models
.
TransientModel
):
...
@@ -37,5 +36,4 @@ class AssociatePalletWizard(models.TransientModel):
...
@@ -37,5 +36,4 @@ class AssociatePalletWizard(models.TransientModel):
if
success_package
:
if
success_package
:
# 更新托盘的使用状态(理货时间和交货时间会自动通过计算字段更新)
# 更新托盘的使用状态(理货时间和交货时间会自动通过计算字段更新)
record
.
pallet_id
.
update_usage_state
(
success_package
)
record
.
pallet_id
.
update_usage_state
(
success_package
,
record
.
usage_date
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论