[IMP] lunch: Improve general UX (back2basics)
TaskID: 2586326
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<field name="street">975 Bullock Orchard</field>
|
||||
<field name="zip">02155</field>
|
||||
<field name="email">cynthiasanchez@gmail.com</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="product_bacon_0" model="lunch.product">
|
||||
@@ -22,6 +23,7 @@
|
||||
<field name="supplier_id" ref="supplier_hungry_dog"/>
|
||||
<field name="description">Beef, Bacon, Salad, Cheddar, Fried Onion, BBQ Sauce</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/bacon_burger.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="product_cheese_burger_0" model="lunch.product">
|
||||
@@ -31,6 +33,7 @@
|
||||
<field name="supplier_id" ref="supplier_hungry_dog"/>
|
||||
<field name="description">Beef, Cheddar, Salad, Fried Onions, BBQ Sauce</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/cheeseburger.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="product_club_0" model="lunch.product">
|
||||
@@ -40,6 +43,7 @@
|
||||
<field name="supplier_id" ref="supplier_hungry_dog"/>
|
||||
<field name="description">Ham, Cheese, Vegetables</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/club.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="product_coke_0" model="lunch.product">
|
||||
@@ -47,6 +51,7 @@
|
||||
<field name="category_id" ref="categ_drinks"/>
|
||||
<field name="price">2.9</field>
|
||||
<field name="supplier_id" ref="supplier_hungry_dog"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="product_pizza_0" model="lunch.product">
|
||||
@@ -55,6 +60,7 @@
|
||||
<field name="price">6.90</field>
|
||||
<field name="supplier_id" ref="supplier_hungry_dog"/>
|
||||
<field name="description">Tomatoes, Mozzarella</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -174,6 +180,7 @@
|
||||
<field name="description">Beef, Bacon, Salad, Cheddar, Fried Onion, BBQ Sauce</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/bacon_burger.png"/>
|
||||
<field name="new_until" eval="datetime.today() + relativedelta(weeks=1)"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_cheeseburger">
|
||||
@@ -183,6 +190,7 @@
|
||||
<field name="supplier_id" ref="supplier_corner"/>
|
||||
<field name="description">Beef, Cheddar, Salad, Fried Onions, BBQ Sauce</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/cheeseburger.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_chicken_curry">
|
||||
@@ -191,6 +199,7 @@
|
||||
<field name="price">3.0</field>
|
||||
<field name="supplier_id" ref="supplier_corner"/>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/chicken_curry.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_spicy_tuna">
|
||||
@@ -199,6 +208,7 @@
|
||||
<field name="price">3.0</field>
|
||||
<field name="supplier_id" ref="supplier_corner"/>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/chicken_curry.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_mozzarella">
|
||||
@@ -208,6 +218,7 @@
|
||||
<field name="supplier_id" ref="supplier_corner"/>
|
||||
<field name="description">Mozzarella, Pesto, Tomatoes</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/mozza.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_club">
|
||||
@@ -217,6 +228,7 @@
|
||||
<field name="supplier_id" ref="supplier_corner"/>
|
||||
<field name="description">Ham, Cheese, Vegetables</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/club.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_maki">
|
||||
@@ -227,6 +239,7 @@
|
||||
<field name="description">6 Maki Salmon - 6 Maki Tuna - 6 Maki Shrimp/Avocado</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/maki.png"/>
|
||||
<field name="new_until" eval="datetime.today() + relativedelta(weeks=1)"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_salmon">
|
||||
@@ -237,6 +250,7 @@
|
||||
<field name="description">4 Sushi Salmon - 6 Maki Salmon - 4 Sashimi Salmon </field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/salmon_sushi.png"/>
|
||||
<field name="new_until" eval="datetime.today() + relativedelta(weeks=1)"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_temaki">
|
||||
@@ -247,6 +261,7 @@
|
||||
<field name="description">1 Avocado - 1 Salmon - 1 Eggs - 1 Tuna</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/temaki.png"/>
|
||||
<field name="new_until" eval="datetime.today() + relativedelta(weeks=1)"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_chirashi">
|
||||
@@ -257,6 +272,7 @@
|
||||
<field name="description">2 Tempuras, Cabbages, Onions, Sesame Sauce</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/chirashi.png"/>
|
||||
<field name="new_until" eval="datetime.today() + relativedelta(weeks=1)"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_cheese_ham">
|
||||
@@ -266,6 +282,7 @@
|
||||
<field name="supplier_id" ref="supplier_coin_gourmand"/>
|
||||
<field name="description">Cheese, Ham, Salad, Tomatoes, cucumbers, eggs</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/club.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_country">
|
||||
@@ -275,6 +292,7 @@
|
||||
<field name="supplier_id" ref="supplier_coin_gourmand"/>
|
||||
<field name="description">Brie, Honey, Walnut Kernels</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/brie.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_tuna">
|
||||
@@ -284,6 +302,7 @@
|
||||
<field name="supplier_id" ref="supplier_coin_gourmand"/>
|
||||
<field name="description">Tuna, Mayonnaise</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/tuna_sandwich.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_gouda">
|
||||
@@ -293,6 +312,7 @@
|
||||
<field name="supplier_id" ref="supplier_coin_gourmand"/>
|
||||
<field name="description"></field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/gouda.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_chicken_curry">
|
||||
@@ -302,6 +322,7 @@
|
||||
<field name="supplier_id" ref="supplier_coin_gourmand"/>
|
||||
<field name="description"></field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/chicken_curry.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_margherita">
|
||||
@@ -311,6 +332,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Tomatoes, Mozzarella</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/pizza_margherita.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_funghi">
|
||||
@@ -320,6 +342,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Tomatoes, Mushrooms, Mozzarella</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/pizza_funghi.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_vege">
|
||||
@@ -329,6 +352,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Tomatoes, Mozzarella, Mushrooms, Peppers, Olives</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/pizza_veggie.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_italiana">
|
||||
@@ -338,6 +362,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Fresh Tomatoes, Basil, Mozzarella</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/italiana.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_Bolognese">
|
||||
@@ -347,6 +372,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description"></field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/pasta_bolognese.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_Napoli">
|
||||
@@ -356,6 +382,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Tomatoes, Basil</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/napoli.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.topping" id="product_olives">
|
||||
@@ -371,6 +398,7 @@
|
||||
<field name="supplier_id" ref="supplier_pizza_inn"/>
|
||||
<field name="description">Tomato sauce, Olive oil, Fresh Tomatoes, Onions, Vegetables, Parmesan</field>
|
||||
<field name="image_1920" type="base64" file="lunch/static/img/4formaggio.png"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record model="lunch.cashmove" id="cashmove_1">
|
||||
|
||||
@@ -11,7 +11,7 @@ class LunchOrder(models.Model):
|
||||
_order = 'id desc'
|
||||
_display_name = 'product_id'
|
||||
|
||||
name = fields.Char(related='product_id.name', string="Product Name", readonly=True) # to remove
|
||||
name = fields.Char(related='product_id.name', string="Product Name", store=True, readonly=True)
|
||||
topping_ids_1 = fields.Many2many('lunch.topping', 'lunch_order_topping', 'order_id', 'topping_id', string='Extras 1', domain=[('topping_category', '=', 1)])
|
||||
topping_ids_2 = fields.Many2many('lunch.topping', 'lunch_order_topping', 'order_id', 'topping_id', string='Extras 2', domain=[('topping_category', '=', 2)])
|
||||
topping_ids_3 = fields.Many2many('lunch.topping', 'lunch_order_topping', 'order_id', 'topping_id', string='Extras 3', domain=[('topping_category', '=', 3)])
|
||||
@@ -27,8 +27,7 @@ class LunchOrder(models.Model):
|
||||
states={'new': [('readonly', False)]},
|
||||
default=lambda self: self.env.uid)
|
||||
note = fields.Text('Notes')
|
||||
price = fields.Float('Total Price', compute='_compute_total_price', readonly=True, store=True,
|
||||
digits='Account')
|
||||
price = fields.Monetary('Total Price', compute='_compute_total_price', readonly=True, store=True)
|
||||
active = fields.Boolean('Active', default=True)
|
||||
state = fields.Selection([('new', 'To Order'),
|
||||
('ordered', 'Ordered'),
|
||||
@@ -206,3 +205,6 @@ class LunchOrder(models.Model):
|
||||
|
||||
def action_cancel(self):
|
||||
self.write({'state': 'cancelled'})
|
||||
|
||||
def action_reset(self):
|
||||
self.write({'state': 'ordered'})
|
||||
|
||||
@@ -189,7 +189,7 @@ class LunchSupplier(models.Model):
|
||||
('supplier_id', '=', self.id),
|
||||
('state', '=', 'ordered'),
|
||||
('date', '=', fields.Date.context_today(self.with_context(tz=self.tz))),
|
||||
])
|
||||
], order="user_id, name")
|
||||
if not orders:
|
||||
return
|
||||
|
||||
|
||||
@@ -140,7 +140,6 @@ var LunchControllerCommon = {
|
||||
},
|
||||
};
|
||||
|
||||
// YTI TODO Maybe don't always pass the default_product_id
|
||||
var action = {
|
||||
res_model: 'lunch.order',
|
||||
name: _t('Configure Your Order'),
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
flex: 0 0 auto;
|
||||
border-bottom: 1px solid #CED4DA;
|
||||
background-color: white;
|
||||
position: fixed;
|
||||
z-index: 50;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.o_lunch_purple {
|
||||
@@ -50,6 +53,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.o_kanban_view {
|
||||
&.o_lunch_kanban_view {
|
||||
padding-top: 11rem;
|
||||
}
|
||||
}
|
||||
|
||||
.o_lunch_image {
|
||||
img {
|
||||
max-width: 128px;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<button name="action_confirm" string="Confirm" type="object" icon="fa-check" attrs="{'invisible': [('state', '!=', 'ordered')]}" groups="lunch.group_lunch_manager"/>
|
||||
<button name="action_cancel" string="Cancel" type="object" icon="fa-times" attrs="{'invisible': [('state', 'in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager"/>
|
||||
<button name="action_reset" string="Reset" type="object" icon="fa-undo" attrs="{'invisible': [('state', '!=', 'cancelled')]}" groups="lunch.group_lunch_manager"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -60,7 +61,8 @@
|
||||
<field name="state"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="price"/>
|
||||
<field name="company_id"/>
|
||||
<field name="currency_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
@@ -181,6 +183,7 @@
|
||||
<field name="model">lunch.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="quantity" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
@@ -194,7 +197,7 @@
|
||||
</div>
|
||||
<div class="flex-grow-1 pr-5">
|
||||
<h2><field name="name"/></h2>
|
||||
<h3 class="pt-3"><field name="price" widget="monetary"/></h3>
|
||||
<h3 class="pt-3"><field name="price"/></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_lunch_wizard">
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
<field name="supplier_id"/>
|
||||
<field name="description"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="company_id"/>
|
||||
<field name="is_new"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
|
||||
Reference in New Issue
Block a user