init from 10

This commit is contained in:
ivan deng
2018-03-03 22:02:05 +08:00
parent b9ff0c210b
commit e844184ce3
169 changed files with 0 additions and 9752 deletions

View File

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

View File

@@ -1,34 +0,0 @@
{
'name': 'App Customize Columns of List (Tree) View Dynamic',
'version': '10.0.1.6',
'author': 'Sunpop.cn',
'category': 'Productivity',
'website': 'http://www.odooapp.cn',
'sequence': 2,
'summary': 'App Customize columns of List (Tree) View. Dynamic list.',
'description': """
App Customize Columns of List (Tree) View
============
App Customize Columns of List (Tree) View module is made to show/hide the columns on the list/tree view of Odoo. After installing the module, a "Set Columns" button will be show to the list view.
You can customize every odoo list/tree view easily.
This module is ready for Community and Enterprise Edition.
""",
'images': ['static/description/sales_coms.jpg'
],
'depends': ['web'],
'data': [
'views/listview_button.xml',
],
'demo': [],
'test': [
],
'installable': True,
'application': True,
'auto_install': False,
'qweb': ['static/src/xml/listview_button_view.xml'],
}

View File

@@ -1,24 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * apps_material_backend_theme
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-07 08:57+0000\n"
"PO-Revision-Date: 2016-09-07 08:57+0000\n"
"Last-Translator: Ivan Deng <300883@qq.com>, 2017\n"
"Language-Team: Chinese (China) (https://www.transifex.com/odoo/teams/41243/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: app_dynamic_list
#. openerp-web
#: code:addons/apps_material_backend_theme/static/src/xml/listview_button_view.xml:121
#, python-format
msgid "Set Columns"
msgstr "显示列"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,62 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Customize hide/show the columns on the list (tree) view dynamically</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 customize columns dynamically in list (tree) view of any object of any
installed module. </p>
<br>
<p>"Set Columns" button contains all field(s) in dropdown with checkbox which will exist in
list view of current object. So if user wants to show/hide any field, then he/she has to just do
check/uncheck that respective checkbox besides field name in dropdown list and then just click on
"Apply" button.</p>
</div>
</div>
</div>
<div class="oe_row oe_spaced">
<div class="oe_demo"
style=" margin: 60px auto 0; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<ul>
<li><p class='oe_mt32'>Sales leads in Enterprise Edition</p></li>
</ul>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img src="sales_ent.png" style="border:1px solid black"/>
<br/>
</div>
<div class="oe_demo"
style=" margin: 60px auto 0; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<ul>
<li><p class='oe_mt32'>Sales leads in Community Edition</p></li>
</ul>
</div>
<div class="oe_demo oe_picture oe_screenshot">
<img src="sales_com.png" style="border:1px solid black"/>
<br/>
</div>
</div>
</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>
</div>
</div>
</div>
</section>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -1,97 +0,0 @@
odoo.define('app_dynamic_list.shcolumns', function (require) {
"use strict";
var core = require('web.core');
var ListView = require('web.ListView');
var QWeb = core.qweb;
ListView.include({
reload: function () {
this.setup_columns(this.fields_view.fields, this.grouped);
this.$el.html(QWeb.render(this._template, this));
return this.reload_content();
},
render_buttons: function($node) {
var self = this;
this._super($node);
this.$buttons.find('.oe_select_columns').click(this.proxy('my_setup_columns'));
this.$buttons.find('.oe_dropdown_btn').click(this.proxy('hide_show_columns'));
this.$buttons.find('.dropdown-menu').click(this.proxy('stop_event'));
},
my_setup_columns: function (fields, grouped) {
$("#showcb").toggle();
var getcb = document.getElementById('showcb');
this.visible_columns = _.filter(this.columns, function (column) {
var firstcheck = document.getElementById(column.id);
if(firstcheck == null)
{
var li= document.createElement("li");
var description = document.createTextNode(column.string);
var checkbox = document.createElement("input");
checkbox.id = column.id;
checkbox.type = "checkbox";
checkbox.name = "cb";
if(column.invisible !== '1')
{
checkbox.checked = true;
}
li.appendChild(checkbox);
li.appendChild(description);
getcb.appendChild(li);
}
else
{
if(column.invisible !== '1')
{
firstcheck.checked = true;
}
else
{
firstcheck.checked = false;
}
}
});
},
stop_event : function(e)
{
e.stopPropagation();
},
hide_show_columns : function()
{
$("#showcb").hide();
this.setup_columns(this.fields_view.fields, this.grouped);
this.$el.html(QWeb.render(this._template, this));
return this.reload_content();
},
setup_columns: function (fields, grouped) {
this._super(fields, grouped);
this.visible_columns = _.filter(this.columns, function (column) {
var cbid = document.getElementById(column.id);
if(cbid !== null)
{
var cbid = cbid.checked;
if(cbid !== false)
{
column.invisible = '2';
}
else
{
column.invisible = '1';
}
}
return column.invisible !== '1';
});
this.aggregate_columns = _(this.visible_columns).invoke('to_aggregate');
},
});
$(document).click(function(){
$("#showcb").hide();
});
});

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<templates t-name="selectcolumns">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after">
<div class="btn-group o_dropdown">
<button name="select_columns" id="select_columns"
class="oe_select_columns btn btn-default btn-sm dropdown-toggle"
data-toggle="dropdown">
Set Columns
<span class="caret"></span>
</button>
<ul id="showcb" class="dropdown-menu" style="padding:10px">
<li>
<button name="apply" id="apply" class="oe_dropdown_btn btn btn-primary btn-block">
Apply
</button>
</li>
</ul>
</div>
</t>
</t>
</templates>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="listview" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/app_dynamic_list/static/src/css/my.css"/>
<script type="text/javascript" src="/app_dynamic_list/static/src/js/dynamic_list.js"></script>
</xpath>
</template>
</data>
</openerp>

View File

