mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update hat report
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
'price': 68,
|
'price': 68,
|
||||||
'depends': ['sale_management'],
|
'depends': ['sale_management'],
|
||||||
'data': [
|
'data': [
|
||||||
|
'security/res_group.xml',
|
||||||
|
'views/sale_config_settings_views.xml',
|
||||||
'views/sale_order_views.xml',
|
'views/sale_order_views.xml',
|
||||||
'report/report_sale_order_views.xml',
|
'report/report_sale_order_views.xml',
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
from . import sale_order
|
from . import sale_order
|
||||||
from . import sale_order_line
|
from . import sale_order_line
|
||||||
|
from . import res_config_settings
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
app_product_weight_sale/models/res_config_settings.py
Normal file
10
app_product_weight_sale/models/res_config_settings.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ResConfigSettings(models.TransientModel):
|
||||||
|
_inherit = 'res.config.settings'
|
||||||
|
|
||||||
|
group_sale_weight_print = fields.Boolean("Show Weight in Sale Print", implied_group='app_product_weight_sale.group_sale_weight_print')
|
||||||
@@ -8,15 +8,15 @@
|
|||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<!--xpath 特殊处理,因为加载另的插件会影响顺序,要精确定位,可用th[contains(text(), 'Quantity')]-->
|
<!--xpath 特殊处理,因为加载另的插件会影响顺序,要精确定位,可用th[contains(text(), 'Quantity')]-->
|
||||||
<xpath expr="//div[@class='page']/table[1]/thead/tr/th[@class='text-right'][1]" position="after">
|
<xpath expr="//div[@class='page']/table[1]/thead/tr/th[@class='text-right'][1]" position="after">
|
||||||
<th class="text-right app_sunpop"><strong>Weight Unit</strong></th>
|
<th class="text-right app_sunpop" groups="app_product_weight_sale.group_sale_weight_print"><strong>Weight Unit</strong></th>
|
||||||
<th class="text-right app_sunpop"><strong>Weight Subtotal</strong></th>
|
<th class="text-right app_sunpop" groups="app_product_weight_sale.group_sale_weight_print"><strong>Weight Subtotal</strong></th>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@class='page']/table[1]/tbody/t/tr[1]/t/td[@class='text-right'][1]" position="after">
|
<xpath expr="//div[@class='page']/table[1]/tbody/t/tr[1]/t/td[@class='text-right'][1]" position="after">
|
||||||
<td class="text-right app_sunpop"><span t-field="line.weight_unit"/></td>
|
<td class="text-right app_sunpop" groups="app_product_weight_sale.group_sale_weight_print"><span t-field="line.weight_unit"/></td>
|
||||||
<td class="text-right app_sunpop"><span t-field="line.weight"/></td>
|
<td class="text-right app_sunpop" groups="app_product_weight_sale.group_sale_weight_print"><span t-field="line.weight"/></td>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before">
|
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before" groups="app_product_weight_sale.group_sale_weight_print">
|
||||||
<p>
|
<p class="app_sunpop" groups="app_product_weight_sale.group_sale_weight_print">
|
||||||
<Strong>Total Weight: </Strong>
|
<Strong>Total Weight: </Strong>
|
||||||
<span t-field="doc.weight"/> <span t-field="doc.weight_uom_name"/>
|
<span t-field="doc.weight"/> <span t-field="doc.weight_uom_name"/>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
17
app_product_weight_sale/security/res_group.xml
Normal file
17
app_product_weight_sale/security/res_group.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<!--自定义打印重量 -->
|
||||||
|
<record id="group_sale_weight_print" model="res.groups">
|
||||||
|
<field name="name">Show Weight in Sale Print</field>
|
||||||
|
<field name="category_id" ref="base.module_category_hidden"/>
|
||||||
|
</record>
|
||||||
|
<!--设置 sale 打印重量-->
|
||||||
|
<record id="base.group_user" model="res.groups">
|
||||||
|
<field name="implied_ids"
|
||||||
|
eval="[
|
||||||
|
(4, ref('app_product_weight_sale.group_sale_weight_print')),
|
||||||
|
]"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
24
app_product_weight_sale/views/sale_config_settings_views.xml
Normal file
24
app_product_weight_sale/views/sale_config_settings_views.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="app_res_config_settings_view_form" model="ir.ui.view">
|
||||||
|
<field name="name">app.res.config.settings.view.form.inherit.sale</field>
|
||||||
|
<field name="model">res.config.settings</field>
|
||||||
|
<field name="inherit_id" ref="sale.res_config_settings_view_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='group_sale_delivery_address']/../.." position="after">
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<div class="o_setting_left_pane">
|
||||||
|
<field name="group_sale_weight_print"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_setting_right_pane">
|
||||||
|
<label for="group_sale_weight_print"/>
|
||||||
|
<div class="text-muted">
|
||||||
|
Show product weight in Sale Print
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user