add depend

This commit is contained in:
ivan deng
2018-11-14 14:20:28 +08:00
parent 775ce16042
commit a2222fdeef
23 changed files with 493 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 ---*---
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'App Sales Order Weight',
'version' : '12.0.11.14',
'summary': 'Add sku weight in Sale Order',
'sequence': 10,
'license':'LGPL-3',
'description': """
Add sku weight in Sale Order.
Calculates total weight of a sale order, which is the sum of individual weights of each unit of the products in the order
""",
'category': 'Sales',
'author' : 'Sunpop.cn',
'website' : 'http://www.sunpop.cn',
'images': ['static/description/banner.jpg'],
'depends' : ['sale_management'],
'data': [
'views/sale_order_views.xml',
],
'demo': [
],
'qweb': [
],
'installable': True,
'application': True,
'auto_install': False,
}

View File

@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_product_weight_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0+e-20180617\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-20 17:42+0000\n"
"PO-Revision-Date: 2018-07-20 17:42+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: app_product_weight_sale
#: model:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form
msgid "<span> kg</span>"
msgstr "<span> 公斤</span>"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_total_weight
msgid "Total Weight(kg)"
msgstr "总重量(kg)"
#. module: app_product_weight_sale
#: model:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form
msgid "Total Weight:"
msgstr "总重量:"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line_weight
msgid "Weight(kg)"
msgstr "公斤"

View File

@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import sale_order
from . import sale_order_line

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class SaleOrder(models.Model):
_inherit = "sale.order"
total_weight = fields.Float(string='Total Weight(kg)', compute='_compute_weight_total')
def _compute_weight_total(self):
for sale in self:
weight_tot = 0
for line in sale.order_line:
if line.product_id:
weight_tot += line.weight or 0.0
sale.total_weight = weight_tot

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
# Record the net weight of the order line
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
weight = fields.Float(string='Weight(kg)', compute='_compute_weight',
inverse='_set_weight', store=True)
@api.multi
@api.depends('product_id', 'product_uom_qty')
def _compute_weight(self):
for line in self:
weight = 0
if line.product_id and line.product_id.weight:
weight += (line.product_id.weight * line.product_uom_qty / line.product_uom.factor)
line.weight = weight
@api.one
def _set_weight(self):
pass

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -0,0 +1,68 @@
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Sales Order Weight</h2>
</div>
<p class='oe_mt32'>
This module from BroadTech IT Solutions manages to calculate total weight of a sale order, which is the sum of individual weights of each unit of the products in the order.
</p>
<p class='oe_mt32'>
The product form has a field 'Weight', which stores the weight of the product in Kg.
</p>
<div class="oe_demo oe_screenshot">
<img class="oe_picture oe_screenshot" src="product_weight.jpg">
</div>
<p class='oe_span12 oe_mt32'>
The module adds a field 'Net Weight' in sale order line, which calculates the Order line weight based on Order line Quantity and Unit of Measure. The new field 'Total Weight' in Sale Order would be the sum of sale order line weights.
</p>
<div class="oe_demo oe_screenshot">
<img class="oe_picture oe_screenshot" src="banner.jpg">
</div>
<p class='oe_span12 oe_mt32'>
The calculation uses the following formula:
</p>
<p class='oe_mt32'>
Sale_order_line_net_weight = (line_product_weight * line_product_uom_qty / line_product_uom_factor)
<br/>
Total_weight = sum(Sale_order_line_net_weight)
</p>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="oe_span12">
<h2 class="oe_slogan">Technical Help & Support</h2>
</div>
<div class="col-md-12 pad0">
<div class="oe_mt16">
<p><h4>
For any type of technical help & support requests, Feel free to contact us</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:guohuadeng@hotmail.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> guohuadeng@hotmail.com</a>
<p><h4>
Via QQ: 300883</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:300883@qq.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> 300883@qq.com</a>
</div>
<div class="oe_mt16">
<p><h4>
Visit our website for more support.</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="http://www.sunpop.cn" target="_blank"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-web"></i>http://www.sunpop.cn</a>
</div>
</div>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add the total weight to the sale order list -->
<record model="ir.ui.view" id="sale_weight_tree">
<field name="name">sale.weight.view.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="after">
<field name="total_weight"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sale_quotation_weight_tree">
<field name="name">sale.quotation.weight.view.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="after">
<field name="total_weight"/>
</xpath>
</field>
</record>
<!-- Add the total weight in sale form and net weight to the order line subform -->
<record model="ir.ui.view" id="sale_weight_line_form">
<field name="name">sale.weight.view.line.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='note']" position="before">
<div>
<label for="total_weight" name="total_weight" string="Total Weight: " class="oe_inline"/>
<field name="total_weight" class="oe_inline"/><span> kg</span>
</div>
<newline/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="after">
<field name="weight"/>
</xpath>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="weight"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from . import models
from . import ir
from . import res

View File

