add app_inv

This commit is contained in:
ivan deng
2018-03-12 09:56:41 +08:00
parent 3a7f671d09
commit 22d183033c
13 changed files with 341 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Created on 2018-03-12
# 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:
from . import models

View File

@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
# Created on 2018-03-12
# 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 Inventory Order with Product Supplier Code",
"summary": "This module adds the supplier code defined in the product, to the Inventory Order line.",
"version": "10.0.1",
"author": "Sunpop.cn",
"website": "http://www.sunpop.cn",
"category": "Warehouse",
"depends": ["purchase"],
"license": "AGPL-3",
'sequence': 3,
"data": [
"views/stock_picking_views.xml",
"views/stock_move_views.xml",
],
'images': ['static/description/set1.jpg'],
'installable': True,
'application': True,
'auto_install': False,
"price": 68.00,
"currency": "EUR",
'description': """
==============================
App Inventory Order Product Supplier Code
==============================
This module adds the supplier code defined in the product, to the Inventory Order line.
Usage
=====
To use this module:
#. Go to 'Inventory' and open a Inventory Order.
#. If the vendor has defined some code for any Inventory Order line they will be
displayed in the line under the column 'Product Supplier Code'.
""",
}

View File

@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_inventory_order_product_supplier_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0+e-20171107\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-11 23:54+0000\n"
"PO-Revision-Date: 2018-03-11 23:54+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_inventory_order_product_supplier_code
#: model:ir.model.fields,field_description:app_inventory_order_product_supplier_code.field_stock_move_product_supplier_code
#: model:ir.model.fields,field_description:app_inventory_order_product_supplier_code.field_stock_pack_operation_product_supplier_code
msgid "Product Supplier Code"
msgstr "供应商编码"

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Created on 2018-03-12
# 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:
from . import stock_pack_operation
from . import stock_move

View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# Created on 2018-03-12
# 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:
from openerp import api, fields, models, _
class StockMove(models.Model):
_inherit = "stock.move"
@api.multi
def _compute_product_supplier_code(self):
product_supplierinfo_obj = self.env['product.supplierinfo']
for line in self:
partner = line.picking_id.partner_id
product = line.product_id
if product and partner:
supplier_info = product_supplierinfo_obj.search([
'|', ('product_tmpl_id', '=', product.product_tmpl_id.id),
('product_id', '=', product.id),
('name', '=', partner.id)], limit=1)
if supplier_info:
code = supplier_info.product_code or ''
line.product_supplier_code = code
return True
product_supplier_code = fields.Char(string='Product Supplier Code',
compute=_compute_product_supplier_code)

View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# Created on 2018-03-12
# 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:
from openerp import api, fields, models, _
class PackOperation(models.Model):
_inherit = "stock.pack.operation"
@api.multi
def _compute_product_supplier_code(self):
product_supplierinfo_obj = self.env['product.supplierinfo']
for line in self:
partner = line.picking_id.partner_id
product = line.product_id
if product and partner:
supplier_info = product_supplierinfo_obj.search([
'|', ('product_tmpl_id', '=', product.product_tmpl_id.id),
('product_id', '=', product.id),
('name', '=', partner.id)], limit=1)
if supplier_info:
code = supplier_info.product_code or ''
line.product_supplier_code = code
return True
product_supplier_code = fields.Char(string='Product Supplier Code',
compute=_compute_product_supplier_code)

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -0,0 +1,57 @@
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<h2 class="oe_slogan" style="color:#875A7B;">App Inventory Order Product Supplier Code</h2>
<div>
<p>
This module adds the supplier code defined in the product, to the Inventory Order line.
</p>
<h2>How to use</h2>
<ul>
<li>
#. Go to 'Inventory' and open a Inventory Order.
</li>
<li>
If the vendor has defined some code for any Inventory Order line they will be displayed in the line under the column 'Product Supplier Code'.
</li>
</ul>
<div>
<img class="oe_picture oe_screenshot" src="set1.jpg">
</div>
</div>
</div>
</section>
<section class="oe_container oe_separator">
</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: 46 KiB

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!--tree-->
<record model="ir.ui.view" id="app_stock_move_tree">
<field name="name">app Stock Moves</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.stock_move_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="app_view_move_tree">
<field name="name">app.stock.move.tree</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="app_view_move_picking_tree">
<field name="name">app.stock.move.tree</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
<!--tree
Receipt Picking (By Stock Move)
From stock_partial_move_view
-->
<record model="ir.ui.view" id="app_view_move_tree_receipt_picking">
<field name="name">app.stock.move.tree2</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_tree_receipt_picking"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
<!--form-->
<record model="ir.ui.view" id="app_view_move_form">
<field name="name">app.stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="app_view_move_picking_form">
<field name="name">app.stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="app_view_picking_form">
<field name="name">app.stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='pack_operation_product_ids']/tree/field[@name='product_id']" position="after">
<field name="product_supplier_code"/>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@@ -21,12 +21,12 @@
"version": "10.0.1", "version": "10.0.1",
"author": "Sunpop.cn", "author": "Sunpop.cn",
"website": "http://www.sunpop.cn", "website": "http://www.sunpop.cn",
"category": "Purchase Management", "category": "Purchases",
"depends": ["purchase"], "depends": ["purchase"],
"license": "AGPL-3", "license": "AGPL-3",
'sequence': 3, 'sequence': 3,
"data": [ "data": [
"views/purchase_order_view.xml", "views/stock_picking_views.xml",
], ],
'images': ['static/description/set1.jpg'], 'images': ['static/description/set1.jpg'],
'installable': True, 'installable': True,

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data> <data>
<record id="purchase_order_form" model="ir.ui.view"> <record id="app_purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field> <field name="name">app.purchase.order.form</field>
<field name="model">purchase.order</field> <field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/> <field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
@@ -12,8 +12,8 @@
</field> </field>
</record> </record>
<record id="purchase_order_line_tree" model="ir.ui.view"> <record id="app_purchase_order_line_tree" model="ir.ui.view">
<field name="name">purchase.order.line.tree</field> <field name="name">app.purchase.order.line.tree</field>
<field name="model">purchase.order.line</field> <field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_tree"/> <field name="inherit_id" ref="purchase.purchase_order_line_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">