@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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:
'''
import models
import controllers
from .hooks import pre_init_hook

View File

@@ -1,66 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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 Product Internal Type,Auto Sequence, Auto Code(Variants Supported)',
'summary': 'Auto Internal Reference.',
"version": '10.0.2.2',
'category': 'Sales',
'author': 'Sunpop.cn',
'website': 'http://www.sunpop.cn',
'license': 'AGPL-3',
'sequence': 2,
'installable': True,
'auto_install': False,
'application': True,
'images': ['static/description/set2.jpg'],
'currency': 'EUR',
'price': 98,
'description': u"""
App Product Auto Sequence, Auto Code(Variants Supported)
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
1.Auto Sequence or code for every product.自动产品编码。
2.Auto Sequence or for every product variants, like product20171130-001.自动多规格产品编码,形式为 主产品编码-001。
3.Product code must be Unique.产品编码强制要求唯一。
4.Define different product type, each product type use own rule of sequence.可自定义产品类型,不同产品类型使用不同编码规则。
5.Quick access in sale , inventory, system menu.可以在销售、库存、系统菜单中快速定义。
6.Multi language support.<br/>多语种支持。
7.Setup default Auto Sequence for each product category
""",
'pre_init_hook': 'pre_init_hook',
'depends': [
'product',
'stock',
'sale',
'purchase',
'mrp',
],
'data': [
# 视图
"security/ir.model.access.csv",
# "security/security.xml",
'views/product_template_view.xml',
'views/product_product_view.xml',
'views/product_category_view.xml',
'views/product_internal_type_view.xml',
'data/product_sequence.xml',
],
'demo': [
],
}

View File

@@ -1 +0,0 @@
import main

View File

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

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品 manufactured Products. -->
<record id="seq_manufacture" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">D%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的原料 Components.-->
<record id="seq_component" model="ir.sequence">
<field name="name">Sequence for Components Product</field>
<field name="code">product.product</field>
<field name="prefix">C%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品 Sourced Products.-->
<record id="seq_sourced" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">S%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<record id="internal_type_manufacture" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="description">Set prefix as "D" in link sequence</field>
<field name="link_sequence" ref="seq_manufacture"/>
</record>
<record id="internal_type_sourced" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="description">Set prefix as "S" in link sequence</field>
<field name="link_sequence" ref="seq_sourced"/>
</record>
<record id="internal_type_component" model="product.internal.type">
<field name="name">Components Product</field>
<field name="description">Set prefix as "C" in link sequence</field>
<field name="link_sequence" ref="seq_component"/>
</record>
<!--设置产品默认值为制造产品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('app_product_sequence.internal_type_manufacture'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">PR%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 生产原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">WL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--[(4, ref('purchase.route_warehouse0_buy')),(4, ref('mrp.route_warehouse0_manufacture')),(4, ref('stock.route_warehouse0_mto'))]-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">cp</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "CP" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">Manufactured Components</field>
<field name="ref">bj</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BJ" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">Components Product</field>
<field name="ref">bc</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BC" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">wl</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "WL" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!--这个默认值可以不用因为在onchange事件会设置很多值-->
<!--设置产品默认值为制造成品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品 manufactured Products. -->
<record id="seq_manufacture" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">D%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的原料 Components.-->
<record id="seq_component" model="ir.sequence">
<field name="name">Sequence for Components Product</field>
<field name="code">product.product</field>
<field name="prefix">C%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品 Sourced Products.-->
<record id="seq_sourced" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">S%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<record id="internal_type_manufacture" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">d</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "D" in link sequence</field>
<field name="link_sequence" ref="seq_manufacture"/>
</record>
<record id="internal_type_sourced" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">s</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "S" in link sequence</field>
<field name="link_sequence" ref="seq_sourced"/>
</record>
<record id="internal_type_component" model="product.internal.type">
<field name="name">Components Product</field>
<field name="ref">c</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "C" in link sequence</field>
<field name="link_sequence" ref="seq_component"/>
</record>
<!--设置产品默认值为制造产品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('app_product_sequence.internal_type_manufacture'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 生产原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">CL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--[(4, ref('purchase.route_warehouse0_buy')),(4, ref('mrp.route_warehouse0_manufacture')),(4, ref('stock.route_warehouse0_mto'))]-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">成品</field>
<field name="ref">cp</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">制造的成品。如:床,桌子</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">板件</field>
<field name="ref">bj</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">制造的半成品。如:床的左侧板,柜子的顶板</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">原材料(板材)</field>
<field name="ref">bc</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">制造所需的原材料,不可直接销售。如:中纤板(厚14mm)</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">外购成品</field>
<field name="ref">cl</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">采购后可直接销售,也可当原材料的成品。如:门把手</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!--这个默认值可以不用因为在onchange事件会设置很多值-->
<!--设置产品默认值为制造成品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,91 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 生产原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">CL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">cp</field>
<field name="description">Set prefix as "CP" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">Manufactured Components</field>
<field name="ref">bj</field>
<field name="description">Set prefix as "BJ" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">Sourced Material</field>
<field name="ref">bc</field>
<field name="description">Set prefix as "BC" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">cl</field>
<field name="description">Set prefix as "cl" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!--设置产品默认值为制造成品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,34 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
def pre_init_hook(cr):
"""
Updates existing codes matching the default 'New' or
empty. Primarily this ensures installation does not
fail for demo data.
:param cr: database cursor
:return: void
"""
cr.execute("UPDATE product_product "
"SET default_code = '!!PR!!' || id "
"WHERE default_code IS NULL OR default_code = 'New';")
cr.execute("UPDATE product_template "
"Set default_code = "
"(select default_code from product_product "
"where product_product.product_tmpl_id = product_template.id limit 1)"
"WHERE default_code IS NULL OR default_code = 'New';")

View File

@@ -1,221 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_product_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0-20171107\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-18 19:02+0000\n"
"PO-Revision-Date: 2017-12-18 19:02+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_sequence
#: model:ir.model.fields,help:app_product_sequence.field_product_internal_type_type
msgid "A stockable product is a product for which you manage stock. The \"Inventory\" app has to be installed.\n"
"A consumable product, on the other hand, is a product for which stock is not managed.\n"
"A service is a non-material product you provide.\n"
"A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on the e-commerce such as e-books, music, pictures,... The \"Digital Product\" module has to be installed."
msgstr "A stockable product is a product for which you manage stock. The \"Inventory\" app has to be installed.\n"
"A consumable product, on the other hand, is a product for which stock is not managed.\n"
"A service is a non-material product you provide.\n"
"A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on the e-commerce such as e-books, music, pictures,... The \"Digital Product\" module has to be installed."
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_purchase_ok
msgid "Can be Purchased"
msgstr "可用于采购"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_rental
msgid "Can be Rent"
msgstr "可用于出租"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_sale_ok
msgid "Can be Sold"
msgstr "可用于销售"
#. module: app_product_sequence
#: code:addons/app_product_sequence/models/product_internal_type.py:34
#: selection:product.internal.type,type:0
#, python-format
msgid "Consumable"
msgstr "可消耗"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_create_uid
msgid "Created by"
msgstr "创建人"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_create_date
msgid "Created on"
msgstr "创建时间"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_category_internal_type
msgid "Default Internal Type"
msgstr "默认产品内部类型"
#. module: app_product_sequence
#: model:ir.ui.view,arch_db:app_product_sequence.product_internal_type_form_view
msgid "Auto Set Product's Value To:"
msgstr "自动设置产品默认参数为:"
#. module: app_product_sequence
#: model:ir.model.fields,help:app_product_sequence.field_product_internal_type_route_ids
msgid "Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,..."
msgstr "取决于安装的模块它允许在产品定义路线购买制造MTO/MTS等等..."
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_description
msgid "Description"
msgstr "说明"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_display_name
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_name
#: model:ir.ui.view,arch_db:app_product_sequence.product_internal_type_form_view
msgid "Display Name"
msgstr "显示名称"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_id
msgid "ID"
msgstr "ID"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_product_default_code_index
msgid "Internal Reference Index"
msgstr "Varient序号"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_product_default_code_stored
#: model:ir.model.fields,field_description:app_product_sequence.field_product_template_default_code_stored
msgid "Internal Reference Stored"
msgstr "主产品编码"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_product_internal_type
#: model:ir.model.fields,field_description:app_product_sequence.field_product_template_internal_type
msgid "Internal Type"
msgstr "内部类型(编码)"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type___last_update
msgid "Last Modified on"
msgstr "最后修改日"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_write_uid
msgid "Last Updated by"
msgstr "最后更新人"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_write_date
msgid "Last Updated on"
msgstr "最后更新时间"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_link_sequence
msgid "Link Sequence"
msgstr "使用的序列"
#. module: app_product_sequence
#: code:addons/app_product_sequence/models/product_template.py:41
#, python-format
msgid "Please save product first before adding varients!"
msgstr "增加产品变体前,请先保存当前产品!"
#. module: app_product_sequence
#: model:ir.model.fields,help:app_product_sequence.field_product_internal_type_sequence_prefix
msgid "Prefix value of the record for the sequence"
msgstr "序列记录的前缀"
#. module: app_product_sequence
#: model:ir.model,name:app_product_sequence.model_product_product
msgid "Product"
msgstr "产品"
#. module: app_product_sequence
#: model:ir.model,name:app_product_sequence.model_product_category
msgid "Product Category"
msgstr "产品类别"
#. module: app_product_sequence
#: model:ir.actions.act_window,name:app_product_sequence.internal_type_action
#: model:ir.ui.menu,name:app_product_sequence.menu_internal_type_action_sale
#: model:ir.ui.menu,name:app_product_sequence.menu_internal_type_action_stock
#: model:ir.ui.menu,name:app_product_sequence.menu_internal_type_action_sys
#: model:ir.ui.view,arch_db:app_product_sequence.product_internal_type_form_view
#: model:ir.ui.view,arch_db:app_product_sequence.product_internal_type_tree_view
msgid "Product Internal Type"
msgstr "内部类型(编码)"
#. module: app_product_sequence
#: model:ir.model,name:app_product_sequence.model_product_template
msgid "Product Template"
msgstr "产品模板"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_type
msgid "Product Type"
msgstr "产品类型"
#. module: app_product_sequence
#: code:addons/app_product_sequence/models/product_product.py:83
#, python-format
msgid "Product varient can only create in Product view!"
msgstr "请在产品管理页面增加产品的多属性!"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_route_ids
msgid "Routes"
msgstr "路线"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_sequence_prefix
msgid "Sequence Prefix"
msgstr "编号前缀"
#. module: app_product_sequence
#: code:addons/app_product_sequence/models/product_internal_type.py:35
#: selection:product.internal.type,type:0
#, python-format
msgid "Service"
msgstr "服务"
#. module: app_product_sequence
#: model:ir.model.fields,help:app_product_sequence.field_product_internal_type_sale_ok
msgid "Specify if the product can be selected in a sales order line."
msgstr "如果产品能在销售单明细在被选择,则指定。"
#. module: app_product_sequence
#: code:addons/app_product_sequence/models/product_internal_type.py:36
#: selection:product.internal.type,type:0
#, python-format
msgid "Stockable Product"
msgstr "可库存产品"
#. module: app_product_sequence
#: sql_constraint:product.internal.type:0
#: sql_constraint:product.product:0
msgid "The reference must be unique"
msgstr "产品内部编码不可重复!"
#. module: app_product_sequence
#: model:ir.model.fields,field_description:app_product_sequence.field_product_internal_type_ref
msgid "Unique Code"
msgstr "唯一编码"
#. module: app_product_sequence
#: model:ir.model,name:app_product_sequence.model_product_internal_type
msgid "product.internal.type"
msgstr "product.internal.type"

View File

@@ -1,5 +0,0 @@
# -*- coding: utf-8 -*-
import product_template
import product_product
import product_category
import product_internal_type

View File

@@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-11-28
# 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, exceptions, _
class ProductCategory(models.Model):
_name = "product.category"
_inherit = ['product.category']
internal_type = fields.Many2one(
'product.internal.type', 'Default Internal Type',
auto_join=True, required=False)

View File

@@ -1,62 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
from openerp import api, fields, models, _
class ProductInternalType(models.Model):
_name = "product.internal.type"
name = fields.Char('Display Name', default='Normal', translate=True)
description = fields.Char('Description')
ref = fields.Char('Unique Code', required=True)
link_sequence = fields.Many2one(
'ir.sequence', 'Link Sequence',
auto_join=True, required=True, domain="[('code', '=', 'product.product')]")
sequence_prefix = fields.Char(u'Sequence Prefix', related='link_sequence.prefix', readonly=True, store=False)
# 各种默认值,填则自动录入,不填则不管
type = fields.Selection([
('consu', _('Consumable')),
('service', _('Service')),
('product', _('Stockable Product'))], string='Product Type',
help='A stockable product is a product for which you manage stock. The "Inventory" app has to be installed.\n'
'A consumable product, on the other hand, is a product for which stock is not managed.\n'
'A service is a non-material product you provide.\n'
'A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on '
'the e-commerce such as e-books, music, pictures,... The "Digital Product" module has to be installed.')
rental = fields.Boolean('Can be Rent')
sale_ok = fields.Boolean(
'Can be Sold', default=True,
help="Specify if the product can be selected in a sales order line.")
purchase_ok = fields.Boolean('Can be Purchased', default=True)
# 使用目录的默认路线来处理,暂时不用内部类型路线
route_ids = fields.Many2many('stock.location.route', string='Routes',
domain=[('product_selectable', '=', True)],
help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
# company_id = fields.Many2one(
# 'res.company', 'Company',
# default=lambda self: self.env.user.company_id.id, index=1)
_sql_constraints = [
('uniq_ref',
'unique(ref)',
'The reference must be unique'),
]

View File

@@ -1,84 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
from openerp import models, fields, api, exceptions, _
class ProductProduct(models.Model):
_inherit = 'product.product'
default_code = fields.Char('Internal Reference', index=True, readonly=True, default=lambda self: _('New'), copy=False)
default_code_index = fields.Integer('Internal Reference Index', readonly=True)
_sql_constraints = [
('uniq_default_code',
'unique(default_code)',
'The reference must be unique'),
]
@api.model
def create(self, vals):
# todo: but 先建空白产品后编辑给2个以上变体序号会少个 -1
# code_index: 当没有变体现时值为0有变体时为该变体序号
if 'default_code' not in vals or vals['default_code'] == 'New':
code_index = 0
if 'product_tmpl_id' in vals:
template = self.env['product.template'].search([('id', '=', vals['product_tmpl_id'])], limit=1)
mylen = len(template.product_variant_ids)
# created from product_template
if 'product_tmpl_id' in vals:
template = self.env['product.template'].search([('id', '=', vals['product_tmpl_id'])], limit=1)
attr = vals['attribute_value_ids'][0][2]
if not(attr):
# 没有属性值则是单规格产品。attribute_value_ids格式为[6,0,[]]。多规格时attribute_value_ids格式为[6,0,[x]]
code_index = 0
vals['default_code_index'] = code_index
vals['default_code'] = template.default_code_stored
elif mylen == 0:
# 有属性值了,自己是第一个规格
code_index = 1
vals['default_code_index'] = code_index
vals['default_code'] = template.default_code_stored + '-%03d'%(code_index)
elif mylen == 1:
# 已存在1个当存在的1个有属性时要改已存在的product值
code_index = template.product_variant_ids[:1].default_code_index
if template.product_variant_ids[:1].attribute_value_ids:
if code_index == 0:
code_index = 1
template.product_variant_ids[:1].default_code_index = code_index
template.product_variant_ids[:1].default_code = template.default_code_stored + '-%03d'%(code_index)
# 接着改当前操作的product值
code_index = code_index + 1
vals['default_code_index'] = code_index
vals['default_code'] = template.default_code_stored + '-%03d'%(code_index)
else:
# 找到最大的序号
variant_max = max(template.product_variant_ids,key=lambda x: x['default_code_index'])
code_index = variant_max['default_code_index'] + 1
vals['default_code_index'] = code_index
vals['default_code'] = template.default_code_stored + '-%03d'%(code_index)
else:
# create from product_product
sequence = self.env['product.internal.type'].search([('id', '=', vals['internal_type'])], limit=1)
if sequence:
vals['default_code'] = sequence.link_sequence.next_by_id()
return super(ProductProduct, self).create(vals)
@api.multi
def copy(self, default=None):
if len(self.product_tmpl_id.product_variant_ids)>1 :
raise exceptions.ValidationError(_('Product varient can only create in Product view!'))
return super(ProductProduct, self).copy(default=None)

View File

@@ -1,76 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
from openerp import api, fields, models, exceptions, _
class ProductTemplate(models.Model):
_name = "product.template"
_inherit = ['product.template']
# auto_join只要搜索product.template自动会join。如果经常用到 internal_type 效率会高。
internal_type = fields.Many2one(
'product.internal.type', 'Internal Type',
auto_join=True, required=True)
default_code = fields.Char(
'Internal Reference', compute='_compute_default_code',
inverse='_set_default_code', store=True, readonly=True,
default='New', copy=False)
# 因为default_code有odoo的处理方式影响面大故会将其另存到 default_code_stored
default_code_stored = fields.Char('Internal Reference Stored',default='New')
@api.model
def create(self, vals):
if 'attribute_line_ids' in vals:
if len(vals['attribute_line_ids'])>0:
raise exceptions.ValidationError(_('Please save product first before adding varients!'))
if 'default_code' not in vals or vals['default_code'] == 'New':
sequence = self.env['product.internal.type'].search([('id', '=', vals['internal_type'])], limit=1)
vals['default_code'] = sequence.link_sequence.next_by_id()
vals['default_code_stored'] = vals['default_code']
return super(ProductTemplate, self).create(vals)
@api.depends('product_variant_ids', 'product_variant_ids.default_code')
def _compute_default_code(self):
unique_variants = self.filtered(lambda template: len(template.product_variant_ids) == 1)
for template in unique_variants:
template.default_code = template.product_variant_ids.default_code
for template in (self):
if len(template.product_variant_ids)>1:
template.default_code = ''
@api.one
def _set_default_code(self):
if len(self.product_variant_ids) == 1:
self.product_variant_ids.default_code = self.default_code_stored
# 当内部类型变化时,改变产品模板的各默认值
@api.onchange('internal_type')
def _onchange_internal_type(self):
if self.internal_type:
self.type = self.internal_type.type
self.rental = self.internal_type.rental
self.sale_ok = self.internal_type.sale_ok
self.purchase_ok = self.internal_type.purchase_ok
self.route_ids = self.internal_type.route_ids
# 分类变动时,如果分类绑定了内部类型则联动
@api.onchange('categ_id')
def _onchange_cate_id(self):
if self.categ_id and self.categ_id.internal_type:
self.internal_type = self.categ_id.internal_type

View File

@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_order_type_manager,access_sale_order_type_manager,model_product_internal_type,sales_team.group_sale_manager,1,1,1,1
access_sale_order_type_salesman,access_sale_order_type_salesman,model_product_internal_type,sales_team.group_sale_salesman,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sale_order_type_manager access_sale_order_type_manager model_product_internal_type sales_team.group_sale_manager 1 1 1 1
3 access_sale_order_type_salesman access_sale_order_type_salesman model_product_internal_type sales_team.group_sale_salesman 1 0 0 0

View File

@@ -1,12 +0,0 @@
<?xml version="1.0"?>
<odoo>
<record model="ir.rule" id="product_internal_type_comp_rule">
<field name="name">Product Internal Type multi-company</field>
<field name="model_id" ref="app_product_sequence.model_product_internal_type"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="perm_read" eval="1"/>
<field name="perm_create" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
</record>
</odoo>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,162 +0,0 @@
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<h2 class="oe_slogan" style="color:#875A7B;">App Product Auto Sequence, Auto Code(Variants Supported)</h2>
<div>
<p>
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
</p>
<ul>
<li>
Auto Sequence or code for every product.
</li>
<li>
Auto Sequence or for every product variants, like product20171130-001.
</li>
<li>
Product code must be Unique.
</li>
<li>
Define different product type, each product type use own rule of sequence.
</li>
<li>
Quick access in sale , inventory, system menu.
</li>
<li>
Multi language support.
</li>
</ul>
<div>
<img class="oe_picture oe_screenshot" src="set1.jpg">
</div>
<div>
<img class="oe_picture oe_screenshot" src="set2.jpg">
</div>
<h2>Sample Rule: if we create on oct 2017</h2>
<ul>
<li>
Manufactured Products: M20171100001
</li>
<li>
Components Products: C20171100001
</li>
<li>
Sourced Products: S20171100001
</li>
</ul>
<p>
Sepcial for variants. add [-00?]<br/>
<ul>
<li>
Products with color[red]: M20171100001-001
</li>
<li>
Products with color[blue]: M20171100001-002
</li>
<li>
Products with color[white]: M20171100001-003
</li>
</ul>
</p>
<h2>Installation:</h2>
<p>
Prior to installing this module, if you have any existing products you should ensure they already have a
unique reference (or no reference) set.<br/>
Products with a default_code of '/' or empty will automatically be assigned a code of "!!DP!!" followed
by the system id for that product.<br/>
Otherwise the setting of the unique constraint will fail and the module will fail to install.<br/>
Notice:<br/>
Odoo product variants is very special.<br/>
When u create a product(not product template) with attribute, It would delete the first product, which
have no attribute.
So it's very normal that the first product variants begin wit ???-002.<br/>
And we make a rule that the product variants can only create after you create normal product template.
</p>
<h2>How to use: Very simple</h2>
<p>
After installed the app. You can Go to anyone of the menu:<br/>
<ul>
<li>
Sales->Configuration->Products->Product Internal Type
</li>
<li>
Inventory->Configuration->Products->Product Internal Type
</li>
<li>
Settings->Sequences & Identifiers->Product Internal Type
</li>
</ul>
</p>
<p>
You would see the default Product Intertype we create.
<div>
<img class="oe_picture oe_screenshot" src="set3.jpg">
</div>
</p>
<p>
And create the product and code by yourself.
<div>
<img class="oe_picture oe_screenshot" src="set4.jpg">
</div>
</p>
<p>
Notice: The "Sequence Code" Field of sequence must be "product.product"
<div>
<img class="oe_picture oe_screenshot" src="set5.jpg">
</div>
</p>
Go to Prior to installing this module, if you have any existing products you should ensure they already have
a
unique reference (or no reference) set.<br/>
Products with a default_code of '/' or empty will automatically be assigned a code of "!!DP!!" followed
by the system id for that product.<br/>
Otherwise the setting of the unique constraint will fail and the module will fail to install.<br/>
Notice:<br/>
Odoo product variants is very special.<br/>
When u create a product(not product template) with attribute, It would delete the first product, which
have no attribute.
So it's very normal that the first product variants begin wit ???-002.<br/>
And we make a rule that the product variants can only create after you create normal product template.
</p>
</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.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -1,15 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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 test_product_sequence

View File

@@ -1,59 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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 odoo.tests.common import TransactionCase
from ..hooks import pre_init_hook
class TestProductSequence(TransactionCase):
"""Tests for creating product with and without Product Sequence"""
def setUp(self):
super(TestProductSequence, self).setUp()
self.product_product = self.env['product.product']
def test_product_create_with_default_code(self):
product = self.product_product.create(dict(
name="Apple",
default_code='PROD01'
))
self.assertEqual(product.default_code, 'PROD01')
def test_product_create_without_default_code(self):
product_1 = self.product_product.create(dict(
name="Orange",
default_code='/'))
self.assertRegexpMatches(str(product_1.default_code), r'PR/*')
def test_product_copy(self):
product_2 = self.product_product.create(dict(
name="Apple",
default_code='PROD02'
))
copy_product_2 = product_2.copy()
self.assertEqual(copy_product_2.default_code, 'PROD02-copy')
def test_pre_init_hook(self):
product_3 = self.product_product.create(dict(
name="Apple",
default_code='PROD03'
))
self.cr.execute(
"update product_product set default_code='/' where id=%s"
% (product_3.id,))
product_3.invalidate_cache()
self.assertEqual(product_3.default_code, '/')
pre_init_hook(self.cr)
product_3.invalidate_cache()
self.assertEqual(product_3.default_code, '!!mig!!%s' % (product_3.id,))

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--目录list-->
<record id="product_category_list_view_internal_type" model="ir.ui.view">
<field name="name">product.category.list.internal_type</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_list_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='display_name']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
<!--目录Form-->
<record id="product_category_form_view_internal_type" model="ir.ui.view">
<field name="name">product.category.form._internal_type</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品内部类型list-->
<record id="product_internal_type_tree_view" model="ir.ui.view">
<field name="name">product.internal.type.tree</field>
<field name="model">product.internal.type</field>
<field name="arch" type="xml">
<tree string="Product Internal Type">
<field name="name"/>
<field name="ref"/>
<field name="type"/>
<field name="sale_ok"/>
<field name="purchase_ok"/>
<field name="route_ids" widget="many2many_tags"/>
<field name="link_sequence" context="{'default_code': 'product.product'}"/>
<field name="sequence_prefix"/>
<field name="description"/>
</tree>
</field>
</record>
<!--产品内部类型from-->
<record id="product_internal_type_form_view" model="ir.ui.view">
<field name="name">product.internal.type.form</field>
<field name="model">product.internal.type</field>
<field name="arch" type="xml">
<form string="Product Internal Type">
<sheet>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Display Name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="ref"/>
</group>
<group>
<field name="description"/>
</group>
</group>
<group>
<field name="link_sequence"/>
<field name="sequence_prefix"/>
</group>
<group string="Auto Set Product's Value To:">
<group>
<field name="type"/>
<field name="route_ids" widget="many2many_checkboxes"/>
</group>
<group>
<field name="sale_ok"/>
<field name="purchase_ok"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="internal_type_action" model="ir.actions.act_window">
<field name="name">Product Internal Type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.internal.type</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="app_product_sequence.internal_type_action" id="menu_internal_type_action_sys" parent="base.next_id_5"/>
<menuitem action="app_product_sequence.internal_type_action" id="menu_internal_type_action_sale"
parent="sale.prod_config_main" sequence="6" groups="base.group_no_one"/>
<menuitem action="app_product_sequence.internal_type_action" id="menu_internal_type_action_stock"
parent="stock.menu_product_in_config_stock" sequence="3" groups="base.group_no_one"/>
</data>
</openerp>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品list-->
<record id="product_product_tree_view" model="ir.ui.view">
<field name="name">product.product.tree</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品模板list-->
<record id="product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.product.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="before">
<field name="internal_type"/>
</xpath>
</field>
</record>
<!--产品Form-->
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='options']" position="before">
<div>
<label for="internal_type"/>
<field name="internal_type" options="{'no_create': True,'no_open': True}"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,22 +0,0 @@
App Product Auto Sequence, Auto Code(Variants Supported)
1.<2E>Զ<EFBFBD><D4B6><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>
2.<2E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EBA3AC>ʽΪ <20><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>-001<30><31>
3.<2E><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF>Ҫ<EFBFBD><D2AA>Ψһ<CEA8><D2BB>
4.<2E><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD>ͬ<EFBFBD><CDAC>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>ʹ<EFBFBD>ò<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۡ<EFBFBD><DBA1><EFBFBD><EFBFBD>桢ϵͳ<CFB5>˵<EFBFBD><CBB5>п<EFBFBD><D0BF>ٶ<EFBFBD><D9B6>
6.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>֡<EFBFBD>
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
1.Auto Sequence or code for every product.<2E>Զ<EFBFBD><D4B6><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>
2.Auto Sequence or for every product variants, like product20171130-001.<2E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EBA3AC>ʽΪ <20><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>-001<30><31>
3.Product code must be Unique.<2E><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF>Ҫ<EFBFBD><D2AA>Ψһ<CEA8><D2BB>
4.Define different product type, each product type use own rule of sequence.<2E><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD>ͬ<EFBFBD><CDAC>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>ʹ<EFBFBD>ò<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
5.Quick access in sale , inventory, system menu.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۡ<EFBFBD><DBA1><EFBFBD><EFBFBD>桢ϵͳ<CFB5>˵<EFBFBD><CBB5>п<EFBFBD><D0BF>ٶ<EFBFBD><D9B6>
6.Multi language support.<br/><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>֡<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
http://www.sunpop.cn/product/app-product-auto-sequence-auto-codevariants-supported/

View File

@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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:
'''
import models
import controllers
from .hooks import pre_init_hook