@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
# Created on 2018-11-05
# author: 广州尚鹏http://www.sunpop.cn
# email: 300883@qq.com
# resource of Sunpop
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Odoo在线中文用户手册长期更新
# http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# http://www.sunpop.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程jquery参考Jinja2模板PostgresSQL参考odoo开发必备
# http://www.sunpop.cn/odoo10_developer_document_offline/
# description:
{
'name': "App stock putaway show. 单独的上架策略界面及菜单",
'version': '12.0.11.14',
'author': 'Sunpop.cn',
'category': 'Base',
'website': 'http://www.sunpop.cn',
'license': 'LGPL-3',
'sequence': 2,
'summary': """
Show stock putaway strategy in stock menu.
""",
'description': """
上架策略菜单。
广州尚鹏Sunpop.cn 的odoo模块。
""",
'depends': ['stock'],
'images': [],
'data': [
'views/product_putaway_views.xml',
'views/stock_procrules_views.xml',
],
'demo': [
],
'test': [
],
'css': [
],
'qweb': [
],
'js': [
],
'installable': True,
'application': True,
'auto_install': True,
}

View File

@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_stock_putaway
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0+e-20180915\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-04 20:04+0000\n"
"PO-Revision-Date: 2018-11-04 20:04+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: app_stock_putaway
#: model:ir.actions.act_window,help:app_stock_putaway.action_product_putaway
msgid "Click to define a new picking type group."
msgstr "点击创建一条新的记录."
#. module: app_stock_putaway
#: model:ir.ui.view,arch_db:app_stock_putaway.app_view_strock_putaway_tree
msgid "Stock Put Away Strategy"
msgstr "上架策略"
#. module: app_stock_putaway
#: model:ir.actions.act_window,name:app_stock_putaway.action_product_putaway
#: model:ir.ui.menu,name:app_stock_putaway.menu_putaway
msgid "Stock Putaway Strategy"
msgstr "上架策略"

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -0,0 +1,71 @@
<section class="oe_container">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_span12">
<h2 class="oe_slogan">App stock picking type group </h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>This moduld allows user to . </p>
<h1>More Powerful addons:
<a class="btn btn-primary mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Supop.cn Odoo Addons</a>
</h1>
<br>
<h3>Lastest update: v10.0.3.27, 2018-03-27</h3>
<ul>
<li>1. Manager picking type groups</li>
<li>2. Group by picking type groups in stock dashboard</li>
</ul>
</div>
<div class="oe_demo oe_screenshot">
<h3>Base setup: </h3>
<ul>
<li>1. Go to Inventory->Configuration->Warehouse Management</li>
<li>2. Set Picking Type Group for the certain type</li>
</ul>
<img src="setup.jpg" style="border:1px solid black"/>
<br/>
</div>
<div class="oe_demo oe_screenshot">
<h3>After setup, the view would look like:</h3>
<img src="demo1.jpg" style="border:1px solid black"/>
<br/>
</div>
<div class="oe_demo oe_screenshot mt32">
<img src="demo2.jpg" style="border:1px solid black"/>
<br/>
</div>
</div>
</div>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="oe_span12">
<h2 class="oe_slogan">Technical Help & Support</h2>
</div>
<div class="col-md-12 pad0">
<div class="oe_mt16">
<p><h4>
For any type of technical help & support requests, Feel free to contact us</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:guohuadeng@hotmail.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> guohuadeng@hotmail.com</a>
<p><h4>
Via QQ: 300883</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:300883@qq.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> 300883@qq.com</a>
</div>
<div class="oe_mt16">
<p><h4>
Visit our website for more support.</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="http://www.sunpop.cn" target="_blank"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-web"></i>http://www.sunpop.cn</a>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- 补货规则设置 -->
<record id="action_procurement_rule_app" model="ir.actions.act_window">
<field name="name">Global Procurement Rules</field>
<field name="res_model">stock.location.route</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a route.
</p>
<p>You can define here the main routes that run through
your warehouses and that define the flows of your products. These
routes can be assigned to a product, a product category or be fixed
on procurement or sales order. </p>
</field>
</record>
<menuitem id="app_menu_procurement_rules" action="action_procurement_rule_app"
parent="felive_menu_stock_config_settings" sequence="60"/>
<!-- 推式规则设置 -->
<menuitem id="felive_menu_stock_location_path" name="Global Push Rules" action="stock.stolocpath" parent="felive_menu_stock_config_settings"
sequence="70"/>
</data>
</odoo>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="app_view_strock_putaway_tree">
<field name="name">Stock Putaway Strategy</field>
<field name="model">product.putaway</field>
<field name="arch" type="xml">
<tree string="Stock Put Away Strategy">
<field name="name"/>
<field name="fixed_location_ids"/>
</tree>
</field>
</record>
<record id="action_product_putaway" model="ir.actions.act_window">
<field name="name">Stock Putaway Strategy</field>
<field name="res_model">product.putaway</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new picking type group.
</p>
</field>
</record>
<menuitem id="menu_putaway" parent="stock.menu_warehouse_config" action="action_product_putaway" sequence="5"/>
</odoo>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- 补货规则设置 -->
<record id="action_procurement_rule" model="ir.actions.act_window">
<field name="name">Global Procurement Rules</field>
<field name="res_model">procurement.rule</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a route.
</p>
<p>You can define here the main routes that run through
your warehouses and that define the flows of your products. These
routes can be assigned to a product, a product category or be fixed
on procurement or sales order. </p>
</field>
</record>
<menuitem id="menu_procurement_rule" parent="stock.menu_warehouse_config" action="action_procurement_rule" sequence="5"/>
<!--&lt;!&ndash; 推式规则设置 &ndash;&gt;-->
<!--<menuitem id="menu_stock_location_path" name="Global Push Rules" action="stock.stolocpath" parent="felive_menu_stock_config_settings"-->
<!--sequence="70"/>-->
</data>
</odoo>