update hat report

This commit is contained in:
ivan deng
2019-08-13 02:53:49 +08:00
parent 6bbdc8098d
commit 0abebf9b93
6 changed files with 60 additions and 6 deletions

View File

@@ -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',
], ],

View File

@@ -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

View 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')

View File

@@ -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>

View 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>

View 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>