remove delivery men class

This commit is contained in:
Camilo Sarmiento 2020-09-01 16:31:53 -05:00
parent 7b9cf1f7b0
commit 3f5b773141
6 changed files with 8 additions and 55 deletions

View File

@ -13,10 +13,8 @@ def register():
Pool.register(
restaurant.SaleShopTable,
restaurant.Reservation,
restaurant.SaleDeliveryMen,
restaurant.PartyConsumer,
sale.Shop,
sale.SaleShopDeliveryMen,
sale.Sale,
sale.SaleForceDraft,
sale.SaleLine,

View File

@ -7,10 +7,10 @@ from trytond.pool import Pool
__all__ = ['SaleShopTable', 'Reservation']
TYPE_VEHICLE = [
('', ''),
('motorcycle', 'Motorcycle'),
('bicycle', 'Bicycle'),
('Car', 'Car'),
('', ''),
('motorcycle', 'Motorcycle'),
('bicycle', 'Bicycle'),
('Car', 'Car'),
]
@ -42,14 +42,6 @@ class Reservation(ModelSQL, ModelView):
__name__ = 'sale.reservation'
class SaleDeliveryMen(ModelSQL, ModelView):
'Sale Delivery Men'
__name__ = 'sale.delivery_men'
party = fields.Many2One('party.party', 'Party', required=True)
number_plate = fields.Char('Number Plate')
type_vehicle = fields.Selection(TYPE_VEHICLE, 'Type Vehicle')
class PartyConsumer(ModelSQL, ModelView):
'Party Consumer'
__name__ = 'party.consumer'

View File

@ -25,25 +25,6 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="name">sale_delivery_men_view_tree</field>
</record>
<record model="ir.action.act_window" id="act_sale_delivery_men">
<field name="name">Delivery Men</field>
<field name="res_model">sale.delivery_men</field>
</record>
<record model="ir.action.act_window.view" id="act_sale_delivery_men_tree_view">
<field name="sequence" eval="10"/>
<field name="view" ref="sale_delivery_men_view_tree"/>
<field name="act_window" ref="act_sale_delivery_men"/>
</record>
<record model="ir.action.act_window.view" id="act_sale_delivery_men_form_view">
<field name="sequence" eval="20"/>
<field name="view" ref="sale_delivery_men_view_form"/>
<field name="act_window" ref="act_sale_delivery_men"/>
</record>
<menuitem parent="sale.menu_configuration"
action="act_sale_delivery_men"
id="menu_sale_delivery_men" icon="tryton-list"/>
<record model="ir.ui.view" id="party_consumer_view_form">
<field name="model">party.consumer</field>
<field name="type">form</field>

13
sale.py
View File

@ -26,7 +26,6 @@ class Sale(metaclass=PoolMeta):
('shop', '=', Eval('shop'))
])
productions = fields.Function(fields.One2Many('production', None, 'Productions'), 'get_productions')
delivery_men = fields.Many2One('sale.delivery_men', 'Delivery Men')
delivery_time = fields.Numeric('Delivery Time (Min)', help="In Minutes")
delivery_way = fields.Selection(DELIVERY_WAY, 'Delivery Way')
shipping_time = fields.Time('Shipping Time')
@ -321,15 +320,3 @@ class SaleLine(metaclass=PoolMeta):
class Shop(metaclass=PoolMeta):
__name__ = 'sale.shop'
tables = fields.One2Many('sale.shop.table', 'shop','Tables')
delivery_man = fields.Many2Many('sale.shop.delivery_men', 'shop',
'delivery_men', 'Delivery Man')
class SaleShopDeliveryMen(ModelSQL):
'Sale Shop - Delivery Men'
__name__ = 'sale.shop.delivery_men'
_table = 'sale_shop_delivery_men'
shop = fields.Many2One('sale.shop', 'Shop', ondelete='CASCADE',
select=True, required=True)
delivery_men = fields.Many2One('sale.delivery_men', 'Delivery Men', ondelete='RESTRICT', required=True)

View File

@ -5,10 +5,10 @@ copyright notices and license terms. -->
<data>
<xpath expr="/form/notebook/page[@id='sale']/label[@name='origin']"
position="before">
<label name="consumer"/>
<field name="consumer"/>
<label name="table_assigned"/>
<field name="table_assigned"/>
<label name="delivery_men"/>
<field name="delivery_men" widget="selection"/>
<label name="delivery_time"/>
<field name="delivery_time"/>
<label name="delivery_way"/>
@ -16,9 +16,7 @@ copyright notices and license terms. -->
<label name="shipping_time"/>
<field name="shipping_time"/>
</xpath>
<xpath expr="/form/notebook/page[@id='info']/field[@name='comment']"
<!-- <xpath expr="/form/notebook/page[@id='info']/field[@name='comment']"
position="after">
<label name="consumer"/>
<field name="consumer"/>
</xpath>
</xpath> -->
</data>

View File

@ -7,8 +7,5 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<page string="Tables" col="4" id="tables">
<field name="tables" colspan="4"/>
</page>
<page string="Delivery Man" col="4" id="delivery_man">
<field name="delivery_man" colspan="4"/>
</page>
</xpath>
</data>