View File

@@ -1,67 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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 Product Internal Type,Auto Sequence, Auto Code(Variants Supported), Auto Attributes',
'summary': 'Auto Internal Reference.',
"version": '10.0.2.2',
'category': 'Sales',
'author': 'Sunpop.cn',
'website': 'http://www.sunpop.cn',
'license': 'AGPL-3',
'sequence': 2,
'installable': True,
'auto_install': True,
'application': True,
'images': ['static/description/set2.jpg'],
'currency': 'EUR',
'price': 98,
'description': u"""
App Product Auto Sequence, Auto Code(Variants Supported), Auto Attributes
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
1.Auto Sequence or code for every product.自动产品编码。
2.Auto Sequence or for every product variants, like product20171130-001.自动多规格产品编码,形式为 主产品编码-001。
3.Product code must be Unique.产品编码强制要求唯一。
4.Define different product type, each product type use own rule of sequence.可自定义产品类型,不同产品类型使用不同编码规则。
5.Quick access in sale , inventory, system menu.可以在销售、库存、系统菜单中快速定义。
6.Multi language support.<br/>多语种支持。
7.Setup default Auto Sequence for each product category自动设置每个产品目录使用的产品编码规则
8.Auto setup product attribute lik Sale/Purchase, Stockable/Consumable/Service, Stock Routes. 自动设置产品的销售/采购,可库存产品/服务/消耗品,购买/制造/按订单生成等库存路线
""",
'pre_init_hook': 'pre_init_hook',
'depends': [
'product',
'stock',
'sale',
'purchase',
'mrp',
],
'data': [
# 视图
"security/ir.model.access.csv",
"security/security.xml",
'views/product_template_view.xml',
'views/product_product_view.xml',
'views/product_category_view.xml',
'views/product_internal_type_view.xml',
'data/product_sequence.xml',
],
'demo': [
],
}

