This commit is contained in:
李鹏宇
2025-04-05 17:11:33 +08:00
parent 3129c0e8a2
commit 2acb9d4a49
151 changed files with 14173 additions and 5 deletions
+8
View File
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from .hooks import pre_init_hook
from .hooks import post_init_hook
from . import controllers
from . import models
from . import ir
from . import res
+130
View File
@@ -0,0 +1,130 @@
# -*- coding: utf-8 -*-
# Created on 2023-02-02
# author: 欧度智能,https://www.odooai.cn
# email: 300883@qq.com
# resource of odooai
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Odoo在线中文用户手册(长期更新)
# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# https://www.odooai.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备)
# https://www.odooai.cn/odoo10_developer_document_offline/
# description:
{
'name': 'odoo中文版套件之基础,中国会计基础,Chinese Enhance All in One,',
'version': '17.0.24.12.27',
'author': 'odooai.cn',
'category': 'Base',
'website': 'https://www.odooai.cn',
'live_test_url': 'https://demo.odooapp.cn',
'license': 'LGPL-3',
'sequence': 2,
'price': 0,
'currency': 'EUR',
'summary': '''
odoo简体中文版全面增强. Chinese enhance. Out of the box use odoo in china. Chinese address format, number format, money format.
Set all chinese default value. Default country, timezone, currency, partner.中国会计基础模块.
''',
'description': '''
odoo Chinese Enhance. odoo中国版增强-基础
1. 中文地址格式,适用于所有中国中文客户、供应商、合作伙伴、用户、员工信息等
2. 中文默认值,如国家、时区、货币等。处理模块 base, product.
3. 客户加简称,地址显示中文化,客户编码显示优先
4. 客户地址显示增加手机号与电话号码
5. 货币处理,人民币增强,增加排序显示
6. 修正品类的列表及m2o字段中不显示中文目录名的Bug
7. 修正仓库位置的列表及m2o字段中不显示中文目录名的Bug
8. 超级用户改时区为 中国
9. 时间格式年月日为 中国格式,如 2023-08-08,时间为 12:34
10. 国家增加排序,中国排第一
11. 收款相关显示中国习惯
12. 翻译导出默认中文,默认po
13. [默认已移除,可自行加载.py]在 base 模型增加 name_en_US 字段,赋值后同时改翻译值
14. 常用小数精度调整
15. 销售团队改为中国
16. 精简语言的显示,如 Chinese简体中文改为 中文
21. 多语言支持,多公司支持
22. Odoo 18,17,16,15,14,13,12, 企业版,社区版,在线SaaS.sh版,等全版本支持
23. 代码完全开源
======
1. Chinese address format, applicable to all Chinese customers, suppliers, partners, users, employee information etc.
2. Default values in Chinese such as country, time zone and currency. Processing module base, product.
3. Add customer abbreviation and display addresses in Chinese; prioritize displaying customer codes.
4. Display phone numbers along with mobile numbers for customer addresses.
5. Currency processing with added sorting display.
6. Fixed bug where the category list and m2o field did not display the name of the Chinese directory.
7. Fixed bug where warehouse location list and m2o field did not display the name of the Chinese directory.
8. Superuser changed time zone to China.
9. Date format is year-month-day (e.g., 2023-08-08) and time is 12:34
10.Country sorting added; China ranked first
11.Display payment-related information according to typical practices in China.
12.Default export translation is set to Mandarin (po).
13.Added 'name_en_US' field in base model which updates translation value when assigned a value.
14.Common decimal precision adjustments made.
15.Sales team changed to [China].
21. Multi-language Support. Multi-Company Support.
22. Support Odoo 18,17,16,15,14,13,12, Enterprise and Community and odoo.sh Edition.
23. Full Open Source.
''',
'pre_init_hook': 'pre_init_hook',
'post_init_hook': 'post_init_hook',
'depends': [
'base_address_extended',
'account',
'sales_team',
'sale',
'stock',
'app_odoo_customize',
],
'images': ['static/description/banner.jpg'],
'data': [
'views/res_partner_views.xml',
'views/res_currency_views.xml',
'views/sale_order_views.xml',
'views/account_move_views.xml',
'views/ir_default_views.xml',
# 'views/templates.xml',
'wizard/sale_make_invoice_advance_views.xml',
'data/res_lang_data.xml',
'data/ir_default_data.xml',
'data/base_data.xml',
'data/decimal_precision_data.xml',
'data/res_country_data.xml',
'data/res_currency_data.xml',
'data/res_company_data.xml',
'data/res_partner_data.xml',
'data/res_users_data.xml',
'data/product_data.xml',
'data/product_pricelist_data.xml',
'data/stock_location_data.xml',
'data/sales_team_data.xml',
'views/ir_module_module_views.xml',
],
'assets': {
'web.assets_backend': [
'app_base_chinese/static/src/scss/app_style.scss',
]
},
'demo': [
'demo/res_company_demo.xml',
'demo/res_partner_demo.xml',
],
'test': [
],
'css': [
],
'qweb': [
'static/src/xml/*.xml',
],
'js': [
],
'installable': True,
'application': True,
'auto_install': False,
}
+3
View File
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import database
+49
View File
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
import os
import re
from lxml import html
import odoo
import odoo.modules.registry
from odoo import http
from odoo.exceptions import AccessError
from odoo.http import content_disposition, dispatch_rpc, request, Response
from odoo.service import db
from odoo.tools.misc import file_open, str2bool
from odoo.addons.web.controllers.database import Database as Database
from odoo.addons.base.models.ir_qweb import render as qweb_render
DBNAME_PATTERN = '^[a-zA-Z0-9][a-zA-Z0-9_.-]+$'
class Database(Database):
def _render_template(self, **d):
d.setdefault('manage', True)
d['insecure'] = odoo.tools.config.verify_admin_password('admin')
d['list_db'] = odoo.tools.config['list_db']
d['langs'] = odoo.service.db.exp_list_lang()
d['countries'] = odoo.service.db.exp_list_countries()
d['pattern'] = DBNAME_PATTERN
# databases list
try:
d['databases'] = http.db_list()
d['incompatible_databases'] = odoo.service.db.list_db_incompatible(d['databases'])
except odoo.exceptions.AccessDenied:
d['databases'] = [request.db] if request.db else []
templates = {}
with file_open("web/static/src/public/database_manager.qweb.html", "r") as fd:
templates['database_manager'] = fd.read()
with file_open("web/static/src/public/database_manager.master_input.qweb.html", "r") as fd:
templates['master_input'] = fd.read()
# with file_open("web/static/src/public/database_manager.create_form.qweb.html", "r") as fd:
with file_open("app_base_chinese/static/src/public/database_manager.create_form.qweb.html", "r") as fd:
templates['create_form'] = fd.read()
def load(template_name):
fromstring = html.document_fromstring if template_name == 'database_manager' else html.fragment_fromstring
return (fromstring(templates[template_name]), template_name)
return qweb_render('database_manager', d, load)
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<function name="install_lang" model="res.lang"/>
<record id="base.main_partner" model="res.partner" context="{'default_is_company': True}">
<field name="name">欧度智能</field>
</record>
<!-- Basic Company -->
<record id="base.main_company" model="res.company">
<field name="name">欧度智能</field>
</record>
<record model="res.partner" id="base.partner_root">
<field name="name">超管</field>
</record>
</data>
</odoo>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--<record id="sales_team.team_sales_department" model="crm.team">-->
<!--<field name="name">Sales</field>-->
<!--</record>-->
</data>
</odoo>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="product.decimal_discount" model="decimal.precision">
<field name="digits">0</field>
</record>
<record id="product.decimal_product_uom" model="decimal.precision">
<field name="digits">2</field>
</record>
<record id="account.decimal_payment" model="decimal.precision">
<field name="digits">3</field>
</record>
</data>
</odoo>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<!-- 各种默认值 -->
<!--设置客户默认国家为中国-->
<function model="ir.default" name="set"
eval="('res.partner', 'country_id', ref('base.cn'))"/>
<!--设置默认时区为中国,注意select 类型要加 ""-->
<function model="ir.default" name="set"
eval="('res.partner', 'tz', 'Etc/GMT-8')"/>
<!--设置用户email在odoo内提醒-->
<!-- fix,此处不可设置,因为门户用户只能通过 email,不能 inbox-->
<!-- <function model="ir.default" name="set"-->
<!-- eval="('res.users', 'notification_type', 'inbox')"/>-->
<!--设置产品默认是可库存产品-->
<function model="ir.default" name="set"
eval="('product.template', 'detailed_type', 'product')"/>
<!--设置翻译导出默认中文-->
<function model="ir.default" name="set"
eval="('base.language.export', 'lang', 'zh_CN')"/>
<!--设置翻译导出默认po-->
<function model="ir.default" name="set"
eval="('base.language.export', 'format', 'po')"/>
</data>
</odoo>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--
Resource: product.uom.categ
-->
<!--<record id="product.product_category_all" model="product.category">-->
<!--<field name="name">全部</field>-->
<!--</record>-->
<!--<record id="product.product_category_1" model="product.category">-->
<!--<field name="name">可销售</field>-->
<!--</record>-->
</data>
</odoo>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Price list -->
<!-- <record id="product.list0" model="product.pricelist">-->
<!-- <field name="currency_id" ref="base.CNY"/>-->
<!-- </record>-->
</data>
</odoo>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- <record id="base.main_company" model="res.company">-->
<!-- <field name="currency_id" ref="base.CNY"/>-->
<!-- </record>-->
</data>
</odoo>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Country -->
<record id="base.cn" model="res.country">
<field name="enforce_cities" eval="True"/>
<field name="address_format" eval="'%(country_name)s%(state_name)s%(city)s%(street)s\n%(street2)s'"/>
<field name="address_view_id" ref="app_base_chinese.app_view_partner_form_chinese"/>
</record>
</data>
</odoo>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Currencies -->
<!-- <record id="base.USD" model="res.currency">-->
<!-- <field name="active" eval="False"/>-->
<!-- </record>-->
<!-- <record id="base.EUR" model="res.currency">-->
<!-- <field name="active" eval="False"/>-->
<!-- </record>-->
<record id="base.CNY" model="res.currency">
<field name="active" eval="True"/>
<field name="currency_unit_label">元</field>
<field name="currency_subunit_label">分</field>
<field name="position">before</field>
</record>
</data>
</odoo>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 时间格式 -->
<record id="base.lang_zh_CN" model="res.lang" context="{'lang': 'zh_CN'}">
<field name="name">中文</field>
<field name="date_format">%Y-%m-%d</field>
<field name="time_format">%H:%M:%S</field>
<field name="active">True</field>
</record>
<record id="base.lang_en" model="res.lang" context="{'lang': 'zh_CN'}">
<field name="name">English</field>
</record>
</data>
</odoo>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="base.public_partner" model="res.partner" context="{'lang': 'zh_CN'}">
<field name="name">公共访客用户</field>
</record>
</data>
</odoo>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- 默认user,使用write处理 -->
<function model="res.users" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('base.default_user')]"/>
<value model="res.users" eval="{
'lang': 'zh_CN',
'tz': 'Etc/GMT-8',
'name': '默认内部用户模板',
}"/>
</function>
<function model="res.users" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('base.template_portal_user_id')]"/>
<value model="res.users" eval="{
'lang': 'zh_CN',
'tz': 'Etc/GMT-8',
'name': '默认门户用户模板',
}"/>
</function>
<!-- 游客-->
<function model="res.users" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('base.public_user')]"/>
<value model="res.users" eval="{
'lang': 'zh_CN',
'tz': 'Etc/GMT-8',
}"/>
</function>
</data>
</odoo>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="sales_team.team_sales_department" model="crm.team" context="{'lang': 'zh_CN'}">
<field name="name">中国</field>
</record>
<record id="sales_team.team_sales_department" model="crm.team" context="{'lang': 'en'}">
<field name="name">China</field>
</record>
</data>
</odoo>
+7
View File
@@ -0,0 +1,7 @@
id,name
stock.stock_location_locations_partner,往来单位
stock.stock_location_customers,客户区位
stock.stock_location_suppliers,供应商区位
stock.stock_location_locations,物理区位
stock.stock_location_locations_virtual,虚拟区位
stock.stock_location_inter_wh,内部中转区位
1 id name
2 stock.stock_location_locations_partner 往来单位
3 stock.stock_location_customers 客户区位
4 stock.stock_location_suppliers 供应商区位
5 stock.stock_location_locations 物理区位
6 stock.stock_location_locations_virtual 虚拟区位
7 stock.stock_location_inter_wh 内部中转区位
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="stock.removal_fifo" model="product.removal" context="{'lang': 'zh_CN'}">
<field name="name">先进先出(FIFO)</field>
</record>
<record id="stock.removal_lifo" model="product.removal" context="{'lang': 'zh_CN'}">
<field name="name">后进先出(LIFO)</field>
</record>
</data>
<data noupdate="0">
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_locations', False)]"/>
<value model="stock.location" eval="{
'name': '物理区位',
}"/>
</function>
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_locations_partner', False)]"/>
<value model="stock.location" eval="{
'name': '往来单位',
}"/>
</function>
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_locations_virtual', False)]"/>
<value model="stock.location" eval="{
'name': '虚拟区位',
}"/>
</function>
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_suppliers', False)]"/>
<value model="stock.location" eval="{
'name': '供应商区位',
}"/>
</function>
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_customers', False)]"/>
<value model="stock.location" eval="{
'name': '客户区位',
}"/>
</function>
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
<value eval="[ref('stock.stock_location_inter_wh', False)]"/>
<value model="stock.location" eval="{
'name': '中转区位',
}"/>
</function>
<!-- 几个特殊区位处理-->
<function model="res.company" name="_adjust_wh_cn_name"/>
</data>
</odoo>
+90
View File
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="partner_demo" model="res.partner">
<field name="name">Demo User</field>
<field name="company_id" ref="main_company"/>
<field name="customer" eval="False"/>
<field name="email">demo@yourcompany.example.com</field>
<field name="company_name">YourCompany</field>
<field name="street">Avenue des Dessus-de-Lives, 2</field>
<field name="city">Namur (Loyers)</field>
<field name="zip">5101</field>
<field name="country_id" ref="be"/>
</record>
<record model="res.partner.bank" id="bank_partner_demo">
<field name="acc_number">60-16-13 31926819</field>
<field name="acc_type">bank</field>
<field name="partner_id" ref="partner_demo" />
</record>
<record id="main_partner" model="res.partner">
<field name="name">YourCompany</field>
<field name="company_name">YourCompany</field>
<field name="street">1725 Slough Ave.</field>
<field name="city">Scranton</field>
<field name="zip">18540</field>
<field name='country_id' ref='base.us'/>
<field name='state_id' ref='state_us_39'/>
<field name="phone">+1 555 123 8069</field>
<field name="email">info@yourcompany.example.com</field>
<field name="website">www.example.com</field>
<field name="image" type="base64" file="base/res/res_company_logo.png"/>
</record>
<record id="main_company" model="res.company">
<field name="name">YourCompany</field>
<field name="external_report_layout">standard</field>
</record>
<record id="user_demo" model="res.users">
<field name="partner_id" ref="base.partner_demo"/>
<field name="login">demo</field>
<field name="password">demo</field>
<field name="signature" type="xml"><span>-- <br/>+Mr Demo</span></field>
<field name="company_id" ref="main_company"/>
<field name="groups_id" eval="[(6,0,[ref('base.group_user'), ref('base.group_partner_manager')])]"/>
<field name="image" type="base64" file="base/static/img/user_demo-image.jpg"/>
</record>
<record model="res.partner" id="base.partner_root">
<field name="company_name">YourCompany</field>
<field name="street">215 Vine St</field>
<field name="city">Scranton</field>
<field name="zip">18503</field>
<field name='country_id' ref='base.us'/>
<field name='state_id' ref='state_us_39'/>
<field name="phone">+1 555-555-5555</field>
<field name="email">admin@yourcompany.example.com</field>
<field name="tz">Europe/Brussels</field>
<field name="image" type="base64" file="base/static/img/partner_root-image.jpg"/>
</record>
<!-- Portal : partner and user -->
<record id="partner_demo_portal" model="res.partner">
<field name="name">Demo Portal User</field>
<field name="email">demo.portal@yourcompany.example.com</field>
<field name="supplier" eval="False"/>
<field name="customer" eval="True"/>
<field name="city">Vivegnis</field>
<field name="zip">4683</field>
<field name="country_id" ref="base.be"/>
<field name="company_name">YourCompany</field>
<field name="street">Rue Cesar de Paepe, 43</field>
</record>
<record id="demo_user0" model="res.users" context="{'no_reset_password': True}">
<field name="partner_id" ref="partner_demo_portal"/>
<field name="login">portal</field>
<field name="password">portal</field>
<field name="signature"><![CDATA[<span>-- <br/>Mr Demo Portal</span>]]></field>
<field name="groups_id" eval="[(5,)]"/><!-- Avoid auto-including this user in any default group -->
</record>
<record id="base.group_portal" model="res.groups"><!-- Add the demo user to the portal (and therefore to the portal member group) -->
<field name="users" eval="[(4,ref('demo_user0'))]"/>
</record>
</data>
</odoo>
+738
View File
@@ -0,0 +1,738 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="product_category_2" model="product.category">
<field name="parent_id" ref="product.product_category_all"/>
<field name="name">Internal</field>
</record>
<record id="product_category_3" model="product.category">
<field name="parent_id" ref="product.product_category_1"/>
<field name="name">Services</field>
</record>
<record id="product_category_4" model="product.category">
<field name="parent_id" ref="product.product_category_1"/>
<field name="name">Software</field>
</record>
<record id="product_category_5" model="product.category">
<field name="parent_id" ref="product_category_1"/>
<field name="name">Physical</field>
</record>
<record id="service_order_01" model="product.product">
<field name="name">Prepaid Consulting</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">40</field>
<field name="list_price">90</field>
<field name="type">service</field>
<field name="uom_id" ref="product_uom_hour"/>
<field name="uom_po_id" ref="product_uom_hour"/>
<field name="description">Example of product to invoice on order.</field>
<field name="default_code">SERV_ORDER</field>
</record>
<record id="service_delivery" model="product.product">
<field name="name">Cost-plus Contract</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">200.0</field>
<field name="list_price">180.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">SERV_DEL</field>
</record>
<record id="service_cost_01" model="product.product">
<field name="name">External Audit</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">160</field>
<field name="list_price">180</field>
<field name="type">service</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description">Example of products to invoice based on cost.</field>
<field name="default_code">SERV_COST</field>
</record>
<record id="product_delivery_01" model="product.product">
<field name="name">Switch, 24 ports</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">55.0</field>
<field name="list_price">70.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">PROD_DEL</field>
</record>
<record id="product_delivery_02" model="product.product">
<field name="name">Datacard</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">35.0</field>
<field name="list_price">40.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">PROD_DEL02</field>
</record>
<record id="product_order_01" model="product.product">
<field name="name">Zed+ Antivirus</field>
<field name="categ_id" ref="product_category_4"/>
<field name="standard_price">235.0</field>
<field name="list_price">280.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">PROD_ORDER</field>
</record>
<record id="product_product_1" model="product.product">
<field name="name">GAP Analysis Service</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">20.5</field>
<field name="list_price">30.75</field>
<field name="type">service</field>
<field name="uom_id" ref="product_uom_hour"/>
<field name="uom_po_id" ref="product_uom_hour"/>
<field name="description">Example of products to invoice based on delivery.</field>
</record>
<record id="product_product_2" model="product.product">
<field name="name">Support Services</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">25.5</field>
<field name="list_price">38.25</field>
<field name="type">service</field>
<field name="uom_id" ref="product_uom_hour"/>
<field name="uom_po_id" ref="product_uom_hour"/>
<field name="description">Example of product to invoice based on delivery.</field>
</record>
<record id="product_product_3" model="product.product">
<field name="name">Computer SC234</field>
<field name="categ_id" ref="product_category_5"/>
<field name="list_price">450.0</field>
<field name="standard_price">300.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">17" LCD Monitor&#xA;Processor AMD 8-Core</field>
<field name="default_code">PCSC234</field>
</record>
<!-- Ecommerce Variants and Products -->
<record id="product_attribute_1" model="product.attribute">
<field name="name">Memory</field>
</record>
<record id="product_attribute_value_1" model="product.attribute.value">
<field name="name">16 GB</field>
<field name="attribute_id" ref="product_attribute_1"/>
</record>
<record id="product_attribute_value_2" model="product.attribute.value">
<field name="name">32 GB</field>
<field name="attribute_id" ref="product_attribute_1"/>
</record>
<record id="product_attribute_2" model="product.attribute">
<field name="name">Color</field>
</record>
<record id="product_attribute_value_3" model="product.attribute.value">
<field name="name">White</field>
<field name="attribute_id" ref="product_attribute_2"/>
</record>
<record id="product_attribute_value_4" model="product.attribute.value">
<field name="name">Black</field>
<field name="attribute_id" ref="product_attribute_2"/>
</record>
<record id="product_attribute_3" model="product.attribute">
<field name="name">Wi-Fi</field>
</record>
<record id="product_attribute_value_5" model="product.attribute.value">
<field name="name">2.4 GHz</field>
<field name="attribute_id" ref="product_attribute_3"/>
</record>
<record id="product_product_4" model="product.product">
<field name="name">iPad Retina Display</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">500.0</field>
<field name="list_price">750.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">7.9‑inch (diagonal) LED-backlit, 128Gb&#xA;Dual-core A5 with quad-core graphics&#xA;FaceTime HD Camera, 1.2 MP Photos</field>
<field name="default_code">E-COM01</field>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_3')])]"/>
</record>
<record id="product_product_4b" model="product.product">
<field name="default_code">E-COM02</field>
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_4')])]"/>
</record>
<record id="product_product_4c" model="product.product">
<field name="default_code">E-COM03</field>
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_2'), ref('product.product_attribute_value_3')])]"/>
</record>
<record id="product_product_4d" model="product.product">
<field name="default_code">E-COM04</field>
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_2'), ref('product.product_attribute_value_4')])]"/>
</record>
<record id="product_attribute_line_1" model="product.attribute.line">
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_id" ref="product_attribute_1"/>
<field name="value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_2')])]"/>
</record>
<record id="product_attribute_line_2" model="product.attribute.line">
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_id" ref="product_attribute_2"/>
<field name="value_ids" eval="[(6,0,[ref('product.product_attribute_value_3'), ref('product.product_attribute_value_4')])]"/>
</record>
<record id="product_attribute_line_3" model="product.attribute.line">
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_id" ref="product_attribute_3"/>
<field name="value_ids" eval="[(6,0,[ref('product.product_attribute_value_5')])]"/>
</record>
<record id="product_product_4_product_template" model="product.template">
<field name="attribute_line_ids" eval="[(6,0,[ref('product.product_attribute_line_1'), ref('product.product_attribute_line_2'), ref('product.product_attribute_line_3')])]"/>
</record>
<record id="product_product_4d" model="product.product">
<field name="active" eval="False"/>
</record>
<record id="product_attribute_price_1" model="product.attribute.price">
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="value_id" ref="product_attribute_value_2"/>
<field name="price_extra">50.40</field>
</record>
<record id="product_product_5b" model="product.product">
<field name="name">Bose Mini Bluetooth Speaker</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">140.0</field>
<field name="list_price">247.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">Bose's smallest portable Bluetooth speaker</field>
<field name="default_code">E-COM05</field>
</record>
<record id="product_product_5" model="product.product">
<field name="name">Custom Computer (kit)</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">600.0</field>
<field name="list_price">147.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description">Custom computer shipped in kit.</field>
<field name="default_code">E-COM06</field>
</record>
<record id="product_product_5c" model="product.product">
<field name="name">Parts Replacement</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">600.0</field>
<field name="list_price">147.0</field>
<field name="type">service</field>
</record>
<record id="product_product_6" model="product.product">
<field name="name">iPad Mini</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">800.0</field>
<field name="list_price">320.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM07</field>
<field name='weight'>0.330</field>
</record>
<record id="product_product_6c" model="product.product">
<field name="name">Repair</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">800.0</field>
<field name="list_price">320.0</field>
<field name="type">service</field>
</record>
<record id="product_product_7" model="product.product">
<field name="name">Apple In-Ear Headphones</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">70.0</field>
<field name="list_price">79.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM08</field>
</record>
<record id="product_product_8" model="product.product">
<field name="name">iMac</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">1299.0</field>
<field name="list_price">1799.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM09</field>
<field name='weight'>9.54</field>
</record>
<record id="product_product_9" model="product.product">
<field name="name">Apple Wireless Keyboard</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">10.0</field>
<field name="list_price">47.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM10</field>
</record>
<record id="product_product_10" model="product.product">
<field name="name">Mouse, Optical</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">12.50</field>
<field name="list_price">14</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM11</field>
</record>
<record id="product_product_11" model="product.product">
<field name="name">iPod</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">14</field>
<field name="list_price">16.50</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">E-COM12</field>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_1')])]"/>
</record>
<record id="product_product_11b" model="product.product">
<field name="default_code">E-COM13</field>
<field name="product_tmpl_id" ref="product_product_11_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_2')])]"/>
</record>
<record id="product_product_11c" model="product.product">
<field name="name">Cleaning</field>
<field name="categ_id" ref="product_category_3"/>
<field name="standard_price">14</field>
<field name="list_price">16.50</field>
<field name="type">service</field>
</record>
<record id="product_attribute_line_4" model="product.attribute.line">
<field name="product_tmpl_id" ref="product_product_11_product_template"/>
<field name="attribute_id" ref="product_attribute_1"/>
<field name="value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_2')])]"/>
</record>
<record id="product_product_11_product_template" model="product.template">
<field name="attribute_line_ids" eval="[(6,0,[ref('product.product_attribute_line_4')])]"/>
</record>
<record id="product_attribute_price_2" model="product.attribute.price">
<field name="product_tmpl_id" ref="product_product_11_product_template"/>
<field name="value_id" ref="product_attribute_value_2"/>
<field name="price_extra">6.40</field>
</record>
<!-- MRP Demo Data-->
<record id="product_product_12" model="product.product">
<field name="name">Mouse, Wireless</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">18</field>
<field name="list_price">12.50</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">M-Wir</field>
</record>
<record id="product_product_13" model="product.product">
<field name="name">RAM SR5</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">78.0</field>
<field name="list_price">85.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">RAM-SR5</field>
</record>
<record id="product_product_16" model="product.product">
<field name="name">Computer Case</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">20.0</field>
<field name="list_price">25.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">C-Case</field>
</record>
<record id="product_product_17" model="product.product">
<field name="name">HDD SH-1</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">860.0</field>
<field name="list_price">975.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">HDD-SH1</field>
</record>
<record id="product_product_20" model="product.product">
<field name="name">Motherboard I9P57</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">1700.0</field>
<field name="list_price">1950.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">MBi9</field>
</record>
<record id="product_product_22" model="product.product">
<field name="name">Processor Core i5 2.70 Ghz</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">2010.0</field>
<field name="list_price">2100.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">CPUi5</field>
</record>
<record id="product_product_24" model="product.product">
<field name="name">Graphics Card</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">876.0</field>
<field name="list_price">885.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="default_code">CARD</field>
</record>
<record id="product_product_25" model="product.product">
<field name="name">Laptop E5023</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">2870.0</field>
<field name="list_price">2950.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description">17" Monitor, 4GB RAM&#xA;Standard-1294P Processor</field>
<field name="default_code">LAP-E5</field>
</record>
<record id="product_product_27" model="product.product">
<field name="name">Laptop Customized</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">3300.0</field>
<field name="list_price">3645.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description">Custom Laptop based on customer's requirement.</field>
<field name="default_code">LAP-CUS</field>
</record>
<record id="consu_delivery_03" model="product.product">
<field name="name">Basic Computer</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">25000.0</field>
<field name="list_price">23500.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">Dvorak keyboard&#xA;left-handed mouse</field>
<field name="default_code">CONS_DEL03</field>
</record>
<record id="consu_delivery_02" model="product.product">
<field name="name">Little server</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">45000.0</field>
<field name="list_price">40000.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">raid 1, 512ECC ram</field>
<field name="default_code">CONS_DEL02</field>
</record>
<record id="consu_delivery_01" model="product.product">
<field name="name">Server</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">65000.0</field>
<field name="list_price">60000.0</field>
<field name="type">consu</field>
<field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/>
<field name="description_sale">raid 10, 2048ECC ram</field>
<field name="default_code">CONS_DEL01</field>
</record>
<!-- Membership products -->
<record id="membership_0" model="product.product">
<field name="name">Gold Membership</field>
<field name="list_price">180</field>
<field name="categ_id" ref="product.product_category_1"/>
<field name="type">service</field>
<field name="active" eval="False"/>
</record>
<record id="membership_1" model="product.product">
<field name="name">Silver Membership</field>
<field name="categ_id" ref="product.product_category_1"/>
<field name="list_price">80</field>
<field name="type">service</field>
<field name="active" eval="False"/>
</record>
<record id="membership_2" model="product.product">
<field name="name">Basic Membership</field>
<field name="categ_id" ref="product.product_category_1"/>
<field name="list_price">40</field>
<field name="type">service</field>
<field name="active" eval="False"/>
</record>
<!--
Resource: product.supplierinfo
-->
<record id="product_supplierinfo_1" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_6_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">750</field>
</record>
<record id="product_supplierinfo_2" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_6_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">790</field>
</record>
<record id="product_supplierinfo_2bis" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_6_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">3</field>
<field name="min_qty">3</field>
<field name="price">785</field>
</record>
<record id="product_supplierinfo_3" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_7_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">65</field>
</record>
<record id="product_supplierinfo_4" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_7_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">72</field>
</record>
<record id="product_supplierinfo_5" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_8_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">2</field>
<field name="min_qty">5</field>
<field name="price">1299</field>
</record>
<record id="product_supplierinfo_6" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_8_product_template"/>
<field name="name" ref="base.res_partner_12"/>
<field name="delay">4</field>
<field name="min_qty">1</field>
<field name="price">1399</field>
</record>
<record id="product_supplierinfo_7" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_10_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">2</field>
<field name="min_qty">1</field>
<field name="price">12.50</field>
</record>
<record id="product_supplierinfo_8" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_11_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">2</field>
<field name="min_qty">1</field>
<field name="price">14</field>
</record>
<record id="product_supplierinfo_9" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_13_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">5</field>
<field name="min_qty">1</field>
<field name="price">78</field>
</record>
<record id="product_supplierinfo_10" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_16_product_template"/>
<field name="name" ref="base.res_partner_3"/>
<field name="delay">1</field>
<field name="min_qty">1</field>
<field name="price">20</field>
</record>
<record id="product_supplierinfo_11" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_17_product_template"/>
<field name="name" ref="base.res_partner_2"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">860</field>
</record>
<record id="product_supplierinfo_12" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_20_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">1700</field>
</record>
<record id="product_supplierinfo_13" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_20_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">4</field>
<field name="min_qty">5</field>
<field name="price">1720</field>
</record>
<record id="product_supplierinfo_14" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_22_product_template"/>
<field name="name" ref="base.res_partner_2"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">2010</field>
</record>
<record id="product_supplierinfo_15" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_24_product_template"/>
<field name="name" ref="base.res_partner_2"/>
<field name="delay">3</field>
<field name="min_qty">1</field>
<field name="price">876</field>
</record>
<record id="product_supplierinfo_16" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_25_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">8</field>
<field name="min_qty">1</field>
<field name="price">2870</field>
</record>
<record id="product_supplierinfo_17" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_delivery_02_product_template"/>
<field name="name" ref="base.res_partner_2"/>
<field name="delay">4</field>
<field name="min_qty">1</field>
<field name="price">390</field>
</record>
<record id="product_supplierinfo_18" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_delivery_01_product_template"/>
<field name="name" ref="base.res_partner_3"/>
<field name="delay">2</field>
<field name="min_qty">12</field>
<field name="price">90</field>
</record>
<record id="product_supplierinfo_19" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_delivery_01_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">4</field>
<field name="min_qty">1</field>
<field name="price">66</field>
</record>
<record id="product_supplierinfo_20" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_delivery_02_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">5</field>
<field name="min_qty">1</field>
<field name="price">35</field>
</record>
<record id="product_supplierinfo_21" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_delivery_01_product_template"/>
<field name="name" ref="base.res_partner_12"/>
<field name="delay">7</field>
<field name="min_qty">1</field>
<field name="price">55</field>
</record>
<record id="product_supplierinfo_22" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_9_product_template"/>
<field name="name" ref="base.res_partner_12"/>
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">10</field>
</record>
<record id="product_supplierinfo_23" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_27_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">10</field>
<field name="min_qty">0</field>
<field name="price">3300</field>
</record>
<record id="product_supplierinfo_24" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_12_product_template"/>
<field name="name" ref="base.res_partner_1"/>
<field name="delay">3</field>
<field name="min_qty">0</field>
<field name="price">12.50</field>
</record>
<record id="product_supplierinfo_25" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_12_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">2</field>
<field name="min_qty">0</field>
<field name="price">13.50</field>
</record>
<record forcecreate="True" id="property_product_pricelist_demo" model="ir.property">
<field name="name">property_product_pricelist</field>
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_product_pricelist')]"/>
<field name="value" eval="'product.pricelist,'+str(ref('list0'))"/>
<field name="res_id" eval="'res.partner,'+str(ref('base.partner_demo'))"/>
<field name="company_id" ref="base.main_company"/>
</record>
</data>
</odoo>
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="false">
<record id="product_product_1" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_1-image.jpg"/>
</record>
<record id="product_product_2" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_2-image.jpg"/>
</record>
<record id="product_product_3" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_3-image.jpg"/>
</record>
<record id="product_product_4" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_4-image.png"/>
</record>
<record id="product_product_5" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_5-image.jpg"/>
</record>
<record id="product_product_5b" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_5-image.png"/>
</record>
<record id="product_product_6" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_6-image.png"/>
</record>
<record id="product_product_7" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_7-image.png"/>
</record>
<record id="product_product_8" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_8-image.png"/>
</record>
<record id="product_product_9" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_9-image.png"/>
</record>
<record id="product_product_10" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_10-image.jpg"/>
</record>
<record id="product_product_11" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_11-image.png"/>
</record>
<record id="product_product_12" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_12-image.jpg"/>
</record>
<record id="product_product_13" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_13-image.jpg"/>
</record>
<record id="product_product_16" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_16-image.jpg"/>
</record>
<record id="product_product_17" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_17-image.jpg"/>
</record>
<record id="product_product_20" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_20-image.jpg"/>
</record>
<record id="product_product_22" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_22-image.jpg"/>
</record>
<record id="product_product_24" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_24-image.jpg"/>
</record>
<record id="product_product_25" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_25-image.jpg"/>
</record>
<record id="product_product_27" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_27-image.jpg"/>
</record>
<record id="product_order_01" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_43-image.jpg"/>
</record>
<record id="product_delivery_02" model="product.product">
<field name="image" type="base64" file="product/static/img/product_product_46-image.jpg"/>
</record>
<record id="membership_0" model="product.product">
<field name="image" type="base64" file="product/static/img/membership_0-image.jpg"/>
</record>
<record id="membership_1" model="product.product">
<field name="image" type="base64" file="product/static/img/membership_1-image.jpg"/>
</record>
<record id="membership_2" model="product.product">
<field name="image" type="base64" file="product/static/img/membership_2-image.jpg"/>
</record>
</data>
</odoo>
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record model="res.bank" id="bank_ing">
<field name="name">ING</field>
<field name="bic">BBRUBEBB</field>
</record>
<record model="res.bank" id="bank_crelan">
<field name="name">Crelan</field>
<field name="bic">NICABEBB</field>
</record>
<record model="res.bank" id="bank_cbc">
<field name="name">CBC</field>
<field name="bic">CREGBEBB</field>
</record>
</data>
</odoo>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="main_company" model="res.company">
<field name="name">odooAi欧度智能</field>
</record>
</data>
</odoo>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- todo: 只处理主partern,后续处理其它-->
<record id="base.main_partner" model="res.partner">
<field name="email">info@odooai.cn</field>
<field name="website">www.odooai.cn</field>
</record>
</data>
</odoo>
@@ -0,0 +1,98 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<data noupdate="1">
<record id="base.res_partner_address_1" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_1-image.png"/>
</record>
<record id="base.res_partner_address_2" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_2-image.png"/>
</record>
<record id="base.res_partner_address_4" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_4-image.png"/>
</record>
<record id="base.res_partner_address_5" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_5-image.png"/>
</record>
<record id="base.res_partner_address_7" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_7-image.png"/>
</record>
<record id="base.res_partner_address_10" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_10-image.png"/>
</record>
<record id="base.res_partner_address_11" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_11-image.png"/>
</record>
<record id="base.res_partner_address_13" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_13-image.png"/>
</record>
<record id="base.res_partner_address_14" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_14-image.png"/>
</record>
<record id="base.res_partner_address_15" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_15-image.png"/>
</record>
<record id="base.res_partner_address_16" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_16-image.png"/>
</record>
<record id="base.res_partner_address_17" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_17-image.png"/>
</record>
<record id="base.res_partner_address_18" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_18-image.png"/>
</record>
<record id="base.res_partner_address_24" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_24-image.png"/>
</record>
<record id="base.res_partner_address_25" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_25-image.png"/>
</record>
<record id="base.res_partner_address_27" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_27-image.png"/>
</record>
<record id="base.res_partner_address_28" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_28-image.png"/>
</record>
<record id="base.res_partner_address_30" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_30-image.png"/>
</record>
<record id="base.res_partner_address_32" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_32-image.png"/>
</record>
<record id="base.res_partner_address_33" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_33-image.png"/>
</record>
<record id="base.res_partner_address_34" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_address_34-image.png"/>
</record>
<record id="base.res_partner_main1" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_main1-image.png"/>
</record>
<record id="base.res_partner_main2" model="res.partner">
<field name="image" type="base64" file="base/static/img/res_partner_main2-image.png"/>
</record>
</data>
</odoo>
+63
View File
@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
# Created on 2017-11-22
# author: 欧度智能,https://www.odooai.cn
# email: 300883@qq.com
# resource of odooai
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Odoo在线中文用户手册(长期更新)
# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# https://www.odooai.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备)
# https://www.odooai.cn/odoo10_developer_document_offline/
# description:
from odoo import api, SUPERUSER_ID, _
def pre_init_hook(env):
"""
数据初始化,只在安装时执行,更新时不执行
"""
# todo: 启用中文
pass
def post_init_hook(env):
"""
数据初始化,只在安装后执行,更新时不执行
"""
try:
ids = env['product.category'].sudo().with_context(lang='zh_CN', active_test=False).search([
('parent_id', '!=', False)
], order='parent_path')
for rec in ids:
rec._compute_complete_name()
ids = env['stock.location'].sudo().with_context(lang='zh_CN', active_test=False).search([
('location_id', '!=', False),
('usage', '!=', 'views'),
], order='parent_path')
for rec in ids:
rec._compute_complete_name()
# 超级用户改时区为中国
ids = env['res.users'].sudo().with_context(lang='zh_CN', active_test=False).browse([1, 2])
ids.write({'tz': "Etc/GMT-8"})
# 公司价格改人民币
ids = env['res.company'].sudo().search([], limit=1)
if ids:
ids.write({'currency_id': env.ref('base.CNY').id})
# 价格表改人民币
ids = env['product.pricelist'].sudo().search([], limit=1)
if ids:
ids.write({'currency_id': env.ref('base.CNY').id})
except Exception as e:
raise Warning(e)
def uninstall_hook(env):
"""
数据初始化,卸载时执行
"""
pass
+128
View File
@@ -0,0 +1,128 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_base_chinese
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e-20221228\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-14 08:50+0000\n"
"PO-Revision-Date: 2023-02-14 08:50+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_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_account_tax_group__active
msgid "Active"
msgstr "激活"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_res_company
msgid "Companies"
msgstr "公司"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_res_partner
msgid "Contact"
msgstr "联系人"
#. module: app_base_chinese
#: model_terms:ir.ui.view,arch_db:app_base_chinese.app_res_partner_kanban_view
msgid "Credit:"
msgstr "信用额:"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_res_currency
msgid "Currency"
msgstr "币种"
#. module: app_base_chinese
#: model:ir.model.fields,help:app_base_chinese.field_res_currency__sequence
msgid "Determine the display order. Sort ascending."
msgstr "决定显示顺序,数字越小排序越前"
#. module: app_base_chinese
#: model_terms:ir.ui.view,arch_db:app_base_chinese.app_view_sale_advance_payment_inv
msgid "FaPiao / Invoice Orders"
msgstr "创建收据/发票"
#. module: app_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_res_partner__fax
#: model:ir.model.fields,field_description:app_base_chinese.field_res_users__fax
msgid "Fax"
msgstr "传真"
#. module: app_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_stock_location__complete_name
msgid "Full Location Name"
msgstr "完整的位置名称"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_stock_location
msgid "Inventory Locations"
msgstr "库存位置"
#. module: app_base_chinese
#: model_terms:ir.ui.view,arch_db:app_base_chinese.app_view_order_form
msgid "Invoices/FaPiao"
msgstr "收据/发票"
#. module: app_base_chinese
#: model_terms:ir.ui.view,arch_db:app_base_chinese.app_view_order_form
msgid "Make Collections"
msgstr "收款"
#. module: app_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_res_partner__name
#: model:ir.model.fields,field_description:app_base_chinese.field_res_users__name
msgid "Name"
msgstr "名称"
#. module: app_base_chinese
#: model_terms:ir.ui.view,arch_db:app_base_chinese.app_view_move_form
msgid "Post Entry"
msgstr "过帐"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_product_category
msgid "Product Category"
msgstr "品类"
#. module: app_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_res_currency__sequence
msgid "Sequence"
msgstr "排序"
#. module: app_base_chinese
#: model:ir.model.fields,help:app_base_chinese.field_account_tax_group__active
msgid "Set active to false to hide the tax without removing it."
msgstr "请不要删除指定税率,可以将其归档。"
#. module: app_base_chinese
#: model:ir.model.fields,field_description:app_base_chinese.field_res_partner__short_name
#: model:ir.model.fields,field_description:app_base_chinese.field_res_users__short_name
msgid "Short Name"
msgstr "简称"
#. module: app_base_chinese
#: model:ir.model,name:app_base_chinese.model_account_tax_group
msgid "Tax Group"
msgstr "税组"
#. module: app_base_chinese
#. odoo-javascript
#: code:addons/app_base_chinese/static/src/xml/views.xml:0
#, python-format
msgid "性能原因,只支持 200 条记录的显示"
msgstr ""
#. module: app_base_chinese
#. odoo-javascript
#: code:addons/app_base_chinese/static/src/xml/views.xml:0
#, python-format
msgid "记录没有树状结构"
msgstr ""
+1
View File
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
+12
View File
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
from . import res_company
from . import res_country
from . import res_partner
from . import res_currency
from . import product_category
from . import stock_location
from . import account_tax_group
from . import ir_module_module
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _, tools
class AccountTaxGroup(models.Model):
_inherit = 'account.tax.group'
active = fields.Boolean(default=True, help="Set active to false to hide the tax without removing it.")
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
import logging
import lxml.html
from odoo import api, fields, models, modules, tools, _
_logger = logging.getLogger(__name__)
class Module(models.Model):
_inherit = "ir.module.module"
description_html_cn = fields.Html('Description HTML CN', compute='_get_desc_cn')
@api.depends('name', 'description')
def _get_desc_cn(self):
for module in self:
module_path = modules.get_module_path(module.name, display_warning=False) # avoid to log warning for fake community module
if module_path:
path = modules.check_resource_path(module_path, 'static/description/index_cn.html')
else:
module.description_html_cn = False
if module_path and path:
# 注意: b 不能在 mode中才能使用 utf-8
with tools.file_open(path, 'r') as desc_file:
doc = desc_file.read()
html = lxml.html.document_fromstring(doc)
for element, attribute, link, pos in html.iterlinks():
if element.get('src') and not '//' in element.get('src') and not 'static/' in element.get('src'):
element.set('src', "/%s/static/description/%s" % (module.name, element.get('src')))
module.description_html_cn = tools.html_sanitize(lxml.html.tostring(html))
else:
module.description_html_cn = False
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import logging
from odoo import api, fields, models, _
_logger = logging.getLogger(__name__)
class ProductCategory(models.Model):
_inherit = "product.category"
+30
View File
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.exceptions import UserError, ValidationError
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model
def _adjust_wh_cn_name(self):
companys = self.env['res.company'].with_context(active_test=False, lang='zh_CN').search([])
for rec in companys:
# 修正区位名称
ids = self.env['stock.location'].with_context(active_test=False).search(
[('name', 'like', ': Transit Location'), ('company_id', '=', rec.id)])
ids.with_context(lang='zh_CN').write({'name': '%s:中转区位' % rec.name})
ids = self.env['stock.location'].with_context(active_test=False).search(
[('name', 'like', ': Scrap'), ('company_id', '=', rec.id)])
ids.with_context(lang='zh_CN').write({'name': '%s:报废区位' % rec.name})
ids = self.env['stock.location'].with_context(active_test=False).search(
[('name', 'like', ': Inventory adjustment'), ('company_id', '=', rec.id)])
ids.with_context(lang='zh_CN').write({'name': '%s:盘点区位' % rec.name})
# 注意,原生没有在生产中使用 _
ids = self.env['stock.location'].with_context(active_test=False).search([
('name', 'like', ': Production'), ('company_id', '=', rec.id)])
ids.with_context(lang='zh_CN').write({'name': '%s:生产区位' % rec.name})
ids = self.env['stock.location'].with_context(active_test=False).search([
('name', 'like', ': Subcontracting Location'), ('company_id', '=', rec.id)])
ids.with_context(lang='zh_CN').write({'name': '%s:委外区位' % rec.name})
+11
View File
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Country(models.Model):
_inherit = 'res.country'
_order = 'sequence,name'
sequence = fields.Integer('Sequence', help="Determine the display order", default=99)
+53
View File
@@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
class ResCurrency(models.Model):
_inherit = 'res.currency'
_order = 'active desc, sequence, name'
sequence = fields.Integer('Sequence', default=10, help="Determine the display order. Sort ascending.")
def rmb_upper(self, value):
"""
人民币大写
传入浮点类型的值返回 unicode 字符串
:param 传入阿拉伯数字
:return 返回值是对应阿拉伯数字的绝对值的中文数字
"""
if self.name != 'CNY':
return
rmbmap = [u"零", u"壹", u"贰", u"叁", u"肆", u"伍", u"陆", u"柒", u"捌", u"玖"]
unit = [u"分", u"角", u"元", u"拾", u"佰", u"仟", u"万", u"拾", u"佰", u"仟", u"亿",
u"拾", u"佰", u"仟", u"万", u"拾", u"佰", u"仟", u"兆"]
# 冲红负数处理
xflag = 0
if value < 0:
xflag = value
value = abs(value)
# 先把value 数字进行格式化保留两位小数,转成字符串然后去除小数点
nums = list(map(int, list(str('%0.2f' % value).replace('.', ''))))
words = []
zflag = 0 # 标记连续0次数,以删除万字,或适时插入零字
start = len(nums) - 3
for i in range(start, -3, -1): # 使i对应实际位数,负数为角分
# 大部分情况对应数字不等于零 或者是刚开始循环
if 0 != nums[start - i] or len(words) == 0:
if zflag:
words.append(rmbmap[0])
zflag = 0
words.append(rmbmap[nums[start - i]]) # 数字对应的中文字符
words.append(unit[i + 2]) # 列表此位置的单位
# 控制‘万/元’ 万和元比较特殊,如2拾万和2拾1万 无论有没有这个1 万字是必须的
elif 0 == i or (0 == i % 4 and zflag < 3):
# 上面那种情况定义了 2拾1万 的显示 这个是特殊对待的 2拾万(一类)的显示
words.append(unit[i + 2])
# 元(控制条件为 0 == i )和万(控制条为(0 == i % 4 and zflag < 3))的情况的处理是一样的
zflag = 0
else:
zflag += 1
if words[-1] != unit[0]: # 结尾非‘分’补整字 最小单位 如果最后一个字符不是最小单位(分)则要加一个整字
words.append(u"整")
if xflag < 0: # 如果为负数则要在数字前面加上‘负’字
words.insert(0, u"负")
return ''.join(words)
+33
View File
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.exceptions import UserError, ValidationError
class ResPartner(models.Model):
_inherit = 'res.partner'
name = fields.Char(translate=False)
short_name = fields.Char('Short Name') # 简称
fax = fields.Char('Fax') # 简称
# 增加地址显示中的手机号与电话号码
# 选项 show_address 开启则增加显示手机与电话号
def _get_name(self):
name = super(ResPartner, self)._get_name()
partner = self
if self._context.get('show_address'):
if partner.mobile and partner.phone:
name = name + "\n" + partner.mobile + "," + partner.phone
elif partner.mobile:
name = name + "\n" + partner.mobile
elif partner.phone:
name = name + "\n" + partner.phone
return name.strip()
@api.model_create_multi
def create(self, vals_list):
for values in vals_list:
if 'lang' not in values:
values['lang'] = 'zh_CN'
return super(ResPartner, self).create(vals_list)
+12
View File
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import logging
from odoo import api, fields, models, _
_logger = logging.getLogger(__name__)
class Location(models.Model):
_inherit = "stock.location"
complete_name = fields.Char(translate=True)
+2
View File
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
+1
View File
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

