summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-02-18 19:03:09 +0100
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-02-18 19:03:09 +0100
commit58ca2f6e70fd02bd1370835a46e0ce29bf8f4e2b (patch)
treea5de1e9885e0e80231fa52a12f8cba6b77fe491d /addons
parenta899c8087baa4acf8db5f64c2f7c4841c0b87276 (diff)
[REV] lunch: reverted commits 8720 and 8721 because they were 1) breaking runbot, 2) not fixing the runbot in the best way.
bzr revid: qdp-launchpad@openerp.com-20130218180309-jeltfdibmu01hasz
Diffstat (limited to 'addons')
-rw-r--r--addons/lunch/lunch.py15
-rw-r--r--addons/lunch/tests/test_lunch.py3
2 files changed, 1 insertions, 17 deletions
diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py
index 82c3bf8e51b..0f9033fce38 100644
--- a/addons/lunch/lunch.py
+++ b/addons/lunch/lunch.py
@@ -373,24 +373,11 @@ class lunch_order_line(osv.Model):
cashmove_ref.unlink(cr, uid, cash_ids, context=context)
return self._update_order_lines(cr, uid, ids, context=context)
- def _get_line_order_ids(self, cr, uid, ids, context=None):
- """
- return the list of lunch.order.lines ids to which belong the lunch.order 'ids'
- """
- result = set()
- for lunch_order in self.browse(cr, uid, ids, context=context):
- for lines in lunch_order.order_line_ids:
- result.add(lines.id)
- return list(result)
-
-
_columns = {
'name': fields.related('product_id', 'name', readonly=True),
'order_id': fields.many2one('lunch.order', 'Order', ondelete='cascade'),
'product_id': fields.many2one('lunch.product', 'Product', required=True),
- 'date': fields.related('order_id', 'date', type='date', string="Date", readonly=True, store={
- 'lunch.order': (_get_line_order_ids, ['date'], 10),
- }),
+ 'date': fields.related('order_id', 'date', type='date', string="Date", readonly=True, store=True),
'supplier': fields.related('product_id', 'supplier', type='many2one', relation='res.partner', string="Supplier", readonly=True, store=True),
'user_id': fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True, store=True),
'note': fields.text('Note'),
diff --git a/addons/lunch/tests/test_lunch.py b/addons/lunch/tests/test_lunch.py
index 79095f4504a..49e936848fe 100644
--- a/addons/lunch/tests/test_lunch.py
+++ b/addons/lunch/tests/test_lunch.py
@@ -20,7 +20,6 @@
##############################################################################
from openerp import tools
-import time
from openerp.tests import common
class Test_Lunch(common.TransactionCase):
@@ -44,14 +43,12 @@ class Test_Lunch(common.TransactionCase):
self.new_id_order = self.lunch_order.create(cr,uid,{
'user_id': self.demo_id[0],
'order_line_ids':'[]',
- 'date': time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT),
},context=None)
self.new_id_order_line = self.lunch_order_line.create(cr,uid,{
'order_id':self.new_id_order,
'product_id':self.product_Bolognese_id,
'note': '+Emmental',
'cashmove': [],
- 'date': time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT),
'price': self.lunch_product.browse(cr,uid,self.product_Bolognese_id,context=None).price,
})