Catalog Menu. Add website
This commit is contained in:
parent
8ee5cd2af4
commit
6089af9c0b
|
@ -3,6 +3,7 @@
|
|||
#the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .galatea import *
|
||||
from .menu import *
|
||||
from .sale_cart import *
|
||||
from .shop import *
|
||||
from .product import *
|
||||
|
@ -10,6 +11,7 @@ from .payment_type import *
|
|||
|
||||
def register():
|
||||
Pool.register(
|
||||
CatalogMenu,
|
||||
GalateaWebSite,
|
||||
GalateaUser,
|
||||
PaymentType,
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#This file is part galatea_esale module for Tryton.
|
||||
#The COPYRIGHT file at the top level of this repository contains
|
||||
#the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['CatalogMenu']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class CatalogMenu:
|
||||
__name__ = 'esale.catalog.menu'
|
||||
website = fields.Many2One('galatea.website', 'Website')
|
||||
|
||||
@fields.depends('parent')
|
||||
def on_change_with_website(self):
|
||||
"""Add website from parent"""
|
||||
if self.parent and self.parent.website:
|
||||
return self.parent.website.id
|
||||
return None
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part galatea_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="menu_view_list">
|
||||
<field name="model">esale.catalog.menu</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit" ref="product_esale.menu_view_list"/>
|
||||
<field name="name">menu_list</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="menu_view_tree">
|
||||
<field name="model">esale.catalog.menu</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit" ref="product_esale.menu_view_tree"/>
|
||||
<field name="name">menu_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="menu_view_form">
|
||||
<field name="model">esale.catalog.menu</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="product_esale.menu_view_form"/>
|
||||
<field name="name">menu_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
|
@ -9,5 +9,6 @@ depends:
|
|||
sale_payment_web
|
||||
xml:
|
||||
galatea.xml
|
||||
menu.xml
|
||||
payment_type.xml
|
||||
product.xml
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part galatea_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/field[@name="rec_name"]" position="after">
|
||||
<label name="website"/>
|
||||
<field name="website"/>
|
||||
</xpath>
|
||||
</data>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part galatea_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/tree/field[@name="active"]" position="after">
|
||||
<field name="website"/>
|
||||
</xpath>
|
||||
</data>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part galatea_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/tree/field[@name="default_sort_by"]" position="after">
|
||||
<field name="website"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in New Issue