diff --git a/addons/lunch/__init__.py b/addons/lunch/__init__.py
deleted file mode 100644
index 949e893c0f0..00000000000
--- a/addons/lunch/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- encoding: utf-8 -*-
-import lunch
-import wizard
-import report
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/__terp__.py b/addons/lunch/__terp__.py
deleted file mode 100644
index 46da1f5e13f..00000000000
--- a/addons/lunch/__terp__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- encoding: utf-8 -*-
-{
- "name": "Lunch Module",
- "author": "Tiny",
- "version": "0.1",
- "depends": ["base", "process", "hr"],
- "init_xml": [],
- "update_xml": ['lunch_wizard.xml', 'lunch_view.xml', 'lunch_report.xml',
- 'process/lunch_process.xml'
- ],
- "demo_xml": ['lunch_demo.xml'],
- "installable": True,
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py
deleted file mode 100644
index 167a075d95b..00000000000
--- a/addons/lunch/lunch.py
+++ /dev/null
@@ -1,171 +0,0 @@
-# -*- encoding: utf-8 -*-
-from osv import osv, fields
-import time
-
-class lunch_category(osv.osv):
- _name = 'lunch.category'
- _description = "Category"
-
- _columns = {
- 'name': fields.char('Name', required=True, size=50),
- }
-
- _order = 'name'
-
-lunch_category()
-
-class lunch_product(osv.osv):
- _name = 'lunch.product'
-
- def _category_name_get(self, cr, uid, context={}):
- obj = self.pool.get('lunch.category')
- cat_ids= obj.search(cr,uid,[])
- res = obj.read(cr,uid,cat_ids,['name', 'category'])
- return [(str(r['id']), r['name']) for r in res]+ [('0','')]
-
- _columns = {
- 'name': fields.char('Name', size=50, required=True),
- 'category_id': fields.selection(_category_name_get, 'Category', size=32),
- 'description': fields.char('Description', size=128, required=False),
- 'price': fields.float('Price', digits=(16,2)),
- 'active': fields.boolean('Active'),
- }
-
- _defaults = {
- 'active': lambda *a : True,
- }
-
-lunch_product()
-
-class lunch_cashbox(osv.osv):
- _name='lunch.cashbox'
-
- def amount_available(self, cr, uid, ids, field_name, arg, context):
- cr.execute("SELECT box,sum(amount) from lunch_cashmove where active = 't' group by box")
- r = dict(cr.fetchall())
- for i in ids :
- r.setdefault(i,0)
- return r
-
- _columns={
- 'manager':fields.many2one('res.users','Manager'),
- 'name':fields.char('Name',size=30,required=True, unique = True),
- 'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
- }
-
-lunch_cashbox()
-
-
-
-
-class lunch_cashmove(osv.osv):
- _name= 'lunch.cashmove'
-
- _columns={
- 'name': fields.char('Name',size=128),
- 'user_cashmove': fields.many2one('res.users','User Name', required=True),
- 'amount': fields.float('Amount', digits=(16,2)),
- 'box':fields.many2one('lunch.cashbox','Box Name',size=30,required=True),
- 'active':fields.boolean('Active'),
- 'create_date': fields.datetime('Created date', readonly=True),
- }
-
- _defaults={
- 'active': lambda *a: True,
- }
-
-lunch_cashmove()
-
-
-
-class lunch_order(osv.osv):
- _name='lunch.order'
- _rec_name= "user_id"
-
- def _price_get(self, cr, uid, ids, name, args, context=None):
- res = {}
- for o in self.browse(cr, uid, ids):
- res[o.id] = o.product.price
- return res
-
- _columns={
- 'user_id': fields.many2one('res.users','User Name', required=True,
- readonly=True, states={'draft':[('readonly',False)]}),
- 'product':fields.many2one('lunch.product','Product', required=True,
- readonly=True, states={'draft':[('readonly',False)]}, change_default=True),
- 'date': fields.date('Date',readonly=True,states={'draft':[('readonly',False)]}),
- 'cashmove':fields.many2one('lunch.cashmove', 'CashMove' , readonly=True ),
- 'descript':fields.char('Description Order', readonly=True, size=50,
- states={'draft':[('readonly',False)]}),
- 'state': fields.selection([('draft','Draft'), ('confirmed','Confirmed'),],
- 'State', readonly=True, select=True),
- 'price': fields.function(_price_get, method=True, string="Price"),
- }
-
- _defaults={
- 'user_id': lambda self,cr,uid,context: uid,
- 'date': lambda self,cr,uid,context: time.strftime('%Y-%m-%d'),
- 'state': lambda self,cr,uid,context: 'draft',
- }
-
- def confirm(self,cr,uid,ids,box,context):
- cashmove_ref= self.pool.get('lunch.cashmove')
- for order in self.browse(cr,uid,ids):
- if order.state == 'confirmed':
- continue
- new_id= cashmove_ref.create(cr,uid,{'name': order.product.name+' order',
- 'amount':-order.product.price,
- 'user_cashmove':order.user_id.id,
- 'box':box,
- 'active':True,
- })
- self.write(cr,uid,[order.id],{'cashmove':new_id, 'state':'confirmed'})
- return {}
-
- def lunch_order_cancel(self,cr,uid,ids,context):
- orders= self.browse(cr,uid,ids)
- for order in orders:
- if not order.cashmove:
- continue
- self.pool.get('lunch.cashmove').unlink(cr, uid, [order.cashmove.id])
- self.write(cr,uid,ids,{'state':'draft'})
- return {}
-
- def onchange_product(self, cr, uid, ids, product):
- if not product:
- return {'value': {'price': 0.0}}
- price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price']
- return {'value': {'price': price}}
-
-lunch_order()
-
-class report_lunch_amount(osv.osv):
- _name='report.lunch.amount'
- _description = "Amount available by user and box"
- _auto = False
- _rec_name= "user"
-
- _columns = {
- 'user_id': fields.many2one('res.users','User Name',readonly=True),
- 'amount': fields.float('Amount', readonly=True, digits=(16,2)),
- 'box':fields.many2one('lunch.cashbox','Box Name',size=30,readonly=True),
- }
-
- def init(self, cr):
- cr.execute("""
- create or replace view report_lunch_amount as (
- select
- min(lc.id) as id,
- lc.user_cashmove as user_id,
- sum(amount) as amount,
- lc.box as box
- from
- lunch_cashmove lc
- where
- active = 't'
- group by lc.user_cashmove, lc.box
- )""")
-
-report_lunch_amount()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml
deleted file mode 100644
index e26680f5253..00000000000
--- a/addons/lunch/lunch_demo.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Sandwich
-
-
-
- Club
-
- 2.75
-
-
-
- Cashbox
-
-
-
-
diff --git a/addons/lunch/lunch_report.xml b/addons/lunch/lunch_report.xml
deleted file mode 100644
index 3cdd8cb418c..00000000000
--- a/addons/lunch/lunch_report.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml
deleted file mode 100644
index 5862089067a..00000000000
--- a/addons/lunch/lunch_view.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
-
-
-
-
-
-
- Order
- lunch.order
-
-
-
-
-
-
- Order
- lunch.order
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Make order
- lunch.order
- form,tree
-
-
-
-
- Order of the day
- lunch.order
- [('date','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-
- CashBox
- lunch.cashbox
-
-
-
-
-
-
- CashBox
- lunch.cashbox
- tree
-
-
-
-
-
-
-
-
-
-
- CashBox
- lunch.cashbox
-
-
-
-
- CashMove
- lunch.cashmove
-
-
-
-
-
-
- CashMove
- lunch.cashmove
- tree
-
-
-
-
-
-
-
-
-
-
-
-
- CashMove
- lunch.cashmove
-
-
-
-
-
- Category of product
- lunch.category
-
-
-
-
-
-
- Category
- lunch.category
- tree
-
-
-
-
-
-
-
-
-
- Category of product
- lunch.category
-
-
-
- Products
- form
- lunch.product
-
-
-
-
-
-
-
- Products
- lunch.product
- tree
-
-
-
-
-
-
-
-
-
-
-
- Product
- lunch.product
-
-
-
-
-
-
-
-
- Lunch amount
- report.lunch.amount
- tree
-
-
-
-
-
-
-
-
-
-
- Lunch amount
- report.lunch.amount
- form
-
-
-
-
-
-
-
- Lunch amount
- report.lunch.amount
- form
- tree,form
-
-
-
-
-
-
diff --git a/addons/lunch/lunch_wizard.xml b/addons/lunch/lunch_wizard.xml
deleted file mode 100644
index ec9f7fea855..00000000000
--- a/addons/lunch/lunch_wizard.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/lunch/process/lunch_process.xml b/addons/lunch/process/lunch_process.xml
deleted file mode 100644
index 4818d9d93f9..00000000000
--- a/addons/lunch/process/lunch_process.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/lunch/report/__init__.py b/addons/lunch/report/__init__.py
deleted file mode 100644
index efaffa8d307..00000000000
--- a/addons/lunch/report/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# -*- encoding: utf-8 -*-
-import order
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py
deleted file mode 100644
index 7824bade083..00000000000
--- a/addons/lunch/report/order.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import time
-from report import report_sxw
-from osv import osv
-
-
-class order(report_sxw.rml_parse):
-
- def sum_price(self, orders):
- res = 0.0
- for o in orders:
- res += o.price
- return res
-
- def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
-
- self.localcontext.update({
- 'time': time,
- 'sum_price': self.sum_price,
- })
-
-report_sxw.report_sxw('report.lunch.order', 'lunch.order',
- 'addons/lunch/report/order.rml',parser=order, header=False)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml
deleted file mode 100644
index a7bc1b32cdd..00000000000
--- a/addons/lunch/report/order.rml
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Printed at : [[time.strftime("%Hh%M")]]
-
-
-
-
-
-
-
-
-
- |
- Name
- |
-
- Order
- |
-
- Description
- |
-
- Unit Price
- |
-
-
-
-
-
- |
- [[repeatIn(objects, 'o') ]]
- [[ o.user_id.name ]]
- |
-
- [[o.product.name ]]
- |
-
- [[ o.descript ]]
-
-
-
- |
-
- [['%.2f' % o.price ]]
- |
-
-
- |
-
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
- [[ '%.2f' % sum_price(objects) ]]
- |
-
-
-
-
-
-
-
-
diff --git a/addons/lunch/wizard/__init__.py b/addons/lunch/wizard/__init__.py
deleted file mode 100644
index 26328e41dc2..00000000000
--- a/addons/lunch/wizard/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- encoding: utf-8 -*-
-import confirm
-import cancel
-import reset_box
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/wizard/cancel.py b/addons/lunch/wizard/cancel.py
deleted file mode 100644
index 15ad6b96451..00000000000
--- a/addons/lunch/wizard/cancel.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-import wizard
-import netsvc
-import ir
-import pooler
-
-cancel_form = """
-
"""
-
-
-cancel_fields = {
-}
-
-def _cancel(self,cr,uid,data,context):
- return pooler.get_pool(cr.dbname).get('lunch.order').lunch_order_cancel(cr,uid,data['ids'],context)
-
-class order_cancel(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':cancel_form, 'fields':cancel_fields, 'state':[('end','No'),('cancel','Yes')]}
- },
- 'cancel': {
- 'actions': [_cancel],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-order_cancel('lunch.order.cancel')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/wizard/confirm.py b/addons/lunch/wizard/confirm.py
deleted file mode 100644
index 6c42fb033c3..00000000000
--- a/addons/lunch/wizard/confirm.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import wizard
-import netsvc
-import ir
-import pooler
-
-confirm_order_form = """
-
-"""
-
-confirm_order_fields = {
- 'confirm_cashbox': {'string':'Name of box', 'type':'many2one', 'required':True, 'relation':'lunch.cashbox' },
-}
-
-def _confirm(self,cr,uid,data,context):
- pool= pooler.get_pool(cr.dbname)
- order_ref = pool.get('lunch.order')
- order_ref.confirm(cr,uid,data['ids'],data['form']['confirm_cashbox'],context)
- return {}
-
-class order_confirm(wizard.interface):
- states = {
- 'init': {
- 'action':[],
- 'result':{'type' : 'form', 'arch' : confirm_order_form, 'fields' : confirm_order_fields, 'state' : [('end', 'Cancel'),('go', 'Confirm Order') ]},
- },
- 'go' : {
- 'actions' : [_confirm],
- 'result' : {'type' : 'state', 'state' : 'end'}
- },
- }
-order_confirm('lunch.order.confirm')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/lunch/wizard/reset_box.py b/addons/lunch/wizard/reset_box.py
deleted file mode 100644
index 643ecd3ad3f..00000000000
--- a/addons/lunch/wizard/reset_box.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- encoding: utf-8 -*-
-import wizard
-import netsvc
-import ir
-import pooler
-
-set_to_zero_form = """
-"""
-
-
-
-confirm_setting_zero_fields = {}
-
-def _set_to_zero(self,cr,uid,data,context):
- pool= pooler.get_pool(cr.dbname)
- cashmove_ref = pool.get('lunch.cashmove')
- cr.execute("select user_cashmove, box,sum(amount) from lunch_cashmove where active= 't' and box in (%s) group by user_cashmove, box"%','.join(map(str,data['ids'])))
- res= cr.fetchall()
- cr.execute("update lunch_cashmove set active = 'f' where active= 't' and box in (%s)"%','.join(map(str,data['ids'])))
-## to_unactive= {}.fromkeys([r[0] for r in cr.fetchall]).keys()
-## print to_unactive
-## cashmove_ref.write(cr,uid,to_unactive,{'active':False})
-##
- for (user_id,box_id,amount) in res:
- cashmove_ref.create(cr,uid,{'name': 'Summary for user'+ str(user_id),
- 'amount': amount,
- 'user_cashmove': user_id,
- 'box': box_id,
- 'active': True,
- })
- return {}
-
-
-class cashbox_set_to_zero(wizard.interface):
-
- states = {
-
- 'init': {
- 'action':[],
- 'result':{'type' : 'form',
- 'arch' : set_to_zero_form,
- 'fields' : confirm_setting_zero_fields,
- 'state' : [('end', 'Cancel'),('zero', 'Set to Zero') ]},
-
- },
- 'zero' : {
- 'actions' : [_set_to_zero],
- 'result' : {'type' : 'state', 'state' : 'end'}
- },
- }
-
-cashbox_set_to_zero('lunch.cashbox.clean')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/partner_ldap/__init__.py b/addons/partner_ldap/__init__.py
deleted file mode 100644
index 3ce9f39c009..00000000000
--- a/addons/partner_ldap/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- encoding: utf-8 -*-
-import partner
-import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/partner_ldap/__terp__.py b/addons/partner_ldap/__terp__.py
deleted file mode 100644
index a04691edf52..00000000000
--- a/addons/partner_ldap/__terp__.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- encoding: utf-8 -*-
-{
- "name" : "Partner extension to synchronize TinyERP with ldap",
- "version" : "1.0",
- "author" : "Tiny",
- "depends" : ["base", "hr", "process"],
- "category" : "Generic Modules/Inventory Control",
- "description": "Synchronise partners through a LDAP module. Has been used to synchronise partners in Outlook and Tiny ERP.",
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : ["wizard.xml",
- "process/partner_ldap_process.xml"
- ],
- "active": False,
- "installable": True
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/partner_ldap/partner.py b/addons/partner_ldap/partner.py
deleted file mode 100644
index 1bc3376356f..00000000000
--- a/addons/partner_ldap/partner.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# $Id$
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-from osv import osv, fields
-
-class address_ldap(osv.osv):
- _inherit = 'res.partner.address'
-
- _columns = {
- 'dn' : fields.char('Distinguished name', size=128),
- }
-
-address_ldap()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/partner_ldap/process/partner_ldap_process.xml b/addons/partner_ldap/process/partner_ldap_process.xml
deleted file mode 100644
index 71b3a1d2182..00000000000
--- a/addons/partner_ldap/process/partner_ldap_process.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/partner_ldap/wizard.xml b/addons/partner_ldap/wizard.xml
deleted file mode 100644
index 1785d5c7328..00000000000
--- a/addons/partner_ldap/wizard.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/addons/partner_ldap/wizard/__init__.py b/addons/partner_ldap/wizard/__init__.py
deleted file mode 100644
index 4f0d100c6ac..00000000000
--- a/addons/partner_ldap/wizard/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# -*- encoding: utf-8 -*-
-import synchronize
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/partner_ldap/wizard/synchronize.py b/addons/partner_ldap/wizard/synchronize.py
deleted file mode 100644
index 8cf96f9a727..00000000000
--- a/addons/partner_ldap/wizard/synchronize.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# $Id$
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import sys
-if sys.version_info[:2] < (2, 4):
- from sets import Set as set
-
-import time
-import ldap
-import ldap.modlist
-
-import wizard
-import pooler
-
-BASE_DN = 'ou=addressbook,dc=localdomain'
-
-def terp2ldap(data):
- res = {}
- for ldap_name, terp in LDAP_TERP_MAPPER.items():
- if callable(terp) and terp(data):
- res[ldap_name] = [terp(data)]
- elif isinstance(terp, basestring) and data[terp]:
- res[ldap_name] = ['%s' % data[terp]]
- return res
-
-def get_lastname(dico):
- lnames = dico['name'].split(' ', 1)[1:]
- if lnames:
- return ' '.join(lnames)
- else:
- return dico['name']
-
-def get_street(dico):
- return ' '.join([dico[x] for x in ('street', 'street2') if dico[x]])
-
-def get_name(attribute):
- def func(dico):
- return dico[attribute][1]
- return func
-
-
-LDAP_TERP_MAPPER = {
- 'displayname': 'name',
- 'mail': 'email',
- 'o': get_name('partner_id'),
- 'telephoneNumber': 'phone',
- 'street': get_street,
- 'postalcode': 'zip',
- 'l': 'city',
- 'cn': 'name',
- 'sn': get_lastname,
- 'uid': 'id',
- }
-
-
-class sync_ldap(wizard.interface):
-
- _login_arch = '''
-
- '''
-
- _login_fields = {
- 'ldap_host': {'string': 'LDAP Host', 'type': 'char', 'size': 128},
- 'dn': {'string': 'Distinguished name', 'type': 'char', 'size': 128},
- 'password': {'string': 'Password', 'type': 'char', 'size': 128},
- }
-
- def _do_sync(self, cr, uid, data, context):
- l = ldap.open(data['form']['ldap_host'])
- l.simple_bind_s(data['form']['dn'], data['form']['password'])
- ldap_objs = dict(l.search_s(BASE_DN, ldap.SCOPE_ONELEVEL, 'objectclass=*',
- LDAP_TERP_MAPPER.keys()))
- address = pooler.get_pool(cr.dbname).get('res.partner.address')
- terp_objs = dict([(x['id'], x) for x in address.read(cr, uid, address.search(cr, uid, []))])
- ldap_set = [int(x['uid'][0]) for x in ldap_objs.values()]
- terp_set = terp_objs.keys()
- for to_delete in ldap_set:
- if to_delete in terp_set:
- continue
- l.delete_s('uid=%s,%s' % (to_delete, BASE_DN))
- for to_add in terp_set:
- if to_add in ldap_set:
- continue
- new_dn = 'uid=%s,%s' % (to_add, BASE_DN)
- ldap_data = {'objectclass' : ['organizationalPerson', 'inetOrgPerson']}
- ldap_data.update(terp2ldap(terp_objs[to_add]))
- l.add_s(new_dn, ldap.modlist.addModlist(ldap_data))
- address.write(cr, uid, [to_add], {'dn' : new_dn})
- for to_update in terp_set:
- if to_update not in ldap_set:
- continue
- current_dn = 'uid=%s,%s' % (to_update, BASE_DN)
- modlist = ldap.modlist.modifyModlist(ldap_objs[current_dn], terp2ldap(terp_objs[to_update]))
- if modlist:
- l.modify_s(current_dn, modlist)
- return {}
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {
- 'type' : 'form',
- 'arch' : _login_arch,
- 'fields' : _login_fields,
- 'state' : (('end', 'Cancel'),('sync', 'Synchronize'))
- },
- },
- 'sync' : {
- 'actions' : [ _do_sync ],
- 'result' : { 'type' : 'state', 'state' : 'end' },
- },
- }
-
-
-sync_ldap('partners.sync_ldap')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/__init__.py b/addons/sandwich/__init__.py
deleted file mode 100644
index 25aa31ed040..00000000000
--- a/addons/sandwich/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- encoding: utf-8 -*-
-import sandwich
-import report
-import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/__terp__.py b/addons/sandwich/__terp__.py
deleted file mode 100644
index 12fe33dbb1d..00000000000
--- a/addons/sandwich/__terp__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- encoding: utf-8 -*-
-{
- "name" : "Sandwich Module",
- "author" : "Tiny",
- "version" : "1.0",
- "category" : "Generic Modules/Others",
- "depends" : ["base", "product"],
- "demo_xml" : ["sandwich_demo.xml"],
- "update_xml" : ["sandwich_view.xml", "sandwich_report.xml", "sandwich_wizard.xml"],
- "active": False,
- "installable": True
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/report/__init__.py b/addons/sandwich/report/__init__.py
deleted file mode 100644
index b161da86f17..00000000000
--- a/addons/sandwich/report/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# -*- encoding: utf-8 -*-
-import sandwich_report
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/report/sandwich_report.py b/addons/sandwich/report/sandwich_report.py
deleted file mode 100644
index c98d0ef65e3..00000000000
--- a/addons/sandwich/report/sandwich_report.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-
-import time
-from report import report_sxw
-
-#
-# sandwich command report
-#
-class sandwich_order_print(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(sandwich_order_print, self).__init__(cr, uid, name, context)
- self.localcontext.update( {
- 'time': time,
- })
-
-report_sxw.report_sxw('report.sandwich.order.print','sandwich.order','addons/sandwich/report/sandwich_report.rml',parser=sandwich_order_print)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/report/sandwich_report.rml b/addons/sandwich/report/sandwich_report.rml
deleted file mode 100644
index e6f63c37d9a..00000000000
--- a/addons/sandwich/report/sandwich_report.rml
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(objects, 'o') ]]
-
-
- |
-
-
-
- |
-
- [[ o.partner['name'] ]]
- [[ o.partner.address[0]['street'] ]]
- [[ o.partner.address[0]['street2'] ]]
- [[ o.partner.address[0]['zip'] ]], [[ o.partner.address[0]['city'] ]]
- [[ o.partner.address[0].state_id['name'] ]]
- [[ o.partner.address[0].country_id['name'] ]]
-
-
-
-
-
-
- Phone : [[ o.partner.address[0]['phone'] ]]
- FAX : [[ o.partner.address[0]['fax'] ]]
- |
-
-
-
-
-
-
-
-
- Document : [[ o['name'] ]]
- Date : [[ o['date'] ]]
- Printing date : [[ time.strftime('%d/%m/%Y') ]]
-
-
-
-
-
-
-
-
- |
- Item
- |
-
- Quantity
- |
-
- User
- |
-
- Unit price
- |
-
- Total Price
- |
-
-
- |
- [[ repeatIn(o.order_lines, 'a') ]]
- [[ a.product_id['name'] ]]
- |
-
- [[ a['quantity'] ]]
- |
-
- [[ a.user_id['login'] ]]
- |
-
- [[ a.product_id['price'] ]]
- |
-
- [[ a.product_id['price'] * a['quantity'] ]]
- |
-
-
-
-
-
-
-
-
- [[ o['note'] ]]
-
-
-
-
-
-
-
-
-
diff --git a/addons/sandwich/sandwich.py b/addons/sandwich/sandwich.py
deleted file mode 100644
index 457c91b398b..00000000000
--- a/addons/sandwich/sandwich.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- encoding: utf-8 -*-
-import time
-
-from osv import osv, fields
-import pooler
-
-#
-# Type of type of products (food, drink, lsd, other...)
-#
-class sandwich_product_type(osv.osv):
- _name = 'sandwich.product.type'
- _columns = {
- 'name': fields.char('Name of the type', size=20, required=True),
- 'description': fields.char('Type\'s description', size=255),
- }
-sandwich_product_type()
-
-
-#
-# Type Of Sandwich
-#
-class sandwich_product(osv.osv):
- _name = 'sandwich.product'
- _columns = {
- 'name': fields.char('Product name', size=50, required=True),
- 'price': fields.float('Product price'),
- 'product_type_id': fields.many2one('sandwich.product.type','Type of product'),
- }
-sandwich_product()
-
-
-#
-# Sandwich command
-#
-class sandwich_order(osv.osv):
- _name = 'sandwich.order'
- _columns = {
- 'name': fields.char('Name', size=50, required=True),
- 'date': fields.date('Order date'),
- 'order_lines': fields.one2many('sandwich.order.line','order_id','Order lines'),
- 'note': fields.text('Notes'),
- 'partner': fields.many2one('res.partner','Partner', required=True),
- }
- _defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d'),
- }
-sandwich_order()
-
-
-#
-# Sandwich lines of command
-#
-class sandwich_order_line(osv.osv):
- _name = 'sandwich.order.line'
- _columns = {
- 'name': fields.char('Description', size=50, required=True),
- 'product_id': fields.many2one('sandwich.product', 'Product'),
- 'user_id': fields.many2one('res.users', 'User id', required=True),
- 'quantity': fields.integer('Quantity', required=True),
- 'order_id': fields.many2one('sandwich.order', 'Order'),
- 'date': fields.date('Date'),
- 'product_type_id':fields.many2one('sandwich.product.type','Product type',change_default=True),
- }
- _defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d'),
- 'user_id': lambda self, cr, uid, c: uid,
- 'quantity': lambda *a: 1
- }
-
- def onchange_user_id(self, cr, uid, id, user_id, product_type_id, context={}, *args):
- # print id, user_id, product_type_id, context
- if (not user_id) or (not product_type_id):
- return {}
- cr.execute('SELECT product_id,name,quantity FROM sandwich_order_line WHERE user_id=%d AND product_type_id=%d ORDER BY date DESC LIMIT 1', (user_id, product_type_id))
- res = cr.dictfetchone()
- if res:
- return {'value': res}
- # else
- return {'value': {'product_id': False, 'name': '', 'quantity': 1}}
-
- def onchange_product_type_id(self, cr, uid, id, user_id, product_type_id, context={}):
- if (not product_type_id) or (not user_id):
- return {}
- cr.execute('SELECT product_id,name,quantity FROM sandwich_order_line WHERE user_id=%d AND product_type_id=%d ORDER BY date DESC LIMIT 1', (user_id, product_type_id))
- res = cr.dictfetchone()
- if res:
- return {'value': res}
- # else
- return {'value': {'product_id': False, 'name': '', 'quantity': 1}}
-
- def onchange_product_id(self, cr, uid, id, product_id, context={}):
- if not product_id:
- return {}
- res = pooler.get_pool(cr.dbname).get('sandwich.product').read(cr, uid, [ product_id ], ['name','product_type_id'])
- return {'value': res}
- #return {'value': {'name': name or product_id.name, 'product_type_id': product_id.product_type_id}}
-
-sandwich_order_line()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/sandwich_demo.xml b/addons/sandwich/sandwich_demo.xml
deleted file mode 100644
index adc6a4e6c6f..00000000000
--- a/addons/sandwich/sandwich_demo.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
- sandwich
- something to eat
-
-
- drink
- Something to drink
-
-
- candy
- so sweeeeeet, but so bad for your teeth...
-
-
-
- club
- 2.00
-
-
-
- chicken-curry
- 2.00
-
-
-
- Tuna
- 2.50
-
-
-
- cheese
- 1.50
-
-
-
-
- Little Coke 0.5l
- 1.05
-
-
-
- Coke 1.0l
- 2.00
-
-
-
- Big Coke 2.0l
- 3.50
-
-
-
- Cecemel
- 1.35
-
-
-
- water
- 0.75
-
-
-
-
- Mars
- 0.80
-
-
-
- Snickers
- 0.80
-
-
-
- Twix
- 1.00
-
-
-
-
-
diff --git a/addons/sandwich/sandwich_report.xml b/addons/sandwich/sandwich_report.xml
deleted file mode 100644
index 2c3d8cbee3a..00000000000
--- a/addons/sandwich/sandwich_report.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/sandwich/sandwich_view.xml b/addons/sandwich/sandwich_view.xml
deleted file mode 100644
index 4aa8390879e..00000000000
--- a/addons/sandwich/sandwich_view.xml
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
-
- sandwich.product.type
- sandwich.product.type
- form
-
-
-
-
-
- sandwich.product.type
- sandwich.product.type
- tree
-
-
-
-
-
-
-
-
-
- sandwich.product.type
- form
- form,tree
- []
-
-
-
-
-
-
-
- sandwich.product
- sandwich.product
- tree
-
-
-
-
-
-
-
-
-
- sandwich.product
- sandwich.product
- form
-
-
-
-
-
-
- sandwich.product
- form
- tree,form
- []
-
-
-
-
-
- sandwich.order.line.tree
- sandwich.order.line
- tree
-
-
-
-
-
-
-
-
-
-
-
- sandwich.order.line.form
- sandwich.order.line
- form
-
-
-
-
-
-
- sandwich.order.line
- form
- []
-
-
-
-
-
-
- My order lines
- sandwich.order.line
- form
- tree,form
- [('user_id','=',uid)]
-
-
-
-
-
- My order lines of the day
- sandwich.order.line
- form
- tree,form
- [('user_id','=',uid),('date','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-
- Order lines of the day
- sandwich.order.line
- form
- tree,form
- [('date','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-
- sandwich.order.tree
- sandwich.order
- tree
-
-
-
-
-
-
-
-
-
-
- sandwich.order.form
- sandwich.order
- form
-
-
-
-
-
- Today's orders
- sandwich.order
- form
- tree,form
-
- [('date','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-
-
-
diff --git a/addons/sandwich/sandwich_wizard.xml b/addons/sandwich/sandwich_wizard.xml
deleted file mode 100644
index e325c784921..00000000000
--- a/addons/sandwich/sandwich_wizard.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
- Create Order of the day
- sandwich.order_create
-
-
-
-
-
-
-
diff --git a/addons/sandwich/wizard/__init__.py b/addons/sandwich/wizard/__init__.py
deleted file mode 100644
index c26cfc23f4e..00000000000
--- a/addons/sandwich/wizard/__init__.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import sandwich_wizard
-import order_create
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/wizard/order_create.py b/addons/sandwich/wizard/order_create.py
deleted file mode 100644
index 744553938fa..00000000000
--- a/addons/sandwich/wizard/order_create.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# $Id: makesale.py 1183 2005-08-23 07:43:32Z pinky $
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-from mx.DateTime import now
-
-import wizard
-import netsvc
-import ir
-import pooler
-
-sale_form = """
-"""
-
-sale_fields = {
- 'name' : {'string' : 'Order name', 'type': 'char'},
- 'partner_id' : {'string':'Suplier', 'relation':'res.partner', 'type':'many2one'},
-}
-
-class make_sale(wizard.interface):
- def _makeOrder(self, cr, uid, data, context):
- order = pooler.get_pool(cr.dbname).get('sandwich.order')
- line = pooler.get_pool(cr.dbname).get('sandwich.order.line')
- oid = order.create(cr, uid, {
- 'name': data['form']['name'],
- 'partner': data['form']['partner_id'],
- })
- name=data['form']['name']
- cr.execute('update sandwich_order_line set order_id=%d where order_id is null', (oid,))
- value = {
- 'domain': "[('id','in',["+str(oid)+"])]",
- 'name': "Create Sandwich Orders:"+name,
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'sandwich.order',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'res_id': oid
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form', 'arch' : sale_form, 'fields' : sale_fields, 'state' : [('end', 'Cancel'),('order', 'Make an order')]}
- },
- 'order' : {
- 'actions': [],
- 'result': {'type': 'action', 'action': _makeOrder, 'state':'end'},
- }
- }
-make_sale('sandwich.order_create')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sandwich/wizard/sandwich_wizard.py b/addons/sandwich/wizard/sandwich_wizard.py
deleted file mode 100644
index 21be195546f..00000000000
--- a/addons/sandwich/wizard/sandwich_wizard.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import wizard
-import pooler
-
-#
-# This class fill in the order with kind of automatically generated order lines, based on the last order for a user concerning a type of product
-#
-class sandwich_order_wizard(wizard.interface):
-
- def _sandwich_order_wizard_order(self, cr, uid, data, context):
- if not len(data['ids']):
- return {}
- cr.execute('update sandwich_order_line set order_id=%d where order_id is null', (data['ids'][0],))
- for order in pooler.get_pool(cr.dbname).get('sandwich.order').browse(cr, uid, data['ids']):
- for user_id in data['form']['user_id'][0][2]:
- for producttype in data['form']['product_type_id'][0][2]:
- if not pooler.get_pool(cr.dbname).get('sandwich.order.line').search(cr, uid, [('user_id','=',user_id),('product_type_id','=',producttype),('order_id','=',order.id)]):
- vals = {
- 'user_id': user_id,
- 'order_id': order.id,
- 'date': order.date,
- 'product_type_id': producttype
- }
- vals.update( pooler.get_pool(cr.dbname).get('sandwich.order.line').onchange_user_id(cr, uid, uid, user_id, producttype)['value'] )
- pooler.get_pool(cr.dbname).get('sandwich.order.line').create(cr, uid, vals)
- return {}
-
- _sandwich_order_wizard_form = '''
- '''
-
- _sandwich_order_wizard_fields = {
- 'user_id': {'string': 'User', 'type': 'many2many','relation':'res.users'},
- 'product_type_id': {'string': 'Product', 'type': 'many2many', 'relation':'sandwich.product.type'},
- }
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_sandwich_order_wizard_form, 'fields':_sandwich_order_wizard_fields, 'state':[('end','Cancel'),('complete','Complete order')]}
- },
- 'complete': {
- 'actions': [_sandwich_order_wizard_order],
- 'result': {'type': 'state', 'state': 'end'}
- }
- }
-
-sandwich_order_wizard('sandwich.order.wizard')
-
-#
-# This class send a request message to users who don't have their order filled in for this day
-#
-class sandwich_order_recall_wizard(wizard.interface):
- def _sandwich_order_recall_wizard_send(self, cr, uid, data, context):
- for user_id in data['form']['user_id'][0][2]:
- if not pooler.get_pool(cr.dbname).get('sandwich.order.line').search(cr, uid, [('user_id','=',user_id),('order_id','=',data['id'])]):
- request = pooler.get_pool(cr.dbname).get('res.request')
- request.create(cr, uid, {
- 'name' : "Please order your lunch of the day",
- 'priority' : '0',
- 'state' : 'active',
- 'body' : """Hello,
-
-It seems like you have forgotten to order your sandwich (or meal).
-As it will be ordered soon, it seems to be a rather nice idea to complete your
-order for today ASAP. If you do not, you'll probably get the same meal as yesterday...
-
-Thanks,
-
---
-Tiny ERP
-""",
- 'act_from' : uid,
- 'act_to' : user_id,
- })
- return {}
-
- _sandwich_order_recall_wizard_form = '''
- '''
-
- _sandwich_order_recall_wizard_fields = {
- 'user_id': {'string': 'Baaaad users !', 'type': 'many2many', 'relation': 'res.users'},
- }
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type': 'form', 'arch': _sandwich_order_recall_wizard_form, 'fields': _sandwich_order_recall_wizard_fields, 'state': [('end','Cancel'),('send','Send')]},
- },
- 'send' : {
- 'actions' : [_sandwich_order_recall_wizard_send],
- 'result' : {'type': 'state', 'state': 'end'},
- }
- }
-
-sandwich_order_recall_wizard('sandwich.order.recall.wizard')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-