We would like to automatize lunch as currently all orders are manually ordered and validated, and a cash move has to be manually created each time you want to credit the wallet of some user. 1/ In this commit we add a new widget that comes with the kanban view and will allow to take orders in a friendly manner. 2/ We also add a lunch.supplier model this also allows you to configure an automatic ordering via email. 3/ Introduces new lunch.location model to replace res.partner on suppliers 4/ New mail template for automatic ordering 5/ Add the concept of new products (mark a product as new until some date) 6/ The toppings are now defined by product category 7/ Lunch.order removed, lunch.order.line renamed into lunch.order 8/ New SQL report to get the wallet content (aggregate of lunch.cashmove and lunch.order) 9/ New setting to allow negative wallet (aka overdraft) 10/ Application now remembers what notes and toppings you last ordered with your product 11/ You can change your location using the widget on the kanban view 12/ Edition of the order can be done until the order is arrived TaskID: 1856876 TaskID: 1916105 closes odoo/odoo#30028
76 lines
2.3 KiB
Python
76 lines
2.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.tests import common
|
|
|
|
|
|
class TestsCommon(common.TransactionCase):
|
|
|
|
def setUp(self):
|
|
super(TestsCommon, self).setUp()
|
|
|
|
self.location_office_1 = self.env['lunch.location'].create({
|
|
'name' : 'Farm 1',
|
|
})
|
|
|
|
self.location_office_2 = self.env['lunch.location'].create({
|
|
'name': 'Farm 2',
|
|
})
|
|
|
|
self.partner_pizza_inn = self.env['res.partner'].create({
|
|
'name': 'Pizza Inn',
|
|
})
|
|
|
|
self.supplier_pizza_inn = self.env['lunch.supplier'].create({
|
|
'partner_id': self.partner_pizza_inn.id,
|
|
'send_by': 'mail',
|
|
'automatic_email_time': 11,
|
|
'available_location_ids': [
|
|
(6, 0, [self.location_office_1.id, self.location_office_2.id])
|
|
],
|
|
})
|
|
|
|
self.partner_coin_gourmand = self.env['res.partner'].create({
|
|
'name': 'Coin Gourmand',
|
|
})
|
|
|
|
self.supplier_coin_gourmand = self.env['lunch.supplier'].create({
|
|
'partner_id': self.partner_coin_gourmand.id,
|
|
'send_by': 'phone',
|
|
'available_location_ids': [
|
|
(6, 0, [self.location_office_1.id, self.location_office_2.id])
|
|
],
|
|
})
|
|
|
|
self.category_pizza = self.env['lunch.product.category'].create({
|
|
'name': 'Pizza',
|
|
})
|
|
|
|
self.category_sandwich = self.env['lunch.product.category'].create({
|
|
'name': 'Sandwich',
|
|
})
|
|
|
|
self.product_pizza = self.env['lunch.product'].create({
|
|
'name': 'Pizza',
|
|
'category_id': self.category_pizza.id,
|
|
'price': 9,
|
|
'supplier_id': self.supplier_pizza_inn.id,
|
|
})
|
|
|
|
self.product_sandwich_tuna = self.env['lunch.product'].create({
|
|
'name': 'Tuna Sandwich',
|
|
'category_id': self.category_sandwich.id,
|
|
'price': 3,
|
|
'supplier_id': self.supplier_coin_gourmand.id,
|
|
})
|
|
|
|
self.topping_olives = self.env['lunch.topping'].create({
|
|
'name': 'Olives',
|
|
'price': 0.3,
|
|
'category_id': self.category_pizza.id,
|
|
})
|
|
|
|
self.env['lunch.cashmove'].create({
|
|
'amount': 100,
|
|
})
|