View File

@@ -1 +0,0 @@
import main

View File

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

View File

@@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">PR%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">WL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--[(4, ref('purchase.route_warehouse0_buy')),(4, ref('mrp.route_warehouse0_manufacture')),(4, ref('stock.route_warehouse0_mto'))]-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">cp</field>
<field name="sequence">1</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "CP" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">Manufactured Components</field>
<field name="ref">bj</field>
<field name="sequence">2</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BJ" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">Components Product</field>
<field name="ref">bc</field>
<field name="sequence">3</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BC" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">wl</field>
<field name="sequence">4</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "WL" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!-- 服务与费用 Service-->
<record id="internal_type_service" model="product.internal.type">
<field name="name">Service</field>
<field name="ref">fw</field>
<field name="sequence">5</field>
<field name="type">service</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="description">Set prefix as "PR" in link sequence</field>
<field name="link_sequence" ref="seq_product_auto"/>
</record>
<!-- 消耗品,无限库存 Consu-->
<record id="internal_type_consu" model="product.internal.type">
<field name="name">Consumer</field>
<field name="ref">xh</field>
<field name="sequence">6</field>
<field name="type">consu</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="description">Set prefix as "PR" in link sequence</field>
<field name="link_sequence" ref="seq_product_auto"/>
</record>
<!--这个默认值可以不用因为在onchange事件会设置很多值-->
<!--设置产品默认值为制造成品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品 manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">D%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的原料 Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Components Product</field>
<field name="code">product.product</field>
<field name="prefix">C%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">S%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 服务与费用 Service-->
<record id="seq_service" model="ir.sequence">
<field name="name">Service</field>
<field name="code">product.product</field>
<field name="prefix">V%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
</data>
<data noupdate="0">
<!-- internal_type 数据-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">d</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "D" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">Components Product</field>
<field name="ref">c</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "C" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">s</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "S" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<record id="internal_type_service" model="product.internal.type">
<field name="name">Service</field>
<field name="ref">v</field>
<field name="type">service</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(5)]"/>
<field name="description">Set prefix as "V" in link sequence</field>
<field name="link_sequence" ref="seq_service"/>
</record>
<!--设置产品默认值为制造产品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('app_product_type_sequence.internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,134 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">PR%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 生产原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">WL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--[(4, ref('purchase.route_warehouse0_buy')),(4, ref('mrp.route_warehouse0_manufacture')),(4, ref('stock.route_warehouse0_mto'))]-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">图纸成品</field>
<field name="ref">cp</field>
<field name="sequence">1</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture')])]"/>
<field name="description">Set prefix as "CP" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">图纸板件</field>
<field name="ref">bj</field>
<field name="sequence">2</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture')])]"/>
<field name="description">Set prefix as "BJ" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">大板</field>
<field name="ref">bc</field>
<field name="sequence">3</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy')])]"/>
<field name="description">Set prefix as "BC" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">基础物料</field>
<field name="ref">cl</field>
<field name="sequence">4</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy')])]"/>
<field name="description">Set prefix as "CL" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!-- 服务与费用 Service-->
<record id="internal_type_service" model="product.internal.type">
<field name="name">服务与费用</field>
<field name="ref">fw</field>
<field name="sequence">5</field>
<field name="type">service</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="description">Set prefix as "PR" in link sequence</field>
<field name="link_sequence" ref="seq_product_auto"/>
</record>
<!-- 消耗品,无限库存 Consu-->
<record id="internal_type_consu" model="product.internal.type">
<field name="name">消耗品</field>
<field name="ref">xh</field>
<field name="sequence">6</field>
<field name="type">consu</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="description">Set prefix as "PR" in link sequence</field>
<field name="link_sequence" ref="seq_product_auto"/>
</record>
<!--这个默认值可以不用因为在onchange事件会设置很多值-->
<!--设置产品默认值为制造成品-->
<!--<record id="product_internal_type_default" model="ir.values">-->
<!--<field name="name">internal_type</field>-->
<!--<field name="model">product.template</field>-->
<!--<field name="key">default</field>-->
<!--<field name="key2"></field>-->
<!--<field name="company_id" ref="base.main_company"/>-->
<!--<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>-->
<!--</record>-->
</data>
</odoo>

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 更新序号规则 Auto Internal Reference. -->
<!-- 所有的 All Products. -->
<record id="seq_product_auto" model="ir.sequence">
<field name="name">Sequence for All Products</field>
<field name="code">product.product</field>
<field name="prefix">P%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的成品,如"床" manufactured Products. -->
<record id="seq_mrp_product" model="ir.sequence">
<field name="name">Sequence for Manufactured Product</field>
<field name="code">product.product</field>
<field name="prefix">CP%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造的板件,如"顶板" Components.-->
<record id="seq_mrp_component" model="ir.sequence">
<field name="name">Sequence for Manufactured Components</field>
<field name="code">product.product</field>
<field name="prefix">BJ%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 制造原材料,采购的板材,如"16mm中纤板" Components.-->
<record id="seq_sourced_material" model="ir.sequence">
<field name="name">Sequence for Sourced Material</field>
<field name="code">product.product</field>
<field name="prefix">BC%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- 采购的成品,如"五金",纯买入卖出类 Sourced Products.-->
<record id="seq_sourced_product" model="ir.sequence">
<field name="name">Sequence for Sourced Product</field>
<field name="code">product.product</field>
<field name="prefix">CL%(y)s%(month)s</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
<field name="initial">True</field>
</record>
<!-- internal_type 数据-->
<!--[(4, ref('purchase.route_warehouse0_buy')),(4, ref('mrp.route_warehouse0_manufacture')),(4, ref('stock.route_warehouse0_mto'))]-->
<!--成品-->
<record id="internal_type_mrp_product" model="product.internal.type">
<field name="name">Manufactured Product</field>
<field name="ref">cp</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "CP" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_product"/>
</record>
<!--板件-->
<record id="internal_type_mrp_component" model="product.internal.type">
<field name="name">Manufactured Components</field>
<field name="ref">bj</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">0</field>
<field name="route_ids" eval="[(6,0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BJ" in link sequence</field>
<field name="link_sequence" ref="seq_mrp_component"/>
</record>
<!--纯制造原材料,板材-->
<record id="internal_type_sourced_material" model="product.internal.type">
<field name="name">Components Product</field>
<field name="ref">bc</field>
<field name="type">product</field>
<field name="sale_ok">0</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "BC" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_material"/>
</record>
<!--其它外购品,如五金-->
<record id="internal_type_sourced_product" model="product.internal.type">
<field name="name">Sourced Product</field>
<field name="ref">cl</field>
<field name="type">product</field>
<field name="sale_ok">1</field>
<field name="purchase_ok">1</field>
<field name="route_ids" eval="[(6,0, [ref('purchase.route_warehouse0_buy'),ref('stock.route_warehouse0_mto')])]"/>
<field name="description">Set prefix as "CL" in link sequence</field>
<field name="link_sequence" ref="seq_sourced_product"/>
</record>
<!--这个默认值可以不用因为在onchange事件会设置很多值-->
<!--设置产品默认值为制造成品-->
<record id="product_internal_type_default" model="ir.values">
<field name="name">internal_type</field>
<field name="model">product.template</field>
<field name="key">default</field>
<field name="key2"></field>
<field name="company_id" ref="base.main_company"/>
<field name="value" eval="'I' + str(ref('internal_type_mrp_product'))+'\n.'"/>
</record>
</data>
</odoo>

View File

@@ -1,34 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
def pre_init_hook(cr):
"""
Updates existing codes matching the default 'New' or
empty. Primarily this ensures installation does not
fail for demo data.
:param cr: database cursor
:return: void
"""
cr.execute("UPDATE product_product "
"SET default_code = '!!PR!!' || id "
"WHERE default_code IS NULL OR default_code = 'New';")
cr.execute("UPDATE product_template "
"Set default_code = "
"(select default_code from product_product "
"where product_product.product_tmpl_id = product_template.id limit 1)"
"WHERE default_code IS NULL OR default_code = 'New';")

View File

@@ -1,249 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_product_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0+e-20171107\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-19 13:34+0000\n"
"PO-Revision-Date: 2017-12-19 13:34+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_type_sequence
#: model:ir.model.fields,help:app_product_type_sequence.field_product_internal_type_type
msgid "A stockable product is a product for which you manage stock. The \"Inventory\" app has to be installed.\n"
"A consumable product, on the other hand, is a product for which stock is not managed.\n"
"A service is a non-material product you provide.\n"
"A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on the e-commerce such as e-books, music, pictures,... The \"Digital Product\" module has to be installed."
msgstr "A stockable product is a product for which you manage stock. The \"Inventory\" app has to be installed.\n"
"A consumable product, on the other hand, is a product for which stock is not managed.\n"
"A service is a non-material product you provide.\n"
"A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on the e-commerce such as e-books, music, pictures,... The \"Digital Product\" module has to be installed."
#. module: app_product_type_sequence
#: model:ir.ui.view,arch_db:app_product_type_sequence.product_internal_type_form_view
msgid "Auto Set Product's Value To:"
msgstr "自动设置产品默认参数为:"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_purchase_ok
msgid "Can be Purchased"
msgstr "可用于采购"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_rental
msgid "Can be Rent"
msgstr "可用于出租"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_sale_ok
msgid "Can be Sold"
msgstr "可用于销售"
#. module: app_product_type_sequence
#: model:product.internal.type,name:app_product_type_sequence.internal_type_sourced_material
msgid "Components Product"
msgstr "原材料"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_internal_type.py:34
#: selection:product.internal.type,type:0
#, python-format
msgid "Consumable"
msgstr "可消耗"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_create_uid
msgid "Created by"
msgstr "创建人"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_create_date
msgid "Created on"
msgstr "创建时间"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_category_internal_type
msgid "Default Internal Type"
msgstr "默认产品内部类型"
#. module: app_product_type_sequence
#: model:ir.model.fields,help:app_product_type_sequence.field_product_internal_type_route_ids
msgid "Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,..."
msgstr "取决于安装的模块它允许在产品定义路线购买制造MTO/MTS等等..."
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_description
msgid "Description"
msgstr "说明"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_display_name
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_name
#: model:ir.ui.view,arch_db:app_product_type_sequence.product_internal_type_form_view
msgid "Display Name"
msgstr "显示名称"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_id
msgid "ID"
msgstr "ID"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_product_default_code_index
msgid "Internal Reference Index"
msgstr "Varient序号"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_product_default_code_stored
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_template_default_code_stored
msgid "Internal Reference Stored"
msgstr "主产品编码"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_product_internal_type
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_template_internal_type
msgid "Internal Type"
msgstr "内部类型"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type___last_update
msgid "Last Modified on"
msgstr "最后修改日"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_write_uid
msgid "Last Updated by"
msgstr "最后更新人"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_write_date
msgid "Last Updated on"
msgstr "最后更新时间"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_link_sequence
msgid "Link Sequence"
msgstr "使用的序列"
#. module: app_product_type_sequence
#: model:product.internal.type,name:app_product_type_sequence.internal_type_mrp_product
msgid "Manufactured Product"
msgstr "制造成品"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_product.py:23
#: code:addons/app_product_type_sequence/models/product_template.py:33
#, python-format
msgid "New"
msgstr "新建"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_template.py:41
#, python-format
msgid "Please save product first before adding varients!"
msgstr "增加产品变体前,请先保存当前产品!"
#. module: app_product_type_sequence
#: model:ir.model.fields,help:app_product_type_sequence.field_product_internal_type_sequence_prefix
msgid "Prefix value of the record for the sequence"
msgstr "序列记录的前缀"
#. module: app_product_type_sequence
#: model:ir.model,name:app_product_type_sequence.model_product_product
msgid "Product"
msgstr "产品"
#. module: app_product_type_sequence
#: model:ir.model,name:app_product_type_sequence.model_product_category
msgid "Product Category"
msgstr "产品类别"
#. module: app_product_type_sequence
#: model:ir.actions.act_window,name:app_product_type_sequence.internal_type_action
#: model:ir.ui.menu,name:app_product_type_sequence.menu_internal_type_action_purchase
#: model:ir.ui.menu,name:app_product_type_sequence.menu_internal_type_action_sale
#: model:ir.ui.menu,name:app_product_type_sequence.menu_internal_type_action_stock
#: model:ir.ui.menu,name:app_product_type_sequence.menu_internal_type_action_sys
#: model:ir.ui.view,arch_db:app_product_type_sequence.product_internal_type_form_view
#: model:ir.ui.view,arch_db:app_product_type_sequence.product_internal_type_tree_view
msgid "Product Internal Type"
msgstr "产品编码类型"
#. module: app_product_type_sequence
#: model:ir.model,name:app_product_type_sequence.model_product_template
msgid "Product Template"
msgstr "产品模板"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_type
msgid "Product Type"
msgstr "产品类型"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_product.py:83
#, python-format
msgid "Product varient can only create in Product view!"
msgstr "请在产品管理页面增加产品的多属性!"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_route_ids
msgid "Routes"
msgstr "路线"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_sequence_prefix
msgid "Sequence Prefix"
msgstr "编号前缀"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_sequence
msgid "Sequence"
msgstr "显示顺序"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_internal_type.py:35
#: selection:product.internal.type,type:0
#, python-format
msgid "Service"
msgstr "服务"
#. module: app_product_type_sequence
#: model:product.internal.type,name:app_product_type_sequence.internal_type_sourced_product
msgid "Sourced Product"
msgstr "外购成品"
#. module: app_product_type_sequence
#: model:ir.model.fields,help:app_product_type_sequence.field_product_internal_type_sale_ok
msgid "Specify if the product can be selected in a sales order line."
msgstr "如果产品能在销售单明细在被选择,则指定。"
#. module: app_product_type_sequence
#: code:addons/app_product_type_sequence/models/product_internal_type.py:36
#: selection:product.internal.type,type:0
#, python-format
msgid "Stockable Product"
msgstr "可库存产品"
#. module: app_product_type_sequence
#: sql_constraint:product.internal.type:0
#: sql_constraint:product.product:0
msgid "The reference must be unique"
msgstr "产品内部编码不可重复!"
#. module: app_product_type_sequence
#: model:ir.model.fields,field_description:app_product_type_sequence.field_product_internal_type_ref
msgid "Unique Code"
msgstr "唯一编码"
#. module: app_product_type_sequence
#: model:ir.model,name:app_product_type_sequence.model_product_internal_type
msgid "product.internal.type"
msgstr "product.internal.type"

View File

@@ -1,5 +0,0 @@
# -*- coding: utf-8 -*-
import product_template
import product_product
import product_category
import product_internal_type

View File

@@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-11-28
# 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, exceptions, _
class ProductCategory(models.Model):
_name = "product.category"
_inherit = ['product.category']
internal_type = fields.Many2one(
'product.internal.type', 'Default Internal Type',
auto_join=True, required=False)

View File

@@ -1,64 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
from openerp import api, fields, models, _
class ProductInternalType(models.Model):
_name = "product.internal.type"
_order = 'sequence, name'
sequence = fields.Integer('Sequence', default=9)
name = fields.Char('Display Name', default='Normal', translate=True)
description = fields.Char('Description')
ref = fields.Char('Unique Code', required=True)
link_sequence = fields.Many2one(
'ir.sequence', 'Link Sequence',
auto_join=True, required=True, domain="[('code', '=', 'product.product')]")
sequence_prefix = fields.Char(u'Sequence Prefix', related='link_sequence.prefix', readonly=True, store=False)
# 各种默认值,填则自动录入,不填则不管
type = fields.Selection([
('consu', _('Consumable')),
('service', _('Service')),
('product', _('Stockable Product'))], string='Product Type',
help='A stockable product is a product for which you manage stock. The "Inventory" app has to be installed.\n'
'A consumable product, on the other hand, is a product for which stock is not managed.\n'
'A service is a non-material product you provide.\n'
'A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on '
'the e-commerce such as e-books, music, pictures,... The "Digital Product" module has to be installed.')
rental = fields.Boolean('Can be Rent')
sale_ok = fields.Boolean(
'Can be Sold', default=True,
help="Specify if the product can be selected in a sales order line.")
purchase_ok = fields.Boolean('Can be Purchased', default=True)
# 使用目录的默认路线来处理,暂时不用内部类型路线
route_ids = fields.Many2many('stock.location.route', string='Routes',
domain=[('product_selectable', '=', True)],
help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
company_id = fields.Many2one(
'res.company', 'Company',
default=lambda self: self.env.user.company_id.id, index=1)
_sql_constraints = [
('uniq_ref',
'unique(ref)',
'The reference must be unique'),
]

View File

@@ -1,140 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-01-09
# 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 models, fields, api, exceptions, _
class ProductProduct(models.Model):
_inherit = 'product.product'
default_code = fields.Char('Internal Reference', index=True, default=lambda self: _('New'), copy=False)
default_code_index = fields.Integer('Internal Reference Index', readonly=True)
# todo: 检查数据,要保证数据唯一性
_sql_constraints = [
('uniq_default_code',
'unique(default_code)',
'The reference must be unique'),
]
@api.model
def default_get(self, fields):
context = self._context or {}
res = super(ProductProduct, self).default_get(fields)
# 内部编码类型默认值的录入
if context.get("default_internal_type"):
self._onchange_internal_type()
elif context.get("default_internal_type_ref"):
types = self.env['product.internal.type'].search_read([('ref', '=', context.get("default_internal_type_ref"))], limit=1)
if types:
res.update({'internal_type':types[0]['id']})
self._onchange_internal_type()
return res
@api.model
def create(self, vals):
# todo: but 先建空白产品后编辑2个以上变体序号会少个 -1
# code_index: 当没有变体现时值为0有变体时为该变体序号
code_index = 0
if 'default_code' not in vals or vals['default_code'] == _('New'):
if 'product_tmpl_id' in vals:
# 按产品模板创建产品,有多种情况
template = self.env['product.template'].search([('id', '=', vals['product_tmpl_id'])], limit=1)
if template.default_code and template.default_code != '':
code_stored = template.default_code
else:
code_stored = template.default_code_stored
if not code_stored:
code_stored = ''
mylen = len(template.product_variant_ids)
try:
attr = vals['attribute_value_ids'][0][2]
except:
attr = 0
# if self.env.context.get('create_from_tmpl') and not(attr): 此条件已限制不让在template中先直接创建变体要求先保存
if self.env.context.get('create_from_tmpl') and not(attr):
# 从产品模板创建的第一个sku产品不带属性
# 没有属性值则是单规格产品。attribute_value_ids格式为[6,0,[]]。多规格时attribute_value_ids格式为[6,0,[x]]
code_index = 0
vals['default_code_index'] = code_index
vals['default_code'] = code_stored
elif mylen == 0:
# 有属性值了,自己是第一个规格
code_index = 1
vals['default_code_index'] = code_index
vals['default_code'] = code_stored + '#%03d'%(code_index)
elif mylen == 1:
# 已存在1个当存在的1个有属性时要改已存在的product值
code_index = template.product_variant_ids[:1].default_code_index
if template.product_variant_ids[:1].attribute_value_ids:
if code_index == 0:
code_index = 1
template.product_variant_ids[:1].default_code_index = code_index
template.product_variant_ids[:1].default_code = code_stored + '#%03d'%(code_index)
# 接着改当前操作的product值
code_index = code_index + 1
vals['default_code_index'] = code_index
vals['default_code'] = code_stored + '#%03d'%(code_index)
elif mylen > 1:
# 找到最大的序号
variant_max = max(template.product_variant_ids,key=lambda x: x['default_code_index'])
code_index = variant_max['default_code_index'] + 1
vals['default_code_index'] = code_index
vals['default_code'] = code_stored + '#%03d'%(code_index)
else:
# 当按模板
# 此条件常规不出现,但特殊项目会有
variant_max = max(template.product_variant_ids,key=lambda x: x['default_code_index'])
code_index = variant_max['default_code_index'] + 1
vals['default_code_index'] = code_index
vals['default_code'] = code_stored + '#%03d'%(code_index)
else:
# create from product_product
# 默认使用制造成品的编码
sequence = self.env.ref('app_product_type_sequence.internal_type_mrp_product', raise_if_not_found=False)
if 'internal_type' in vals:
sequence = self.env['product.internal.type'].search([('id', '=', vals['internal_type'])], limit=1)
vals['default_code'] = sequence.link_sequence.next_by_id()
else:
# 如果有自己输入 ref则不需要自运输生成
# sequence = self.env['product.internal.type'].search([('id', '=', vals['internal_type'])], limit=1)
# if sequence:
# vals['default_code'] = sequence.link_sequence.next_by_id()
pass
return super(ProductProduct, self).create(vals)
@api.multi
def copy(self, default=None):
if len(self.product_tmpl_id.product_variant_ids)>1 :
raise exceptions.ValidationError(_('Product varient can only create in Product view!'))
return super(ProductProduct, self).copy(default=None)
# 当内部类型变化时,改变产品的各默认值
@api.onchange('internal_type')
def _onchange_internal_type(self):
if self.internal_type:
self.type = self.internal_type.type
self.rental = self.internal_type.rental
self.sale_ok = self.internal_type.sale_ok
self.purchase_ok = self.internal_type.purchase_ok
self.route_ids = self.internal_type.route_ids
# 分类变动时,如果分类绑定了内部类型则联动
@api.onchange('categ_id')
def _onchange_cate_id(self):
if self.categ_id and self.categ_id.internal_type:
self.internal_type = self.categ_id.internal_type

View File

@@ -1,101 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-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:
from openerp import api, fields, models, exceptions, _
class ProductTemplate(models.Model):
_name = "product.template"
_inherit = ['product.template']
# auto_join只要搜索product.template自动会join。如果经常用到 internal_type 效率会高。
internal_type = fields.Many2one(
'product.internal.type', 'Internal Type',
auto_join=True, required=True)
default_code = fields.Char(
'Internal Reference',
compute='_compute_default_code',
inverse='_set_default_code',
store=True, default=lambda self: _('New'), copy=False)
# 因为default_code有odoo的处理方式影响面大故会将其另存到 default_code_stored
default_code_stored = fields.Char('Internal Reference Stored',
default=lambda self: _('New'))
@api.model
def default_get(self, fields):
context = self._context or {}
res = super(ProductTemplate, self).default_get(fields)
# 内部编码类型默认值的录入
if context.get("default_internal_type"):
self._onchange_internal_type()
elif context.get("default_internal_type_ref"):
types = self.env['product.internal.type'].search_read([('ref', '=', context.get("default_internal_type_ref"))], limit=1)
if types:
res.update({'internal_type':types[0]['id']})
self._onchange_internal_type()
return res
@api.model
def create(self, vals):
if 'attribute_line_ids' in vals:
if len(vals['attribute_line_ids'])>0:
raise exceptions.ValidationError(_('Please save product first before adding varients!'))
if 'default_code' not in vals or vals['default_code'] == _('New'):
sequence = self.env['product.internal.type'].search([('id', '=', vals['internal_type'])], limit=1)
if not sequence:
sequence = self.env.ref('app_product_type_sequence.internal_type_mrp_product', raise_if_not_found=False)
vals['default_code'] = sequence.link_sequence.next_by_id()
else:
pass
if vals['default_code']:
vals['default_code_stored'] = vals['default_code']
return super(ProductTemplate, self).create(vals)
@api.depends('product_variant_ids', 'product_variant_ids.default_code')
def _compute_default_code(self):
unique_variants = self.filtered(lambda template: len(template.product_variant_ids) == 1)
# 设置default_code
for template in unique_variants:
template.default_code = template.product_variant_ids.default_code
for template in (self - unique_variants):
if len(template.product_variant_ids)>1:
template.default_code = ''
@api.one
def _set_default_code(self):
if len(self.product_variant_ids) == 1:
self.product_variant_ids.default_code = self.default_code_stored
# 当内部类型变化时,改变产品模板的各默认值
@api.onchange('internal_type')
def _onchange_internal_type(self):
if self.internal_type:
self.type = self.internal_type.type
self.rental = self.internal_type.rental
self.sale_ok = self.internal_type.sale_ok
self.purchase_ok = self.internal_type.purchase_ok
self.route_ids = self.internal_type.route_ids
# 分类变动时,如果分类绑定了内部类型则联动
@api.onchange('categ_id')
def _onchange_cate_id(self):
if self.categ_id and self.categ_id.internal_type:
self.internal_type = self.categ_id.internal_type

View File

@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_order_type_manager,access_sale_order_type_manager,model_product_internal_type,sales_team.group_sale_manager,1,1,1,1
access_sale_order_type_salesman,access_sale_order_type_salesman,model_product_internal_type,sales_team.group_sale_salesman,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sale_order_type_manager access_sale_order_type_manager model_product_internal_type sales_team.group_sale_manager 1 1 1 1
3 access_sale_order_type_salesman access_sale_order_type_salesman model_product_internal_type sales_team.group_sale_salesman 1 0 0 0

View File

@@ -1,12 +0,0 @@
<?xml version="1.0"?>
<odoo>
<record model="ir.rule" id="product_internal_type_comp_rule">
<field name="name">Product Internal Type multi-company</field>
<field name="model_id" ref="app_product_type_sequence.model_product_internal_type"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="perm_read" eval="1"/>
<field name="perm_create" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
</record>
</odoo>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,171 +0,0 @@
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<h2 class="oe_slogan" style="color:#875A7B;"> App Product Auto Sequence, Auto Code(Variants Supported), Auto Attributes</h2>
<div>
<p>
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
</p>
<ul>
<li>
Auto Sequence or code for every product.
</li>
<li>
Auto Sequence or for every product variants, like product20171130-001.
</li>
<li>
Product code must be Unique.
</li>
<li>
Define different product type, each product type use own rule of sequence.
</li>
<li>
Quick access in sale , inventory, system menu.
</li>
<li>
Multi language support.
</li>
<li>
Setup default Auto Sequence for each product category.
</li>
<li>
Auto setup product attribute lik Sale/Purchase, Stockable/Consumable/Service, Stock Routes.
</li>
</ul>
<div>
<img class="oe_picture oe_screenshot" src="set0.jpg">
</div>
<div>
<img class="oe_picture oe_screenshot" src="set1.jpg">
</div>
<div>
<img class="oe_picture oe_screenshot" src="set2.jpg">
</div>
<h2>Sample Rule: if we create on oct 2017</h2>
<ul>
<li>
Manufactured Products: M20171100001
</li>
<li>
Components Products: C20171100001
</li>
<li>
Sourced Products: S20171100001
</li>
</ul>
<p>
Sepcial for variants. add [-00?]<br/>
<ul>
<li>
Products with color[red]: M20171100001#001
</li>
<li>
Products with color[blue]: M20171100001#002
</li>
<li>
Products with color[white]: M20171100001#003
</li>
</ul>
</p>
<h2>Installation:</h2>
<p>
Prior to installing this module, if you have any existing products you should ensure they already have a
unique reference (or no reference) set.<br/>
Products with a default_code of '/' or empty will automatically be assigned a code of "!!DP!!" followed
by the system id for that product.<br/>
Otherwise the setting of the unique constraint will fail and the module will fail to install.<br/>
Notice:<br/>
Odoo product variants is very special.<br/>
When u create a product(not product template) with attribute, It would delete the first product, which
have no attribute.
So it's very normal that the first product variants begin wit ???-002.<br/>
And we make a rule that the product variants can only create after you create normal product template.
</p>
<h2>How to use: Very simple</h2>
<p>
After installed the app. You can Go to anyone of the menu:<br/>
<ul>
<li>
Sales->Configuration->Products->Product Internal Type
</li>
<li>
Inventory->Configuration->Products->Product Internal Type
</li>
<li>
Settings->Sequences & Identifiers->Product Internal Type
</li>
</ul>
</p>
<p>
You would see the default Product Intertype we create.
<div>
<img class="oe_picture oe_screenshot" src="set3.jpg">
</div>
</p>
<p>
And create the product and code by yourself.
<div>
<img class="oe_picture oe_screenshot" src="set4.jpg">
</div>
</p>
<p>
Notice: The "Sequence Code" Field of sequence must be "product.product"
<div>
<img class="oe_picture oe_screenshot" src="set5.jpg">
</div>
</p>
Go to Prior to installing this module, if you have any existing products you should ensure they already have
a
unique reference (or no reference) set.<br/>
Products with a default_code of '/' or empty will automatically be assigned a code of "!!DP!!" followed
by the system id for that product.<br/>
Otherwise the setting of the unique constraint will fail and the module will fail to install.<br/>
Notice:<br/>
Odoo product variants is very special.<br/>
When u create a product(not product template) with attribute, It would delete the first product, which
have no attribute.
So it's very normal that the first product variants begin wit ???-002.<br/>
And we make a rule that the product variants can only create after you create normal product template.
</p>
</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.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -1,15 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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 test_product_sequence

View File

@@ -1,59 +0,0 @@
# -*- coding: utf-8 -*-
'''
Created on 2017-10-28
@author: 广州尚鹏http://www.sunpop.cn
@email: 300883@qq.com
@resource of Sunpop
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 odoo.tests.common import TransactionCase
from ..hooks import pre_init_hook
class TestProductSequence(TransactionCase):
"""Tests for creating product with and without Product Sequence"""
def setUp(self):
super(TestProductSequence, self).setUp()
self.product_product = self.env['product.product']
def test_product_create_with_default_code(self):
product = self.product_product.create(dict(
name="Apple",
default_code='PROD01'
))
self.assertEqual(product.default_code, 'PROD01')
def test_product_create_without_default_code(self):
product_1 = self.product_product.create(dict(
name="Orange",
default_code='/'))
self.assertRegexpMatches(str(product_1.default_code), r'PR/*')
def test_product_copy(self):
product_2 = self.product_product.create(dict(
name="Apple",
default_code='PROD02'
))
copy_product_2 = product_2.copy()
self.assertEqual(copy_product_2.default_code, 'PROD02-copy')
def test_pre_init_hook(self):
product_3 = self.product_product.create(dict(
name="Apple",
default_code='PROD03'
))
self.cr.execute(
"update product_product set default_code='/' where id=%s"
% (product_3.id,))
product_3.invalidate_cache()
self.assertEqual(product_3.default_code, '/')
pre_init_hook(self.cr)
product_3.invalidate_cache()
self.assertEqual(product_3.default_code, '!!mig!!%s' % (product_3.id,))

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--目录list-->
<record id="product_category_list_view_internal_type" model="ir.ui.view">
<field name="name">product.category.list.internal_type</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_list_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='display_name']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
<!--目录Form-->
<record id="product_category_form_view_internal_type" model="ir.ui.view">
<field name="name">product.category.form._internal_type</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品内部类型list-->
<record id="product_internal_type_tree_view" model="ir.ui.view">
<field name="name">product.internal.type.tree</field>
<field name="model">product.internal.type</field>
<field name="arch" type="xml">
<tree string="Product Internal Type">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="ref"/>
<field name="type"/>
<field name="sale_ok"/>
<field name="purchase_ok"/>
<field name="route_ids" widget="many2many_tags"/>
<field name="link_sequence" context="{'default_code': 'product.product'}"/>
<field name="sequence_prefix"/>
<field name="description"/>
</tree>
</field>
</record>
<!--产品内部类型from-->
<record id="product_internal_type_form_view" model="ir.ui.view">
<field name="name">product.internal.type.form</field>
<field name="model">product.internal.type</field>
<field name="arch" type="xml">
<form string="Product Internal Type">
<sheet>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Display Name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="ref"/>
<field name="sequence"/>
</group>
<group>
<field name="description"/>
</group>
</group>
<group>
<field name="link_sequence"/>
<field name="sequence_prefix"/>
</group>
<group string="Auto Set Product's Value To:">
<group>
<field name="type"/>
<field name="route_ids" widget="many2many_checkboxes"/>
</group>
<group>
<field name="sale_ok"/>
<field name="purchase_ok"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="internal_type_action" model="ir.actions.act_window">
<field name="name">Product Internal Type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.internal.type</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="internal_type_action" id="menu_internal_type_action_sys" parent="base.next_id_5"/>
<menuitem action="internal_type_action" id="menu_internal_type_action_sale"
parent="sale.prod_config_main" sequence="6" groups="base.group_no_one"/>
<menuitem action="internal_type_action" id="menu_internal_type_action_purchase"
parent="purchase.menu_product_in_config_purchase" sequence="3" groups="base.group_no_one"/>
<menuitem action="internal_type_action" id="menu_internal_type_action_stock"
parent="stock.menu_product_in_config_stock" sequence="3" groups="base.group_no_one"/>
</data>
</openerp>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品list-->
<record id="product_product_tree_view" model="ir.ui.view">
<field name="name">product.product.tree</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="internal_type"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--产品list-->
<record id="product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.product.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="before">
<field name="internal_type"/>
</xpath>
</field>
</record>
<!--产品Form-->
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='options']" position="before">
<div>
<h4>
<label class="oe_edit_only" for="internal_type"/>
<field name="internal_type" options="{'no_create': True,'no_open': True}" required="1"/>
</h4>
</div>
</xpath>
</field>
</record>
<!--改产品默认视图为tree-->
<record id="product.product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="product.product_template_kanban_view"/>
<field name="context">{"search_default_filter_to_sell":1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p>
<p>
You must define a product for everything you sell, whether it's a physical product, a consumable or a service you offer to customers.
</p>
<p>
The product form contains information to simplify the sale process: price, notes in the quotation, accounting data, procurement methods,
etc.
</p>
</field>
</record>
</data>
</openerp>

View File

@@ -1,18 +0,0 @@
App Product Auto Sequence, Auto Code(Variants Supported)
App Product Auto Sequence, Auto Code(Variants Supported), Auto Attributes
This module allows to associate a sequence to the product reference.<br/>
The reference (default code) is unique (SQL constraint) and required.<br/>
Support Product with or without Variants.
1.Auto Sequence or code for every product.自动产品编码。
2.Auto Sequence or for every product variants, like product20171130-001.自动多规格产品编码,形式为 主产品编码-001。
3.Product code must be Unique.产品编码强制要求唯一。
4.Define different product type, each product type use own rule of sequence.可自定义产品类型,不同产品类型使用不同编码规则。
5.Quick access in sale , inventory, system menu.可以在销售、库存、系统菜单中快速定义。
6.Multi language support.<br/>多语种支持。
7.Setup default Auto Sequence for each product category自动设置每个产品目录使用的产品编码规则
8.Auto setup product attribute lik Sale/Purchase, Stockable/Consumable/Service, Stock Routes. 自动设置产品的销售/采购,可库存产品/服务/消耗品,购买/制造/按订单生成等库存路线
http://www.sunpop.cn/product/app-product-auto-sequence-auto-codevariants-supported/

View File

@@ -1,6 +0,0 @@
# -*- coding: utf-8 -*-
from hooks import pre_init_hook
from . import models
from . import res
from . import wizard

View File

@@ -1,67 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-11-05
# author: 广州尚鹏http://www.sunpop.cn
# email: 75695762@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 Purchase Batch Procurement, Procurement product set supplier",
'version': '10.0.2.14',
'summary': """App Purchase Batch Procurement, Procurement product set supplier""",
'description': """
1. Product batch reorder, create procurement
产品批量补货
2. Procurement batch setup supplier, quick purchase
补货单快速设置供应商,直接生成采购询价单。
3. Product filter virtual view (available/exhausted/negative)
产品在途库存过滤
4. Multi language support, done for Chinese and English
多语言版本,默认支持中英双语
""",
'author': 'Sunpop.cn',
'website': 'http://www.sunpop.cn',
'license': 'LGPL-3',
'category': 'Purchase',
'sequence': 0,
'pre_init_hook': 'pre_init_hook',
'images': ['static/description/banner.png'],
'depends': ['base', 'stock', 'purchase'],
'data': [
'views/asset_views.xml',
'views/procurement_order_views.xml',
'views/product_template_views.xml',
'views/menus.xml',
'wizard/product_set_supplier_views.xml',
'wizard/procurement_batch_generator_view.xml',
],
'demo': [
],
'test': [
],
'css': [
],
'qweb': [
'static/src/xml/tree_view_btn.xml'
],
'js': [
],
'images': [
],
"price": 68.00,
"currency": "EUR",
'installable': True,
'auto_install': False,
'application': True,
}

View File

@@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
# Created on 2017-11-22
# 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:
def pre_init_hook(cr):
"""
数据初始化,只在安装时执行,更新时不执行
"""
try:
pass
except Exception, e:
raise Warning(e)

View File

@@ -1,305 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_purchase_batch_procurement
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0+e-20171107\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-14 10:00+0000\n"
"PO-Revision-Date: 2018-02-14 10:00+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_purchase_batch_procurement
#: code:addons/app_purchase_batch_procurement/wizard/procurement_batch_generator.py:73
#, python-format
msgid "All requested quantities are null."
msgstr "没有要补货的产品,请检查."
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.procurement_batch_generator_wiz_form
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.product_set_supplier_wiz_form
msgid "Cancel"
msgstr "取消"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_company_id
msgid "Company"
msgstr "公司"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_create_uid
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_create_uid
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_create_uid
msgid "Created by"
msgstr "创建人"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_create_date
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_create_date
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_create_date
msgid "Created on"
msgstr "创建时间"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_currency_id
msgid "Currency"
msgstr "币种"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_delay
msgid "Delivery Lead Time"
msgstr "交货周期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_display_name
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_display_name
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_display_name
msgid "Display Name"
msgstr "显示名称"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_date_end
msgid "End Date"
msgstr "结束日期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_date_end
msgid "End date for this vendor price"
msgstr "此供应商价格的结束日期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_virtual_available
msgid "Forecast Quantity"
msgstr "预测数量"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_id
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_id
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_id
msgid "ID"
msgstr "ID"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_outgoing_qty
msgid "Incoming Quantity"
msgstr "将入库"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator___last_update
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line___last_update
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz___last_update
msgid "Last Modified on"
msgstr "最后修改日"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_write_uid
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_write_uid
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_write_uid
msgid "Last Updated by"
msgstr "最后更新人"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_write_date
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_write_date
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_write_date
msgid "Last Updated on"
msgstr "最后更新时间"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_delay
msgid "Lead time in days between the confirmation of the purchase order and the receipt of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."
msgstr "提前时间是订单确认到仓库收到货物天数,使用于采购单自动计算规划调度"
#. module: app_purchase_batch_procurement
#: model:ir.model,name:app_purchase_batch_procurement.model_procurement_batch_generator_line
msgid "Lines of the wizard to request procurements"
msgstr "即将生成补货单的产品"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_min_qty
msgid "Minimal Quantity"
msgstr "最少数量"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_incoming_qty
msgid "Outgoing Quantity"
msgstr "将出库"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_parent_id
msgid "Parent"
msgstr "上级"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_date_planned
msgid "Planned Date"
msgstr "计划的日期"
#. module: app_purchase_batch_procurement
#: code:addons/app_purchase_batch_procurement/wizard/product_set_supplier_wiz.py:59
#, python-format
msgid "Please select valid procurement orders. Only the 'status=Exception' and 'Buy in Inventory Routes' product can be set!"
msgstr "请选择有效的补货单。 只有 状态=异常 且 路线包含 '购买' 的 '可购买' 产品才可设置!"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_route_ids
msgid "Preferred Routes"
msgstr "首选路线"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_price
msgid "Price"
msgstr "价格"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_ids
msgid "Procurement Request Lines"
msgstr "补货明细"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.product_set_supplier_wiz_form
msgid "Procurement list to setup supplier for the product"
msgstr "待设置产品供应商的补货单"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_p_ids
msgid "Procurement to set"
msgstr "待处理的补货单"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_product_id
msgid "Product"
msgstr "产品"
#. module: app_purchase_batch_procurement
#: model:ir.actions.act_window,name:app_purchase_batch_procurement.purchase_procurement_action
#: model:ir.ui.menu,name:app_purchase_batch_procurement.felive_menu_purchase_procurement_action
msgid "Purchase Procurement Orders"
msgstr "待处理的采购补货"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_qty_available
msgid "Quantity On Hand"
msgstr "在手数量"
#. module: app_purchase_batch_procurement
#. openerp-web
#: code:addons/app_purchase_batch_procurement/static/src/xml/tree_view_btn.xml:8
#: model:ir.actions.act_window,name:app_purchase_batch_procurement.procurement_batch_generator_tree_action
#: model:ir.actions.act_window,name:app_purchase_batch_procurement.procurement_batch_generator_tree_action2
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.procurement_batch_generator_wiz_form
#, python-format
msgid "Request Procurements"
msgstr "补货请求"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_procurement_qty
msgid "Requested Quantity"
msgstr "补货数量"
#. module: app_purchase_batch_procurement
#. openerp-web
#: code:addons/app_purchase_batch_procurement/static/src/xml/tree_view_btn.xml:5
#: model:ir.actions.act_window,name:app_purchase_batch_procurement.action_product_set_supplier
#: model:ir.actions.act_window,name:app_purchase_batch_procurement.product_set_supplier_action
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.product_set_supplier_wiz_form
#, python-format
msgid "Set Supplier"
msgstr "设置供应商并创建采购询价单"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.product_set_supplier_wiz_form
msgid "Set supplier and run Scheduler"
msgstr "设定供应商并执行补货计算"
#. module: app_purchase_batch_procurement
#: model:ir.model,name:app_purchase_batch_procurement.model_product_set_supplier_wiz
msgid "Set supplier for product"
msgstr "指定相关产品模板的供应商"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_view_po
msgid "Show relate RFQ after set supplier"
msgstr "完成后编辑相关采购询价单"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_date_start
msgid "Start Date"
msgstr "开始日期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_date_start
msgid "Start date for this vendor price"
msgstr "此供应商价格的开始日期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_partner_id
msgid "Supplier"
msgstr "供应商"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_min_qty
msgid "The minimal quantity to purchase from this vendor, expressed in the vendor Product Unit of Measure if not any, in the default unit of measure of the product otherwise."
msgstr "从供应商采购的最小数量的计量单位在产品的供应商信息中有维护,如果没有维护,那么计量单位就是产品中默认设置的"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_price
msgid "The price to purchase a product"
msgstr "该价格购买产品"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_uom_id
msgid "Unit of Measure"
msgstr "计量单位"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.procurement_batch_generator_wiz_form
msgid "Validate"
msgstr "确定"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.product_set_supplier_wiz_form
msgid "Validity From"
msgstr "有效期"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_product_set_supplier_wiz_name
msgid "Vendor"
msgstr "供应商"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,help:app_purchase_batch_procurement.field_product_set_supplier_wiz_name
msgid "Vendor of this product"
msgstr "这个产品的供应商"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.felive_product_template_search_form_view_stock
msgid "Virtual Available Products"
msgstr "在途库存>0"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.felive_product_template_search_form_view_stock
msgid "Virtual Exhausted Stock"
msgstr "在途库存=0"
#. module: app_purchase_batch_procurement
#: model:ir.ui.view,arch_db:app_purchase_batch_procurement.felive_product_template_search_form_view_stock
msgid "Virtual Negative Stock"
msgstr "在途库存<0"
#. module: app_purchase_batch_procurement
#: model:ir.model.fields,field_description:app_purchase_batch_procurement.field_procurement_batch_generator_line_warehouse_id
msgid "Warehouse"
msgstr "仓库"
#. module: app_purchase_batch_procurement
#: model:ir.model,name:app_purchase_batch_procurement.model_procurement_batch_generator
msgid "Wizard to create procurements from product tree"
msgstr "补货向导"

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,101 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_span12">
<h2 class="oe_slogan">App Purchase Batch Procurement, Procurement product set supplier</h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>This moduld is to easy purchase</p>
<h3>Lastest update: v10.0.2.14, 2018-02-14</h3>
<ul>
<li>1. Product batch reorder, create procurement</li>
<li>2. Procurement batch setup supplier, quick purchase</li>
<li>3. Product filter virtual view (available/exhausted/negative), and auto set procurement quantity</li>
</ul>
</div>
<div class="oe_demo oe_screenshot">
<img src="cnreadme.png" style="border:1px solid black"/>
<br/>
</div>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>1. Procurement batch setup supplier, quick purchase</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="demo11.png" style="border:1px solid black"/>
<br/>
<img src="demo12.png" style="border:1px solid black"/>
<br/>
<h3> So you can get the procurement</h3>
<img src="demo31.png" style="border:1px solid black"/>
<br/>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_demo"
style=" argin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%; ">
<h2 class='oe_mt32'>2. Procurement batch setup supplier, quick purchase</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="demo41.png" style="border:1px solid black"/>
</br>
<img src="demo51.png" style="border:1px solid black"/>
<br/>
<h3> So you can get the purchase of all product</h3>
<img src="demo61.png" style="border:1px solid black"/>
<br/>
<br/>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_demo"
style=" argin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%; ">
<h2 class='oe_mt32'>3. Product filter virtual view (available/exhausted/negative), and auto set procurement quantity</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="demo71.png" style="border:1px solid black"/>
</br>
<h3> The procurement quantity would be auto set</h3>
<img src="demo81.png" style="border:1px solid black"/>
<br/>
</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

@@ -1,66 +0,0 @@
odoo.define('app_purchase_batch_procurement.btn_set_supplier', function (require) {
"use strict";
var core = require('web.core');
var ListView = require('web.ListView');
var web_client = require('web.web_client')
var QWeb = core.qweb;
ListView.include({
render_buttons: function ($node) {
if ($node) {
var self = this;
this._super($node);
this.$buttons.find('.o_list_btn_set_supplier').click(this.proxy('set_supplier_action'));
this.$buttons.find('.o_list_btn_batch_procurement').click(this.proxy('batch_procurement_action'));
}
},
set_supplier_action: function () {
//纯js取
// var active_ids = $.map($('.o_list_view .o_list_record_selector :checkbox:checked'), function (el) {
// return $(el).closest('tr').data('id');
// });
//odoo内置方法取值
var active_ids = this.groups.get_selection().ids
this.do_action({
type: "ir.actions.act_window",
name: " Set Supplier",
res_model: "product.set.supplier.wiz",
views: [[false, 'form']],
view_type: 'form',
view_mode: 'form',
multi: 1,
key2: "client_action_multi",
src_model: "procurement.order",
active_model: "procurement.order",
target: 'new',
context: {'active_ids': active_ids}
});
return {'type': 'ir.actions.client'}
},
batch_procurement_action: function () {
// var active_ids = self.$.map($('.o_list_view .o_list_record_selector :checkbox:checked'), function (el) {
// return $(el).closest('tr').data('id');
// });
var active_ids = this.groups.get_selection().ids
// var active_ids = self.getSelection().ids;
this.do_action({
type: "ir.actions.act_window",
name: "Request Procurements",
res_model: "procurement.batch.generator",
views: [[false, 'form']],
view_type: 'form',
view_mode: 'form',
multi: 1,
key2: "client_action_multi",
src_model: "product.product",
active_model: "product.product",
target: 'new',
context: {'active_ids': active_ids}
});
return {'type': 'ir.actions.client'}
}
});
});

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after">
<button t-if="widget.model == 'procurement.order'" class="btn btn-primary btn-sm o_list_btn_set_supplier" type="button">
Set Supplier
</button>
<button t-if="widget.model == 'product.product' | widget.model == 'product.template'" class="btn btn-primary btn-sm o_list_btn_batch_procurement" type="button">
Request Procurements
</button>
</t>
</t>
</templates>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="felive_purchase asset " inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/app_purchase_batch_procurement/static/src/js/btn_set_supplier.js"></script>
</xpath>
</template>
</data>
</odoo>

Some files were not shown because too many files have changed in this diff Show More