mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
add sale weight report
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
'depends': ['sale_management'],
|
'depends': ['sale_management'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/sale_order_views.xml',
|
'views/sale_order_views.xml',
|
||||||
|
'report/report_sale_order_views.xml',
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
|
|||||||
2
app_product_weight_sale/report/__init__.py
Normal file
2
app_product_weight_sale/report/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
25
app_product_weight_sale/report/report_sale_order_views.xml
Normal file
25
app_product_weight_sale/report/report_sale_order_views.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<template id="app_report_saleorder_document" inherit_id="sale.report_saleorder_document">
|
||||||
|
<xpath expr="//table[hasclass('table', 'table-sm')]/thead/tr/th[1]" position="before">
|
||||||
|
<t t-set="colspan" t-value="colspan+2"/>
|
||||||
|
</xpath>
|
||||||
|
<!--xpath 特殊处理,因为加载另的插件会影响顺序,要精确定位,可用th[contains(text(), 'Quantity')]-->
|
||||||
|
<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"><strong>Weight Subtotal</strong></th>
|
||||||
|
</xpath>
|
||||||
|
<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"><span t-field="line.weight"/></td>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before">
|
||||||
|
<p>
|
||||||
|
<Strong>Total Weight: </Strong>
|
||||||
|
<span t-field="doc.weight"/> <span t-field="doc.weight_uom_name"/>
|
||||||
|
</p>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
BIN
app_product_weight_sale/static/description/demo_sale2.jpg
Normal file
BIN
app_product_weight_sale/static/description/demo_sale2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
@@ -113,6 +113,10 @@
|
|||||||
<div class="oe_demo oe_screenshot">
|
<div class="oe_demo oe_screenshot">
|
||||||
<img src="demo_sale.jpg">
|
<img src="demo_sale.jpg">
|
||||||
</div>
|
</div>
|
||||||
|
<p>Weight in sale report</p>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo_sale2.jpg">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -67,5 +67,5 @@
|
|||||||
'post_init_hook': 'post_init_hook',
|
'post_init_hook': 'post_init_hook',
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'application': True,
|
'application': True,
|
||||||
'auto_install': False,
|
'auto_install': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
odoo.define('web_fontawesome5.FormRenderer', function (require) {
|
odoo.define('web_fontawesome.FormRenderer', function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var FormRenderer = require('web.FormRenderer');
|
var FormRenderer = require('web.FormRenderer');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
odoo.define('web_fontawesome5.ListRenderer', function (require) {
|
odoo.define('web_fontawesome.ListRenderer', function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var ListRenderer = require('web.ListRenderer');
|
var ListRenderer = require('web.ListRenderer');
|
||||||
|
|||||||
Reference in New Issue
Block a user