@@ -0,0 +1,156 @@
<section class="oe_container container">
<div class="oe_row oe_spaced" >
<div class="row">
<h2 class="oe_slogan">Chinese Enhance All in One。 Local customize for china user </h2>
<h3 class="oe_slogan">20+ chinese setting enhance.</h3>
<div class="oe_row">
<h3>Latest update: v17.24.10.08</h3>
<div class="oe_span12 oe_spaced">
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<i class="fa fa-hand-o-right"></i><b> Key features: </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-check-square-o text-primary"></i>
1. Chinese address format, applicable to all Chinese customers, suppliers, partners, users, employee information etc.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
2. Default values in Chinese such as country, time zone and currency. Processing module base, product.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
3. Add customer abbreviation and display addresses in Chinese; prioritize displaying customer codes.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
4. Display phone numbers along with mobile numbers for customer addresses.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
5. Currency processing with added sorting display.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
6. Fixed bug where the category list and m2o field did not display the name of the Chinese directory.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
7. Fixed bug where warehouse location list and m2o field did not display the name of the Chinese directory.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
8. Superuser changed time zone to China.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
9. Date format is year-month-day (e.g., 2023-08-08) and time is 12:34
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
10.Country sorting added; China ranked first
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
11.Display payment-related information according to typical practices in China.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
12.Default export translation is set to Mandarin (po).
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
13.Added 'name_en_US' field in base model which updates translation value when assigned a value.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
14.Common decimal precision adjustments made.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
15.Sales team changed to "China".
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
21. Multi-language Support. Multi-Company Support.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
22. Support Odoo 18,17,16,15,14,13,12, Enterprise and Community and odoo.sh Edition.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
23. Full Open Source..
</li>
</ul>
</div>
</div>
<div class="row">
<img class="oe_demo oe_screenshot img img-fluid" src="cnreadme.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Set the address format to chinese. Including all customer, supplier, users</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo1.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Set Default country, state, timezone, currency.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo2.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Fix Category Display not in english bug.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo3.jpg">
</div>
</div>
</section>
<section class="container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="row">
<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:odoo@china.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> odoo@china.com</a>
<p><h4>
Via QQ: 300883 (App user would not get QQ or any other IM support. Only for odoo project customize.)</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">
<h4>
Visit our website for more support.</h4>
<h4>https://www.odooai.cn</h4>
</div>
</div>
</div>
<div class="oe_row oe_spaced text-center">
<h2>More Powerful addons, Make your odoo very easy to use, easy customize:
<a class="btn btn-primary mb16" href="http://www.odoo.com/apps/modules/browse?author=odooai.cn">odooai.cn Odoo Addons</a>
</h2>
</div>
</section>
@@ -0,0 +1,67 @@
<t>
<t t-call="master_input" />
<div class="row mb-3">
<label for="dbname" class="col-md-4 col-form-label">Database Name</label>
<div class="col-md-8">
<input id="dbname" type="text" name="name" class="form-control" required="required" autocomplete="off" t-att-pattern="pattern" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/>
</div>
</div>
<div class="row mb-3">
<label for="login" class="col-md-4 col-form-label">Email</label>
<div class="col-md-8">
<input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/>
</div>
</div>
<div class="row mb-3">
<label for="password" class="col-md-4 col-form-label">Password</label>
<div class="col-md-8">
<div class="input-group">
<input id="password" type="password" name="password" class="form-control" required="required" autocomplete="off"/>
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span>
</div>
</div>
</div>
<div class="row mb-3">
<label for="phone" class="col-md-4 col-form-label">Phone number</label>
<div class="col-md-8">
<input id="phone" type="tel" name="phone" class="form-control" autocomplete="off"/>
</div>
</div>
<div class="row mb-3">
<label for="lang" class="col-md-4 col-form-label">Language</label>
<div class="col-md-8">
<select id="lang" name="lang" class="form-select" required="required" autocomplete="off">
<t t-foreach="langs" t-as="lang">
<t t-if="lang[0] == 'zh_CN'">
<option t-att-value="lang[0]" t-out="lang[1]" selected="selected"/>
</t>
<t t-else="">
<option t-att-value="lang[0]" t-out="lang[1]"/>
</t>
</t>
</select>
</div>
</div>
<div class="row mb-3">
<label for="country" class="col-md-4 col-form-label ">Country</label>
<div class="col-md-8">
<select id="country" name="country_code" class="form-select" autocomplete="off">
<option value=""></option>
<t t-foreach="countries" t-as="country">
<t t-if="country[0] == 'cn'">
<option t-att-value="country[0]" t-out="country[1]" selected="selected"/>
</t>
<t t-else="">
<option t-att-value="country[0]" t-out="country[1]"/>
</t>
</t>
</select>
</div>
</div>
<div class="row mb-3">
<label for="load_demo_checkbox" class="col-md-4 col-form-label">Demo data</label>
<div class="col-md-8">
<input type="checkbox" id="load_demo_checkbox" class="form-control-sm" name="demo" value="1" />
</div>
</div>
</t>
@@ -0,0 +1,39 @@
//必须有 form ,故要特殊处理样式
.o_form_view.o_form_nosheet.o_form_address_chinese, .o_form_view .o_form_nosheet.o_form_address_chinese {
padding: 0 0 0 0;
}
.o_form_view .o_address_format.o_address_chinese {
.o_address_country {
display: -webkit-inline-flex;
display: inline-flex;
width: 38%;
margin-right: 2%;
}
}
.o_form_view .o_address_format.o_address_chinese {
.o_address_country {
display: -webkit-inline-flex;
display: inline-flex;
width: 38%;
margin-right: 2%;
}
}
.o_form_view .o_form_editable .o_address_format.o_address_chinese {
.o_address_zip{
width: 38%;
margin-right: 2%;
}
.o_address_state {
width: 38%;
margin-right: 2%;
}
.o_address_city{
width: 38%;
margin-right: 2%;
}
.o_address_city_id{
width: 38%;
margin-right: 2%;
}
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!--改search中英文-->
<t t-extend="SearchPanel.Category">
<t t-jquery="div.alert" t-operation="replace">
<div t-if="category.limitAttained" class="alert alert-warning">
<span>性能原因,只支持 200 条记录的显示</span>
<span t-if="category.parentField">记录没有树状结构</span>
</div>
</t>
</t>
</templates>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- VIEWS -->
<record id="app_view_move_form" model="ir.ui.view">
<field name="name">app.account.move.form</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<!-- 过帐操作-->
<xpath expr="//header//button[@name='action_post']" position="attributes">
<attribute name="string">Post Entry</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- currency视图, tree -->
<record id="app_view_currency_tree" model="ir.ui.view">
<field name="name">app.res.currency.tree</field>
<field name="model">res.currency</field>
<field name="inherit_id" ref="base.view_currency_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="before">
<field name="sequence" widget="handle"/>
</xpath>
</field>
</record>
<!-- currency视图, form -->
<record id="app_view_currency_form" model="ir.ui.view">
<field name="name">app.res.currency.form</field>
<field name="model">res.currency</field>
<field name="inherit_id" ref="base.view_currency_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='position']" position="after">
<field name="sequence"/>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="app_base_chinese_module_module_form_view" model="ir.ui.view">
<field name="name">app.base.chinese.module.module.form</field>
<field name="model">ir.module.module</field>
<field name="inherit_id" ref="base.module_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='description_html']" position="before">
<field name="description_html_cn"/>
</xpath>
</field>
</record>
<record id="app_base_chinese_module_kanban_view" model="ir.ui.view">
<field name="name">app.base.chinese.module.kanban</field>
<field name="model">ir.module.module</field>
<field name="inherit_id" ref="base.module_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//a[@t-if='record.to_buy.raw_value']" position="attributes">
<attribute name="href">https://www.odooapp.cn/pricing?utm_source=db&amp;utm_medium=module#hosting=on_premise</attribute>
</xpath>
</field>
</record>
</odoo>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="app_view_company_tree" model="ir.ui.view">
<field name="name">app.res.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="short_name"/>
</xpath>
</field>
</record>
<record id="app_view_company_form" model="ir.ui.view">
<field name="name">app.res.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='phone']" position="before">
<field name='short_name'/>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- currency视图, tree -->
<record id="app_ir_default_tree_view" model="ir.ui.view">
<field name="name">app.ir.default tree view</field>
<field name="model">ir.default</field>
<field name="inherit_id" ref="base.ir_default_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='json_value']" position="after">
<field name="condition"/>
</xpath>
</field>
</record>
<!-- currency视图, form -->
<record id="app_ir_default_form_view" model="ir.ui.view">
<field name="name">app.ir.default form view</field>
<field name="model">ir.default</field>
<field name="inherit_id" ref="base.ir_default_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='json_value']" position="after">
<field name="condition"/>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Partner Form视图,用继承方式改写2018-11-21,ivan -->
<record id="app_view_partner_form" model="ir.ui.view">
<field name="name">app.res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<!-- 客户编号设计在重要位置,放到 app_partner_auto_reference -->
<!--<xpath expr="//field[@name='type']" position="after">-->
<!--<xpath expr="//field[@name='ref']" position="move"/>-->
<!--</xpath>-->
<xpath expr="//field[@name='function']" position="before">
<field name="short_name"/>
</xpath>
<!--res.partner客户,细节调整至 app_base_chinese_city 中处理 -->
<xpath expr="//field[@name='street']" position="before">
<xpath expr="//div[@name='partner_address_country']" position="move"/>
</xpath>
<xpath expr="//page//field[@name='child_ids']//form[1]//field[@name='name']" position="attributes">
<attribute name="required">1</attribute>
<attribute name="force_save">1</attribute>
</xpath>
<xpath expr="//field[@name='child_ids']//form[1]//field[@name='email']" position="before">
<field name="category_id" widget="many2many_tags"/>
</xpath>
<!-- res.partner联系人 kanban -->
<!-- 显示类型和地址等 -->
<xpath expr="//field[@name='child_ids']//kanban[1]//templates//field[@name='name']" position="before">
<t t-if="record.ref and record.ref.raw_value">[<field name="ref"/>]
</t>
</xpath>
<xpath expr="//field[@name='child_ids']//kanban[1]//templates//field[@name='name']" position="after">
<div t-if="record.type and record.type.raw_value">
<field name="type"/>
</div>
<div t-if="record.category_id and record.category_id.raw_value">
<field name="category_id" widget="many2many_tags"/>
</div>
</xpath>
</field>
</record>
<!-- 指定的中国地址格式-->
<record id="app_view_partner_form_chinese" model="ir.ui.view">
<field name="name">app.res.partner.form.chinese</field>
<field name="model">res.partner</field>
<field name="priority" eval="900"/>
<field name="arch" type="xml">
<form class="o_form_address_chinese">
<div class="o_address_format o_address_chinese">
<div name="partner_address_country" class="d-flex">
<field name="country_id" placeholder="Country" class="o_address_country"
options='{"no_open": True, "no_create": True}'/>
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
</div>
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True, "no_create": True}'
context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}"/>
<field name="city_id" placeholder="City" class="o_address_city"
options='{"no_open": True, "no_create": True}'
context="{'default_country_id': country_id, 'default_state_id': state_id,}"/>
<field name="city" placeholder="City" invisible="1"/>
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
</div>
</form>
</field>
</record>
<record id="app_view_partner_tree" model="ir.ui.view">
<field name="name">app.res.partner.tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="after">
<field name="category_id" widget="many2many_tags" optional="show"/>
</xpath>
</field>
</record>
<!--Partner kanban 视图,用继承方式改写2017-11-23,ivan-->
<record id="app_res_partner_kanban_view" model="ir.ui.view">
<field name="name">app.res.partner.kanban</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="credit_limit"/>
</xpath>
<xpath expr="//div[hasclass('oe_kanban_details')]/div/ul" position="inside">
<li t-if="record.credit_limit and record.credit_limit.raw_value">
Credit:
<field name="credit_limit"/>
</li>
</xpath>
</field>
</record>
<!--end客户-->
<!-- 为供应商菜单单独增加筛选器 2017-11-13 -->
<!--end供应商-->
<!-- 所有合作伙伴 2017-11-13 -->
</data>
</odoo>
@@ -0,0 +1,24 @@
<odoo>
<data>
<!-- 改收款相关操作显示 -->
<record id="app_view_order_form" model="ir.ui.view">
<field name="name">app.sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<!-- 全款操作-->
<xpath expr="//header//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][1]" position="attributes">
<attribute name="string">Make Collections</attribute>
</xpath>
<!-- 尾款操作-->
<xpath expr="//header//button[@name='%(sale.action_view_sale_advance_payment_inv)d'][1]" position="attributes">
<attribute name="string">Make Collections</attribute>
</xpath>
<!-- 查看收据列表-->
<xpath expr="//div[hasclass('oe_button_box')]//field[@name='invoice_count']" position="attributes">
<attribute name="string">Invoices/FaPiao</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sale.view_sale_advance_payment_inv" model="ir.ui.view">
<field name="name">FaPiao / Invoice Orders</field>
</record>
<record id="app_view_sale_advance_payment_inv" model="ir.ui.view">
<field name="name">app.account.move.form</field>
<field name="model">sale.advance.payment.inv</field>
<field name="inherit_id" ref="sale.view_sale_advance_payment_inv"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="string">FaPiao / Invoice Orders</attribute>
</xpath>
</field>
</record>
<record id="sale.action_view_sale_advance_payment_inv" model="ir.actions.act_window">
<field name="name">Create FaPiao / Invoice</field>
</record>
</odoo>
+3
View File
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
+91
View File
@@ -0,0 +1,91 @@
# -*- coding: utf-8 -*-
# Created on 2021-11-30
# author: 欧度智能,https://www.odooai.cn
# email: 300883@qq.com
# resource of odooai
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Odoo12在线用户手册(长期更新)
# https://www.odooai.cn/documentation/user/12.0/en/index.html
# Odoo12在线开发者手册(长期更新)
# https://www.odooai.cn/documentation/12.0/index.html
# Odoo10在线中文用户手册(长期更新)
# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# https://www.odooai.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备)
# https://www.odooai.cn/odoo10_developer_document_offline/
# change ztree to https://github.com/wenzhixin/font-awesome-zTree
{
'name': 'Many2One Hierarchy Parent Child M2o Selector, zTree 树状下拉选择器',
'version': '17.0.24.12.18',
'author': 'odooai.cn',
'category': 'Base',
'website': 'https://www.odooai.cn',
'live_test_url': 'https://demo.odooapp.cn',
'license': 'OPL-1',
'sequence': 2,
'summary': """
show parent tree, parent children node in m2o select field.
Use for parent children tree list select navigator.
ztree widget.
""",
'description': """
zTree widget.
Advance search with real parent children tree, ListView or KanbanView ,
eg: Product category tree ,Department tree, stock location tree.
M2O字段下拉树状选择器,Many2One动态父子多层级关系树展现widget小组件,可用于任何模块。
用于父子树列表选择导航器。例如品类,部门等多层次展现。
已内置10多个免费odoo应用的多层级选择,如产品,Hr部门,联系人,仓库货架等。
1. M2o Select with Hierarchy parent/child dropdown.
2. zTree widget for any app in odoo.
3. Easy use in customize 3rd app. Easy to make custom parent children tree.
4. Hierarchy selector out-of-box with all apps:
Product, Sales, Purchase, MRP, Stock, Etc...
5. zTree树状下拉选择器,可完全自定义的Widget
""",
'price': 108.00,
'currency': 'EUR',
'depends': [
'web',
# 'product',
],
'images': ['static/description/banner.gif'],
'data': [
# 'views/product_views.xml',
],
'assets': {
'web.assets_qweb': [
],
'web.assets_backend': [
'app_web_widget_ztree/static/src/lib/ztree_v3/css/awesomeStyle/fa.scss',
'app_web_widget_ztree/static/src/lib/ztree_v3/css/awesomeStyle/awesome.scss',
'app_web_widget_ztree/static/src/scss/variables.scss',
'app_web_widget_ztree/static/src/scss/views.scss',
'app_web_widget_ztree/static/src/lib/ztree_v3/js/jquery.ztree.core.js',
('after', 'web/static/src/core/autocomplete/autocomplete.js', 'app_web_widget_ztree/static/src/js/ztree.js'),
('after', 'web/static/src/views/fields/x2many/x2many_field.js', 'app_web_widget_ztree/static/src/js/ztree_chart.js'),
('after', 'web/static/src/views/fields/relational_utils.js', 'app_web_widget_ztree/static/src/js/ztree_many2x.js'),
('after', 'web/static/src/views/fields/many2one/many2one_field.js', 'app_web_widget_ztree/static/src/js/ztree_select.js'),
('after', 'web/static/src/core/autocomplete/autocomplete.xml', 'app_web_widget_ztree/static/src/xml/ztree.xml'),
'app_web_widget_ztree/static/src/xml/ztree_chart.xml',
('after', 'web/static/src/views/fields/relational_utils.xml', 'app_web_widget_ztree/static/src/xml/ztree_many2x.xml'),
('after', 'web/static/src/views/fields/many2one/many2one_field.xml', 'app_web_widget_ztree/static/src/xml/ztree_select.xml'),
],
},
'demo': [
],
'test': [
],
'post_load': None,
'post_init_hook': None,
'installable': True,
'application': True,
'auto_install': False,
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+4
View File
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import models
from . import mixin_parent_chart
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from odoo import api, fields, models, _
# 用于widget的树结构 mixin
class MixinParentChart(models.AbstractModel):
_name = 'mixin.parent.chart'
_description = '树状结构基础mixin'
_parent_name = "parent_id"
_parent_store = True
_order = 'parent_path asc'
_parent_order = 'id'
# 上级生产单
parent_id = fields.Many2one(_name, string='上级对象', index=True, ondelete='cascade')
parent_path = fields.Char(index=True)
child_ids = fields.One2many(_name, 'parent_id', string='结构树')
+133
View File
@@ -0,0 +1,133 @@
# -*- coding: utf-8 -*-
from odoo import models, api
class BaseModelExtend(models.AbstractModel):
_name = 'basemodel.extend'
_description = 'Base Extend for Ztree'
def _register_hook(self):
"""
Register method in BaseModel
type: bar是在superbar中,field是在form中
"""
# name_field 显示的字段
# type = chart 时,只取自己这棵树,使用 parent_path 处理
@api.model
def search_ztree(self, domain=None, context=None, parent_key=None, root_id=None, expend_level=None, name_field=None, limit=None, order=None, type=None,
selected_id=None):
if context:
self = self.with_context
try:
limit = int(limit)
except Exception:
limit = 1000
if not limit:
limit = 1000
if not order:
order = self._order
try:
expend_level = int(expend_level)
if expend_level == 0:
expend_level = 3
except Exception:
expend_level = 3
if name_field:
pass
elif self._fields.get("name"):
name_field = 'name'
elif self._fields.get("display_name"):
name_field = 'display_name'
else:
name_field = self._rec_name
if name_field == 'display_name':
fields = ['id', 'display_name']
else:
fields = ['id', name_field, 'display_name']
# 返回 id, name, value, pId, title, value
def ztree(x):
y = {}
p = parent_key
pid = False
if p and x.get(p):
pid = x[p]
if pid:
pid = pid[0]
y['id'] = x['id']
if x.get(name_field):
y['name'] = x[name_field]
else:
y['name'] = x['display_name']
y['value'] = x[name_field]
y['title'] = x['display_name']
y['pId'] = pid
return y
# 递归展开指定级别,即设定open
def getLevel(node, nodes, level=1):
if not node.get("pId"):
level = 1
else:
try:
level = level + getLevel(nodes[node.get("pId")], nodes)
except Exception:
level = 1
return level
# todo: 检查 root_id 的处理
if not parent_key:
parent_key = self._parent_name or False
if parent_key:
fields.append(parent_key)
if root_id:
r = self.search_read([('id', '=', root_id)], ['parent_path'], limit=1)
path = r[0]['parent_path']
domain += [('parent_path', '=like', path + '%')]
# type=chart时 遍历只取本棵树
elif type == 'chart' and not selected_id:
# 没有当前值,比如创建时,显示空
domain += [('id', '=', False)]
elif type == 'chart' and not self._fields.get("parent_path"):
# 没有parent_path,只显示当前
domain += [('id', '=', selected_id)]
elif type == 'chart' and selected_id:
r = self.search_read([('id', '=', selected_id)], ['parent_path'], limit=1)
if r:
path = r[0]['parent_path']
pos = path.find('/')
if pos > 0:
path = path[0:pos + 1]
domain += [('parent_path', '=like', path + '%')]
else:
domain += [('id', '=', selected_id)]
records = self.search_read(domain or [], fields, 0, limit=limit, order=order)
if not records:
return []
result = records
res = map(ztree, result)
if len(result) < 1:
return result
# reorder read, index: dict, res: list
index = {vals['id']: vals for vals in res}
for key in index:
index[key]["ztree_link"] = '/mail/view?model=%s&res_id=%s' % (self._name, index[key]["id"]),
index[key]["level"] = getLevel(index[key], index, 1)
if index[key]["level"] < expend_level:
index[key]["open"] = True
else:
index[key]["open"] = False
res = [index[record["id"]] for record in records if record["id"] in index]
return res
models.BaseModel.search_ztree = search_ztree
return super(BaseModelExtend, self)._register_hook()
Binary file not shown.

After

Width:  |  Height:  |  Size: 692 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

@@ -0,0 +1,348 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2009~2024 odooAi.cn
##############################################################################
-->
<html>
<!-- begin title-->
<section class="oe_container container o_cc o_cc2">
<h2 class="text-center bg-warning text-white pt24 pb24">App ztree widget,Hierarchy Parent tree in m2o select. Hierarchy Chart selector</h2>
<h3 class="text-center">树状视图m2o及结构图widget套件,用于Odoo所有应用以展现树状层级结构</h3>
</section>
<!-- end title-->
<section class="oe_container container">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<h2 class="oe_slogan" style="color:#875A7B;"></h2>
<h3 class="oe_slogan">Very useful for parent child relationship, like product category, stock location, hr department</h3>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">Buy
<a href="https://www.odoo.com/apps/modules/17.0/app_web_widget_ztree/">
this 1 app, Hierarchy Parent tree in m2o select and Chart in Form View.
</a>
in odoo Store. Get
<a href="https://www.odoo.com/apps/modules/browse?search=ztree" target="_blank">
free 20+ more related apps.
</a>
</h2>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<div class="row">
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<h3>Update: v18.0.24.12.18</h3>
<p>Support better for odoo 18 and OWL rule</p>
<h3>Update: v16.24.12.18</h3>
<p>Optimize style</p>
<i class="fa fa-hand-o-right"></i><b> Key features: </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-check-square-o text-primary"></i>
1. M2o Select with Hierarchy parent/child dropdown
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
2. zTree widget for any app in odoo. MRP, Account, User, Product Category, Stock location, etc...
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
3. Easy use in customize 3rd app. Easy to make custom parent children tree.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
4. Hierarchy selector out-of-box with all apps:
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
5. Hierarchy Chart widget zChart. easy with all apps. MRP, Account, User, Product Category, Stock location, etc...
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
6. We provide 10+ more free Demo for you can use it in anywhere in odoo.
</li>
</ul>
</div>
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<i class="fa fa-hand-o-right"></i><b>Get relate Demo(All Free. Only 2 paid for Multi-level BoM) </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_product_ztree/" target="_blank">Free Product and category m2o ztree.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_account_ztree/" target="_blank">Free Account multi level COA m2o ztree.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_stock_ztree/" target="_blank">Free Stock and Location m2o ztree.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_hr_ztree/" target="_blank">Free hr department and employee ztree.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_product_category_zchart/" target="_blank">Free Product and category zchart</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_mrp_bom_zchart/" target="_blank">
<em class="text-danger mr8">Pay(Not Free)</em> Multi-Level Bom Chart.zChart hierarchy
</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_mrp_workcenter_zchart/" target="_blank">Free MRP Workcenter zChart</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_mrp_production_zchart/" target="_blank">Free MRP Production zChart Hierarchy</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_stock_location_zchart/" target="_blank">Free Stock and Location zChart</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_hr_department_zchart/" target="_blank">Free Hr department employee zchart hierarchy</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_account_zchart/" target="_blank">
<em class="text-danger mr8">Pay(Not Free)</em> Multi level Account chart hierarchy
</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="./app_users_zchart/" target="_blank">User Alliance Distribution Multi level zchart hierarchy</a>
</li>
</ul>
</div>
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">Buy this apps, get Extra bonus apps, App zTree widget, Hierarchy Parent tree in m2o select</h2>
<h4 class="oe_slogan">Ready for product category Hierarchy Parent tree in m2o select</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_product1.gif">
</div>
<h4 class="oe_slogan">Ready for Stock Location Hierarchy Parent tree in m2o select</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_stock1.gif">
</div>
<h4 class="oe_slogan">Ready for Hr Department Hierarchy Parent tree in m2o select</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_hr1.gif">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">The Feature Including in this module.</h2>
<h4 class="oe_slogan">Use in product.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo2.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Free to Use in product category.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo1.jpg">
</div>
<h4 class="oe_slogan">Also Show product category in Hierarchy Char</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo1-1.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Free to Use in Account multi level COA</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo6.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Free to Use in stock location.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo3.jpg">
</div>
<h4 class="oe_slogan">Support Chart view</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo3-1.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Free to Use in MRP Workcenter.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo3-2.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Use in hr department.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo4.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Use in hr employee.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo5.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">Product category Chart Hierarchy</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo31.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2><em class="text-danger">Pay(Not Free)</em> Multi-Level Bom Chart zChart hierarchy</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">快速在统一界面中管理多层级BoM</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo_bom.jpg">
</div>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo41.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">Stock Location Chart Hierarchy</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo32.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">HR Department Chart Hierarchy</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo33.jpg">
</div>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">HR Employee Chart Hierarchy (this is include in odoo)</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo34.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2><em class="text-danger">Pay(Not Free)</em> Multi-Level Account zChart Hierarchy</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">快速在统一界面中管理多层级会计科目</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo35.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">User Alliance Distribution Multi level</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo36.jpg">
</div>
</div>
</section>
<section class="container oe_container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">MRP Production Chart Hierarchy</h2>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo37.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Easy to setup just use widget='ztree_select'. and widget='ztree_chart' like this</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="setup1.jpg">
</div>
<h2><br/> Use follow param to setup widget:<br/></h2>
<h4>ztree_parent_key: --the key field of parent children relation.</h4>
<h4>ztree_expend_level: --how many level to expend the tree for initialize. Default is 2</h4>
<h4>limit: --how many record to show ztree. Default is 16</h4>
<h4>order: --the field to order by</h4>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">Extend features
<a href="./app_web_superbar" target="_blank">(Need extra module, Click to get)</a></h2>
<h4 class="oe_slogan">Advance Search Sidebar with Hierarchy Parent Children Tree</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="superbar.gif">
</div>
</div>
</section>
<section class="container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="row">
<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:odoo@china.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> odoo@china.com</a>
<p><h4>
Via QQ: 300883 (App user would not get QQ or any other IM support. Only for odoo project customize.)</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">
<h4>
Visit our website for more support.</h4>
<h4>https://www.odooai.cn</h4>
</div>
</div>
</div>
</section>
</html>
@@ -0,0 +1,206 @@
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<section class="oe_container container">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<h2 class="oe_slogan" style="color:#875A7B;">App ztree小插件,层次父树在m2o选择</h2>
<h3 class="oe_slogan">非常有用的树状结构关系,如产品类别,库存位置,人力资源部门</h3>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">买
<a href="https://www.odoo.com/apps/modules/15.0/app_web_widget_ztree/">
这1个应用程序,层次父树在m2o选择
</a>
在odoo商店.得到
<a href="https://www.odoo.com/apps/modules/browse?search=ztree" target="_blank">
免费的3个相关应用程序。
</a>
</h2>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<div class="row">
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<h3>更新: v12.19.05.02</h3>
<p>优化的风格</p>
<i class="fa fa-hand-o-right"></i><b> 关键特性: </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-check-square-o text-primary"></i>
易于自定义的树状结构.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
在产品类别中免费使用.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
在仓库和库位中免费使用.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
在HR、员工管理中免费使用.
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
它是一个小插件,你可以在odoo的任何地方使用它
</li>
</ul>
</div>
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<i class="fa fa-hand-o-right"></i><b>Extend features
<a href="http://www.odoo.com/apps/modules/15.0/app_web_superbar" target="_blank">(Need extra module, Click to get) </a>
</b>
<ul class="list-unstyled">
<li>
<i class="fa fa-check-square-o text-primary"></i>
易于在树形或看板视图中浏览产品、员工。
</li>
</ul>
</div>
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
<i class="fa fa-hand-o-right"></i><b>得到相关演示 </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-link text-primary"></i>
<a href="http://www.odoo.com/apps/modules/15.0/app_product_ztree/" target="_blank">产品和类别.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="http://www.odoo.com/apps/modules/15.0/app_stock_ztree/" target="_blank">仓库和库位.</a>
</li>
<li>
<i class="fa fa-link text-primary"></i>
<a href="http://www.odoo.com/apps/modules/15.0/app_hr_ztree/" target="_blank">HR部门和员工管理.</a>
</li>
</ul>
</div>
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2>&nbsp;</h2>
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">扩展功能
<a href="http://www.odoo.com/apps/modules/15.0/app_web_superbar" target="_blank">(需要额外模块,单击获取)</a></h2>
<h4 class="oe_slogan">高级搜索侧边栏与层次父子树</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="superbar.gif">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">购买这个应用程序,得到额外的奖励应用程序,应用程序zTree小部件,层次父树在m2o选择</h2>
<h4 class="oe_slogan">在m2o为产品类别选择树状结构</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_product1.gif">
</div>
<h4 class="oe_slogan">在m2o为仓库选择树状结构</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_stock1.gif">
</div>
<h4 class="oe_slogan">在m2o为HR部门选择树状结构</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="z_hr1.gif">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">包含在这个模块中的特性.</h2>
<h4 class="oe_slogan">在产品中使用.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo2.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">免费在产品目录中使用.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo1.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">免费在仓库中使用.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo3.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">在部门中使用.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo4.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">在员工管理中使用.</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="demo5.jpg">
</div>
</div>
</section>
<section class="oe_container container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">很容易设置,只需使用widget='widget_select'。像这样</h4>
<div class="oe_demo oe_screenshot img img-fluid">
<img src="setup1.jpg">
</div>
<h2><br/> 使用跟随参数设置小插件:<br/></h2>
<h4>ztree_parent_key: --父子关系的关键字段.</h4>
<h4>ztree_expend_level: --初始化树需要扩展多少个级别。默认是2</h4>
<h4>limit: --显示ztree的记录数。默认是16</h4>
<h4>order: --订单的字段</h4>
</div>
</section>
<section class="container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="row">
<h2 class="oe_slogan">帮助与技术支持</h2>
</div>
<div class="col-md-12 pad0">
<div class="oe_mt16">
<p><h4>
任何类型的技术帮助和支持请求,请随时与我们联系</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:odoo@china.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> odoo@china.com</a>
<p><h4>
Via QQ: 300883 (App用户将不会获得QQ或其他即时通讯支持。仅为odoo项目定制.)</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>
访问我们的网站以获得更多的支持.</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="https://www.odooai.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>https://www.odooai.cn</a>
</div>
</div>
</div>
</section>
<!--结尾加下方的-->
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1556511959618" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8731"
xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24">
<defs>
<style type="text/css"></style>
</defs>
<path d="M357.34582738 1152.71014146h22.0934536v22.0934536H357.34582738zM379.43928098 1108.52323555H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.3738131H357.34582738v-44.18690592h22.0934536v44.18690592z m0-88.3738118H357.34582738v-44.18690722h22.0934536v44.18690722z m0-88.37381312H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.37381311H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.3738118H357.34582738v-44.18690721h22.0934536v44.18690721z m0-88.37381312H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.3738131H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.37381181H357.34582738v-44.18690721h22.0934536v44.18690721z m0-88.37381311H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.37381311H357.34582738v-44.1869059h22.0934536v44.1869059z m0-88.3738118H357.34582738v-44.18690722h22.0934536v44.18690722z m0-88.3738131H357.34582738V3.85057755h22.0934536v44.18690592z m0-88.37381312H357.34582738V-84.52323555h22.0934536v44.1869059zM357.34582738-150.80359506h22.0934536v22.0934536H357.34582738z"
fill="#666666" p-id="8732"></path>
<path d="M622.46726541 500.95327385h22.09345361v22.0934523h-22.09345361zM584.90839547 523.04672615H547.3495255v-22.0934523h37.55886997v22.0934523z m-75.11774122 0H470.02243855v-22.0934523h37.55887125l2.20934445 22.0934523z m-77.32708566 0H394.90469865v-22.0934523h37.55886994v22.0934523zM644.56071902 500.95327385h22.0934536v22.0934523h-22.0934536z"
fill="#666666" p-id="8733"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+188
View File
@@ -0,0 +1,188 @@
/** @odoo-module */
import { AutoComplete } from "@web/core/autocomplete/autocomplete";
import { loadJS } from "@web/core/assets";
const { Component, useRef } = owl;
import {session} from "@web/session";
import { useService } from "@web/core/utils/hooks";
//todo: ztree 继承 import { AutoComplete } from "@web/core/autocomplete/autocomplete";
//field ztree 继承 fieldm2o,优化 xml 并入 Many2XAutocomplete
export class Ztree extends AutoComplete {
setup() {
super.setup();
let self = this;
let setting = self.props.setting;
let data = self.props.data;
this.rpc = useService("rpc");
this.orm = useService("orm");
this.ztree_root = useRef("ztree_root");
this.$Ztree = false;
this.zNodes = false;
let ztree_Max = 1000;
this.setting = {
view: {
selectedMulti: true,
fontCss: function getFont(treeId, node) {
return node.font ? node.font : {};
},
nameIsHTML: true,
showIcon: false,
txtSelectedEnable: true,
},
data: {
key: {
title: "title"
},
simpleData: {
enable: true,
}
}
};
if (setting)
$.extend(this.setting, setting);
//如果有定义zNodes,则直接按 zNodes数据展现,否则 rpc 取
if (data && data.zNodes && data.zNodes.length)
this.zNodes = data.zNodes;
this.ztree_field = data.ztree_field;
this.ztree_model = data.ztree_model;
this.ztree_parent_key = data.ztree_parent_key;
//todo: root_id,这个是节点的根id,用 parent_left < x < parent_right 实现,在 domain 增加值
this.ztree_root_id = data.ztree_root_id;
this.ztree_domain = data.ztree_domain;
this.ztree_context = data.ztree_context ? data.ztree_context : session.user_context;
this.order = data.order;
this.ztree_selected_id = Number(data.ztree_selected_id);
this.ztree_selected_vals = [];
this.ztree_with_sub_node = data.ztree_with_sub_node;
this.ztree_index = data.ztree_index;
this.ztree_add_show_all = data.ztree_add_show_all;
//默认2级
this.ztree_expend_level = data.ztree_expend_level ? data.ztree_expend_level : 2;
this.ztree_name_field = data.ztree_name_field;
this.limit = data.limit > 0 ? data.limit : ztree_Max;
this.ztree_id = 'ztree-' + this.guid();
this.ztree_type = data.ztree_type ? data.ztree_type : 'select';
//点击外部关闭ztree
$(document).delegate('body', 'click', function (ev) {
var $parent = $(ev.target).parents('.dropdown')
if (!$parent.length && self.zNodes) {
self.close()}
});
}
loadSources(useInput) {
let self = this;
this.sources = [];
this.state.activeSourceOption = null;
const proms = [];
let request = useInput ? this.inputRef.el.value.trim() : ""
for (const pSource of this.props.sources) {
const source = this.makeSource(pSource);
this.sources.push(source);
const options = this.loadOptions(
pSource.options,
useInput ? this.inputRef.el.value.trim() : ""
);
if (options instanceof Promise) {
source.isLoading = true;
const prom = options.then((options) => {
source.options = options.map((option) => this.makeOption(option));
source.isLoading = false;
this.state.optionsRev++;
this.zNodes = options;
this.state.open = true;
});
proms.push(prom);
}
}
Promise.all(proms).then(() => {
self.navigate(0);
var $el = $('#' + self.ztree_id);
if ($el) {
self.$Ztree = $.fn.zTree.init($el, self.setting, self.zNodes);
let ztree_selected_id = this.inputRef.el.getAttribute('data-ztree_selected_id');
if (!request && ztree_selected_id != undefined && ztree_selected_id > 0) {
var node = self.$Ztree.getNodeByParam('id', ztree_selected_id, null);
if (node)
self.$Ztree.selectNode(node);
}
}
});
}
makeOption(option) {
let res = {};
if (!option.action)
option = {label: option.name, value: option.id};
else
option = {
label: option.label,
value: option.id,
action: option.action
}
res = Object.assign(Object.create(option), {
id: ++this.nextOptionId,
});
return res;
}
close() {
super.close();
if (this.zNodes) {
$.fn.zTree.destroy(this.ztree_id);
this.$Ztree = undefined;
this.zNodes = false;
}
}
onInputBlur() {
const value = this.inputRef.el.value;
if (
this.props.autoSelect &&
value.length > 0
) {
;
} else {
this.props.onBlur({
inputValue: value,
});
this.close();
}
}
guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
getChildNodes(treeNode) {
var childNodes = this.$Ztree.transformToArray(treeNode);
var nodes = new Array();
var i;
for (i = 0; i < childNodes.length; i++) {
nodes[i] = childNodes[i].id;
}
return nodes.join(",");
}
}
Ztree.template = "App.Ztree";
Ztree.props = {
...AutoComplete.props,
setting: {type: Object, optional: true},
data: {type: Object, optional: true},
};
Ztree.defaultProps = {
...AutoComplete.defaultProps,
};
@@ -0,0 +1,208 @@
/** @odoo-module */
import {X2ManyField, x2ManyField} from '@web/views/fields/x2many/x2many_field';
import { onMounted, useRef } from "@odoo/owl";
import {session} from "@web/session";
import {Ztree} from './ztree';
import {ZtreeMany2X} from './ztree_many2x';
import {registry} from "@web/core/registry";
import {useService} from "@web/core/utils/hooks";
import {_lt} from "@web/core/l10n/translation";
import {FieldZTree} from "./ztree_select";
export class FieldZTreeChart extends X2ManyField {
async setup() {
super.setup();
let self = this;
let setting = self.props.setting;
let data = self.props;
this.rpc = useService("rpc");
this.orm = useService("orm");
this.action = useService("action");
this.ztree_root = useRef("ztree_root");
this.$Ztree = false;
this.zNodes = false;
let ztree_Max = 1000;
this.setting = {
view: {
selectedMulti: true,
fontCss: function getFont(treeId, node) {
return node.font ? node.font : {};
},
nameIsHTML: true,
showIcon: false,
txtSelectedEnable: true,
},
callback: {
onClick: function (event, treeId, treeNode, clickFlag) {
self.onSelect(event, {
treeId: treeId,
treeNode: treeNode,
});
}
},
data: {
key: {
title: "title"
},
simpleData: {
enable: true,
}
}
};
if (setting)
$.extend(this.setting, setting);
//如果有定义zNodes,则直接按 zNodes数据展现,否则 rpc 取
if (self.props && self.props.zNodes && self.props.zNodes.length)
this.zNodes = self.props.zNodes;
this.ztree_field = self.props.name;
this.ztree_model = self.props.record.resModel;
this.ztree_parent_key = self.field.relation_field;
//todo: root_id,这个是节点的根id,用 parent_left < x < parent_right 实现,在 domain 增加值
this.ztree_root_id = data.ztree_root_id;
this.ztree_domain = data.ztree_domain;
this.ztree_context = data.ztree_context ? data.ztree_context : session.user_context;
this.order = data.order;
this.ztree_selected_id = Number(data.record.data.id);
this.ztree_selected_vals = [];
this.ztree_with_sub_node = data.ztree_with_sub_node;
this.ztree_index = data.ztree_index;
this.ztree_add_show_all = false;
//默认2级
this.ztree_expend_level = data.ztree_expend_level ? data.ztree_expend_level : 2;
this.ztree_name_field = data.ztree_name_field;
this.limit = data.limit > 0 ? data.limit : ztree_Max;
self.ztree_id = 'ztree-' + self.guid();
this.ztree_type = data.ztree_type ? data.ztree_type : 'chart';
onMounted(this.handleComponentUpdate.bind(this));
}
async handleComponentUpdate() {
let self = this;
self.zNodes = await self.loadZchartSource().then(function (){
var $el = $('#' + self.ztree_id);
if ($el && self.zNodes) {
self.$Ztree = $.fn.zTree.init($el, self.setting, self.zNodes);
let ztree_selected_id = self.props.record.data.id;
if (ztree_selected_id != undefined && ztree_selected_id > 0 && self.props.record.data.id) {
var node = self.$Ztree.getNodeByParam('id', ztree_selected_id, null);
if (node)
self.$Ztree.selectNode(node);
};
};
});
}
async loadZchartSource() {
//数据初始化
let self = this;
if (self.lastProm) {
self.lastProm.abort(false);
}
let ztree_Max = 1000;
var domain = self.ztree_domain || [];
let root_id = self.ztree_root_id;
if (!root_id) {
root_id = self.props.record.data.parent_id ? self.props.record.data.parent_id[0] : 0;
}
if (!root_id) {
root_id = self.props.record.data.id;
}
self.ztree_selected_id = self.props.record.data.id;
let para = {
context: self.ztree_context || {},
domain: domain,
parent_key: self.ztree_parent_key,
root_id: root_id,
expend_level: self.ztree_expend_level,
name_field: self.ztree_name_field,
order: self.order,
limit: parseInt(self.props.limit ? self.props.limit : ztree_Max),
type: 'chart',
//如果 type='chart',要按 selected_id 得到 root_id 遍历
selected_id: self.ztree_selected_id,
};
this.lastProm = this.orm.call(this.props.record.resModel, 'search_ztree', [], para);
const records = await this.lastProm;
self.zNodes = records || [];
return records;
}
async onSelect(option, params = {}) {
var self = this;
var record = {
id: 0,
name: '',
};
if (params.treeNode) {
record = {
id: params.treeNode.id,
name: params.treeNode.name,
};
//todo: 面包屑处理不生效,后续优化
// let action = await self.orm.call(self.props.record.resModel, 'get_formview_action', [record.id]);
var action = self.env.model.action.currentController.action;
action = {...action,
res_id: record.id,
views: [[false, "form"]],
};
var bs = self.env.config.breadcrumbs;
if (bs.length > 1) {
self.action.doAction(action, {
clearBreadcrumbs: true,
});
} else {
self.action.doAction(action);
}
}
}
guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
}
FieldZTreeChart.components = {Ztree};
FieldZTree.components = {
...X2ManyField.components,
Ztree,
ZtreeMany2X,
};
FieldZTreeChart.props = {
...X2ManyField.props,
ztree_parent_key: {type: String, optional: true},
ztree_root_id: {type: Number, optional: true},
ztree_name_field: {type: String, optional: true},
order: {type: String, optional: true},
ztree_expend_level: {type: String, optional: true},
};
FieldZTreeChart.supportedTypes = ["one2many"];
FieldZTreeChart.displayName = _lt("Hierarchy Chart");
FieldZTreeChart.template = 'App.FieldZtreeChart';
export const fieldZTreeChart = {
...x2ManyField,
component: FieldZTreeChart,
extractProps({ options }) {
const props = x2ManyField.extractProps(...arguments);
props.ztree_parent_key = options.ztree_parent_key;
props.ztree_root_id = options.ztree_root_id;
props.ztree_name_field = options.ztree_name_field;
props.order = options.order;
props.ztree_expend_level = options.ztree_expend_level;
return props;
},
};
registry.category("fields").add("ztree_chart", fieldZTreeChart);

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