diff --git a/addons/account/account.py b/addons/account/account.py
index 937f50249e5..0abdd2af7e0 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1144,6 +1144,7 @@ class account_move(osv.osv):
return amount
def _centralise(self, cr, uid, move, mode, context=None):
+ assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection
if context is None:
context = {}
@@ -1191,10 +1192,7 @@ class account_move(osv.osv):
else:
line_id2 = 0
- cr.execute('SELECT SUM(%s) '\
- 'FROM account_move_line '\
- 'WHERE move_id=%s AND id<>%s',
- (mode, move.id, line_id2))
+ cr.execute('SELECT SUM(%s) FROM account_move_line WHERE move_id=%%s AND id!=%%s' % (mode,), (move.id, line_id2))
result = cr.fetchone()[0] or 0.0
cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
return True
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 50ca647d61d..404c7560535 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -309,6 +309,7 @@
+
diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py
index 56b6410e3a2..65645f5da1e 100644
--- a/addons/account/wizard/account_fiscalyear_close.py
+++ b/addons/account/wizard/account_fiscalyear_close.py
@@ -68,8 +68,10 @@ class account_fiscalyear_close(osv.osv_memory):
fy_id = data[0]['fy_id']
- period_ids = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', fy_id)])
- periods_fy2 = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', data[0]['fy2_id'])])
+ cr.execute("SELECT id FROM account_period WHERE date_stop < (SELECT date_start FROM account_fiscalyear WHERE id = %s)" , (str(data[0]['fy2_id']),))
+ fy_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
+ cr.execute("SELECT id FROM account_period WHERE date_start > (SELECT date_stop FROM account_fiscalyear WHERE id = %s)" , (str(fy_id),))
+ fy2_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
period = obj_acc_period.browse(cr, uid, data[0]['period_id'], context=context)
new_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy2_id'], context=context)
@@ -90,8 +92,7 @@ class account_fiscalyear_close(osv.osv_memory):
if move_ids:
raise osv.except_osv(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
- query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
- cr.execute(query)
+ cr.execute("SELECT id FROM account_fiscalyear WHERE date_stop < %s", (str(new_fyear.date_start),))
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = obj_acc_move_line._query_get(cr, uid,
@@ -151,19 +152,17 @@ class account_fiscalyear_close(osv.osv_memory):
offset = 0
limit = 100
while True:
- #TODO: this query could be improved in order to work if there is more than 2 open FY
- # a.period_id IN ('+fy2_period_set+') is the problematic clause
- cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
+ cr.execute('SELECT DISTINCT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
'b.date_maturity, b.date_created ' \
'FROM account_move_line a, account_move_line b ' \
'WHERE b.account_id = %s ' \
'AND b.reconcile_id is NOT NULL ' \
'AND a.reconcile_id = b.reconcile_id ' \
- 'AND b.period_id IN %s'\
- 'AND a.period_id IN %s' \
+ 'AND b.period_id IN ('+fy_period_set+') ' \
+ 'AND a.period_id IN ('+fy2_period_set+') ' \
'ORDER BY id ' \
- 'LIMIT %s OFFSET %s', (account.id,tuple(period_ids),tuple(periods_fy2),limit, offset))
+ 'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py
index 6ad4af16266..c3533af2702 100644
--- a/addons/crm_claim/__openerp__.py
+++ b/addons/crm_claim/__openerp__.py
@@ -24,8 +24,12 @@
'name': 'Customer & Supplier Relationship Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
- 'description': """claim""",
- 'author': 'Tiny',
+ 'description': """
+This modules allows you to track your customers/suppliers claims and flames.
+It is fully integrated with the email gateway so that you can create
+automatically new claims based on incoming emails.
+ """,
+ 'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['crm'],
'init_xml': [
diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py
index 86eea3f7631..feeaa074b6d 100644
--- a/addons/marketing_campaign/marketing_campaign.py
+++ b/addons/marketing_campaign/marketing_campaign.py
@@ -395,9 +395,9 @@ class marketing_campaign_workitem(osv.osv):
'object': wi.activity_id,
'transition': wi.activity_id.to_ids
}
- expr = eval(str(wi.activity_id.condition), eval_context)
- if expr:
- try:
+ try:
+ expr = eval(str(wi.activity_id.condition), eval_context)
+ if expr:
result = True
if wi.campaign_id.mode in ('manual','active'):
result = self.pool.get('marketing.campaign.activity').process(
@@ -410,11 +410,10 @@ class marketing_campaign_workitem(osv.osv):
if type(result) == type({}) and 'error_msg' in result:
vals['error_msg'] = result['error_msg']
self.write(cr, uid, wi.id, vals)
- except Exception,e:
- self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
- else :
- self.write(cr, uid, wi.id, {'state': 'cancelled'})
-
+ else:
+ self.write(cr, uid, wi.id, {'state': 'cancelled'})
+ except Exception,e:
+ self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
return True
def process_all(self, cr, uid, camp_ids=None, context={}):
@@ -422,16 +421,19 @@ class marketing_campaign_workitem(osv.osv):
if not camp_ids:
camp_ids = camp_obj.search(cr, uid, [('state','=','running')], context=context)
for camp in camp_obj.browse(cr, uid, camp_ids, context=context):
- if camp.mode in ('test_realtime','active'):
- workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
- ('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))])
- elif camp.mode == 'test':
- workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
- else:
- # manual states are not processed automatically
- workitem_ids = []
- if workitem_ids:
- self.process(cr, uid, workitem_ids, context)
+ while True:
+ if camp.mode in ('test_realtime','active'):
+ workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
+ ('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))])
+ elif camp.mode == 'test':
+ workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
+ else:
+ # manual states are not processed automatically
+ workitem_ids = []
+ if workitem_ids:
+ self.process(cr, uid, workitem_ids, context)
+ else:
+ break
def preview(self, cr, uid, ids, context):
res = {}
diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py
index 590a1b47bc0..4853cb65e2c 100644
--- a/addons/marketing_campaign/report/campaign_analysis.py
+++ b/addons/marketing_campaign/report/campaign_analysis.py
@@ -26,13 +26,13 @@ class campaign_analysis(osv.osv): #{{{
_description = "Campaign Analysis"
_auto = False
_rec_name = 'date'
-
def _total_cost(self, cr, uid, ids, field_name, arg, context={}):
-
- """ @param cr: the current row, from the database cursor,
+ """
+ @param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of case and section Data’s IDs
- @param context: A standard dictionary for contextual values """
+ @param context: A standard dictionary for contextual values
+ """
result = {}
for ca_obj in self.browse(cr, uid, ids, context):
wi_ids = self.pool.get('marketing.campaign.workitem').search(cr, uid,
@@ -41,7 +41,6 @@ class campaign_analysis(osv.osv): #{{{
(ca_obj.campaign_id.fixed_cost / len(wi_ids))
result[ca_obj.id] = total_cost
return result
-
_columns = {
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'),
@@ -61,36 +60,33 @@ class campaign_analysis(osv.osv): #{{{
type='many2one', relation='res.country',string='Country'),
'total_cost' : fields.function(_total_cost, string='Cost', method=True,
type="float" ),
- 'revenue': fields.float('Revenue',readonly=True),
-# 'case_id': fields.many2one('crm.lead', 'Opportunity', readonly=True),
-# 'count' : fields.integer('Count', readonly=True),
+ 'revenue': fields.float('Revenue',digits=(16,2),readonly=True),
+ 'count' : fields.integer('# of Actions', readonly=True),
}
-
def init(self, cr):
tools.drop_view_if_exists(cr, 'campaign_analysis')
-
cr.execute("""
- create or replace view campaign_analysis as (
- select
- wi.id as id,
- to_char(wi.date, 'YYYY') as year,
- to_char(wi.date, 'MM') as month,
- wi.date as date,
- s.campaign_id as campaign_id,
- wi.activity_id as activity_id,
- wi.segment_id as segment_id,
- wi.partner_id as partner_id ,
- act.revenue as revenue
- from
- marketing_campaign_workitem wi
- left join res_partner p on (p.id=wi.partner_id)
- left join marketing_campaign_segment s on (s.id=wi.segment_id)
- left join marketing_campaign_activity act on (act.id= wi.activity_id)
- group by
- to_char(wi.date, 'YYYY'),to_char(wi.date, 'MM'),
- s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,revenue,
- wi.date,wi.id
- )
- """)
-
+ create or replace view campaign_analysis as (
+ select
+ min(wi.id) as id,
+ to_char(wi.date::date, 'YYYY') as year,
+ to_char(wi.date::date, 'MM') as month,
+ wi.date::date as date,
+ s.campaign_id as campaign_id,
+ wi.activity_id as activity_id,
+ wi.segment_id as segment_id,
+ wi.partner_id as partner_id ,
+ wi.state as state,
+ sum(act.revenue) as revenue,
+ count(*) as count
+ from
+ marketing_campaign_workitem wi
+ left join res_partner p on (p.id=wi.partner_id)
+ left join marketing_campaign_segment s on (s.id=wi.segment_id)
+ left join marketing_campaign_activity act on (act.id= wi.activity_id)
+ group by
+ s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,wi.state,
+ wi.date::date
+ )
+ """)
campaign_analysis() #}}}
diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml
index d7827033809..fb83e12a225 100644
--- a/addons/marketing_campaign/report/campaign_analysis_view.xml
+++ b/addons/marketing_campaign/report/campaign_analysis_view.xml
@@ -1,7 +1,7 @@
-
-
+
+
campaign.analysis.tree
campaign.analysis
tree
@@ -15,42 +15,52 @@
-
-
+
-
+
campaign.analysis.search
campaign.analysis
search
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -60,17 +70,17 @@
-
+
Campaigns
campaign.analysis
form
tree
- {'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1}
+ {'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1, 'group_by_no_leaf':1}
-
+
-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 86e7a57dd53..9f28cff4594 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -543,16 +543,21 @@ class mrp_production(osv.osv):
return {'value': {'location_dest_id': src}}
return {}
- def product_id_change(self, cr, uid, ids, product):
+ def product_id_change(self, cr, uid, ids, product, context=None):
""" Finds UoM of changed product.
@param product: Id of changed product.
@return: Dictionary of values.
"""
if not product:
- return {}
- res = self.pool.get('product.product').read(cr, uid, [product], ['uom_id'])[0]
- uom = res['uom_id'] and res['uom_id'][0]
- result = {'product_uom': uom}
+ return {'value': {
+ 'product_uom': False,
+ 'bom_id': False
+ }}
+ res = self.pool.get('product.product').browse(cr, uid, product, context=context)
+ result = {
+ 'product_uom': res.uom_id and res.uom_id.id or False,
+ 'bom_id': res.bom_ids and res.bom_ids[0].id or False
+ }
return {'value': result}
def bom_id_change(self, cr, uid, ids, product):
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 982a9158022..e302ed912c0 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -99,7 +99,7 @@
-
+
diff --git a/addons/product_expiry/__init__.py b/addons/product_expiry/__init__.py
index 3b5500415c2..de4fe83ab83 100644
--- a/addons/product_expiry/__init__.py
+++ b/addons/product_expiry/__init__.py
@@ -19,7 +19,5 @@
##############################################################################
import product_expiry
-import wizard
-import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product_expiry/__terp__.py b/addons/product_expiry/__openerp__.py
similarity index 91%
rename from addons/product_expiry/__terp__.py
rename to addons/product_expiry/__openerp__.py
index 2e44f2c6462..b03777ecec6 100644
--- a/addons/product_expiry/__terp__.py
+++ b/addons/product_expiry/__openerp__.py
@@ -20,7 +20,7 @@
{
"name" : "Products date of expiry",
"version" : "1.0",
- "author" : "Tiny",
+ "author" : "OpenERP SA",
"category" : "Enterprise Specific Modules/Food Industries",
"depends" : ["base", "account", "product", "stock"],
"init_xml" : [],
@@ -31,7 +31,7 @@
- removal date
- alert date
Used, for example, in food industries.''',
- "update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml", "wizard/stock_partial_view.xml"],
+ "update_xml" : ["product_expiry_view.xml"],
"active": False,
"installable": True
}
diff --git a/addons/product_expiry/i18n/ca.po b/addons/product_expiry/i18n/ca.po
index 0ed0bfcab10..c4acce0421f 100644
--- a/addons/product_expiry/i18n/ca.po
+++ b/addons/product_expiry/i18n/ca.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
-"PO-Revision-Date: 2010-06-21 15:56+0000\n"
+"PO-Revision-Date: 2010-01-10 22:56+0000\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Catalan \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
@@ -161,3 +161,20 @@ msgstr ""
#: field:product.product,alert_time:0
msgid "Product alert time"
msgstr "Data alerta producte"
+
+#~ msgid "Alert date"
+#~ msgstr "Data alarma"
+
+#~ msgid ""
+#~ "Track different dates on products and lots. Used, for exampel, in food "
+#~ "industries: expiry date, alert date, date of removal, eso."
+#~ msgstr ""
+#~ "Gestiona diferents dates per a productes i lots. Utilitzat, per exemple, en "
+#~ "la indústria alimentària: Data de caducitat, data d'alarma, data "
+#~ "d'eliminació, ..."
+
+#~ msgid "DLUO"
+#~ msgstr "Data caducitat"
+
+#~ msgid "Removal date"
+#~ msgstr "Data eliminació"
diff --git a/addons/product_expiry/i18n/es.po b/addons/product_expiry/i18n/es.po
index 72a3aeec0e2..537d7ce26ef 100644
--- a/addons/product_expiry/i18n/es.po
+++ b/addons/product_expiry/i18n/es.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
-"PO-Revision-Date: 2010-06-21 15:56+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2010-04-29 04:43+0000\n"
+"Last-Translator: Rhubeni Lopes de Andrade \n"
"Language-Team: Spanish \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-30 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
@@ -161,3 +161,20 @@ msgstr ""
#: field:product.product,alert_time:0
msgid "Product alert time"
msgstr "Fecha alerta producto"
+
+#~ msgid "Alert date"
+#~ msgstr "Fecha alarma"
+
+#~ msgid ""
+#~ "Track different dates on products and lots. Used, for exampel, in food "
+#~ "industries: expiry date, alert date, date of removal, eso."
+#~ msgstr ""
+#~ "Gestiona distintas fechas para productos y lotes. Utilizado, por ejemplo, en "
+#~ "industria alimentaria: Fecha de caducidad, fecha de alarma, fecha de "
+#~ "eliminación, ..."
+
+#~ msgid "DLUO"
+#~ msgstr "Fecha caducidad"
+
+#~ msgid "Removal date"
+#~ msgstr "Fecha eliminación"
diff --git a/addons/product_expiry/i18n/fr.po b/addons/product_expiry/i18n/fr.po
index 45cf454a094..13a3e127700 100644
--- a/addons/product_expiry/i18n/fr.po
+++ b/addons/product_expiry/i18n/fr.po
@@ -1,20 +1,19 @@
-# French translation for openobject-addons
-# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2010.
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_expiry
#
msgid ""
msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
+"Project-Id-Version: OpenERP Server 5.0.1\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
-"PO-Revision-Date: 2010-06-21 15:56+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: French \n"
+"PO-Revision-Date: 2010-01-04 18:19+0000\n"
+"Last-Translator: Fabien (Open ERP) \n"
+"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py
index ad9b8252d49..72f18412af4 100644
--- a/addons/product_expiry/product_expiry.py
+++ b/addons/product_expiry/product_expiry.py
@@ -21,21 +21,10 @@
import datetime
from osv import fields, osv
import pooler
-import time
class stock_production_lot(osv.osv):
_name = 'stock.production.lot'
_inherit = 'stock.production.lot'
- def name_get(self, cr, uid, ids, context=None):
- if not len(ids):
- return []
- result = []
- for line in self.browse(cr, uid, ids, context):
- if line.life_date:
- result.append((line.id, (line.name or '')+' ('+line.life_date+')'))
- else:
- result.append((line.id, line.name))
- return result
def _get_date(dtype):
"""Return a function to compute the limit date for this type"""
@@ -52,24 +41,36 @@ class stock_production_lot(osv.osv):
# set date to False when no expiry time specified on the product
date = duration and (datetime.datetime.today()
+ datetime.timedelta(days=duration))
- return date and date.strftime('%Y-%m-%d')
+ return date and date.strftime('%Y-%m-%d %H:%M:%S')
return calc_date
_columns = {
- 'life_date': fields.date('End of Life Date',
+ 'life_date': fields.datetime('End of Life Date',
help='The date the lot may become dangerous and should not be consumed.'),
- 'use_date': fields.date('Best before Date',
+ 'use_date': fields.datetime('Best before Date',
help='The date the lot starts deteriorating without becoming dangerous.'),
- 'removal_date': fields.date('Removal Date',
+ 'removal_date': fields.datetime('Removal Date',
help='The date the lot should be removed.'),
- 'alert_date': fields.date('Alert Date'),
+ 'alert_date': fields.datetime('Alert Date'),
}
+ # Assign dates according to products data
+ def create(self, cr, uid, vals, context=None):
+ newid = super(stock_production_lot, self).create(cr, uid, vals, context=context)
+ obj = self.browse(cr, uid, newid, context=context)
+ towrite = []
+ for f in ('life_date','use_date','removal_date','alert_date'):
+ if not getattr(obj, f):
+ towrite.append(f)
+ context = context or {}
+ context['product_id'] = obj.product_id.id
+ self.write(cr, uid, [obj.id], self.default_get(cr, uid, towrite, context=context))
+ return newid
_defaults = {
- # 'life_date': _get_date('life_time'),
- # 'use_date': _get_date('use_time'),
- # 'removal_date': _get_date('removal_time'),
- # 'alert_date': _get_date('alert_time'),
+ 'life_date': _get_date('life_time'),
+ 'use_date': _get_date('use_time'),
+ 'removal_date': _get_date('removal_time'),
+ 'alert_date': _get_date('alert_time'),
}
stock_production_lot()
diff --git a/addons/product_expiry/report/__init__.py b/addons/product_expiry/report/__init__.py
deleted file mode 100644
index a6006ed47b3..00000000000
--- a/addons/product_expiry/report/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import report_stock
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/product_expiry/report/report_stock.py b/addons/product_expiry/report/report_stock.py
deleted file mode 100644
index bef64eaffa6..00000000000
--- a/addons/product_expiry/report/report_stock.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv, fields
-from tools.translate import _
-import tools
-from tools.sql import drop_view_if_exists
-
-class stock_report_prodlots(osv.osv):
- _name = "stock.report.prodlots1"
- _description = "Stock report by production lots"
- _auto = False
- _columns = {
- 'name': fields.float('Quantity', readonly=True),
- 'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
- 'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True),
- 'life_date': fields.date('End of Life Date',
- help='The date the lot may become dangerous and should not be consumed.'),
- 'use_date': fields.date('Best before Date',
- help='The date the lot starts deteriorating without becoming dangerous.'),
- 'removal_date': fields.date('Removal Date',
- help='The date the lot should be removed.'),
- 'alert_date': fields.date('Alert Date'),
-
- }
-
- def init(self, cr):
- drop_view_if_exists(cr, 'stock_report_prodlots1')
- cr.execute("""
- create or replace view stock_report_prodlots1 as (
- select max(id) as id,
- location_id,
- product_id,
- prodlot_id,
- life_date,
- use_date,
- removal_date,
- alert_date,
- sum(qty) as name
- from (
- select -max(sm.id) as id,
- sm.location_id,
- sm.product_id,
- sm.prodlot_id,
- spl.life_date,
- spl.use_date,
- spl.removal_date,
- spl.alert_date,
- -sum(sm.product_qty /uo.factor) as qty
- from stock_move as sm
- left join stock_location sl
- on (sl.id = sm.location_id)
- left join stock_production_lot spl
- on (sm.prodlot_id=spl.id)
- left join product_uom uo
- on (uo.id=sm.product_uom)
- where state = 'done'
- group by sm.location_id, sm.product_id, sm.product_uom, sm.prodlot_id,
- spl.life_date,
- spl.use_date,
- spl.removal_date,
- spl.alert_date
-
- union all
- select max(sm.id) as id,
- sm.location_dest_id as location_id,
- sm.product_id,
- sm.prodlot_id,
- spl.life_date,
- spl.use_date,
- spl.removal_date,
- spl.alert_date,
- sum(sm.product_qty /uo.factor) as qty
- from stock_move as sm
- left join stock_location sl
- on (sl.id = sm.location_dest_id)
- left join stock_production_lot spl
- on (sm.prodlot_id=spl.id)
- left join product_uom uo
- on (uo.id=sm.product_uom)
- where sm.state = 'done'
- group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.prodlot_id,
- spl.life_date,
- spl.use_date,
- spl.removal_date,
- spl.alert_date
-
- ) as report
- group by location_id, product_id, prodlot_id,
- life_date,
- use_date,
- removal_date,
- alert_date
- )""")
-
- def unlink(self, cr, uid, ids, context={}):
- raise osv.except_osv(_('Error !'), _('You cannot delete any record!'))
-
-
-stock_report_prodlots()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product_expiry/report/report_stock_view.xml b/addons/product_expiry/report/report_stock_view.xml
deleted file mode 100644
index 68198e87dd3..00000000000
--- a/addons/product_expiry/report/report_stock_view.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
- stock.report.prodlots.filter
- stock.report.prodlots1
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots1
- form
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots1
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots1
- graph
-
-
-
-
-
-
-
-
-
-
- Inventory by Location
- ir.actions.act_window
- stock.report.prodlots1
- form
- tree,form
- {'full':'1','search_default_internal_locations':1}
-
-
-
-
-
-
-
-
diff --git a/addons/product_expiry/wizard/__init__.py b/addons/product_expiry/wizard/__init__.py
deleted file mode 100644
index 2b1b55ed6e0..00000000000
--- a/addons/product_expiry/wizard/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-import stock_partial
diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py
deleted file mode 100644
index 6af52951613..00000000000
--- a/addons/product_expiry/wizard/stock_partial.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-from service import web_services
-from tools.misc import UpdateableStr, UpdateableDict
-from tools.translate import _
-import netsvc
-import pooler
-import time
-import datetime, time
-import wizard
-
-class stock_production_lot(osv.osv):
- _inherit = "stock.production.lot"
- def create(self, cr, uid, vals, context={}):
- new_id = super(stock_production_lot, self).create(cr, uid, vals, context=context)
- prodlot_obj = self.pool.get('stock.production.lot')
- prod = prodlot_obj.browse(cr, uid, new_id, context=context)
- res = {}
- current_date = time.strftime('%Y-%m-%d %H:%M:%S')
- if not prod.life_date:
- date_life = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.life_time))
- res['life_date'] = date_life.strftime('%Y-%m-%d')
- if not prod.use_date:
- date_use = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.use_time))
- res['use_date'] = date_use.strftime('%Y-%m-%d')
- if not prod.removal_date:
- date_removal = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.removal_time))
- res['removal_date'] = date_removal.strftime('%Y-%m-%d')
- if not prod.alert_date:
- date_alert = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.alert_time))
- res['alert_date'] = date_alert.strftime('%Y-%m-%d')
- prodlot_obj.write(cr, uid, [prod.id], res)
- return new_id
-stock_production_lot()
-
-class stock_move_split_lines_exist(osv.osv_memory):
- _inherit = "stock.move.split.lines"
- _columns = {
- 'date': fields.date('Expiry Date'),
- }
- # TODO: use this date instead of default one
- def on_change_product(self, cr, uid, ids, product_id):
- if not product_id:
- return {'value':{'date': False}}
- day_life = self.pool.get('product.product').browse(cr, uid, product_id).life_time
- date_life = (datetime.datetime.now() + datetime.timedelta(days=day_life))
- return {'value':
- {'date': date_life.strftime('%Y-%m-%d')}
- }
-stock_move_split_lines_exist()
diff --git a/addons/product_expiry/wizard/stock_partial_view.xml b/addons/product_expiry/wizard/stock_partial_view.xml
deleted file mode 100644
index b42ea07ba40..00000000000
--- a/addons/product_expiry/wizard/stock_partial_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- Split in lots
- stock.move.split
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/product_manufacturer/__openerp__.py b/addons/product_manufacturer/__openerp__.py
index 5d7e8922520..bccabe95283 100644
--- a/addons/product_manufacturer/__openerp__.py
+++ b/addons/product_manufacturer/__openerp__.py
@@ -20,8 +20,8 @@
{
"name" : "Products Attributes & Manufacturers",
"version" : "1.0",
- "author" : "Tiny",
- "category" : "Enterprise Specific Modules/Industries",
+ "author" : "OpenERP SA",
+ "category" : "Enterprise Specific Modules/Manufacturer Industries",
"depends" : ["base", "account", "product", "stock"],
"init_xml" : [],
"demo_xml" : [],
diff --git a/addons/product_manufacturer/i18n/fr_BE.po b/addons/product_manufacturer/i18n/fr_BE.po
index 2fc936e9dfc..11351ba679d 100644
--- a/addons/product_manufacturer/i18n/fr_BE.po
+++ b/addons/product_manufacturer/i18n/fr_BE.po
@@ -1,6 +1,6 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * product_electronic
+# * product_manufacturer
#
msgid ""
msgstr ""
@@ -15,88 +15,88 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
-#. module: product_electronic
-#: model:ir.module.module,description:product_electronic.module_meta_information
+#. module: product_manufacturer
+#: model:ir.module.module,description:product_manufacturer.module_meta_information
msgid "A module that add manufacturers and attributes on the product form"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer_pref:0
msgid "Manufacturer product code"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
-#. module: product_electronic
-#: view:product.electronic.attribute:0
+#. module: product_manufacturer
+#: view:product.manufacturer.attribute:0
msgid "Product Template Name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
-#. module: product_electronic
-#: model:ir.model,name:product_electronic.model_product_electronic_attribute
+#. module: product_manufacturer
+#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute
msgid "Product attributes"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing data"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Product reference"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,name:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,name:0
msgid "Attribute"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,product_id:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,product_id:0
msgid "Product"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,value:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,value:0
msgid "Value"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing Data"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Product name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
#: field:product.product,attribute_ids:0
msgid "Attributes"
msgstr ""
-#. module: product_electronic
-#: model:ir.module.module,shortdesc:product_electronic.module_meta_information
+#. module: product_manufacturer
+#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information
msgid "Products Attributes & Manufacturers"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer_pname:0
msgid "Manufacturer product name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer:0
msgid "Manufacturer"
msgstr ""
diff --git a/addons/product_manufacturer/i18n/product_manufacturer.pot b/addons/product_manufacturer/i18n/product_electronic.pot
similarity index 61%
rename from addons/product_manufacturer/i18n/product_manufacturer.pot
rename to addons/product_manufacturer/i18n/product_electronic.pot
index 2fc936e9dfc..11351ba679d 100644
--- a/addons/product_manufacturer/i18n/product_manufacturer.pot
+++ b/addons/product_manufacturer/i18n/product_electronic.pot
@@ -1,6 +1,6 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * product_electronic
+# * product_manufacturer
#
msgid ""
msgstr ""
@@ -15,88 +15,88 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
-#. module: product_electronic
-#: model:ir.module.module,description:product_electronic.module_meta_information
+#. module: product_manufacturer
+#: model:ir.module.module,description:product_manufacturer.module_meta_information
msgid "A module that add manufacturers and attributes on the product form"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer_pref:0
msgid "Manufacturer product code"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
-#. module: product_electronic
-#: view:product.electronic.attribute:0
+#. module: product_manufacturer
+#: view:product.manufacturer.attribute:0
msgid "Product Template Name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
-#. module: product_electronic
-#: model:ir.model,name:product_electronic.model_product_electronic_attribute
+#. module: product_manufacturer
+#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute
msgid "Product attributes"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing data"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Product reference"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,name:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,name:0
msgid "Attribute"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,product_id:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,product_id:0
msgid "Product"
msgstr ""
-#. module: product_electronic
-#: field:product.electronic.attribute,value:0
+#. module: product_manufacturer
+#: field:product.manufacturer.attribute,value:0
msgid "Value"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing Data"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
msgid "Product name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: view:product.product:0
#: field:product.product,attribute_ids:0
msgid "Attributes"
msgstr ""
-#. module: product_electronic
-#: model:ir.module.module,shortdesc:product_electronic.module_meta_information
+#. module: product_manufacturer
+#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information
msgid "Products Attributes & Manufacturers"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer_pname:0
msgid "Manufacturer product name"
msgstr ""
-#. module: product_electronic
+#. module: product_manufacturer
#: field:product.product,manufacturer:0
msgid "Manufacturer"
msgstr ""
diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py
index d77ab518efe..969b4ce69cf 100644
--- a/addons/product_manufacturer/product_manufacturer.py
+++ b/addons/product_manufacturer/product_manufacturer.py
@@ -24,26 +24,13 @@ class product_product(osv.osv):
_inherit = 'product.product'
_name = 'product.product'
_columns = {
+ 'manufacturer' : fields.many2one('res.partner', 'Manufacturer'),
+ 'manufacturer_pname' : fields.char('Manufacturer Product Name', size=64),
+ 'manufacturer_pref' : fields.char('Manufacturer Product Code', size=64),
'attribute_ids': fields.one2many('product.manufacturer.attribute', 'product_id', 'Attributes'),
- 'manufacturer_ids': fields.one2many('res.partner.manufacturer', 'product_id', 'Manufacturers'),
}
product_product()
-class res_partner_manufacturer(osv.osv):
- _name = 'res.partner.manufacturer'
- _rec_name = 'manufacturer_id'
- _columns = {
- 'manufacturer_id' : fields.many2one('res.partner', 'Manufacturer'),
- 'country_id' : fields.many2one('res.country', 'Country'),
- 'authorized' : fields.boolean('Authorized'),
- 'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
- }
- _defaults = {
- 'authorized': lambda *a: True,
- }
-
-res_partner_manufacturer()
-
class product_attribute(osv.osv):
_name = "product.manufacturer.attribute"
_description = "Product attributes"
diff --git a/addons/product_manufacturer/product_manufacturer_view.xml b/addons/product_manufacturer/product_manufacturer_view.xml
index cfd7f23ae8d..1d1f952cd4d 100644
--- a/addons/product_manufacturer/product_manufacturer_view.xml
+++ b/addons/product_manufacturer/product_manufacturer_view.xml
@@ -1,72 +1,56 @@
-
+
-
- product.normal.form
- product.product
-
- form
-
-
-
-
-
+
+ product.normal.form
+ product.product
+
+ form
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
- product.manufacturer.attribute.tree
- product.manufacturer.attribute
- tree
-
-
-
-
-
-
-
-
- product.manufacturer.attribute.form
- product.manufacturer.attribute
- form
-
-
-
-
+
+ product.manufacturer.attribute.tree
+ product.manufacturer.attribute
+ tree
+
+
+
+
+
+
+
+
+ product.manufacturer.attribute.form
+ product.manufacturer.attribute
+ form
+
+
+
+
-
- res.partner.manufacturer.tree
- res.partner.manufacturer
- tree
-
-
-
-
-
-
-
-
-
- res.partner.manufacturer.form
- res.partner.manufacturer
- form
-
-
-
-
-
+
diff --git a/addons/product_manufacturer/security/ir.model.access.csv b/addons/product_manufacturer/security/ir.model.access.csv
index 1d3f9af7a2b..6f07fb1dc94 100644
--- a/addons/product_manufacturer/security/ir.model.access.csv
+++ b/addons/product_manufacturer/security/ir.model.access.csv
@@ -1,5 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",,1,0,0,0
+"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,0,0,0
"access_product_manufacturer_attribute_manager","product.manufacturer.attribute","model_product_manufacturer_attribute","product.group_product_manager",1,1,1,1
-"access_partner_manufacturer","res.partner.manufacturer","model_res_partner_manufacturer",,1,0,0,0
-"access_partner_manufacturer_manager","res.partner.manufacturer","model_res_partner_manufacturer","product.group_product_manager",1,1,1,1
diff --git a/addons/sale/board_sale_view.xml b/addons/sale/board_sale_view.xml
index 555390d1921..c89b90ecb65 100644
--- a/addons/sale/board_sale_view.xml
+++ b/addons/sale/board_sale_view.xml
@@ -30,7 +30,7 @@