summaryrefslogtreecommitdiff
path: root/addons/lunch
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2016-08-09 16:17:17 +0200
committerThibault Delavallée <tde@openerp.com>2016-08-10 15:48:07 +0200
commitc8a313d51e57e9db52758a2c92c13044efef5a6a (patch)
tree5d213f21f33e815804206e36bf4f6c807a6a122c /addons/lunch
parent5ce159924c235c06e4b1f6f653fe305932b83b5a (diff)
[IMP] various: use odoo for imports instead of openerp and update class names
Diffstat (limited to 'addons/lunch')
-rw-r--r--addons/lunch/models/lunch.py7
-rw-r--r--addons/lunch/tests/test_lunch.py3
-rw-r--r--addons/lunch/wizard/lucky_order.py16
3 files changed, 15 insertions, 11 deletions
diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py
index ee5437fbdd2..64ddc393818 100644
--- a/addons/lunch/models/lunch.py
+++ b/addons/lunch/models/lunch.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
-from openerp import models, fields, api, _
-import openerp.addons.decimal_precision as dp
-from openerp.exceptions import AccessError, ValidationError
+from odoo import api, fields, models, _
+from odoo.exceptions import AccessError, ValidationError
+import odoo.addons.decimal_precision as dp
class LunchOrder(models.Model):
diff --git a/addons/lunch/tests/test_lunch.py b/addons/lunch/tests/test_lunch.py
index 6b7ea1f8461..0dc1900b310 100644
--- a/addons/lunch/tests/test_lunch.py
+++ b/addons/lunch/tests/test_lunch.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from openerp.tests import common
+from odoo.tests import common
class Test_Lunch(common.TransactionCase):
diff --git a/addons/lunch/wizard/lucky_order.py b/addons/lunch/wizard/lucky_order.py
index 7583fbe6f72..0533de5b4ee 100644
--- a/addons/lunch/wizard/lucky_order.py
+++ b/addons/lunch/wizard/lucky_order.py
@@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from openerp import api, fields, models, _
import random
-from openerp.exceptions import UserError
-class lunch_order_line(models.TransientModel):
+from odoo import api, fields, models, _
+from odoo.exceptions import UserError
+
+
+class LunchOrderLineLucky(models.TransientModel):
_name = 'lunch.order.line.lucky'
def _default_supplier(self):
@@ -16,7 +18,7 @@ class lunch_order_line(models.TransientModel):
supplier_ids = fields.Many2many(comodel_name='res.partner', string='Vendor', domain=lambda self: [("id", "in", self.env['lunch.product'].search([]).mapped("supplier").ids)])
is_max_budget = fields.Boolean("I'm not feeling rich", help="Enable this option to set a maximal budget for your lucky order.", store=True)
max_budget = fields.Float('Max Budget', store=True)
-
+
@api.multi
def random_pick(self):
"""
@@ -24,13 +26,13 @@ class lunch_order_line(models.TransientModel):
"""
self.ensure_one()
if self.is_max_budget:
- products_obj = self.env['lunch.product'].search([('supplier', "in", self.supplier_ids.ids), ('price', '<=', self.max_budget)])
+ products_obj = self.env['lunch.product'].search([('supplier', "in", self.supplier_ids.ids), ('price', '<=', self.max_budget)])
else:
- products_obj = self.env['lunch.product'].search([('supplier', "in", self.supplier_ids.ids)])
+ products_obj = self.env['lunch.product'].search([('supplier', "in", self.supplier_ids.ids)])
if len(products_obj) != 0:
random_product_obj = self.env['lunch.product'].browse([random.choice(products_obj.ids)])
order_line = self.env['lunch.order.line'].create({
- 'product_id': random_product_obj.id,
+ 'product_id': random_product_obj.id,
'order_id': self._context['active_id']
})
else: