mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix seq,多公司支持
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
'data': [
|
'data': [
|
||||||
# 视图
|
# 视图
|
||||||
"security/ir.model.access.csv",
|
"security/ir.model.access.csv",
|
||||||
# "security/security.xml",
|
"security/security.xml",
|
||||||
'views/product_template_view.xml',
|
'views/product_template_view.xml',
|
||||||
'views/product_product_view.xml',
|
'views/product_product_view.xml',
|
||||||
'views/product_category_view.xml',
|
'views/product_category_view.xml',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data noupdate="1">
|
<data noupdate="0">
|
||||||
<!-- 更新序号规则 Auto Internal Reference. -->
|
<!-- 更新序号规则 Auto Internal Reference. -->
|
||||||
<!-- 所有的 All Products. -->
|
<!-- 所有的 All Products. -->
|
||||||
<record id="seq_product_auto" model="ir.sequence">
|
<record id="seq_product_auto" model="ir.sequence">
|
||||||
@@ -38,6 +38,15 @@
|
|||||||
<field name="company_id" eval="False"/>
|
<field name="company_id" eval="False"/>
|
||||||
<field name="initial">True</field>
|
<field name="initial">True</field>
|
||||||
</record>
|
</record>
|
||||||
|
<!-- 服务与费用 Service-->
|
||||||
|
<record id="seq_service" model="ir.sequence">
|
||||||
|
<field name="name">Service</field>
|
||||||
|
<field name="code">product.product</field>
|
||||||
|
<field name="prefix">V%(y)s%(month)s</field>
|
||||||
|
<field name="padding">5</field>
|
||||||
|
<field name="company_id" eval="False"/>
|
||||||
|
<field name="initial">True</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
<data noupdate="0">
|
<data noupdate="0">
|
||||||
<!-- internal_type 数据-->
|
<!-- internal_type 数据-->
|
||||||
@@ -71,6 +80,16 @@
|
|||||||
<field name="description">Set prefix as "S" in link sequence</field>
|
<field name="description">Set prefix as "S" in link sequence</field>
|
||||||
<field name="link_sequence" ref="seq_sourced_product"/>
|
<field name="link_sequence" ref="seq_sourced_product"/>
|
||||||
</record>
|
</record>
|
||||||
|
<record id="internal_type_service" model="product.internal.type">
|
||||||
|
<field name="name">Service</field>
|
||||||
|
<field name="ref">v</field>
|
||||||
|
<field name="type">service</field>
|
||||||
|
<field name="sale_ok">1</field>
|
||||||
|
<field name="purchase_ok">1</field>
|
||||||
|
<field name="route_ids" eval="[(5)]"/>
|
||||||
|
<field name="description">Set prefix as "V" in link sequence</field>
|
||||||
|
<field name="link_sequence" ref="seq_service"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!--设置产品默认值为制造产品-->
|
<!--设置产品默认值为制造产品-->
|
||||||
<record id="product_internal_type_default" model="ir.values">
|
<record id="product_internal_type_default" model="ir.values">
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ class ProductInternalType(models.Model):
|
|||||||
domain=[('product_selectable', '=', True)],
|
domain=[('product_selectable', '=', True)],
|
||||||
help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
|
help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
|
||||||
|
|
||||||
# company_id = fields.Many2one(
|
company_id = fields.Many2one(
|
||||||
# 'res.company', 'Company',
|
'res.company', 'Company',
|
||||||
# default=lambda self: self.env.user.company_id.id, index=1)
|
default=lambda self: self.env.user.company_id.id, index=1)
|
||||||
|
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
('uniq_ref',
|
('uniq_ref',
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem action="app_product_type_sequence.internal_type_action" id="menu_internal_type_action_sys" parent="base.next_id_5"/>
|
<menuitem action="app_product_type_sequence.internal_type_action" id="menu_internal_type_action_sys" parent="base.menu_ir_property"/>
|
||||||
|
|
||||||
<menuitem action="app_product_type_sequence.internal_type_action" id="menu_internal_type_action_sale"
|
<menuitem action="app_product_type_sequence.internal_type_action" id="menu_internal_type_action_sale"
|
||||||
parent="sale.prod_config_main" sequence="6" groups="base.group_no_one"/>
|
parent="sale.prod_config_main" sequence="6" groups="base.group_no_one"/>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<field name="internal_type"/>
|
<field name="internal_type"/>
|
||||||
<field name="id"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='type']" position="before">
|
<xpath expr="//field[@name='type']" position="before">
|
||||||
<field name="internal_type"/>
|
<field name="internal_type"/>
|
||||||
<field name="id"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<h4>
|
<h4>
|
||||||
<label class="oe_edit_only" for="internal_type"/>
|
<label class="oe_edit_only" for="internal_type"/>
|
||||||
<field name="internal_type" options="{'no_create': True,'no_open': True}"/>
|
<field name="internal_type" options="{'no_create': True,'no_open': True}" required="1"/>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user