diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml
index 4c6faae9e19..50e431935bc 100644
--- a/addons/account/account_installer.xml
+++ b/addons/account/account_installer.xml
@@ -19,26 +19,26 @@
position="attributes">
You can enhance OpenERP's basic accounting support with a few additional OpenERP applications.
-
+
Configure
23
-
-
-
+
+
+
-
+
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
@@ -88,12 +88,12 @@
account_installer_action_replace
tree
-
-
-
+
+
+
-
+
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 6c031955cc9..a91d4d7eb33 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -488,20 +488,5 @@
-
-
-
- res.partner.invoice.info.inherit
- res.partner
- form
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 84dd2c90e7c..c599c7c4447 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -577,13 +577,16 @@ class account_move_line(osv.osv):
# writeoff; entry generated for the difference between the lines
#
- def reconcile_partial(self, cr, uid, ids, type='auto', context={}):
+ def reconcile_partial(self, cr, uid, ids, type='auto', context=None):
merges = []
unmerge = []
total = 0.0
merges_rec = []
company_list = []
+ if context is None:
+ context = {}
+
for line in self.browse(cr, uid, ids, context=context):
if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
@@ -613,13 +616,15 @@ class account_move_line(osv.osv):
self.pool.get('account.move.reconcile').reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context)
return True
- def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}):
+ def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None):
lines = self.browse(cr, uid, ids, context=context)
unrec_lines = filter(lambda x: not x['reconcile_id'], lines)
credit = debit = 0.0
currency = 0.0
account_id = False
partner_id = False
+ if context is None:
+ context = {}
company_list = []
for line in self.browse(cr, uid, ids, context=context):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 94fd5c664ed..7df04b0f3f4 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1554,7 +1554,7 @@
-
+
Account Add wizard
@@ -1577,7 +1577,7 @@
res_model="account.addtmpl.wizard"
context="{'tmpl_ids': active_id}"
src_model="account.account.template"
- view_type="form" view_mode="form"/>
+ view_type="form" view_mode="form"/>
Generate Chart of Accounts from a Chart Template
- Generate Chart of Accounts from a Chart Template
-
-
- This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template
- 150
-
-
- 15
-
-
+
+
+ This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template
+ 150
+
+
+ 15
+
+
diff --git a/addons/account/partner.py b/addons/account/partner.py
index 215c4286315..2497aaa447c 100644
--- a/addons/account/partner.py
+++ b/addons/account/partner.py
@@ -89,7 +89,7 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_description = 'Partner'
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
- query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
+ query = self.pool.get('account.move.line')._query_get(cr, 1, context=context)
cr.execute("""select
l.partner_id, a.type, sum(l.debit-l.credit)
from
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 72004afa944..e7e2dc8d92a 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -118,7 +118,6 @@
-
@@ -126,21 +125,14 @@
-
- res.partner.account.info.inherit
- res.partner
- form
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/addons/account/process/customer_invoice_process.xml b/addons/account/process/customer_invoice_process.xml
index b9710276509..fd1b65708b2 100644
--- a/addons/account/process/customer_invoice_process.xml
+++ b/addons/account/process/customer_invoice_process.xml
@@ -39,7 +39,7 @@
-
+
diff --git a/addons/account/process/supplier_invoice_process.xml b/addons/account/process/supplier_invoice_process.xml
index 26e1e9862e7..080cc5cb984 100644
--- a/addons/account/process/supplier_invoice_process.xml
+++ b/addons/account/process/supplier_invoice_process.xml
@@ -39,7 +39,7 @@
-
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 03037963ded..067fbd38ab1 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -312,23 +312,23 @@
[('journal_id','=',active_id)]
-
+
-
+
-
+
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index beb3e4e8ebb..67f3bf65f61 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -24,7 +24,11 @@
-
- Entry lines
+ Entry lines
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Journal Period
+ Journal Period
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Journal multi-company
+ Journal multi-company
- ['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Analytic journal multi-company
+ Analytic journal multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Analytic journal multi-company
+ Analytic journal multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Period multi-company
+ Period multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Fiscal year multi-company
+ Fiscal year multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Account multi-company
+ Account multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Tax multi-company
+ Tax multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Tax code multi-company
+ Tax code multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Invoice multi-company
+ Invoice multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 7458594d240..826e2076033 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -1,4 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_product_product_account_user","product.product.account.user","product.model_product_product","group_account_user",1,0,0,0
"access_account_payment_term","account.payment.term","model_account_payment_term","account.group_account_user",1,0,0,0
"access_account_payment_term_line","account.payment.term.line","model_account_payment_term_line","account.group_account_user",1,0,0,0
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
@@ -69,7 +70,6 @@
"access_account_add_tmpl_wizard_system_manager","account.addtmpl.wizard system manager","model_account_addtmpl_wizard","base.group_system",1,1,1,1
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
-"access_account_invoice_user","account.invoice.tax user","model_account_invoice_tax","base.group_user",1,0,0,0
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
@@ -85,7 +85,7 @@
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0
-"access_account_installer","account.installer","model_account_installer","base.group_user",1,0,0,0
+"access_account_installer","account.installer","model_account_installer","base.group_system",1,1,1,1
"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,0,0,0
"access_temp_range","temp.range","model_temp_range","account.group_account_manager",1,0,0,0
"access_report_aged_receivable","report.aged.receivable","model_report_aged_receivable","account.group_account_manager",1,0,0,0
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index 2370c6dbe13..2a81dd9e62d 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -31,15 +31,16 @@ class account_automatic_reconcile(osv.osv_memory):
_columns = {
'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Account to reconcile', domain = [('reconcile','=',1)], \
help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'),
- 'writeoff_acc_id': fields.many2one('account.account', 'Account', required=True),
- 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
- 'period_id': fields.many2one('account.period', 'Period', required=True),
+ 'writeoff_acc_id': fields.many2one('account.account', 'Account'),
+ 'journal_id': fields.many2one('account.journal', 'Journal'),
+ 'period_id': fields.many2one('account.period', 'Period'),
'max_amount': fields.float('Maximum write-off amount'),
'power': fields.selection([(p, str(p)) for p in range(2, 10)], 'Power', required=True),
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
'reconciled': fields.integer('Reconciled transactions', readonly=True),
'unreconciled': fields.integer('Not reconciled transactions', readonly=True),
+ 'allow_write_off': fields.boolean('Allow write off')
}
def _get_reconciled(self, cr, uid, context={}):
@@ -134,7 +135,6 @@ class account_automatic_reconcile(osv.osv_memory):
return (reconciled, len(credits)+len(debits))
def reconcile(self, cr, uid, ids, context=None):
- service = netsvc.LocalService("object_proxy")
move_line_obj = self.pool.get('account.move.line')
obj_model = self.pool.get('ir.model.data')
if context is None:
@@ -146,16 +146,18 @@ class account_automatic_reconcile(osv.osv_memory):
if not form['account_ids']:
raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile'))
for account_id in form['account_ids']:
+ if not context.get('allow_write_off', False):
+ query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
+ AND state <> 'draft' GROUP BY partner_id \
+ HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0)
+# query="SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
+# AND state <> 'draft' GROUP BY partner_id AND debit = credi"%(account_id)
+ else:
+ query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
+ AND state <> 'draft' GROUP BY partner_id \
+ HAVING ABS(SUM(debit-credit)) <= %s AND count(*)>0"%(account_id, max_amount or 0.0)
# reconcile automatically all transactions from partners whose balance is 0
- cr.execute(
- "SELECT partner_id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "GROUP BY partner_id " \
- "HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0",
- (account_id, max_amount or 0.0))
+ cr.execute(query)
partner_ids = [id for (id,) in cr.fetchall()]
for partner_id in partner_ids:
cr.execute(
@@ -168,63 +170,67 @@ class account_automatic_reconcile(osv.osv_memory):
(account_id, partner_id))
line_ids = [id for (id,) in cr.fetchall()]
if len(line_ids):
- move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
reconciled += len(line_ids)
+ if not context.get('allow_write_off', False):
+ move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
+ else:
+ move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- # get the list of partners who have more than one unreconciled transaction
- cr.execute(
- "SELECT partner_id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND partner_id IS NOT NULL " \
- "GROUP BY partner_id " \
- "HAVING count(*)>1",
- (account_id,))
- partner_ids = [id for (id,) in cr.fetchall()]
- #filter?
- for partner_id in partner_ids:
- # get the list of unreconciled 'debit transactions' for this partner
- cr.execute(
- "SELECT id, debit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND debit > 0",
- (account_id, partner_id))
- debits = cr.fetchall()
+ # get the list of partners who have more than one unreconciled transaction
+ cr.execute(
+ "SELECT partner_id " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND partner_id IS NOT NULL " \
+ "GROUP BY partner_id " \
+ "HAVING count(*)>1",
+ (account_id,))
+ partner_ids = [id for (id,) in cr.fetchall()]
+ #filter?
+ for partner_id in partner_ids:
+ # get the list of unreconciled 'debit transactions' for this partner
+ cr.execute(
+ "SELECT id, debit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND debit > 0",
+ (account_id, partner_id))
+ debits = cr.fetchall()
- # get the list of unreconciled 'credit transactions' for this partner
- cr.execute(
- "SELECT id, credit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND credit > 0",
- (account_id, partner_id))
- credits = cr.fetchall()
+ # get the list of unreconciled 'credit transactions' for this partner
+ cr.execute(
+ "SELECT id, credit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND credit > 0",
+ (account_id, partner_id))
+ credits = cr.fetchall()
- (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- reconciled += rec
- unreconciled += unrec
+ (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
+ reconciled += rec
+ unreconciled += unrec
- # add the number of transactions for partners who have only one
- # unreconciled transactions to the unreconciled count
- partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
- cr.execute(
- "SELECT count(*) " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " + partner_filter,
- (account_id,))
- additional_unrec = cr.fetchone()[0]
- context.update({'reconciled': reconciled, 'unreconciled': unreconciled + additional_unrec})
+ # add the number of transactions for partners who have only one
+ # unreconciled transactions to the unreconciled count
+ partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
+ cr.execute(
+ "SELECT count(*) " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " + partner_filter,
+ (account_id,))
+ additional_unrec = cr.fetchone()[0]
+ unreconciled = unreconciled + additional_unrec
+ context.update({'reconciled': reconciled, 'unreconciled': unreconciled})
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_automatic_reconcile_view1')])
resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
return {
diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml
index 5afbbed7eed..4cb5915f8e4 100644
--- a/addons/account/wizard/account_automatic_reconcile_view.xml
+++ b/addons/account/wizard/account_automatic_reconcile_view.xml
@@ -8,20 +8,28 @@
form
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
@@ -64,4 +72,3 @@
-
diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py
index be0ebc40677..e12ff69dc0a 100644
--- a/addons/account/wizard/account_reconcile.py
+++ b/addons/account/wizard/account_reconcile.py
@@ -56,11 +56,11 @@ class account_move_line_reconcile(osv.osv_memory):
if 'trans_nbr' in fields:
res.update({'trans_nbr':data['trans_nbr']})
if 'credit' in fields:
- res.update({'trans_nbr':data['credit']})
+ res.update({'credit':data['credit']})
if 'debit' in fields:
- res.update({'trans_nbr':data['debit']})
+ res.update({'debit':data['debit']})
if 'writeoff' in fields:
- res.update({'trans_nbr':data['writeoff']})
+ res.update({'writeoff':data['writeoff']})
return res
def partial_check(self, cr, uid, ids, context=None):
diff --git a/addons/account_budget/wizard/account_budget_spread.py b/addons/account_budget/wizard/account_budget_spread.py
index ab2eb3d0bf6..f8a627ce070 100644
--- a/addons/account_budget/wizard/account_budget_spread.py
+++ b/addons/account_budget/wizard/account_budget_spread.py
@@ -32,13 +32,12 @@ class account_budget_spread(osv.osv_memory):
}
def check_spread(self, cr, uid, ids, context=None):
- service = netsvc.LocalService("object_proxy")
if context is None:
context = {}
- data = self.read(cr, uid, ids, [])[0]
- res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', context['active_ids'], data['fiscalyear'], data['amount'])
+ data = self.browse(cr, uid, ids, context=context)[0]
+ res = self.pool.get('account.budget.post').spread(cr, uid, context['active_ids'], data.fiscalyear.id, data.amount)
return {}
account_budget_spread()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_payment/__init__.py b/addons/account_payment/__init__.py
index 3724590e5f5..82a05aa73e9 100644
--- a/addons/account_payment/__init__.py
+++ b/addons/account_payment/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -23,11 +23,10 @@
# Init Sales
#----------------------------------------------------------
-import payment
+import account_payment
import wizard
import account_move_line
import account_invoice
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index 98b76d05088..cd0e162df17 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -41,11 +41,11 @@
'wizard/account_payment_pay_view.xml',
'wizard/account_payment_populate_statement_view.xml',
'wizard/account_payment_create_order_view.xml',
- 'payment_view.xml',
- 'payment_workflow.xml',
- 'payment_sequence.xml',
+ 'account_payment_view.xml',
+ 'account_payment_workflow.xml',
+ 'account_payment_sequence.xml',
'account_invoice_view.xml',
- 'payment_report.xml',
+ 'account_payment_report.xml',
],
'demo_xml': [],
'test': ['test/account_payment.yml'],
diff --git a/addons/account_payment/payment.py b/addons/account_payment/account_payment.py
similarity index 98%
rename from addons/account_payment/payment.py
rename to addons/account_payment/account_payment.py
index 8e300f7072a..20d8ff1afd7 100644
--- a/addons/account_payment/payment.py
+++ b/addons/account_payment/account_payment.py
@@ -18,29 +18,25 @@
# along with this program. If not, see .
#
##############################################################################
-
-from osv import fields
-from osv import osv
import time
-import netsvc
-import pooler
+from osv import osv, fields
+import netsvc
class payment_type(osv.osv):
_name= 'payment.type'
_description= 'Payment Type'
_columns= {
- 'name': fields.char('Name', size=64, required=True,help='Payment Type'),
- 'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'),
+ 'name': fields.char('Name', size=64, required=True, help='Payment Type'),
+ 'code': fields.char('Code', size=64, required=True, help='Specifies the Code for Payment Type'),
'suitable_bank_types': fields.many2many('res.partner.bank.type',
'bank_type_payment_type_rel',
'pay_type_id','bank_type_id',
'Suitable bank types')
- }
+ }
payment_type()
-
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment Mode'
@@ -66,16 +62,14 @@ class payment_mode(osv.osv):
where pm.id = %s """, [payment_code])
return [x[0] for x in cr.fetchall()]
-
payment_mode()
-
class payment_order(osv.osv):
_name = 'payment.order'
_description = 'Payment Order'
_rec_name = 'reference'
- def get_wizard(self,type):
+ def get_wizard(self, type):
logger = netsvc.Logger()
logger.notifyChannel("warning", netsvc.LOG_WARNING,
"No wizard found for the payment type '%s'." % type)
@@ -146,7 +140,6 @@ class payment_order(osv.osv):
payment_order()
-
class payment_line(osv.osv):
_name = 'payment.line'
_description = 'Payment Line'
diff --git a/addons/account_payment/payment_report.xml b/addons/account_payment/account_payment_report.xml
similarity index 100%
rename from addons/account_payment/payment_report.xml
rename to addons/account_payment/account_payment_report.xml
diff --git a/addons/account_payment/payment_sequence.xml b/addons/account_payment/account_payment_sequence.xml
similarity index 100%
rename from addons/account_payment/payment_sequence.xml
rename to addons/account_payment/account_payment_sequence.xml
diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/account_payment_view.xml
similarity index 100%
rename from addons/account_payment/payment_view.xml
rename to addons/account_payment/account_payment_view.xml
diff --git a/addons/account_payment/payment_workflow.xml b/addons/account_payment/account_payment_workflow.xml
similarity index 100%
rename from addons/account_payment/payment_workflow.xml
rename to addons/account_payment/account_payment_workflow.xml
diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py
index 5e37bd79488..81f5e4a570f 100644
--- a/addons/account_payment/wizard/account_payment_order.py
+++ b/addons/account_payment/wizard/account_payment_order.py
@@ -110,8 +110,7 @@ class payment_order_create(osv.osv_memory):
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
- return {
- 'name': ('Entrie Lines'),
+ return {'name': ('Entrie Lines'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
diff --git a/addons/account_payment/wizard/account_payment_pay.py b/addons/account_payment/wizard/account_payment_pay.py
index 74e1566520c..20e1e10f882 100644
--- a/addons/account_payment/wizard/account_payment_pay.py
+++ b/addons/account_payment/wizard/account_payment_pay.py
@@ -18,16 +18,13 @@
# along with this program. If not, see .
#
##############################################################################
-import time
from osv import fields, osv
class account_payment_make_payment(osv.osv_memory):
_name = 'account.payment.make.payment'
_description = 'Account make payment'
- _columns = {
- }
- def launch_wizard(self, cr, uid, ids, context):
+ def launch_wizard(self, cr, uid, ids, context=None):
"""
Search for a wizard to launch according to the type.
If type is manual. just confirm the order.
@@ -35,8 +32,8 @@ class account_payment_make_payment(osv.osv_memory):
obj_payment_order = self.pool.get('payment.order')
obj_model = self.pool.get('ir.model.data')
obj_act = self.pool.get('ir.actions.act_window')
- order= obj_payment_order.browse(cr,uid,context['active_id'],context)
- t= order.mode and order.mode.type.code or 'manual'
+ order= obj_payment_order.browse(cr, uid, context['active_id'], context)
+ t = order.mode and order.mode.type.code or 'manual'
if t == 'manual' :
obj_payment_order.set_done(cr,uid,context['active_id'],context)
return {}
@@ -49,12 +46,10 @@ class account_payment_make_payment(osv.osv_memory):
module, wizard= gw
result = mod_obj._get_id(cr, uid, module, wizard)
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id])[0]
+ return act_obj.read(cr, uid, [id])[0]
#result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
- return result
account_payment_make_payment()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_payment/wizard/account_payment_pay_view.xml b/addons/account_payment/wizard/account_payment_pay_view.xml
index 322c0a72e48..566359d8b32 100644
--- a/addons/account_payment/wizard/account_payment_pay_view.xml
+++ b/addons/account_payment/wizard/account_payment_pay_view.xml
@@ -8,7 +8,7 @@
form
-
+
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index ed250f0aaf0..3dff856b716 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -37,7 +37,7 @@
"category" : "Generic Modules/Accounting",
"website" : "http://tinyerp.com",
"depends" : [
- "base",
+ "base",
"account"
],
"init_xml" : [
@@ -54,8 +54,12 @@
"voucher_view.xml",
"voucher_wizard.xml",
"wizard/account_voucher_open_view.xml",
-
+
],
+ "test" : [
+ "test/account_voucher.yml",
+ ],
+
'certificate': '0037580727101',
"active": False,
"installable": True,
diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml
new file mode 100644
index 00000000000..a49222c3b96
--- /dev/null
+++ b/addons/account_voucher/test/account_voucher.yml
@@ -0,0 +1,116 @@
+
+-
+ In order to check account voucher module in OpenERP I create a customer voucher
+-
+ !record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
+ account_id: account.cash
+ company_id: base.main_company
+ currency_id: base.EUR
+ journal_id: account.bank_journal
+ name: Voucher for Axelor
+ narration: Basic Pc
+ payment_ids:
+ - account_id: account.a_recv
+ amount: 1000.0
+ name: Voucher for Axelor
+ partner_id: base.res_partner_desertic_hispafuentes
+ period_id: account.period_6
+ reference_type: none
+
+-
+ I check that Initially customer voucher is in the "Draft" state
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
+ - state == 'draft'
+-
+ I change the state of voucher to "proforma" by clicking PRO-FORMA button
+-
+ !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucherforaxelor0}
+-
+ I check that the voucher state is now "proforma"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
+ - state == 'proforma'
+-
+ I create voucher by clicking on Create button
+-
+ !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}
+-
+ I check that the voucher state is "Waiting for re-checking"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
+ - state == 'recheck'
+-
+ I clicked on Validate Button
+-
+ !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucherforaxelor0}
+-
+ I check that the voucher state is "posted"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
+ - state == 'posted'
+
+-
+ I check that Moves get created for this voucher
+-
+ !python {model: account.voucher}: |
+ acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor0"))
+ assert(acc_id.move_id)
+
+
+-
+ Now I create a Vendor Voucher
+-
+ !record {model: account.voucher, id: account_voucher_voucheraxelor0}:
+ account_id: account.cash
+ company_id: base.main_company
+ currency_id: base.EUR
+ journal_id: account.bank_journal
+ name: Voucher Axelor
+ narration: Basic PC
+ payment_ids:
+ - account_id: account.cash
+ amount: 1000.0
+ name: Voucher Axelor
+ period_id: account.period_6
+ reference_type: none
+
+-
+ I check that Initially vendor voucher is in the "Draft" state
+-
+ !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
+ - state == 'draft'
+-
+ I change the state of voucher to "proforma" by clicking PRO-FORMA button
+-
+ !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucheraxelor0}
+-
+ I check that the voucher state is now "proforma"
+-
+ !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
+ - state == 'proforma'
+-
+ I create voucher by clicking on Create button
+-
+ !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucheraxelor0}
+-
+ I check that the voucher state is "Waiting for re-checking"
+-
+ !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
+ - state == 'recheck'
+-
+ I clicked on Validate Button
+-
+ !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucheraxelor0}
+-
+ I check that the voucher state is "posted"
+-
+ !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
+ - state == 'posted'
+
+-
+ I check that moves get created for this voucher
+-
+ !python {model: account.voucher}: |
+ acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0"))
+ assert(acc_id.move_id)
diff --git a/addons/account_voucher_payment/__terp__.py b/addons/account_voucher_payment/__openerp__.py
similarity index 92%
rename from addons/account_voucher_payment/__terp__.py
rename to addons/account_voucher_payment/__openerp__.py
index 83864a543be..fa1b37399f6 100755
--- a/addons/account_voucher_payment/__terp__.py
+++ b/addons/account_voucher_payment/__openerp__.py
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
{
@@ -23,24 +23,29 @@
"version" : "1.0",
"author" : 'Tiny & Axelor',
"description": """This module includes :
- * It reconcile the invoice (supplier, customer) while paying through
+ * It reconcile the invoice (supplier, customer) while paying through
Accounting Vouchers
""",
"category" : "Generic Modules/Indian Accounting",
"website" : "http://tinyerpindia.com",
"depends" : [
- "base",
+ "base",
"account",
"account_voucher",
],
"init_xml" : [
],
-
+
"demo_xml" : [],
"update_xml" : [
"account_voucher_payment_view.xml",
"account_voucher_payment_wizard.xml"
],
+ "test" : [
+# "test/account_voucher.yml",
+ "test/account_voucher_payment.yml",
+ ],
+
"active": False,
"installable": True,
}
diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py
index 1cd1da98208..bf03c90c522 100755
--- a/addons/account_voucher_payment/account_voucher_payment.py
+++ b/addons/account_voucher_payment/account_voucher_payment.py
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -35,9 +35,9 @@ class account_voucher(osv.osv):
_columns = {
'voucher_line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
}
-
+
def action_move_line_create(self, cr, uid, ids, *args):
-
+
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
@@ -55,12 +55,12 @@ class account_voucher(osv.osv):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
-
+
date = inv.date
total_currency = 0
for i in iml:
partner_id=i['partner_id']
- acc_id = i['account_id']
+ acc_id = i['account_id']
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['amount']
@@ -97,19 +97,19 @@ class account_voucher(osv.osv):
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x,date, context={})) ,iml)
an_journal_id=inv.journal_id.analytic_journal_id.id
journal_id = inv.journal_id.id
-
+
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
if journal.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
move = {
- 'name': name,
- 'journal_id': journal_id,
+ 'name': name,
+ 'journal_id': journal_id,
'voucher_type':inv.type,
'narration' : inv.narration,
'data':date
}
-
+
if inv.period_id:
move['period_id'] = inv.period_id.id
for i in line:
@@ -128,7 +128,7 @@ class account_voucher(osv.osv):
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'partner_id': False,
- 'ref': ref,
+ 'ref': ref,
'date': date
}
if inv.type in ('rec_voucher', 'bank_rec_voucher', 'journal_pur_voucher', 'journal_voucher'):
@@ -144,15 +144,15 @@ class account_voucher(osv.osv):
'voucher_invoice' : iml and iml[0]['invoice'] and iml[0]['invoice'].id or False,
'debit':False,
'credit':False,
- 'move_id':move_id,
+ 'move_id':move_id,
'account_id':line.account_id.id or False,
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'partner_id':line.partner_id.id or False,
- 'ref':ref,
+ 'ref':ref,
'date':date
}
-
+
if line.type == 'dr':
move_line['debit'] = line.amount or False
amount=line.amount
@@ -161,7 +161,7 @@ class account_voucher(osv.osv):
amount=line.amount * (-1)
ml_id=self.pool.get('account.move.line').create(cr, uid, move_line)
id_mapping_dict[line.id] = ml_id
-
+
total = 0.0
mline = self.pool.get('account.move.line')
if line.invoice_id.id:
@@ -180,7 +180,7 @@ class account_voucher(osv.osv):
line.name=inv.narration
else:
line.name=line.name
-
+
if line.account_analytic_id:
an_line = {
'name':line.name,
@@ -197,22 +197,22 @@ class account_voucher(osv.osv):
self.pool.get('account.move.line').reconcile_partial(cr, uid, mline_ids, 'manual', context={})
self.write(cr, uid, [inv.id], {'move_id': move_id})
obj=self.pool.get('account.move').browse(cr, uid, move_id)
-
+
for line in obj.line_id :
cr.execute('insert into voucher_id (account_id,rel_account_move) values (%d, %d)',(int(ids[0]),int(line.id)))
-
+
return True
account_voucher()
class account_voucher_line(osv.osv):
_inherit = 'account.voucher.line'
-
+
def default_get(self, cr, uid, fields, context={}):
data = super(account_voucher_line, self).default_get(cr, uid, fields, context)
self.voucher_context = context
return data
-
+
_columns = {
'invoice_id' : fields.many2one('account.invoice','Invoice'),
}
@@ -220,8 +220,8 @@ class account_voucher_line(osv.osv):
def move_line_get_item(self, cr, uid, line, context={}):
res = super(account_voucher_line, self).move_line_get_item(cr, uid, line, context)
res['invoice'] = line.invoice_id or False
- return res
-
+ return res
+
def onchange_invoice_id(self, cr, uid, ids, invoice_id, context={}):
lines = []
if 'lines' in self.voucher_context:
@@ -233,27 +233,27 @@ class account_voucher_line(osv.osv):
residual = invoice_obj.residual
same_invoice_amounts = [x['amount'] for x in lines if x['invoice_id']==invoice_id]
residual -= sum(same_invoice_amounts)
- return {'value' : {'amount':residual}}
-
+ return {'value' : {'amount':residual}}
+
def onchange_line_account(self, cr, uid, ids, account_id, type, type1):
if not account_id:
return {'value' : {'account_id' : False, 'type' : False ,'amount':False}}
obj = self.pool.get('account.account')
acc_id = False
-
+
if type1 in ('rec_voucher','bank_rec_voucher', 'journal_voucher'):
acc_id = obj.browse(cr, uid, account_id)
balance = acc_id.credit
type = 'cr'
- elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
+ elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
acc_id = obj.browse(cr, uid, account_id)
balance = acc_id.debit
type = 'dr'
- elif type1 in ('journal_sale_vou') :
+ elif type1 in ('journal_sale_vou') :
acc_id = obj.browse(cr, uid, account_id)
balance = acc_id.credit
type = 'dr'
- elif type1 in ('journal_pur_voucher') :
+ elif type1 in ('journal_pur_voucher') :
acc_id = obj.browse(cr, uid, account_id)
balance = acc_id.debit
type = 'cr'
@@ -265,7 +265,7 @@ account_voucher_line()
class account_invoice(osv.osv):
_inherit = "account.invoice"
-
+
def action_cancel(self, cr, uid, ids, *args):
res = super(account_invoice, self).action_cancel(cr, uid, ids, *args)
invoices = self.read(cr, uid, ids, ['move_id'])
@@ -276,7 +276,7 @@ class account_invoice(osv.osv):
move_ids = move_db.search(cr, uid, [])
move_obj = move_db.browse(cr, uid, move_ids)
return res
-
+
account_invoice()
diff --git a/addons/account_voucher_payment/account_voucher_unreconcile.py b/addons/account_voucher_payment/account_voucher_unreconcile.py
index a209fe13ba0..f36af98dc1c 100644
--- a/addons/account_voucher_payment/account_voucher_unreconcile.py
+++ b/addons/account_voucher_payment/account_voucher_unreconcile.py
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -32,11 +32,11 @@ _info_form = '''
def _trans_unrec(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
voucher = pool.get('account.voucher').browse(cr, uid, data.get('id'))
- recs = None
+ recs = []
for line in voucher.move_ids:
if line.reconcile_id:
recs = [line.reconcile_id.id]
-
+
for rec in recs:
pool.get('account.move.reconcile').unlink(cr, uid, rec)
return {}
diff --git a/addons/account_voucher_payment/test/account_voucher_payment.yml b/addons/account_voucher_payment/test/account_voucher_payment.yml
new file mode 100644
index 00000000000..8bcea6a23a4
--- /dev/null
+++ b/addons/account_voucher_payment/test/account_voucher_payment.yml
@@ -0,0 +1,118 @@
+-
+ In order to test account_voucher_payment module in OpenERP I create an invoice and paid it through voucher
+-
+ I create a customer invoice record
+-
+ !record {model: account.invoice, id: account_invoice_voucher_payment}:
+ account_id: account.a_recv
+ address_contact_id: base.res_partner_address_3000
+ address_invoice_id: base.res_partner_address_3000
+ company_id: base.main_company
+ currency_id: base.EUR
+ invoice_line:
+ - account_id: account.a_sale
+ name: '[PC1] Basic PC'
+ price_unit: 450.0
+ quantity: 1.0
+ product_id: product.product_product_pc1
+ uos_id: product.product_uom_unit
+ journal_id: account.sales_journal
+ partner_id: base.res_partner_desertic_hispafuentes
+ reference_type: none
+
+-
+ I check that Initially customer invoice is in the "Draft" state
+-
+ !assert {model: account.invoice, id: account_invoice_voucher_payment}:
+ - state == 'draft'
+-
+ I change the state of invoice to "Proforma2" by clicking PRO-FORMA button
+-
+ !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_voucher_payment}
+-
+ I check that the invoice state is now "Proforma2"
+-
+ !assert {model: account.invoice, id: account_invoice_voucher_payment}:
+ - state == 'proforma2'
+-
+ I create invoice by clicking on Create button
+-
+ !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_voucher_payment}
+-
+ I check that the invoice state is "Open"
+-
+ !assert {model: account.invoice, id: account_invoice_voucher_payment}:
+ - state == 'open'
+
+-
+ I create a voucher record for above invoice
+-
+ !record {model: account.voucher, id: account_voucher_voucherforaxelor1}:
+ account_id: account.cash
+ company_id: base.main_company
+ currency_id: base.EUR
+ journal_id: account.bank_journal
+ name: Voucher for Axelor
+ narration: Basic Pc
+ payment_ids:
+ - account_id: account.a_recv
+ amount: 450.0
+ name: Voucher for Axelor
+ partner_id: base.res_partner_desertic_hispafuentes
+ invoice_id: account_invoice_voucher_payment
+ type: cr
+ period_id: account.period_6
+ reference_type: none
+
+-
+ I check that Initially customer voucher is in the "Draft" state
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}:
+ - state == 'draft'
+-
+ I change the state of voucher to "proforma" by clicking PRO-FORMA button
+-
+ !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucherforaxelor1}
+-
+ I check that the voucher state is now "proforma"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}:
+ - state == 'proforma'
+-
+ I create voucher by clicking on Create button
+-
+ !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor1}
+-
+ I check that the voucher state is "Waiting for re-checking"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}:
+ - state == 'recheck'
+-
+ I clicked on Validate Button
+-
+ !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucherforaxelor1}
+-
+ I check that the voucher state is "posted"
+-
+ !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}:
+ - state == 'posted'
+
+-
+ I check that Moves get created for this voucher
+-
+ !python {model: account.voucher}: |
+ acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor1"))
+ assert(acc_id.move_id)
+
+-
+ I check that the invoice state is now Done
+-
+ !assert {model: account.invoice, id: account_invoice_voucher_payment}:
+ - state == 'paid'
+
+
+
+
+
+
+
diff --git a/addons/auction/report/auction_invoice.py b/addons/auction/report/auction_invoice.py
index f367d8df88e..b8c508237a5 100644
--- a/addons/auction/report/auction_invoice.py
+++ b/addons/auction/report/auction_invoice.py
@@ -27,8 +27,7 @@ class auction_invoice(report_int):
report_int.__init__(self, name)
def create(self,cr, uid, ids, datas, context):
- service = netsvc.LocalService("object_proxy")
- lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', ids, ['ach_inv_id'])
+ lots = self.pool.get('auction.lots').read(cr,uid, ids, ['ach_inv_id'], context=context)
invoices = {}
for l in lots:
diff --git a/addons/base_action_rule/security/ir.model.access.csv b/addons/base_action_rule/security/ir.model.access.csv
index 99e4fc07c4b..a8e43372e23 100644
--- a/addons/base_action_rule/security/ir.model.access.csv
+++ b/addons/base_action_rule/security/ir.model.access.csv
@@ -1,2 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_base_action_rule","base.action.rule","model_base_action_rule",,1,1,1,1
+"access_base_action_rule","base.action.rule","model_base_action_rule",,1,0,0,0
+"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,0,0,0
diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml
index 79c8a0207a3..56e45c9ccf9 100644
--- a/addons/base_calendar/base_calendar_view.xml
+++ b/addons/base_calendar/base_calendar_view.xml
@@ -2,7 +2,7 @@
-
+
calendar.attendee.form
@@ -10,12 +10,12 @@
form
-
-
-
+
+
+
-
+
@@ -68,7 +68,7 @@
-
+
calendar.attendee.tree
@@ -87,7 +87,7 @@
-
+
calendar.attendee.search
@@ -103,52 +103,52 @@
separator="1" help="Declined Invitations" />
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
- Event Invitations
- ir.actions.act_window
- calendar.attendee
- form
- tree,form
-
- {'default_sent_by_uid': uid}
-
+
+ Event Invitations
+ ir.actions.act_window
+ calendar.attendee
+ form
+ tree,form
+
+ {'default_sent_by_uid': uid}
+
-
+
+ parent="base.menu_base_config" sequence="15" />
-
+
-
-
+
-
+
res.alarm.form
res.alarm
form
@@ -165,7 +165,7 @@
-
+
res.alarm.tree
@@ -189,198 +189,199 @@
tree,form
-
+
+
-
- Event Form
- calendar.event
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Event Form
+ calendar.event
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
- Event Tree
- calendar.event
- tree
-
-
-
-
-
-
-
-
-
-
-
+
+ Event Tree
+ calendar.event
+ tree
+
+
+
+
+
+
+
+
+
+
+
-
+
-
- Events Calendar
- calendar.event
- calendar
-
-
-
-
-
-
-
-
-
+
+ Events Calendar
+ calendar.event
+ calendar
+
+
+
+
+
+
+
+
+
-
+
-
- Calendar Events Search
- calendar.event
- search
-
+
+ Calendar Events Search
+ calendar.event
+ search
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
- Events
- ir.actions.act_window
- calendar.event
- form
- tree,form,calendar
-
-
+
+ Events
+ ir.actions.act_window
+ calendar.event
+ form
+ tree,form,calendar
+
+
-
+
-
diff --git a/addons/base_calendar/security/ir.model.access.csv b/addons/base_calendar/security/ir.model.access.csv
old mode 100755
new mode 100644
index eba4e092f14..a95b1e1a129
--- a/addons/base_calendar/security/ir.model.access.csv
+++ b/addons/base_calendar/security/ir.model.access.csv
@@ -1,9 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_calendar_attendee","calendar.attendee","model_calendar_attendee",,1,1,1,1
-"access_calendar_alarm","calendar.alarm","model_calendar_alarm",,1,1,1,1
-"access_res_alarm","res.alarm","model_res_alarm",,1,1,1,1
-"access_calendar_event_all","calendar.event","model_calendar_event",,1,1,1,1
-"access_calendar_todo","calendar.todo","model_calendar_todo",,1,1,1,1
-"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",,1,1,1,1
-"access_calendar_event_edit_all","calendar_event_edit_all","model_calendar_event_edit_all",,1,1,1,1
-"access_base_calendar_set_exrule","base.calendar.set.exrule","model_base_calendar_set_exrule",,1,1,1,1
+"access_calendar_attendee","calendar.attendee","model_calendar_attendee",base.group_user,1,1,1,1
+"access_calendar_alarm","calendar.alarm","model_calendar_alarm",base.group_user,1,1,1,1
+"access_res_alarm","res.alarm","model_res_alarm",base.group_user,1,1,1,1
+"access_calendar_event_all","calendar.event","model_calendar_event",base.group_user,1,1,1,1
+"access_calendar_todo","calendar.todo","model_calendar_todo",base.group_user,1,1,1,1
+"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",base.group_user,1,1,1,1
+"access_calendar_event_edit_all","calendar_event_edit_all","model_calendar_event_edit_all",base.group_user,1,1,1,1
+"access_base_calendar_set_exrule","base.calendar.set.exrule","model_base_calendar_set_exrule",base.group_user,1,1,1,1
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index 7a543f5466f..46c4dbc6e0b 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -18,10 +18,10 @@
If you don't think you need any of these right now, you can easily install them later on.
-
- 15
-
-
+
+ 15
+
+
Install Generic Modules
@@ -29,13 +29,14 @@ If you don't think you need any of these right now, you can easily install them
-
+
+
@@ -60,11 +61,11 @@ If you don't think you need any of these right now, you can easily install them
base_setup_installer_action_replace
tree
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml
index 2d6b400d2c5..5ec9be53d76 100644
--- a/addons/base_setup/base_setup_todo.xml
+++ b/addons/base_setup/base_setup_todo.xml
@@ -10,45 +10,45 @@
Main Company Setup
-
- Information of your company will be used to custiomise your documents like Invoices, Sale Orders,...
-
-
- Configure Your Company
-
-
- 25
-
-
+
+ Information of your company will be used to custiomise your documents like Invoices, Sale Orders,...
+
+
+ Configure Your Company
+
+
+ 25
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py
index b7123b1ba38..0ab47197d66 100644
--- a/addons/base_setup/installer.py
+++ b/addons/base_setup/installer.py
@@ -75,6 +75,9 @@ class base_setup_installer(osv.osv_memory):
"OpenERP's report creation."),
'thunderbird' :fields.boolean('Thunderbird'),
# Vertical modules
+ 'product_expiry':fields.boolean('Food Industry',
+ help="Installs a preselected set of OpenERP "
+ "applications which will help you manage foods."),
'profile_association':fields.boolean('Associations',
help="Installs a preselected set of OpenERP "
"applications which will help you manage your association "
diff --git a/addons/base_setup/security/ir.model.access.csv b/addons/base_setup/security/ir.model.access.csv
index 912e3c1c634..9cc4e8bda68 100644
--- a/addons/base_setup/security/ir.model.access.csv
+++ b/addons/base_setup/security/ir.model.access.csv
@@ -1,4 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-"access_base_setup_installer","base.setup.installer","model_base_setup_installer",,1,0,0,0
-"access_base_setup_company","base.setup.company","model_base_setup_company",,1,0,0,0
-"access_base_setup_config","base.setup.config","model_base_setup_config",,1,0,0,0
+"access_base_setup_installer","base.setup.installer","model_base_setup_installer",base.group_system,1,1,1,1
+"access_base_setup_company","base.setup.company","model_base_setup_company",base.group_system,1,1,1,1
+"access_base_setup_config","base.setup.config","model_base_setup_config",base.group_system,1,1,1,1
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index aad27f9eb14..cea854427dc 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -29,7 +29,6 @@
-
-
+
@@ -298,7 +298,7 @@
-
+
diff --git a/addons/crm/crm_mailgate.py b/addons/crm/crm_mailgate.py
index 00fa761f51d..f2380182aad 100644
--- a/addons/crm/crm_mailgate.py
+++ b/addons/crm/crm_mailgate.py
@@ -32,11 +32,12 @@ from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
+import collections
from tools import command_re
-class crm_cases(osv.osv):
- """ crm cases """
+class mailgate_thread(osv.osv):
+ """ mailgate_thread """
_name = "mailgate.thread"
_inherit = "mailgate.thread"
@@ -127,7 +128,7 @@ class crm_cases(osv.osv):
#getattr(self, act)(cr, uid, select)
return res
- def emails_get(self, cr, uid, ids, context={}):
+ def emails_get(self, cr, uid, ids, context=None):
"""
Get Emails
@@ -137,16 +138,24 @@ class crm_cases(osv.osv):
@param ids: List of email’s IDs
@param context: A standard dictionary for contextual values
"""
- res = []
+ res = {}
+
if isinstance(ids, (str, int, long)):
- select = [ids]
+ select = [long(ids)]
else:
select = ids
- for case in self.browse(cr, uid, select):
- user_email = (case.user_id and case.user_id.address_id and case.user_id.address_id.email) or False
- res += [(user_email, case.email_from, case.email_cc or False, getattr(case,'priority') and case.priority or False)]
- if isinstance(ids, (str, int, long)):
- return len(res) and res[0] or False
+
+ for thread in self.browse(cr, uid, select, context=context):
+ values = collections.defaultdict(set)
+
+ for message in thread.message_ids:
+ user_email = (message.user_id and message.user_id.address_id and message.user_id.address_id.email) or False
+ values['user_email'].add(user_email)
+ values['email_from'].add(message.email_from)
+ values['email_cc'].add(message.email_cc or False)
+
+ res[str(thread.id)] = dict((key,list(values[key])) for key, value in values.iteritems())
+
return res
def msg_send(self, cr, uid, id, *args, **argv):
@@ -161,4 +170,4 @@ class crm_cases(osv.osv):
"""
return True
-crm_cases()
+mailgate_thread()
diff --git a/addons/crm/crm_meeting_menu.xml b/addons/crm/crm_meeting_menu.xml
index aaae9541613..ec58c116baf 100644
--- a/addons/crm/crm_meeting_menu.xml
+++ b/addons/crm/crm_meeting_menu.xml
@@ -38,7 +38,7 @@
-
+
gantt
@@ -85,33 +85,33 @@
+ parent="base.menu_base_partner" sequence="3" />
+ action="crm_case_categ_meet" parent="menu_meeting_sale"
+ sequence="1" />
-
+
Calendar
ir.ui.menu
-
+
- Meeting Invitations
- ir.actions.act_window
- calendar.attendee
- form
- tree,form
-
+ Meeting Invitations
+ ir.actions.act_window
+ calendar.attendee
+ form
+ tree,form
+
[('ref','like','crm.meeting,')]
- {'default_sent_by_uid': uid}
-
+ {'default_sent_by_uid': uid}
+
+ name="Meeting Invitations" parent="crm.menu_meeting_sale"
+ sequence="10" action="action_view_attendee_form"
+ groups="base.group_extended" />
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index cd3b7866a89..34bdafe1c58 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -2,7 +2,7 @@
-
+
Meeting Categories
@@ -16,7 +16,7 @@
-
+
CRM - Meetings Form
@@ -26,7 +26,7 @@
+ required="1" colspan="2" />
+ name="%(base_calendar.action_base_calendar_set_exrule)d" icon="gtk-zoom-out" type="action"
+ context="{'model' : 'crm.meeting'}"
+ attrs="{'invisible':[('rrule_type','in', ('none', False))]}"/>
@@ -133,7 +133,7 @@
-
-
+
CRM - Meetings Tree
@@ -222,7 +222,7 @@
-
+
CRM - Meetings Calendar
@@ -238,7 +238,7 @@
-
+
CRM - Meetings Gantt
@@ -254,7 +254,7 @@
-
+
CRM - Meetings Search
@@ -274,29 +274,29 @@
domain="[('section_id','=',context.get('section_id',False))]"
help="My Sale Team" />
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
calendar.attendee.form.inherit
@@ -310,7 +310,7 @@
-
+
calendar.attendee.tree.inherit
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index 98e4c6f3ded..440033a2400 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -52,8 +52,9 @@ class crm_opportunity(osv.osv):
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'phone': fields.char("Phone", size=64),
'date_deadline': fields.date('Expected Closing'),
- 'date_action': fields.date('Next Action'),
- }
+ 'date_action': fields.date('Next Action Date'),
+ 'title_action': fields.char('Next Action', size=64),
+ }
def case_close(self, cr, uid, ids, *args):
"""Overrides close for crm_case for setting probability and close date
@param self: The object pointer
diff --git a/addons/crm/crm_opportunity_menu.xml b/addons/crm/crm_opportunity_menu.xml
index a1cdce906af..cb24990416f 100644
--- a/addons/crm/crm_opportunity_menu.xml
+++ b/addons/crm/crm_opportunity_menu.xml
@@ -2,7 +2,7 @@
-
-
Opportunities
crm.lead
- tree,form,graph
- ['|',('type','=','opportunity'),('state','=','draft')]
- {'search_default_user_id':uid,'search_default_current':1}
+ tree,form,graph,calendar
+ [('type','=','opportunity')]
+ {'search_default_user_id':uid,'search_default_current':1, 'default_type': 'opportunity'}
- {'search_default_current':1, 'default_type': 'opportunity'}
@@ -55,11 +54,11 @@
+ parent="base.menu_base_partner" sequence="1" />
+ parent="base.menu_sales" action="crm_case_category_act_oppor11"
+ sequence="2" />
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 5fbfa766cbf..08530fcae27 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -32,7 +32,7 @@
id="menu_crm_opportunity_stage_act" name="Stages"
parent="menu_crm_config_opportunity" />
-
+
Opportunity Resource Type
@@ -81,8 +81,10 @@
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
+
-
+
+
@@ -133,6 +135,27 @@
icon="gtk-convert" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -160,10 +183,10 @@
icon="gtk-undo" type="action" />
-
-
-
-
+
+
+
+
+
-
-
-
+
-
-
+
+
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index db8adda789c..59b8013b167 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -261,7 +261,7 @@
-
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index f854981858c..19e3f731606 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -2,22 +2,22 @@
+ parent="base.menu_base_config" sequence="1"/>
+ parent="base.menu_crm_config_sales" sequence="1"/>
+ parent="base.menu_base_config" sequence="4"/>
+ parent="base.menu_base_partner" sequence="8" />
@@ -57,7 +57,7 @@
-
+
crm.case.section.tree
@@ -73,7 +73,7 @@
-
+
Sales Team
@@ -82,7 +82,7 @@
-
+
crm.case.stage.tree
@@ -99,7 +99,7 @@
-
+
crm.case.stage.form
@@ -120,7 +120,7 @@
-
+
Stages
@@ -144,7 +144,7 @@
-
+
crm.case.categ.tree
@@ -158,7 +158,7 @@
-
+
Categories
@@ -173,7 +173,7 @@
-
+
crm.case.resource.type.tree
@@ -188,7 +188,7 @@
-
+
crm.case.resource.type.form
@@ -203,7 +203,7 @@
-
+
Resource Type
@@ -220,7 +220,7 @@
-
+
crm.case.log.tree
@@ -240,7 +240,7 @@
-
+
crm.segmentation.line.tree
@@ -257,7 +257,7 @@
-
+
crm.segmentation.line.form
@@ -277,7 +277,7 @@
-
+
crm.segmentation.form
@@ -322,7 +322,7 @@
-
+
crm.segmentation.tree
@@ -383,7 +383,7 @@
-
+
view.res.partner.form.crm.inherited1
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index f6ac9238b3c..0601cd47c71 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -232,11 +232,9 @@
-
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index ddc50460e31..f1f5eb4a490 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -187,9 +187,8 @@
-
diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml
index 24523f7b072..769cb5d5c81 100644
--- a/addons/crm/res_partner_view.xml
+++ b/addons/crm/res_partner_view.xml
@@ -4,62 +4,62 @@
-
- res.partner.crm.info.inherit
- res.partner
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv
index bbd437dba47..8befbd8c084 100644
--- a/addons/crm/security/ir.model.access.csv
+++ b/addons/crm/security/ir.model.access.csv
@@ -1,19 +1,23 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_crm_segmentation_user","crm.segmentation user","model_crm_segmentation","crm.group_crm_user",1,0,0,0
+"access_crm_segmentation_line_user","crm.segmentation.line user","model_crm_segmentation_line","crm.group_crm_user",1,0,0,0
"access_crm_segmentation","crm.segmentation","model_crm_segmentation","crm.group_crm_manager",1,1,1,1
"access_crm_segmentation_line","crm.segmentation.line","model_crm_segmentation_line","crm.group_crm_manager",1,1,1,1
"access_crm_case_section","crm.case.section","model_crm_case_section","crm.group_crm_user",1,0,0,0
"access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0
-"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_manager",1,1,1,1
-"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_manager",1,1,1,1
-"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_manager",1,1,1,1
+"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_user",1,1,1,1
+"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_user",1,1,1,1
+"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_user",1,1,1,1
+"access_crm_case_section_user","crm.case.section.user","model_crm_case_section","crm.group_crm_user",1,0,0,0
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
+"access_crm_case_categ_user","crm.case.categ.user","model_crm_case_categ","crm.group_crm_user",1,0,0,0
"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
"access_crm_case_resource_type_user","crm_case_resource_type user","model_crm_case_resource_type","crm.group_crm_user",1,0,0,0
"access_crm_case_resource_type_manager","crm_case_resource_type manager","model_crm_case_resource_type","crm.group_crm_manager",1,1,1,1
-"access_crm_lead_report_user","crm.lead.report","model_crm_lead_report","crm.group_crm_user",1,0,0,0
-"access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0
+"access_crm_lead_report_manager","crm.lead.report","model_crm_lead_report","crm.group_crm_manager",1,0,0,0
+"access_crm_phonecall_report_manager","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_manager",1,0,0,0
"access_crm_lead2partner","crm.lead2partner","model_crm_lead2partner","crm.group_crm_user",1,1,1,1
"access_crm_lead2opportunity","crm.lead2opportunity","model_crm_lead2opportunity","crm.group_crm_user",1,1,1,1
"access_crm_opportunity2phonecall","crm.opportunity2phonecall","model_crm_opportunity2phonecall","crm.group_crm_user",1,1,1,1
@@ -24,6 +28,11 @@
"access_crm_send_mail_attachment","crm.send.mail.attachment","model_crm_send_mail_attachment","crm.group_crm_user",1,1,1,1
"access_crm_partner2opportunity","crm.partner2opportunity","model_crm_partner2opportunity","crm.group_crm_user",1,1,1,1
"access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1
-"access_crm_installer","crm.installer.rule","model_crm_installer","crm.group_crm_user",1,1,1,1
-"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",2,2,2,2
+"access_crm_installer","crm.installer.rule","model_crm_installer","base.group_system",1,1,1,1
+"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",1,1,1,1
"access_mailgate_thread","mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1
+"access_res_partner","res.partner.crm.user","base.model_res_partner","crm.group_crm_user",1,0,0,0
+"access_res_partner_address","res.partner.address.crm.user","base.model_res_partner_address","crm.group_crm_user",1,0,0,0
+"access_res_partner_category","res.partner.category.crm.user","base.model_res_partner_category","crm.group_crm_user",1,0,0,0
+"mail_gateway_mailgate_message","mail_gateway.mailgate.message","mail_gateway.model_mailgate_message","crm.group_crm_user",1,1,1,1
+"mail_gateway_mailgate_thread","mail_gateway.mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index 61cf7c6368d..c59e0aabdc8 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -295,5 +295,22 @@
+
+
+
+
+
diff --git a/addons/crm_profiling/wizard/open_questionnaire.py b/addons/crm_profiling/wizard/open_questionnaire.py
index 0fc50b9186a..91b82a02d1a 100644
--- a/addons/crm_profiling/wizard/open_questionnaire.py
+++ b/addons/crm_profiling/wizard/open_questionnaire.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
import pooler
@@ -50,11 +50,11 @@ class open_questionnaire(wizard.interface):
states = {
'init': {
'actions': [],
- 'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel'), ('open', 'Open Questionnaire')]}
+ 'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel','gtk-cancel'), ('open', 'Open Questionnaire','terp-camera_test')]}
},
'open': {
'actions': [build_form],
- 'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel'), ('compute', 'Save Data')]}
+ 'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel','gtk-cancel'), ('compute', 'Save Data','terp-stock_format-scientific')]}
},
'compute': {
'actions': [],
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index 427f5bfd6f2..cc5ce326204 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -67,7 +67,7 @@
-
+
@@ -243,18 +243,6 @@
-
- stock.move.tree.weight
- tree
- stock.move
-
-
-
-
-
-
-
-
stock.move.form.weight
form
@@ -267,18 +255,6 @@
-
- stock.move.reception.packing.tree.weight
- tree
- stock.move
-
-
-
-
-
-
-
-
stock.move.reception.packing.form.weight
form
@@ -297,8 +273,8 @@
-
-
+
+
diff --git a/addons/delivery/i18n/ru.po b/addons/delivery/i18n/ru.po
index fa64529594b..b43f11ed5d9 100644
--- a/addons/delivery/i18n/ru.po
+++ b/addons/delivery/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-04-23 09:08+0000\n"
-"Last-Translator: grisha \n"
+"PO-Revision-Date: 2010-06-11 16:12+0000\n"
+"Last-Translator: Sios \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-04-24 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-06-12 03:44+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: delivery
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index 0bab191d942..56d96d916ca 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -3,7 +3,7 @@
-
+
@@ -13,15 +13,15 @@
form
-
-
-
-
-
-
+
+
+
+
+
+
-
+
@@ -71,13 +71,13 @@
-
+
-
+
@@ -238,19 +238,19 @@
help="less 1 month modified/created attachments"
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')),('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
/>
-
-
+
+
-
-
-
-
+
+
+
+
-
+
diff --git a/addons/email_template/__init__.py b/addons/email_template/__init__.py
old mode 100755
new mode 100644
diff --git a/addons/email_template/__openerp__.py b/addons/email_template/__openerp__.py
old mode 100755
new mode 100644
index 9c5f7bb5c70..ef50f631e3e
--- a/addons/email_template/__openerp__.py
+++ b/addons/email_template/__openerp__.py
@@ -16,6 +16,7 @@
'email_template_view.xml',
'email_template_mailbox_view.xml',
'wizard/email_template_send_wizard_view.xml',
+ 'security/ir.model.access.csv'
],
"installable": True,
"active": False,
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
old mode 100755
new mode 100644
index 1cef7aac6e3..37b38774a7d
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -17,10 +17,10 @@ try:
TEMPLATE_ENGINES.append(('mako', 'Mako Templates'))
except:
LOGGER.notifyChannel(
- _("Email Template"),
- netsvc.LOG_ERROR,
- _("Mako templates not installed")
- )
+ _("Email Template"),
+ netsvc.LOG_WARNING,
+ _("Mako templates not installed")
+ )
try:
from django.template import Context, Template as DjangoTemplate
#Workaround for bug:
@@ -31,10 +31,10 @@ try:
TEMPLATE_ENGINES.append(('django', 'Django Template'))
except:
LOGGER.notifyChannel(
- _("Email Template"),
- netsvc.LOG_ERROR,
- _("Django templates not installed")
- )
+ _("Email Template"),
+ netsvc.LOG_WARNING,
+ _("Django templates not installed")
+ )
import email_template_engines
import tools
@@ -468,7 +468,7 @@ class email_template(osv.osv):
context)
return True
- def generate_mailbox_item_from_template(self,
+ def _generate_mailbox_item_from_template(self,
cursor,
user,
template,
@@ -559,6 +559,8 @@ class email_template(osv.osv):
'folder':'drafts',
'mail_type':'multipart/alternative'
}
+ if not mailbox_values['account_id']:
+ raise Exception("Unable to send the mail. No account linked to the template.")
#Use signatures if allowed
if template.use_sign:
sign = self.pool.get('res.users').read(cursor,
@@ -570,13 +572,17 @@ class email_template(osv.osv):
mailbox_values['body_text'] += sign
if mailbox_values['body_html']:
mailbox_values['body_html'] += sign
+ print 'Creating', mailbox_values
mailbox_id = self.pool.get('email_template.mailbox').create(
cursor,
user,
mailbox_values,
context)
+
+ print 'Sending', mailbox_id
+ self.pool.get('email_template.mailbox').send_this_mail(cursor, user, [mailbox_id], context)
return mailbox_id
-
+
def generate_mail(self,
cursor,
user,
@@ -588,6 +594,7 @@ class email_template(osv.osv):
template = self.browse(cursor, user, template_id, context=context)
if not template:
raise Exception("The requested template could not be loaded")
+ print 'loaded', record_ids
for record_id in record_ids:
mailbox_id = self._generate_mailbox_item_from_template(
cursor,
@@ -595,6 +602,7 @@ class email_template(osv.osv):
template,
record_id,
context)
+ print 'loaded'
mail = self.pool.get('email_template.mailbox').browse(
cursor,
user,
@@ -616,7 +624,7 @@ class email_template(osv.osv):
mailbox_id,
{'folder':'outbox'},
context=context
- )
+ )
return True
email_template()
@@ -625,6 +633,18 @@ class email_template_preview(osv.osv_memory):
_name = "email_template.preview"
_description = "Email Template Preview"
+ def _get_model_recs(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ #Fills up the selection box which allows records from the selected object to be displayed
+ self.context = context
+ if 'template_id' in context.keys():
+ ref_obj_id = self.pool.get('email.template').read(cr, uid, context['template_id'], ['object_name'], context)
+ ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id['object_name'][0], ['model'], context)['model']
+ ref_obj_ids = self.pool.get(ref_obj_name).search(cr, uid, [], context=context)
+ ref_obj_recs = self.pool.get(ref_obj_name).name_get(cr, uid, ref_obj_ids, context)
+ return ref_obj_recs
+
def _default_model(self, cursor, user, context=None):
"""
Returns the default value for model field
@@ -635,7 +655,7 @@ class email_template_preview(osv.osv_memory):
return self.pool.get('email.template').read(
cursor,
user,
- context['active_id'],
+ context['template_id'],
['object_name'],
context)['object_name']
@@ -644,6 +664,7 @@ class email_template_preview(osv.osv_memory):
'email.template',
'Template', readonly=True),
'rel_model':fields.many2one('ir.model', 'Model', readonly=True),
+ 'rel_model_ref':fields.selection(_get_model_recs, 'Referred Document'),
'to':fields.char('To', size=250, readonly=True),
'cc':fields.char('CC', size=250, readonly=True),
'bcc':fields.char('BCC', size=250, readonly=True),
@@ -653,10 +674,9 @@ class email_template_preview(osv.osv_memory):
'report':fields.char('Report Name', size=100, readonly=True),
}
_defaults = {
- 'ref_template': lambda self, cr, uid, ctx:ctx['active_id'],
+ 'ref_template': lambda self, cr, uid, ctx:ctx['template_id'],
'rel_model': _default_model
}
- # Need to check
def on_change_ref(self, cr, uid, ids, rel_model_ref, context=None):
if context is None:
context = {}
@@ -665,13 +685,13 @@ class email_template_preview(osv.osv_memory):
vals = {}
if context == {}:
context = self.context
- template = self.pool.get('email.template').browse(cr, uid, context['active_id'], context)
+ template = self.pool.get('email.template').browse(cr, uid, context['template_id'], context)
#Search translated template
lang = get_value(cr, uid, rel_model_ref, template.lang, template, context)
if lang:
ctx = context.copy()
ctx.update({'lang':lang})
- template = self.pool.get('email.template').browse(cr, uid, context['active_id'], ctx)
+ template = self.pool.get('email.template').browse(cr, uid, context['template_id'], ctx)
vals['to'] = get_value(cr, uid, rel_model_ref, template.def_to, template, context)
vals['cc'] = get_value(cr, uid, rel_model_ref, template.def_cc, template, context)
vals['bcc'] = get_value(cr, uid, rel_model_ref, template.def_bcc, template, context)
diff --git a/addons/email_template/email_template_account.py b/addons/email_template/email_template_account.py
old mode 100755
new mode 100644
diff --git a/addons/email_template/email_template_account_view.xml b/addons/email_template/email_template_account_view.xml
old mode 100755
new mode 100644
index 7a0bc84538f..9a35328b25c
--- a/addons/email_template/email_template_account_view.xml
+++ b/addons/email_template/email_template_account_view.xml
@@ -1,69 +1,69 @@
-
+
-
- email_template.account.form
- email_template.account
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ email_template.account.form
+ email_template.account
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- email_template.account.tree
- email_template.account
- tree
-
-
-
-
-
-
-
-
-
-
-
-
+
+ email_template.account.tree
+ email_template.account
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
email_template.account.search
@@ -85,21 +85,21 @@
-
- Accounts
- email_template.account
- form
- form,tree
-
+
+ Accounts
+ email_template.account
+ form
+ form,tree
+
{'group_by': [], 'search_default_draft': 1, 'search_default_my': 1}
-
+
-
+
-
+
-
+
diff --git a/addons/email_template/email_template_engines.py b/addons/email_template/email_template_engines.py
old mode 100755
new mode 100644
diff --git a/addons/email_template/email_template_mailbox.py b/addons/email_template/email_template_mailbox.py
old mode 100755
new mode 100644
index 45eef77729e..fe9ca334d21
--- a/addons/email_template/email_template_mailbox.py
+++ b/addons/email_template/email_template_mailbox.py
@@ -41,9 +41,7 @@ class email_template_mailbox(osv.osv):
return True
def send_this_mail(self, cr, uid, ids=None, context=None):
- if ids is None:
- ids = []
- for id in ids:
+ for id in (ids or []):
try:
account_obj = self.pool.get('email_template.account')
values = self.read(cr, uid, id, [], context)
diff --git a/addons/email_template/email_template_mailbox_view.xml b/addons/email_template/email_template_mailbox_view.xml
old mode 100755
new mode 100644
index c521320bf3a..93a1a9958d4
--- a/addons/email_template/email_template_mailbox_view.xml
+++ b/addons/email_template/email_template_mailbox_view.xml
@@ -1,81 +1,81 @@
-
-
-
- email_template.mailbox.form
- email_template.mailbox
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ email_template.mailbox.form
+ email_template.mailbox
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- email_template.mailbox.tree
- email_template.mailbox
- tree
-
-
-
-
-
-
-
-
-
-
+
+
+ email_template.mailbox.tree
+ email_template.mailbox
+ tree
+
+
+
+
+
+
+
+
+
+
email_template.mailbox.search
@@ -109,14 +109,14 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/addons/email_template/email_template_scheduler_data.xml b/addons/email_template/email_template_scheduler_data.xml
old mode 100755
new mode 100644
diff --git a/addons/email_template/email_template_view.xml b/addons/email_template/email_template_view.xml
old mode 100755
new mode 100644
index 5158d7a5544..0faa28e042f
--- a/addons/email_template/email_template_view.xml
+++ b/addons/email_template/email_template_view.xml
@@ -1,147 +1,147 @@
-
-
-
- email_template.preview.form
- email_template.preview
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ email_template.preview.form
+ email_template.preview
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Template Preview
- email_template.preview
- email_template.preview
- ir.actions.act_window
- form
- form
-
- new
- {'ids':active_id}
-
-
+
+ Template Preview
+ email_template.preview
+ email_template.preview
+ ir.actions.act_window
+ form
+ form
+
+ new
+ {'template_id':active_id}
+
+
-
- email.template.form
- email.template
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ email.template.form
+ email.template
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- email.template.tree
- email.template
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ email.template.tree
+ email.template
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
email.template.search
@@ -161,19 +161,19 @@
-
- Email Templates
- email.template
- form
- form,tree
-
+
+ Email Templates
+ email.template
+ form
+ form,tree
+
-
+
-
+
-
+
diff --git a/addons/email_template/email_template_workflow.xml b/addons/email_template/email_template_workflow.xml
old mode 100755
new mode 100644
index 4d3176f0ae0..911b8bf49ff
--- a/addons/email_template/email_template_workflow.xml
+++ b/addons/email_template/email_template_workflow.xml
@@ -11,24 +11,24 @@
email_template.account
True
-
+
-
+
True
draft
- function
+ function
write({'state':'draft'})
-
+
approval
function
do_approval()
-
+
suspended
@@ -40,16 +40,16 @@
True
-
+
-
+
button_approval
-
+
@@ -67,6 +67,6 @@
get_never
-
+
diff --git a/addons/email_template/html2text.py b/addons/email_template/html2text.py
old mode 100755
new mode 100644
diff --git a/addons/email_template/security/email_template_security.xml b/addons/email_template/security/email_template_security.xml
index 90067252eca..9dc788f6780 100755
--- a/addons/email_template/security/email_template_security.xml
+++ b/addons/email_template/security/email_template_security.xml
@@ -1,19 +1,10 @@
-
+
-
- Email Template / Settings_Manager
-
+
+ Marketing / Email Template
+
-
- Email Template / External_users
-
-
-
- Email Template / Internal_users
-
-
-
-
+
diff --git a/addons/email_template/security/ir.model.access.csv b/addons/email_template/security/ir.model.access.csv
new file mode 100644
index 00000000000..958c43f42cd
--- /dev/null
+++ b/addons/email_template/security/ir.model.access.csv
@@ -0,0 +1,7 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_email_template_engines","email_template.engines","model_email_template_engines","email_template.res_groups_email_template_admin",1,1,1,1
+"access_email_template_account","email_template.account","model_email_template_account","email_template.res_groups_email_template_admin",1,1,1,1
+"access_email_template","email.template","model_email_template","email_template.res_groups_email_template_admin",1,1,1,1
+"access_email_template_preview","email_template.preview","model_email_template_preview","email_template.res_groups_email_template_admin",1,1,1,1
+"access_email_template_mailbox","email_template.mailbox","model_email_template_mailbox","email_template.res_groups_email_template_admin",1,1,1,1
+"access_email_template_send_wizard","email_template.send.wizard","model_email_template_send_wizard","email_template.res_groups_email_template_admin",1,1,1,1
diff --git a/addons/google_map/i18n/ru.po b/addons/google_map/i18n/ru.po
index 1543a8f1523..640f842cade 100644
--- a/addons/google_map/i18n/ru.po
+++ b/addons/google_map/i18n/ru.po
@@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-10-09 07:48+0000\n"
-"Last-Translator: Sardorbek Pulatov (pROCKrammer) \n"
+"PO-Revision-Date: 2010-06-13 13:02+0000\n"
+"Last-Translator: Alex L. \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-04-17 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-06-15 03:32+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: google_map
#: model:ir.actions.wizard,name:google_map.wizard_google_map
msgid "Launch Google Map"
-msgstr ""
+msgstr "Запустить Google Map"
#. module: google_map
#: constraint:ir.ui.view:0
@@ -39,6 +39,9 @@ msgid ""
"so that we can directly open google map from the\n"
"url widget."
msgstr ""
+"Модуль добавляет поле с Google картой в адрес партнера\n"
+"поэтому мы можем открыть карту Google непосредственно из\n"
+"адреса виджета."
#. module: google_map
#: view:res.partner:0
diff --git a/addons/hr/hr_department_view.xml b/addons/hr/hr_department_view.xml
index 977cc22f005..70576149592 100644
--- a/addons/hr/hr_department_view.xml
+++ b/addons/hr/hr_department_view.xml
@@ -51,7 +51,7 @@
-
+
@@ -73,7 +73,7 @@
-
+
res.users.form
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index 75da20cef20..f6a03030a6f 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -6,10 +6,16 @@
icon="terp-hr"
name="Human Resources"
sequence="6"/>
+
-
-
Initial Jobs Demand
1
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 673d4de130b..8411a9223b7 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -13,23 +13,22 @@
# ------------------------------------------------------
- Applicant Categories
- crm.case.categ
- form
-
- [('object_id.model', '=', 'hr.applicant')]
- {'object_id':'hr.applicant'}
+ Applicant Categories
+ crm.case.categ
+ form
+
+ [('object_id.model', '=', 'hr.applicant')]
+ {'object_id':'hr.applicant'}
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
Applicant Stages
- crm.case.stage
+ hr.recruitment.stage
form
-
- [('object_id.model', '=', 'hr.applicant')]
- {'object_id':'hr.applicant'}
+ []
+ {}
@@ -89,9 +88,10 @@
+
-
+
@@ -183,9 +183,9 @@
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'new', 'model': 'hr.applicant'}"
+ icon="gtk-go-forward" type="action" />
@@ -278,56 +278,56 @@
-
- hr.recruitment.stage.tree
- hr.recruitment.stage
- tree
-
-
-
-
-
-
-
+
+ hr.recruitment.stage.tree
+ hr.recruitment.stage
+ tree
+
+
+
+
+
+
+
-
- hr.recruitment.stage.form
- hr.recruitment.stage
- form
-
-
-
-
-
-
-
-
-
-
+
+ hr.recruitment.stage.form
+ hr.recruitment.stage
+ form
+
+
+
+
+
+
+
+
+
+
-
- Stages
- hr.recruitment.stage
- form
-
-
+
+ Stages
+ hr.recruitment.stage
+ form
+
+
-
+
-
+
diff --git a/addons/hr_recruitment/security/ir.model.access.csv b/addons/hr_recruitment/security/ir.model.access.csv
index f8898499c4d..40e82cb1a15 100644
--- a/addons/hr_recruitment/security/ir.model.access.csv
+++ b/addons/hr_recruitment/security/ir.model.access.csv
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_manager",1,1,1,1
-"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report",,1,0,0,0
+"access_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_user",1,1,1,1
+"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","hr.group_hr_manager",1,0,0,0
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index ca5bf104fe8..ce340fb4eb9 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -1,4 +1,8 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","hr.group_hr_user",1,1,1,1
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","hr.group_hr_user",1,1,1,0
-"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","hr.group_hr_user",1,0,0,0
\ No newline at end of file
+"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","hr.group_hr_user",1,0,0,0
+"access_hr_sign_in_project","hr.sign.in.project","model_hr_sign_in_project","hr.group_hr_user",1,1,1,1
+"access_hr_sign_out_project","hr.sign.out.project","model_hr_sign_out_project","hr.group_hr_user",1,1,1,1
+"access_hr_analytal_timesheet_employee","hr.analytical.timesheet.employee","model_hr_analytical_timesheet_employee","hr.group_hr_manager",1,1,1,1
+"access_hr_analytal_timesheet_user","hr.analytical.timesheet.user","model_hr_analytical_timesheet_users","hr.group_hr_user",1,1,1,1
diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml
index 69079149f03..2a94e440265 100644
--- a/addons/hr_timesheet/test/test_hr_timesheet.yml
+++ b/addons/hr_timesheet/test/test_hr_timesheet.yml
@@ -1,10 +1,9 @@
- |
In order to test hr_timesheet Module in OpenERP, I make "Sign In or Sign Out for Project" to encode and
track time spent on the different projects.
-
+
- |
Now, I create a new employee “Mark Johnson” to test Timesheet.
-
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
@@ -13,41 +12,43 @@
marital: hr.hr_employee_marital_status_single
name: Mark Johnson
user_id: base.user_root
-
+
- |
- I start by "Sign In/Sign Out by Project" wizard and click on "Sign In/Sign Out" button of this wizard.
+ I create new user "user1" which is assigned to employee.
-
- !python {model: hr.sign.in.project}: |
- self.check_state(cr, uid, [ref("hr_employee_employee0")])
+ !record {model: res.users, id: res_users_user0}:
+ company_id: base.main_company
+ context_lang: en_US
+ groups_id:
+ - hr.group_hr_user
+ - hr_attendance.group_hr_attendance
+ - base.group_user
+ - base.group_extended
+ - hr.group_hr_manager
+ login: user1
+ name: user1
+ password: user1
+
- |
- I select start date and Perform start work on project.
+ I create another employee "Francline" as "user1".
-
- !record {model: hr.sign.in.project, id: hr_employee_employee0}:
- name: employee1
- server_date: '2010-05-20 16:10:59'
- state: absent
+ !record {model: hr.employee, id: hr_employee_fracline1}:
+ address_home_id: base.res_partner_address_8
+ name: Francline
+ parent_id: 'hr_employee_employee0'
+ user_id: 'res_users_user0'
+
- |
- I click on "Start Working" button of this wizard to start work on Project.
--
- !python {model: hr.sign.in.project}: |
- self.sign_in_result(cr, uid, [ref("hr_employee_employee0")], context)
-- |
- My work is done and I want to stop work.for that I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard.
- Which check state in hr attendace form for user.
--
- !python {model: hr.sign.in.project}: |
- obj_attendance = self.pool.get('hr.employee')
- emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "employee1")])
- if emp_id:
- employee = obj_attendance.read(cr, uid, emp_id)[0]
- self.write(cr, uid, [ref('hr_employee_employee0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
- self.check_state(cr, uid, [ref("hr_employee_employee0")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
- })
+ Given that I have Timesheet journal for employee.
+-
+ !record {model: account.analytic.journal, id: analytic_journal}:
+ code: TS
+ name: Timesheet Journal
+ type: general
- |
Given that I have product for "Consultancy - Senior Developer".
-
--
+-
!record {model: product.product, id: product_consultant}:
categ_id: product.product_category_10
default_code: DEV
@@ -62,35 +63,95 @@
uom_po_id: product.uom_hour
- |
- I assing product and journal to "Mark Johnson"
--
+ I assing product and journal to "Mark Johnson"
+-
!record {model: hr.employee, id: hr_employee_employee0}:
+ product_id: product_consultant
journal_id: analytic_journal
- product_id: product_consultant
-
- |
- This will Open "hr sign out project" form. I select analytical project2 development account.
--
- !record {model: hr.sign.out.project, id: hr_employee_employee0}:
- account_id: account.analytic_project_2_development
- analytic_amount: 7.0
- date: '2010-05-21 16:40:00'
- date_start: '2010-05-19 16:37:00'
- info: Create Yaml for hr module
- name: Mark Johnson
- server_date: '2010-05-19 16:40:15'
- state: present
-
+ And also assing product and journal to "francline" employee.
+-
+ !record {model: hr.employee, id: hr_employee_fracline1}:
+ product_id: product_consultant
+ journal_id: analytic_journal
- |
- My work for this project is over and I stop work by click on "Stop Work" button of this wizard.
--
- !python {model: hr.sign.out.project}: |
- emp_obj = self.pool.get('hr.employee')
- emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid), ('name', '=', 'employee1')])
- if emp_id:
- employee = emp_obj.read(cr, uid, emp_id)[0]
- self.write(cr, uid, [ref('hr_employee_employee0')], {'emp_id': emp_id[0] })
- #self.sign_out_result(cr, uid, [ref('hr_employee_employee0')])
+ Now , When I came in office , I create Attendances and perform "Sign In" action with proper reason.
+-
+ !record {model: hr.attendance, id: hr_attendance_0}:
+ action: sign_in
+ employee_id: 'hr_employee_fracline1'
+ name: '2010-05-26 10:08:08'
- |
- I can see employee timesheet for particular month using "Employee Timesheet" report.
\ No newline at end of file
+ When I left office , I create attendance and perform "Sign Out".
+-
+ !record {model: hr.attendance, id: hr_attendance_1}:
+ action: sign_out
+ employee_id: 'hr_employee_fracline1'
+ name: '2010-05-26 15:10:55'
+
+
+- |
+ I start by "Sign In/Sign Out by Project" wizard and click on "Sign In/Sign Out" button of this wizard.
+-
+ !python {model: hr.sign.in.project}: |
+ uid = ref('res_users_user0')
+ self.check_state(cr, uid, [ref("hr_employee_fracline1")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]})
+- |
+ I select start date and Perform start work on project.
+-
+ !record {model: hr.sign.in.project, id: hr_sign_in_project_francline0}:
+ emp_id: 'hr_employee_fracline1'
+ name: Francline
+ server_date: '2010-06-08 19:50:54'
+ state: absent
+
+
+- |
+ I click on "Start Working" button of this wizard to start work on Project.
+-
+ !python {model: hr.sign.in.project}: |
+ uid = ref('res_users_user0')
+ obj_attendance = self.pool.get('hr.employee')
+ emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Francline")])
+ if emp_id:
+ employee = obj_attendance.read(cr, uid, emp_id)[0]
+ self.write(cr, uid, [ref('hr_sign_in_project_francline0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
+ #self.sign_in_result(cr, uid, [ref("hr_sign_in_project_francline0")], context)
+
+- |
+ My work is done and I want to stop work.for that I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard.
+ Which check state in hr attendace form for user.
+-
+ !python {model: hr.sign.in.project}: |
+ uid = ref('res_users_user0')
+ self.check_state(cr, uid, [ref("hr_sign_in_project_francline0")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
+ })
+
+- |
+ This will Open "hr sign out project" form. I select analytical project2 development account.
+-
+ !record {model: hr.sign.out.project, id: hr_sign_out_project_francline0}:
+ account_id: account.analytic_project_2_development
+ analytic_amount: 7.0
+ date: '2010-05-25 16:40:00'
+ date_start: '2010-06-05 16:37:00'
+ info: Create Yaml for hr module
+ name: Francline
+ server_date: '2010-06-09 16:40:15'
+ state: present
+
+- |
+ My work for this project is over and I stop work by click on "Stop Work" button of this wizard.
+-
+ !python {model: hr.sign.out.project}: |
+ uid = ref('res_users_user0')
+ obj_attendance = self.pool.get('hr.employee')
+ emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Francline")])
+ if emp_id:
+ employee = obj_attendance.read(cr, uid, emp_id)[0]
+ self.write(cr, uid, [ref('hr_sign_out_project_francline0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
+ #self.sign_out_result_end(cr, uid, [ref('hr_sign_out_project_francline0')])
+
+- |
+ I can see employee timesheet for particular month using "Employee Timesheet" report.
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
index dc1a6723786..6fc19a83b5d 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
+++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
@@ -35,22 +35,26 @@ class hr_so_project(osv.osv_memory):
'name': fields.char('Employees name', size=32, required=True, readonly=True),
'state': fields.char('Current state', size=32, required=True, readonly=True),
'server_date': fields.datetime('Current Date', required=True, readonly=True),
- 'emp_id': fields.char('Employee ID', size=256, required=False),
+ 'emp_id': fields.many2one('hr.employee', 'Employee ID')
}
-
+
def _get_empid(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
if emp_id:
- employee = emp_obj.read(cr, uid, emp_id)[0]
- return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
- raise osv.except_osv(_('UserError'), _('No employee defined for your user !'))
+ for employee in emp_obj.browse(cr, uid, emp_id):
+ return {'name': employee.name, 'state': employee.state, 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
def _get_empid2(self, cr, uid, context):
+
res = self._get_empid(cr, uid, context)
cr.execute('select name,action from hr_attendance where employee_id=%s order by name desc limit 1', (res['emp_id'],))
+
res['server_date'] = time.strftime('%Y-%m-%d %H:%M:%S')
- res['date_start'] = cr.fetchone()[0]
+ date_start = cr.fetchone()
+
+ if date_start:
+ res['date_start'] = date_start[0]
return res
def default_get(self, cr, uid, fields_list, context=None):
@@ -67,11 +71,13 @@ class hr_so_project(osv.osv_memory):
if minimum:
hour = round(round((hour + minimum / 2) / minimum) * minimum, 2)
res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'])
+
if not res['product_uom_id']:
raise osv.except_osv(_('UserError'), _('No cost unit defined for this employee !'))
up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour, res['product_uom_id'])['value']
+
res['name'] = data['info']
- res['account_id'] = data['account_id']
+ res['account_id'] = data['account_id'].id
res['unit_amount'] = hour
emp_journal = emp_obj.browse(cr, uid, emp_id, context).journal_id
res['journal_id'] = emp_journal and emp_journal.id or False
@@ -79,39 +85,60 @@ class hr_so_project(osv.osv_memory):
up = timesheet_obj.on_change_account_id(cr, uid, [], res['account_id']).get('value', {})
res.update(up)
return timesheet_obj.create(cr, uid, res, context=context)
-
+
def sign_out_result_end(self, cr, uid, ids, context=None):
+
emp_obj = self.pool.get('hr.employee')
- data = self.read(cr, uid, ids, [])[0]
- emp_id = data['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='sign_out',dt=data['date'])
- self._write(cr, uid, data, emp_id, context=context)
+
+ for data in self.browse(cr, uid, ids):
+ emp_id = data.emp_id.id
+ emp_obj.attendance_action_change(cr, uid, [emp_id], type='sign_out',dt=data.date)
+ self._write(cr, uid, data, emp_id, context=context)
return {}
def sign_out_result(self, cr, uid, ids, context=None):
emp_obj = self.pool.get('hr.employee')
- data = self.read(cr, uid, ids, [])[0]
- emp_id = data['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='action', dt=data['date'])
- self._write(cr, uid, data, emp_id, context=context)
+
+ for data in self.browse(cr, uid, ids):
+ emp_id = data.emp_id.id
+ emp_obj.attendance_action_change(cr, uid, [emp_id], type='action', dt=data.date)
+ self._write(cr, uid, data, emp_id, context=context)
return {}
hr_so_project()
class hr_si_project(osv.osv_memory):
+
_name = 'hr.sign.in.project'
_description = 'Sign In By Project'
_columns = {
- 'name': fields.char('Employees name', size=32, required=True, readonly=True),
- 'state': fields.char('Current state', size=32, required=True, readonly=True),
+ 'name': fields.char('Employees name', size=32, readonly=True),
+ 'state': fields.char('Current state', size=32, readonly=True),
'date': fields.datetime('Starting Date'),
- 'server_date': fields.datetime('Current Date', required=True, readonly=True),
- 'emp_id': fields.char('Employee ID', size=512, required=False),
+ 'server_date': fields.datetime('Current Date', readonly=True),
+ # 'emp_id': fields.char('Employee ID', size=512, required=False),
+ 'emp_id': fields.many2one('hr.employee', 'Employee ID')
}
+
+ def view_init(self, cr, uid, fields, context=None):
+ """
+ This function checks for precondition before wizard executes
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param fields: List of fields for default value
+ @param context: A standard dictionary for contextual values
+ """
+ emp_obj = self.pool.get('hr.employee')
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
+ if not emp_id:
+ raise osv.except_osv(_('UserError'), _('No employee defined for your user !'))
+ return False
def check_state(self, cr, uid, ids, context=None):
+
obj_model = self.pool.get('ir.model.data')
- emp_id = self._get_empid(cr, uid, context)['emp_id']
+ emp_id = self.default_get(cr, uid, context)['emp_id']
# get the latest action (sign_in or out) for this employee
cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
res = (cr.fetchone() or ('sign_out',))[0]
@@ -129,24 +156,20 @@ class hr_si_project(osv.osv_memory):
'target': 'new'
}
- def _get_empid(self, cr, uid, context=None):
- emp_obj = self.pool.get('hr.employee')
- emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
- if emp_id:
- employee = emp_obj.read(cr, uid, emp_id)[0]
- return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
- raise osv.except_osv(_('UserError'), _('No employee defined for your user !'))
-
def sign_in_result(self, cr, uid, ids, context):
emp_obj = self.pool.get('hr.employee')
- data = self.read(cr, uid, ids, [], context)[0]
- emp_id = data['emp_id']
- success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
+ for data in self.browse(cr, uid, ids, context):
+ emp_id = data.emp_id.id
+ success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data.date or False)
return {}
def default_get(self, cr, uid, fields_list, context=None):
res = super(hr_si_project, self).default_get(cr, uid, fields_list, context=context)
- res.update(self._get_empid(cr, uid, context=context))
+ emp_obj = self.pool.get('hr.employee')
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
+ if emp_id:
+ for employee in emp_obj.browse(cr, uid, emp_id):
+ res.update({'emp_id': employee.name, 'state': employee.state, 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')})
return res
hr_si_project()
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
index a603cc3f24e..b56ecd75769 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
@@ -20,7 +20,7 @@
-
+
account.analytic.account.form
account.analytic.account
@@ -32,7 +32,7 @@
-
+
hr.analytic.timesheet.form
hr.analytic.timesheet
@@ -117,9 +117,9 @@
tree,form
[('to_invoice','<>',False)]
-
@@ -178,9 +178,9 @@
form
-
diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv
index 6349b4f766c..f6d344cfb31 100644
--- a/addons/hr_timesheet_invoice/security/ir.model.access.csv
+++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv
@@ -3,9 +3,10 @@
"access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
"access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0
"access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0
-"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_user",1,0,0,0
-"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_user",1,0,0,0
-"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_user",1,0,0,0
-"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_user",1,0,0,0
-"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_user",1,0,0,0
-"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_user",1,0,0,0
+"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","hr.group_hr_manager",1,0,0,0
+"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","hr.group_hr_manager",1,0,0,0
+"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","hr.group_hr_manager",1,0,0,0
+"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","hr.group_hr_manager",1,0,0,0
+"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","hr.group_hr_manager",1,0,0,0
+"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","hr.group_hr_manager",1,0,0,0
+"access_hr_timesheet_analytic_profit","hr_timesheet_analytic_profit","model_hr_timesheet_analytic_profit","account.group_account_invoice",1,1,1,1
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index f686daf575e..51edeea837b 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -195,7 +195,7 @@
-
+
-
+
diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
index bb163b3c68e..38186031028 100644
--- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
+++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
@@ -131,9 +131,9 @@
- state == 'confirm'
- |
"Mark Johnson" check timesheet and time spend on project by "francline" employee.
- And then accept it request by click on "Accept" button.
- If "Maximal difference between timesheet and attendances" is more than 1 then manage can "Refuse" his request.
+ And then accept it request by click on "Accept" button.If "Maximal difference between timesheet and attendances" is more than 1 then manage can "Refuse" his request.
+
+
-
- !python {model: hr_timesheet_sheet.sheet}: |
- #self.write(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {'state': 'done'})
-
\ No newline at end of file
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.write(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {'state': 'done'})
\ No newline at end of file
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index 90ee35d21e2..ca46b31ace8 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -68,8 +68,8 @@
action="action_idea_category_tree"/>
+ id="menu_give_vote"
+ action="action_idea_select"/>
@@ -128,11 +128,11 @@
form
-
-
-
-
-
+
+
+
+
+
@@ -147,18 +147,18 @@
idea.vote
search
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,7 +270,7 @@
-
+
diff --git a/addons/knowledge/security/ir.model.access.csv b/addons/knowledge/security/ir.model.access.csv
index 4fcaaad82cd..9abb2d03be7 100644
--- a/addons/knowledge/security/ir.model.access.csv
+++ b/addons/knowledge/security/ir.model.access.csv
@@ -1,2 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_knowledge_installer","knowledge.installer","model_knowledge_installer",base.group_user,1,0,0,0
+"access_knowledge_installer","knowledge.installer","model_knowledge_installer",base.group_system,1,1,1,1
diff --git a/addons/l10n_be/security/ir.model.access.csv b/addons/l10n_be/security/ir.model.access.csv
index fbb5c74c18c..04d498b5785 100644
--- a/addons/l10n_be/security/ir.model.access.csv
+++ b/addons/l10n_be/security/ir.model.access.csv
@@ -1,6 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_vat_listing_clients","vat.listing.clients","model_vat_listing_clients",,1,1,1,1
-"access_partner_vat_intra","partner.vat.intra","model_partner_vat_intra",,1,1,1,1
-"access_partner_vat","partner.vat","model_partner_vat",,1,1,1,1
-"access_partner_vat_list","partner.vat.list","model_partner_vat_list",,1,1,1,1
-"access_l1on_be_vat_declaration","l1on_be.vat.declaration","model_l1on_be_vat_declaration",,1,1,1,1
+"access_vat_listing_clients","vat.listing.clients","model_vat_listing_clients",account.group_account_user,1,1,1,1
+"access_partner_vat_intra","partner.vat.intra","model_partner_vat_intra",account.group_account_user,1,1,1,1
+"access_partner_vat","partner.vat","model_partner_vat",account.group_account_user,1,1,1,1
+"access_partner_vat_list","partner.vat.list","model_partner_vat_list",account.group_account_user,1,1,1,1
+"access_l1on_be_vat_declaration","l1on_be.vat.declaration","model_l1on_be_vat_declaration",account.group_account_user,1,1,1,1
diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
index 8b4b94a3de2..a5e664c833a 100644
--- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
+++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
@@ -28,9 +28,15 @@ class l10n_be_vat_declaration(osv.osv_memory):
_name = "l1on_be.vat.declaration"
_description = "Vat Declaration"
+ def _get_xml_data(self, cr, uid, context=None):
+ if context.get('file_save', False):
+ return base64.encodestring(context['file_save'])
+ return ''
+
_columns = {
'name': fields.char('File Name', size=32),
'period_id': fields.many2one('account.period','Period', required=True),
+ 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', domain=[('parent_id', '=', False)]),
'msg': fields.text('File created', size=64, readonly=True),
'file_save': fields.binary('Save File'),
'ask_resitution': fields.boolean('Ask Restitution'),
@@ -39,7 +45,9 @@ class l10n_be_vat_declaration(osv.osv_memory):
}
_defaults = {
'msg': 'Save the File with '".xml"' extension.',
- }
+ 'file_save': _get_xml_data,
+ 'name': 'vat_declaration.xml',
+ }
def create_xml(self, cr, uid, ids, context=None):
obj_fyear = self.pool.get('account.fiscalyear')
@@ -48,16 +56,22 @@ class l10n_be_vat_declaration(osv.osv_memory):
obj_user = self.pool.get('res.users')
obj_comp = self.pool.get('res.company')
obj_data = self.pool.get('ir.model.data')
+ mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
list_of_tags=['00','01','02','03','44','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','88','91']
- obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
+ data_tax = self.browse(cr, uid, ids[0])
+ if data_tax.tax_code_id:
+ obj_company = data_tax.tax_code_id.company_id
+ else:
+ obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
user_cmpny = obj_company.name
vat_no = obj_company.partner_id.vat
if not vat_no:
- osv.except_osv(_('Data Insufficient'), _('No VAT Number Associated with Main Company!'))
+ raise osv.except_osv(_('Data Insufficient'), _('No VAT Number Associated with Main Company!'))
+
tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
ctx = context.copy()
@@ -99,9 +113,21 @@ class l10n_be_vat_declaration(osv.osv_memory):
data_of_file +='\n\t\t\t\t' + str(abs(int(item['sum_period']*100))) + ' '
data_of_file +='\n\t\t\t\n\t\t\n\t\n'
- data['file_save'] = base64.encodestring(data_of_file)
- self.write(cr, uid, ids, {'file_save': data['file_save'], 'name': 'vat_declare.xml'}, context=context)
- return True
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_vat_save')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ context['file_save'] = data_of_file
+ return {
+ 'name': _('Save XML For Vat declaration'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'l1on_be.vat.declaration',
+ 'views': [(resource_id,'form')],
+ 'view_id': 'view_vat_save',
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
l10n_be_vat_declaration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml
index 342226930ce..dbc857a30c3 100644
--- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml
+++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml
@@ -13,29 +13,44 @@
form
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Save XML
+ l1on_be.vat.declaration
+ form
+
+
+
+
-
-
-
-
+
+
+
+
-
+
diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra.py b/addons/l10n_be/wizard/l10n_be_vat_intra.py
index 954b4675a49..de497d151d8 100644
--- a/addons/l10n_be/wizard/l10n_be_vat_intra.py
+++ b/addons/l10n_be/wizard/l10n_be_vat_intra.py
@@ -31,6 +31,11 @@ class partner_vat_intra(osv.osv_memory):
_name = "partner.vat.intra"
_description = 'Partner VAT Intra'
+ def _get_xml_data(self, cr, uid, context=None):
+ if context.get('file_save', False):
+ return base64.encodestring(context['file_save'])
+ return ''
+
def _get_europe_country(self, cursor, user, context=None):
return self.pool.get('res.country').search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])
@@ -46,6 +51,7 @@ class partner_vat_intra(osv.osv_memory):
'''
),
'period_ids': fields.many2many('account.period', 'account_period_rel', 'acc_id', 'period_id', 'Period (s)', help = 'Select here the period(s) you want to include in your intracom declaration'),
+ 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', domain=[('parent_id', '=', False)]),
'test_xml': fields.boolean('Test XML file', help="Sets the XML output as test file"),
'mand_id' : fields.char('MandataireId', size=14, required=True, help="This identifies the representative of the sending company. This is a string of 14 characters"),
'msg': fields.text('File created', size=14, readonly=True),
@@ -56,6 +62,8 @@ class partner_vat_intra(osv.osv_memory):
_defaults = {
'country_ids': _get_europe_country,
+ 'file_save': _get_xml_data,
+ 'name': 'vat_Intra.xml',
}
def create_xml(self, cursor, user, ids, context=None):
@@ -65,13 +73,18 @@ class partner_vat_intra(osv.osv_memory):
obj_partner = self.pool.get('res.partner')
obj_partner_add = self.pool.get('res.partner.address')
obj_country = self.pool.get('res.country')
+ mod_obj = self.pool.get('ir.model.data')
street = zip_city = country = p_list = data_clientinfo = ''
error_message = list_partner = []
seq = amount_sum = 0
if context is None:
context = {}
- data_cmpny = obj_user.browse(cursor, user, user).company_id
+ data_tax = self.browse(cursor, user, ids[0], context=context)
+ if data_tax.tax_code_id:
+ data_cmpny = data_tax.tax_code_id.company_id
+ else:
+ data_cmpny = obj_user.browse(cursor, user, user).company_id
data = self.read(cursor, user, ids)[0]
company_vat = data_cmpny.partner_id.vat
if not company_vat:
@@ -132,14 +145,20 @@ class partner_vat_intra(osv.osv_memory):
amount_sum = int(amount_sum)
data_decl = '\n\t'
data_file += str(data_decl) + str(data_comp) + str(data_period) + str(data_clientinfo) + '\n\t \n'
- data = {
- 'msg': 'XML Flie has been Created. Save the File with '".xml"' extension.',
- 'file_save': base64.encodestring(data_file),
- 'name': 'vat_Intra.xml',
- 'country_ids': [[6, 0, obj_country.search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])]],
- }
- self.write(cursor, user, ids, {'file_save':data['file_save'], 'msg':data['msg'], 'name':data['name'], 'no_vat':p_list, 'country_ids':data['country_ids']}, context=context)
- return True
+ model_data_ids = mod_obj.search(cursor, user,[('model','=','ir.ui.view'),('name','=','view_vat_intra_save')], context=context)
+ resource_id = mod_obj.read(cursor, user, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ context['file_save'] = data_file
+ return {
+ 'name': _('Save'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'partner.vat.intra',
+ 'views': [(resource_id,'form')],
+ 'view_id': 'view_vat_intra_save',
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
partner_vat_intra()
diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra_view.xml b/addons/l10n_be/wizard/l10n_be_vat_intra_view.xml
index 59fa21000a1..fa50513a9da 100644
--- a/addons/l10n_be/wizard/l10n_be_vat_intra_view.xml
+++ b/addons/l10n_be/wizard/l10n_be_vat_intra_view.xml
@@ -13,32 +13,50 @@
form
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Partner VAT intra Save
+ partner.vat.intra
+ form
+
+
+
+
+
-
-
-
-
-
@@ -46,6 +64,7 @@
+
Partner Vat Intra
ir.actions.act_window
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index fb4920e9632..48b3a12aee4 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -21,26 +21,9 @@
from osv import osv, fields
import time
-import base64
+import tools
+import base64
-class one2many_domain(fields.one2many):
- def set(self, cr, obj, id, field, values, user=None, context=None):
- if not values:
- return
- return super(one2many_domain, self).set(cr, obj, id, field, values,
- user=user, context=context)
-
- def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
- if context is None:
- context = {}
- res = {}
- msg_obj = obj.pool.get('mailgate.message')
- for thread in obj.browse(cr, user, ids, context=context):
- final = msg_obj.search(cr, user, self._domain + [('thread_id', '=', thread.id)], context=context)
- res[thread.id] = final
- return res
-
-
class mailgate_thread(osv.osv):
'''
Mailgateway Thread
@@ -51,11 +34,11 @@ class mailgate_thread(osv.osv):
_columns = {
'thread': fields.char('Thread', size=32, required=False),
- 'message_ids': one2many_domain('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False),
- 'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
- }
+ 'message_ids': fields.one2many('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False),
+ 'log_ids': fields.one2many('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
+ }
- def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
+ def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=None, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@@ -69,9 +52,13 @@ class mailgate_thread(osv.osv):
@param context: A standard dictionary for contextual values"""
if context is None:
context = {}
+ if attach is None:
+ attach = []
+
# The mailgate sends the ids of the cases and not the object list
- if all(isinstance(case_id, (int, long)) for case_id in cases) and context.get('model'):
- cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
+
+ if all(isinstance(case_id, (int, long)) for case_id in cases):
+ cases = self.browse(cr, uid, cases, context=context)
model_obj = self.pool.get('ir.model')
att_obj = self.pool.get('ir.attachment')
@@ -84,7 +71,7 @@ class mailgate_thread(osv.osv):
'user_id': uid,
'model_id' : model_ids and model_ids[0] or False,
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
- 'thread_id': case.thread_id.id,
+ 'thread_id': case.thread_id.id,
'message_id': message_id,
}
attachments = []
@@ -93,29 +80,28 @@ class mailgate_thread(osv.osv):
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
data = {
- 'name': subject or 'History',
- 'history': True,
- 'user_id': uid,
- 'model_id' : model_ids and model_ids[0] or False,
- 'res_id': case.id,
- 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
- 'description': details or (hasattr(case, 'description') and case.description or False),
- 'email_to': email or \
- (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from', False),
- 'email_from': email_from or \
- (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from', False),
- 'partner_id': hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False,
- 'thread_id': case.thread_id.id,
- 'message_id': message_id,
- 'attachment_ids': [(6, 0, attachments)]
- }
+ 'name': subject or 'History',
+ 'history': True,
+ 'user_id': uid,
+ 'model_id' : model_ids and model_ids[0] or False,
+ 'res_id': case.id,
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'description': details or (hasattr(case, 'description') and case.description or False),
+ 'email_to': email or \
+ (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
+ case.user_id.address_id.email) or tools.config.get('email_from', False),
+ 'email_from': email_from or \
+ (hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
+ case.user_id.address_id.email) or tools.config.get('email_from', False),
+ 'partner_id': hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False,
+ 'thread_id': case.thread_id.id,
+ 'message_id': message_id,
+ 'attachment_ids': [(6, 0, attachments)]
+ }
res = obj.create(cr, uid, data, context)
return True
- _history = __history
- history = __history
+ __history = history = _history
mailgate_thread()
diff --git a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
index a865443c1b9..c4cad98b046 100755
--- a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
+++ b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
@@ -3,7 +3,8 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2009 Tiny SPRL ().
+# Copyright (C) 2010-TODAY OpenERP S.A. (http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -22,14 +23,18 @@
import re
import smtplib
-import email, mimetypes
+import email
+import mimetypes
from email.Header import decode_header
from email.MIMEText import MIMEText
import xmlrpclib
import os
import binascii
-import time, socket
-
+import time
+import socket
+import logging
+import sys
+import optparse
email_re = re.compile(r"([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6})")
case_re = re.compile(r"\[([0-9]+)\]", re.UNICODE)
@@ -89,7 +94,6 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
html = html.replace('', '**').replace(' ', '**')
html = html.replace('', '**').replace(' ', '**')
html = html.replace('', '/').replace(' ', '/')
-
# the only line breaks we respect is those of ending tags and
# breaks
@@ -101,14 +105,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
html = re.sub(' ', '\n', html)
html = html.replace(' ' * 2, ' ')
-
- # for all other tags we failed to clean up, just remove then and
- # complain about them on the stderr
- def desperate_fixer(g):
- #print >>sys.stderr, "failed to clean up %s" % str(g.group())
- return ' '
-
- html = re.sub('<.*?>', desperate_fixer, html)
+ html = re.sub('<.*?>', ' ', html)
# lstrip all lines
html = '\n'.join([x.lstrip() for x in html.splitlines()])
@@ -166,10 +163,10 @@ class email_parser(object):
pass
return s.decode('latin1')
- def _decode_header(self, s):
- from email.Header import decode_header
- s = decode_header(s.replace('\r', ''))
- return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
+ def _decode_header(self, text):
+ if text:
+ text = decode_header(text.replace('\r', ''))
+ return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), text or []))
def msg_new(self, msg):
message = self.msg_body_get(msg)
@@ -188,14 +185,25 @@ class email_parser(object):
}
data.update(self.partner_get(msg_from))
- try:
- id = self.rpc(self.model, 'create', data)
- self.rpc(self.model, 'history', [id], 'Receive', True, msg_to, message['body'], msg_from, False, {'model' : self.model})
- #self.rpc(self.model, 'case_open', [id])
- except Exception, e:
- if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode:
- e = '\n\nThe Specified user does not have an access to the CRM case.'
- print e
+ values = {
+ 'message_ids' : [
+ (0, 0, {
+ 'model_id' : self.rpc('ir.model', 'search', [('name', '=', self.model)])[0],
+ 'date' : time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'description' : message['body'],
+ 'email_from' : msg_from,
+ 'email_to' : msg_to,
+ 'name' : 'Receive',
+ 'history' : True,
+ 'user_id' : self.rpc.user_id,
+ }
+ )
+ ]
+ }
+ thread_id = self.rpc('mailgate.thread', 'create', values)
+ data['thread_id'] = thread_id
+ oid = self.rpc(self.model, 'create', data)
+
attachments = message['attachment']
for attach in attachments or []:
data_attach = {
@@ -204,30 +212,19 @@ class email_parser(object):
'datas_fname': str(attach),
'description': 'Mail attachment',
'res_model': self.model,
- 'res_id': id
+ 'res_id': oid
}
self.rpc('ir.attachment', 'create', data_attach)
- return id
-
-# #change the return type format to dictionary
-# {
-# 'body':'body part',
-# 'attachment':{
-# 'file_name':'file data',
-# 'file_name':'file data',
-# 'file_name':'file data',
-# }
-# }
+ return (oid, thread_id,)
def msg_body_get(self, msg):
- message = {};
- message['body'] = '';
- message['attachment'] = {};
+ message = {
+ 'body' : '',
+ 'attachment' : {},
+ }
attachment = message['attachment'];
counter = 1;
- def replace(match):
- return ''
for part in msg.walk():
if part.get_content_maintype() == 'multipart':
@@ -237,27 +234,23 @@ class email_parser(object):
buf = part.get_payload(decode=True)
if buf:
txt = self._to_decode(buf, part.get_charsets())
- txt = re.sub("<(\w)>", replace, txt)
- txt = re.sub("<\/(\w)>", replace, txt)
+ txt = re.sub("<\/?(\w)>", '', txt)
if txt and part.get_content_subtype() == 'plain':
message['body'] += txt
- elif txt and part.get_content_subtype() == 'html':
+ elif txt and part.get_content_subtype() == 'html':
message['body'] += html2plaintext(txt)
-
+
filename = part.get_filename();
if filename :
attachment[filename] = part.get_payload(decode=True);
-
- elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text':
+
+ elif part.get_content_maintype() in ('application', 'image', 'text'):
filename = part.get_filename();
- if filename :
- attachment[filename] = part.get_payload(decode=True);
- else:
+ if not filename :
filename = 'attach_file'+str(counter);
counter += 1;
- attachment[filename] = part.get_payload(decode=True);
- #end if
- #end if
+
+ attachment[filename] = part.get_payload(decode=True);
message['attachment'] = attachment
#end for
return message
@@ -316,22 +309,42 @@ class email_parser(object):
}
self.rpc('ir.attachment', 'create', data_attach)
- self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), body['body'], self._decode_header(msg['From']), False, {'model' : self.model})
+ self.create_message(id, msg['From'], msg['To'], 'Send', message['body'])
+
return id
+ def create_message(self, oid, email_from, email_to, name, body):
+ """
+ This functions creates a message in the thread
+
+ > create_message(id, msg['From'], msg['To'], 'Send', message['body'])
+ """
+ values = {
+ 'thread_id' : self.rpc(self.model, 'read', [oid], ['thread_id'])[0]['thread_id'][0],
+ 'model_id' : self.rpc('ir.model', 'search', [('name', '=', self.model)])[0],
+ 'res_id' : oid,
+ 'date' : time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'description' : body,
+ 'email_from' : self._decode_header(email_from),
+ 'email_to' : self._decode_header(email_to),
+ 'name' : name,
+ 'history' : True,
+ 'user_id' : self.rpc.user_id,
+ }
+ return self.rpc('mailgate.message', 'create', values)
+
def msg_send(self, msg, emails, priority=None):
- if not len(emails):
+ if not emails:
return False
- del msg['To']
+
msg['To'] = emails[0]
- if len(emails)>1:
- if 'Cc' in msg:
- del msg['Cc']
+ if len(emails) > 1:
msg['Cc'] = ','.join(emails[1:])
- del msg['Reply-To']
msg['Reply-To'] = self.email
+
if priority:
msg['X-Priority'] = priorities.get(priority, '3 (Normal)')
+
s = smtplib.SMTP()
s.connect()
s.sendmail(self.email, emails, msg.as_string())
@@ -343,11 +356,6 @@ class email_parser(object):
body = message['body']
act = 'case_open'
self.rpc(self.model, act, [id])
- #body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n')))
- #data = {
- # 'description':body,
- #}
- #self.rpc(self.model, 'write', [id], data)
attachments = message['attachment']
for attach in attachments or []:
data_attach = {
@@ -360,14 +368,16 @@ class email_parser(object):
}
self.rpc('ir.attachment', 'create', data_attach)
- self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), message['body'], self._decode_header(msg['From']), False, {'model' : self.model})
+ self.create_message(id, msg['From'], msg['To'], 'Send', message['body'])
return id
def msg_test(self, msg, case_str):
if not case_str:
return (False, False)
- emails = self.rpc(self.model, 'emails_get', int(case_str))
- return (int(case_str), emails)
+
+ case_id = int(case_str)
+ emails = self.rpc(self.model, 'emails_get', [case_id])
+ return (case_id, emails)
def parse(self, msg):
case_str = reference_re.search(msg.get('References', ''))
@@ -377,23 +387,37 @@ class email_parser(object):
case_str = case_re.search(msg.get('Subject', ''))
if case_str:
case_str = case_str.group(1)
+
+ logging.info("email: %s -> %s -- %s", msg['From'], self.email, msg['Subject'])
(case_id, emails) = self.msg_test(msg, case_str)
+ thread_id = None
if case_id:
- if emails[0] and self.email_get(emails[0])==self.email_get(self._decode_header(msg['From'])):
+ values = self.rpc(self.model, 'read', [case_id], ['thread_id'])
+ if values:
+ thread_id = values[0]['thread_id'][0]
+ emails = emails[str(thread_id)]
+
+ user_email = filter(None, emails['user_email'])[0]
+
+ if user_email and self.email_get(user_email) == self.email_get(self._decode_header(msg['From'])):
self.msg_user(msg, case_id)
else:
self.msg_partner(msg, case_id)
else:
- case_id = self.msg_new(msg)
- subject = self._decode_header(msg['subject'])
- if msg.get('Subject', ''):
- del msg['Subject']
- msg['Subject'] = '['+str(case_id)+'] '+subject
- msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(case_id)+'@'+socket.gethostname()+'>'
+ case_id, thread_id = self.msg_new(msg)
+ subject = self._decode_header(msg['Subject'])
+ msg['Subject'] = "[%s] %s" % (case_id, subject,)
+ msg['Message-Id'] = "<%s-openerpcrm-%s@%s>" % (time.time(), case_id, socket.gethostname(),)
- emails = self.rpc(self.model, 'emails_get', case_id)
- priority = emails[3]
- em = [emails[0], emails[1]] + (emails[2] or '').split(',')
+ logging.info(" case: %r", case_id)
+ logging.info(" thread: %r", thread_id)
+
+ values = self.rpc(self.model, 'emails_get', [case_id])
+
+ emails = values[str(thread_id)]
+
+ priority = emails.get('piority', [3])[0]
+ em = emails['user_email'] + emails['email_from'] + emails['email_cc']
emails = map(self.email_get, filter(None, em))
mm = [self._decode_header(msg['From']), self._decode_header(msg['To'])]+self._decode_header(msg.get('Cc', '')).split(',')
@@ -405,13 +429,11 @@ class email_parser(object):
except:
if self.email_default:
a = self._decode_header(msg['Subject'])
- del msg['Subject']
msg['Subject'] = '[OpenERP-CaseError] ' + a
self.msg_send(msg, self.email_default.split(','))
- return case_id, emails
+ return case_id, thread_id, emails
if __name__ == '__main__':
- import sys, optparse
parser = optparse.OptionParser(usage='usage: %prog [options]', version='%prog v1.0')
group = optparse.OptionGroup(parser, "Note",
"This program parse a mail from standard input and communicate "
@@ -426,8 +448,10 @@ if __name__ == '__main__':
parser.add_option("--host", dest="host", help="Hostname of the Open ERP Server", default="localhost")
parser.add_option("--port", dest="port", help="Port of the Open ERP Server", default="8069")
-
(options, args) = parser.parse_args()
+
+ logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
+
parser = email_parser(options.userid, options.password, options.model, options.email, options.default, dbname=options.dbname, host=options.host, port=options.port)
msg_txt = email.message_from_file(sys.stdin)
diff --git a/addons/marketing/__openerp__.py b/addons/marketing/__openerp__.py
index ee6abca5355..6db46333985 100644
--- a/addons/marketing/__openerp__.py
+++ b/addons/marketing/__openerp__.py
@@ -29,7 +29,10 @@
"description": "Menu for Marketing",
'website': 'http://www.openerp.com',
'init_xml': [],
- 'update_xml': ['marketing_view.xml'],
+ 'update_xml': [
+ 'marketing_view.xml',
+ 'security/ir.model.access.csv'
+ ],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/marketing/marketing_view.xml b/addons/marketing/marketing_view.xml
index 7d8a46a8a92..800b85f7c49 100644
--- a/addons/marketing/marketing_view.xml
+++ b/addons/marketing/marketing_view.xml
@@ -29,8 +29,9 @@
Configure
-
+
+
diff --git a/addons/marketing/marketing_wizard.py b/addons/marketing/marketing_wizard.py
index 8eb1d1a01f4..78b4e78ff6c 100644
--- a/addons/marketing/marketing_wizard.py
+++ b/addons/marketing/marketing_wizard.py
@@ -25,7 +25,8 @@ class marketing_installer(osv.osv_memory):
_name = 'marketing.installer'
_inherit = 'res.config.installer'
_columns = {
- # Generic modules
+ 'email_template':fields.boolean('Automated E-Mails',
+ help="Helps you to design templates of emails and integrate them in your different processes."),
'marketing_campaign':fields.boolean('Marketing Campaigns',
help="Helps you to manage marketing campaigns and automate actions and communication steps."),
'marketing_campaign_mailchimp':fields.boolean('Mailchimp Integration',
diff --git a/addons/marketing/security/ir.model.access.csv b/addons/marketing/security/ir.model.access.csv
new file mode 100644
index 00000000000..2a712aab4fd
--- /dev/null
+++ b/addons/marketing/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_marketing_installer","marketing.installer","model_marketing_installer","base.group_system",1,1,1,1
+"access_res_config_installer","access_marketing_installer","base.model_res_config_installer","base.group_system",1,1,1,1
diff --git a/addons/marketing_campaign/__init__.py b/addons/marketing_campaign/__init__.py
old mode 100755
new mode 100644
diff --git a/addons/marketing_campaign/__openerp__.py b/addons/marketing_campaign/__openerp__.py
old mode 100755
new mode 100644
index 992731c1332..8abbf9eb706
--- a/addons/marketing_campaign/__openerp__.py
+++ b/addons/marketing_campaign/__openerp__.py
@@ -39,6 +39,8 @@
'marketing_campaign_data.xml',
'marketing_campaign_workflow.xml',
'report/campaign_analysis_view.xml',
+ "security/marketing_campaign_security.xml",
+ "security/ir.model.access.csv"
],
'demo_xml': [
'marketing_campaign_demo.xml',
diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py
old mode 100755
new mode 100644
index 4773a190a41..36754bea803
--- a/addons/marketing_campaign/marketing_campaign.py
+++ b/addons/marketing_campaign/marketing_campaign.py
@@ -101,7 +101,7 @@ class marketing_campaign_segment(osv.osv):
_columns = {
'name': fields.char('Name', size=64,required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
- required=True),
+ required=True, select=1),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
@@ -200,7 +200,7 @@ class marketing_campaign_activity(osv.osv):
_columns = {
'name': fields.char('Name', size=128, required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
- required = True, ondelete='cascade'),
+ required = True, ondelete='cascade', select=1),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
@@ -242,7 +242,7 @@ class marketing_campaign_activity(osv.osv):
self._actions = {'paper' : self.process_wi_report,
'email' : self.process_wi_email,
'server_action' : self.process_wi_action,
- }
+ }
return super(marketing_campaign_activity, self).__init__(*args)
def search(self, cr, uid, args, offset=0, limit=None, order=None,
@@ -259,7 +259,7 @@ class marketing_campaign_activity(osv.osv):
return super(marketing_campaign_activity, self).search(cr, uid, args,
offset, limit, order, context, count)
- def process_wi_report(self, cr, uid, activity, workitem):
+ def process_wi_report(self, cr, uid, activity, workitem, context={}):
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
(report_data, format) = service.create(cr, uid, [], {}, {})
attach_vals = {
@@ -274,46 +274,58 @@ class marketing_campaign_activity(osv.osv):
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
return True
- def process_wi_email(self, cr, uid, activity, workitem):
- template = activity.email_template_id
- accounts = template.enforce_from_account
- if not template.enforce_from_account:
- return {'error_msg' : "There is no account defined for the email"}
- if not workitem.partner_id.email:
- return {'error_msg' : "There is no email defined for the partner"}
- vals = {
- 'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
- 'email_to': workitem.partner_id.email,
- 'subject': template.def_subject,
- 'body_text': template.def_body_text,
- 'body_html': template.def_body_html,
- 'account_id':accounts.id,
- 'state':'na',
- 'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
- }
-# if accounts.use_sign:
-# signature = self.pool.get('res.users').read(cr, uid, uid, ['signature'], context)['signature']
-# if signature:
-# vals['pem_body_text'] = tools.ustr(vals['pem_body_text'] or '') + signature
-# vals['pem_body_html'] = tools.ustr(vals['pem_body_html'] or '') + signature
+ def process_wi_email(self, cr, uid, activity, workitem, context=None):
+ print 'Sending Email Init', activity.name
+ return self.pool.get('email.template').generate_mail(cr, uid, activity.email_template_id.id, [workitem.res_id], context=context)
- #Create partly the mail and later update attachments
- mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
+ #if not template.enforce_from_account:
+ # self.pool.get('marketing.campaign.workitem').write(cr, uid, [workitem.id], {
+ # 'error_msg': 'There is no account defined for the email',
+ # 'state': 'exception'
+ # })
+ # return False
+ #if not workitem.partner_id.email:
+ # self.pool.get('marketing.campaign.workitem').write(cr, uid, [workitem.id], {
+ # 'error_msg': "There is no email defined for the partner",
+ # 'state': 'exception'
+ # })
+ # return False
+ #vals = {
+ # 'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
+ # 'email_to': template.email_to,
+ # 'email_cc': template.email_cc,
+ # 'email_bcc': template.email_bcc,
+ # 'subject': template.def_subject,
+ # 'body_text': template.def_body_text,
+ # 'body_html': template.def_body_html,
+ # 'account_id': accounts.id,
+ # 'state':'na',
+ # 'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
+ #}
+# # if accounts.use_sign:
+# # signature = self.pool.get('res.users').read(cr, uid, uid, ['signature'], context)['signature']
+# # if signature:
+# # vals['pem_body_text'] = tools.ustr(vals['pem_body_text'] or '') + signature
+# # vals['pem_body_html'] = tools.ustr(vals['pem_body_html'] or '') + signature
+
+ ##Create partly the mail and later update attachments
+ #print 'Sending Email', vals
+ #mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
return True
-
- def process_wi_action(self, cr, uid, activity, workitem):
+
+ def process_wi_action(self, cr, uid, activity, workitem, context={}):
context = {}
server_obj = self.pool.get('ir.actions.server')
- server_obj.run(cr, uid, [activity.server_action_id.id], context)
+ server_obj.run(cr, uid, [activity.server_action_id.id], context)
return True
-
def process(self, cr, uid, act_id, wi_id, context={}):
activity = self.browse(cr, uid, act_id)
+ print 'Process', activity.name
workitem_obj = self.pool.get('marketing.campaign.workitem')
- workitem = workitem_obj.browse(cr, uid, wi_id)
- self._actions[activity.type](cr, uid, activity, workitem)
- return True
+ workitem = workitem_obj.browse(cr, uid, wi_id, context=context)
+ print 'WI', workitem, activity.type
+ return self._actions[activity.type](cr, uid, activity, workitem, context)
marketing_campaign_activity()
@@ -324,7 +336,7 @@ class marketing_campaign_transition(osv.osv):
_columns = {
'activity_from_id': fields.many2one('marketing.campaign.activity',
- 'Source Activity'),
+ 'Source Activity', select=1),
'activity_to_id': fields.many2one('marketing.campaign.activity',
'Destination Activity'),
'interval_nbr': fields.integer('Interval No.'),
@@ -366,12 +378,12 @@ class marketing_campaign_workitem(osv.osv):
'campaign_id': fields.related('segment_id', 'campaign_id',
type='many2one', relation='marketing.campaign', string='Campaign', readonly=True),
'object_id': fields.related('segment_id', 'campaign_id', 'object_id',
- type='many2one', relation='ir.model', string='Object'),
- 'res_id': fields.integer('Resource ID'),
+ type='many2one', relation='ir.model', string='Object', select=1),
+ 'res_id': fields.integer('Resource ID', select=1),
'res_name': fields.function(_res_name_get, method=True, string='Resource Name', type="char", size=64),
'date': fields.datetime('Execution Date'),
- 'partner_id': fields.many2one('res.partner', 'Partner'),
- 'state': fields.selection([('todo', 'ToDo'), ('inprogress', 'In Progress'),
+ 'partner_id': fields.many2one('res.partner', 'Partner', select=1),
+ 'state': fields.selection([('todo', 'To Do'), ('inprogress', 'In Progress'),
('exception', 'Exception'), ('done', 'Done'),
('cancelled', 'Cancelled')], 'State'),
@@ -400,8 +412,14 @@ class marketing_campaign_workitem(osv.osv):
self.create(cr, uid, workitem_vals)
return True
+ def button_draft(self, cr, uid, workitem_ids, context={}):
+ for wi in self.browse(cr, uid, workitem_ids, context=context):
+ if wi.state=='exception':
+ self.write(cr, uid, [wi.id], {'state':'todo'}, context=context)
+ return True
+
def button_cancel(self, cr, uid, workitem_ids, context={}):
- for wi in self.browse(cr, uid, workitem_ids):
+ for wi in self.browse(cr, uid, workitem_ids, context=context):
if wi.state in ('todo','exception'):
self.write(cr, uid, [wi.id], {'state':'cancelled'}, context=context)
return True
@@ -419,14 +437,18 @@ class marketing_campaign_workitem(osv.osv):
}
expr = eval(str(wi.activity_id.condition), eval_context)
if expr:
- try :
+ try:
+ result = True
if wi.campaign_id.mode in ('manual','active'):
- self.pool.get('marketing.campaign.activity').process(
+ result = self.pool.get('marketing.campaign.activity').process(
cr, uid, wi.activity_id.id, wi.id, context)
- self.write(cr, uid, wi.id, {'state': 'done'})
- self.process_chain(cr, uid, wi.id, context)
+ if result:
+ self.write(cr, uid, wi.id, {'state': 'done'})
+ self.process_chain(cr, uid, wi.id, context)
+ else:
+ self.write(cr, uid, wi.id, {'state': 'exception'})
except Exception,e:
- self.write(cr, uid, wi.id, {'state': 'exception'})
+ self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
else :
self.write(cr, uid, wi.id, {'state': 'cancelled'})
@@ -444,9 +466,9 @@ class marketing_campaign_workitem(osv.osv):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
else:
# manual states are not processed automatically
- pass
- if workitem_ids:
- self.process(cr, uid, workitem_ids, context)
+ workitem_ids = []
+ if workitem_ids:
+ self.process(cr, uid, workitem_ids, context)
marketing_campaign_workitem()
diff --git a/addons/marketing_campaign/marketing_campaign_view.xml b/addons/marketing_campaign/marketing_campaign_view.xml
old mode 100755
new mode 100644
index ea25e0d3163..0ab2add38ba
--- a/addons/marketing_campaign/marketing_campaign_view.xml
+++ b/addons/marketing_campaign/marketing_campaign_view.xml
@@ -182,15 +182,15 @@
-
+
-
-
+
+
@@ -397,11 +397,16 @@
+
+
+
+
+
-
+
diff --git a/addons/marketing_campaign/security/ir.model.access.csv b/addons/marketing_campaign/security/ir.model.access.csv
new file mode 100644
index 00000000000..dfafc2cd8a5
--- /dev/null
+++ b/addons/marketing_campaign/security/ir.model.access.csv
@@ -0,0 +1,7 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
+"access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
+"access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
+"access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
+"access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing_campaign.res_groups_marketing_campaign",1,1,1,1
+"access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing_campaign.res_groups_marketing_campaign",1,0,0,0
diff --git a/addons/marketing_campaign/security/marketing_campaign_security.xml b/addons/marketing_campaign/security/marketing_campaign_security.xml
new file mode 100644
index 00000000000..e28fd4867ce
--- /dev/null
+++ b/addons/marketing_campaign/security/marketing_campaign_security.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+ Marketing / Campaign
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp/i18n/hi.po b/addons/mrp/i18n/hi.po
index 7ac7081d791..2e356c5ca2a 100644
--- a/addons/mrp/i18n/hi.po
+++ b/addons/mrp/i18n/hi.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-06-10 09:51+0000\n"
+"PO-Revision-Date: 2010-06-11 10:07+0000\n"
"Last-Translator: vir (Open ERP) \n"
"Language-Team: Hindi \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-11 03:42+0000\n"
+"X-Launchpad-Export-Date: 2010-06-12 03:44+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
@@ -460,7 +460,7 @@ msgstr ""
#. module: mrp
#: field:mrp.bom.revision,author_id:0
msgid "Author"
-msgstr ""
+msgstr "लेखक"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_stockproduct0
@@ -491,7 +491,7 @@ msgstr ""
#. module: mrp
#: field:mrp.procurement,message:0
msgid "Latest error"
-msgstr ""
+msgstr "नवीनतम त्रुटि"
#. module: mrp
#: field:mrp.bom,bom_lines:0
@@ -511,7 +511,7 @@ msgstr ""
#. module: mrp
#: view:mrp.production:0
msgid "Consumed Products"
-msgstr ""
+msgstr "खपत उत्पाद"
#. module: mrp
#: constraint:mrp.bom:0
@@ -538,12 +538,12 @@ msgstr ""
#. module: mrp
#: selection:mrp.procurement,state:0
msgid "Ready"
-msgstr ""
+msgstr "तैयार"
#. module: mrp
#: view:mrp.routing:0
msgid "Workcenter Operations"
-msgstr ""
+msgstr "Workcenter संचालन"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.mrp_production_action2_gantt
@@ -564,7 +564,7 @@ msgstr ""
#. module: mrp
#: field:mrp.production,date_finnished:0
msgid "End Date"
-msgstr ""
+msgstr "समाप्ति तिथि"
#. module: mrp
#: help:mrp.production,picking_id:0
@@ -576,7 +576,7 @@ msgstr ""
#. module: mrp
#: selection:mrp.production,state:0
msgid "In Production"
-msgstr ""
+msgstr "उत्पादन में"
#. module: mrp
#: field:stock.warehouse.orderpoint,qty_multiple:0
@@ -600,12 +600,12 @@ msgstr ""
#. module: mrp
#: wizard_button:mrp.workcenter.load,init,report:0
msgid "Print"
-msgstr ""
+msgstr "प्रिंट"
#. module: mrp
#: field:mrp.workcenter,type:0
msgid "Type"
-msgstr ""
+msgstr "प्रकार"
#. module: mrp
#: model:process.node,note:mrp.process_node_stockproduct0
@@ -616,7 +616,7 @@ msgstr ""
#. module: mrp
#: selection:mrp.workcenter.load,init,time_unit:0
msgid "Per month"
-msgstr ""
+msgstr "प्रति माह"
#. module: mrp
#: field:mrp.procurement,product_uos_qty:0
@@ -626,18 +626,18 @@ msgstr ""
#. module: mrp
#: rml:bom.structure:0
msgid "Product Name"
-msgstr ""
+msgstr "वस्तु का नाम"
#. module: mrp
#: rml:mrp.production.order:0
msgid "Printing date"
-msgstr ""
+msgstr "मुद्रण तारीख"
#. module: mrp
#: model:process.node,name:mrp.process_node_orderrfq0
#: model:process.node,name:mrp.process_node_rfq0
msgid "RFQ"
-msgstr ""
+msgstr "कोटेशन के लिए अनुरोध"
#. module: mrp
#: field:mrp.bom,revision_type:0
@@ -657,7 +657,7 @@ msgstr ""
#. module: mrp
#: field:stock.warehouse.orderpoint,product_min_qty:0
msgid "Min Quantity"
-msgstr ""
+msgstr "न्यूनतम मात्रा"
#. module: mrp
#: view:mrp.production:0
@@ -678,7 +678,7 @@ msgstr ""
#. module: mrp
#: model:process.transition,note:mrp.process_transition_servicemts0
msgid "If Product type is service and procure method is Make to stock"
-msgstr ""
+msgstr "अगर उत्पाद प्रकार सेवा है और खरीद विधि है स्टॉक बनाने के लिए"
#. module: mrp
#: model:process.node,note:mrp.process_node_serviceproduct0
@@ -689,7 +689,7 @@ msgstr ""
#. module: mrp
#: field:res.company,security_lead:0
msgid "Security Days"
-msgstr ""
+msgstr "सुरक्षा दिवस"
#. module: mrp
#: view:mrp.production:0
@@ -715,7 +715,7 @@ msgstr ""
#. module: mrp
#: selection:mrp.procurement,state:0
msgid "Exception"
-msgstr ""
+msgstr "अपवाद"
#. module: mrp
#: wizard_view:product.product.procurement,init:0
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index b4c575bf2b0..26cecf79faa 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -117,9 +117,9 @@ class mrp_bom(osv.osv):
"""
Defines bills of material for a product.
"""
- _name = 'mrp.bom'
+ _name = 'mrp.bom'
_description = 'Bill of Material'
-
+
def _child_compute(self, cr, uid, ids, name, arg, context={}):
""" Gets child bom.
@param self: The object pointer
@@ -140,14 +140,14 @@ class mrp_bom(osv.osv):
bom_id = ids[0]
bom_parent = bom_obj.browse(cr, uid, bom_id)
for bom in self.browse(cr, uid, ids, context=context):
- if (bom_parent and bom_parent.multi_level_bom) or bom.id == bom_id:
+ if (bom_parent) or (bom.id == bom_id):
result[bom.id] = map(lambda x: x.id, bom.bom_lines)
else:
result[bom.id] = []
if bom.bom_lines:
continue
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
- if (bom.type=='phantom' or ok) and bom_parent.multi_level_bom:
+ if (bom.type=='phantom' or ok):
sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
bom2 = bom_obj.browse(cr, uid, sids[0], context=context)
@@ -203,7 +203,6 @@ class mrp_bom(osv.osv):
'revision_type': fields.selection([('numeric','numeric indices'),('alpha','alphabetical indices')], 'Index type'),
'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'company_id': fields.many2one('res.company','Company',required=True),
- 'multi_level_bom': fields.boolean('Multi-level BoM'),
}
_defaults = {
'active': lambda *a: 1,
@@ -212,7 +211,6 @@ class mrp_bom(osv.osv):
'product_rounding': lambda *a: 1.0,
'type': lambda *a: 'normal',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c),
- 'multi_level_bom': lambda *a: 0,
}
_order = "sequence"
_sql_constraints = [
@@ -247,7 +245,7 @@ class mrp_bom(osv.osv):
v['name'] = prod.name
return {'value': v}
return {}
-
+
def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
@@ -954,6 +952,3 @@ class mrp_production_product_line(osv.osv):
}
mrp_production_product_line()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 293c8d58aa9..3837588035e 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -41,7 +41,7 @@
id="menu_mrp_configuration"
name="Configuration"
parent="base.menu_mrp_root"
- groups="base.group_extended"
+ groups="group_mrp_manager"
sequence="50" />
@@ -250,23 +250,31 @@
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -283,7 +291,7 @@
-
+
mrp.bom.select
mrp.bom
search
@@ -291,9 +299,9 @@
-
-
-
+
+
+
@@ -402,26 +410,26 @@
-
-
+
-
+
-
+
-
-
+
+
+ Production Management
+ -->
mrp.production.tree
@@ -499,15 +507,15 @@
-
+
-
-
-
+
+
+
@@ -515,9 +523,9 @@
-
-
-
+
+
+
-
-
+
+
- procurement.order.form.inherit
- procurement.order
-
- form
-
-
-
-
-
+ procurement.order.form.inherit
+ procurement.order
+
+ form
+
+
+
+
+
+
+
+
+ product.normal.form
+ product.product
+
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/product.py b/addons/mrp/product.py
index ea717bd546c..64185d8dc26 100644
--- a/addons/mrp/product.py
+++ b/addons/mrp/product.py
@@ -24,15 +24,17 @@ from tools.translate import _
class product_product(osv.osv):
- _inherit = "product.product"
-
+ _inherit = "product.product"
+ _columns = {
+ "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials'),
+ }
def do_change_standard_price(self, cr, uid, ids, datas, context={}):
""" Changes the Standard Price of Product and parent products and creates an account move accordingly.
@param datas: dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
- @param context: A standard dictionary
- @return:
- """
- #TODO : TO Check
+ @param context: A standard dictionary
+ @return:
+ """
+ #TODO : TO Check
res = super(product_product, self).do_change_standard_price(cr, uid, ids, datas, context=context)
bom_obj = self.pool.get('mrp.bom')
def _compute_price(bom):
@@ -44,7 +46,7 @@ class product_product(osv.osv):
price += bom_line.product_qty * prod_price
accounts = self.get_product_accounts(cr, uid, bom.bom_id.product_id.id, context)
-
+
datas = {
'new_price': price,
'stock_output_account': accounts['stock_account_output'],
@@ -54,9 +56,9 @@ class product_product(osv.osv):
super(product_product, self).do_change_standard_price(cr, uid, [bom.bom_id.product_id.id], datas, context)
_compute_price(bom.bom_id)
return price
-
+
bom_ids = bom_obj.search(cr, uid, [('product_id', 'in', ids)])
-
+
for bom in bom_obj.browse(cr, uid, bom_ids):
_compute_price(bom)
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 8f58f7179ad..8089be4a431 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -24,7 +24,7 @@
"access_hr_timesheet_group_mrp_worker","resource.calendar mrp_worker","resource.model_resource_calendar","mrp.group_mrp_user",1,0,0,0
"access_procurement_stock_worker","procurement.order stock_worker","model_procurement_order","stock.group_stock_user",1,1,1,1
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
-"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
+"access_mrp_installer","mrp.installer","model_mrp_installer","base.group_system",1,1,1,1
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
"access_mrp_change_production_qty","change.production.qty","model_change_production_qty","mrp.group_mrp_user",1,0,0,0
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0
diff --git a/addons/mrp_operations/i18n/hi.po b/addons/mrp_operations/i18n/hi.po
new file mode 100644
index 00000000000..25ec3464854
--- /dev/null
+++ b/addons/mrp_operations/i18n/hi.po
@@ -0,0 +1,439 @@
+# Hindi 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.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-08-28 16:01+0000\n"
+"PO-Revision-Date: 2010-06-14 08:48+0000\n"
+"Last-Translator: vir (Open ERP) \n"
+"Language-Team: Hindi \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-15 03:33+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_startoperation0
+msgid "Start Operation"
+msgstr "ऑपरेशन प्रारंभ करें"
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,state:0
+msgid "In Progress"
+msgstr "प्रगति में है"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Pause"
+msgstr "ठहरें (Pause)"
+
+#. module: mrp_operations
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_startoperation0
+msgid "Operation is started"
+msgstr "ऑपरेशन शुरू कर दिया है"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Information"
+msgstr "जानकारी"
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startcanceloperation0
+msgid "Start Cancel Operation"
+msgstr "आरंभ रद्द संचालन"
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "In Production"
+msgstr "उत्पादन में"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_code_action
+msgid "Operations Code"
+msgstr "परिचालन संहिता"
+
+#. module: mrp_operations
+#: model:process.process,name:mrp_operations.process_process_mrpoperationprocess0
+msgid "Mrp Operation Process"
+msgstr "एमआरपी ऑपरेशन प्रक्रिया"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,state:0
+#: field:mrp_operations.operation.code,start_stop:0
+msgid "Status"
+msgstr "स्थिति"
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startdoneoperation0
+msgid "Start Done Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Start"
+msgstr "प्रारंभ"
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,production_id:0
+msgid "Production"
+msgstr "उत्पादन"
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Calendar View"
+msgstr "कैलेंडर देखना"
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_workorder0
+msgid "Work Center"
+msgstr "कार्य केंद्र"
+
+#. module: mrp_operations
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "कार्य की परिभाषा में मॉडल का नाम अमान्य है."
+
+#. module: mrp_operations
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_operation_action
+msgid "Work Order Events Using Bar Codes"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Set Draft"
+msgstr "Set as Draft"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_form
+#: view:mrp.production.workcenter.line:0
+msgid "Work Orders"
+msgstr "काम के आदेश"
+
+#. module: mrp_operations
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_code_action
+msgid "Start - Stop Codes"
+msgstr "शुरू और बंद कोड"
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,uom:0
+msgid "UOM"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation.code:0
+msgid "Production Operation Code"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_planned:0
+msgid "Scheduled Date"
+msgstr "अनुसूचित तिथि"
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_productionstart0
+msgid "From production order, create the workorder"
+msgstr "उत्पादन से आदेश, कार्य आदेश बनाने के लिए"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Hours by Workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production,allow_reorder:0
+msgid ""
+"Check this to be able to move independently all production orders, without "
+"moving dependent ones."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_action
+msgid "All Work Orders"
+msgstr "सभी कार्य आदेश"
+
+#. module: mrp_operations
+#: rml:mrp.code.barcode:0
+msgid "("
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Product to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_wc_barcode
+msgid "Workcenters Barcode"
+msgstr "कार्य केंद्र बारकोड"
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_doneoperation0
+#: model:process.transition,note:mrp_operations.process_transition_startdoneoperation0
+msgid "Operation is done"
+msgstr "ऑपरेशन पूरा हो गया है"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Planned Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Ready to Produce"
+msgstr "Ready to Produce"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Cancel"
+msgstr "रद्द करना"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+msgid "Finished"
+msgstr "समाप्त"
+
+#. module: mrp_operations
+#: field:mrp.production,allow_reorder:0
+msgid "Free Serialisation"
+msgstr "नि: शुल्क Serialisation"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_draft_action_planning
+msgid "Work Orders Planning"
+msgstr "कार्य योजना के आदेश"
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_productionorder0
+msgid "Production Order"
+msgstr "उत्पादन के आदेश"
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_productionorder0
+msgid "Production order for any products"
+msgstr "किसी भी उत्पाद के लिए उत्पादन के आदेश"
+
+#. module: mrp_operations
+#: field:stock.move,move_dest_id_lines:0
+msgid "Children Moves"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation.code,name:0
+msgid "Operation Name"
+msgstr "संचालन नाम"
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation
+msgid "mrp_operations.operation"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_planned_end:0
+#: field:mrp_operations.operation,date_finished:0
+msgid "End Date"
+msgstr "आखिरी दिनांक"
+
+#. module: mrp_operations
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "संरचना देखने के लिए अमान्य XML!"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Real"
+msgstr "वास्तविक"
+
+#. module: mrp_operations
+#: model:ir.module.module,shortdesc:mrp_operations.module_meta_information
+msgid "Workcenter Production start end workflow"
+msgstr "Workcenter उत्पादन आरंभ और अंत कार्यप्रवाह"
+
+#. module: mrp_operations
+#: help:mrp.production.workcenter.line,delay:0
+msgid "This is delay between operation start and stop in this workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,product:0
+msgid "Product"
+msgstr "उत्पाद"
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_workstartoperation0
+msgid "From work order, define the cycles and hour for creating product"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,delay:0
+msgid "Working Hours"
+msgstr "कार्य घंटे"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_draft_action
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_draft_action
+msgid "Future Work Orders"
+msgstr "भविष्य के कार्य आदेश"
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,production_state:0
+msgid "Prod.State"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,order_date:0
+msgid "Order Date"
+msgstr "आदेश की तिथि"
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_workorder0
+msgid "Production Work Center"
+msgstr "उत्पादन कार्य केंद्र"
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_productionstart0
+msgid "Production start Operation"
+msgstr "उत्पादन ऑपरेशन शुरू"
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Packing Exception"
+msgstr "पैकिंग अपवाद"
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,workcenter_id:0
+msgid "Workcenter"
+msgstr "Work center"
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_start:0
+#: field:mrp.production.workcenter.line,date_start_date:0
+#: field:mrp_operations.operation,date_start:0
+msgid "Start Date"
+msgstr "प्रारंभ दिनांक"
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation_code
+msgid "mrp_operations.operation.code"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_operation_action
+#: view:mrp.production.workcenter.line:0
+msgid "Operations"
+msgstr "संचालन"
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,code_id:0
+#: field:mrp_operations.operation.code,code:0
+msgid "Code"
+msgstr "कोड"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_confirm_action
+msgid "Confirmed Work Orders"
+msgstr "काम के आदेश की पुष्टि की"
+
+#. module: mrp_operations
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_confirm_action
+msgid "Work Orders to Do"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_canceloperation0
+msgid "Cancel Operation"
+msgstr "संचालन रद्द"
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_workstartoperation0
+msgid "Work start Operation"
+msgstr "कार्य संचालन शुरू"
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_code_barcode
+msgid "Start/Stop Barcode"
+msgstr "शुरू /बंद बारकोड"
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Resume"
+msgstr "पुनरारंभ"
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_doneoperation0
+msgid "Done Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,qty:0
+msgid "Qty"
+msgstr "मात्रा"
+
+#. module: mrp_operations
+#: rml:mrp.code.barcode:0
+msgid ")"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Production Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Done"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Waiting Goods"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Duration"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+#: selection:mrp.production.workcenter.line,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_canceloperation0
+#: model:process.transition,note:mrp_operations.process_transition_startcanceloperation0
+msgid "Operation is cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+#: selection:mrp.production.workcenter.line,state:0
+msgid "Canceled"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Start working"
+msgstr ""
diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py
index 12a796b4f3b..fa01d7120fd 100644
--- a/addons/mrp_repair/__openerp__.py
+++ b/addons/mrp_repair/__openerp__.py
@@ -34,7 +34,7 @@
* Notes for the technician and for the final customer
""",
'author': 'Tiny',
- 'depends': ['base', 'sale', 'account'],
+ 'depends': ['mrp', 'sale', 'account'],
'update_xml': [
'security/ir.model.access.csv',
'mrp_repair_sequence.xml',
diff --git a/addons/partner_geo_assign/__init__.py b/addons/partner_geo_assign/__init__.py
new file mode 100644
index 00000000000..e1957dfb286
--- /dev/null
+++ b/addons/partner_geo_assign/__init__.py
@@ -0,0 +1,22 @@
+# -*- 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 partner_geo_assign
diff --git a/addons/partner_geo_assign/__openerp__.py b/addons/partner_geo_assign/__openerp__.py
new file mode 100644
index 00000000000..2d18649236e
--- /dev/null
+++ b/addons/partner_geo_assign/__openerp__.py
@@ -0,0 +1,38 @@
+# -*- 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 .
+#
+##############################################################################
+
+
+{
+ 'name': 'Partner Geo-Localisation',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Production',
+ 'description': """
+This is the module used by OpenERP SA to redirect customers to his partners,
+based on geolocalisation.
+ """,
+ 'author': 'OpenERP SA',
+ 'depends': ['crm'],
+ 'update_xml': ['res_partner_view.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': False,
+}
diff --git a/addons/partner_geo_assign/partner_geo_assign.py b/addons/partner_geo_assign/partner_geo_assign.py
new file mode 100644
index 00000000000..2ed96e3125d
--- /dev/null
+++ b/addons/partner_geo_assign/partner_geo_assign.py
@@ -0,0 +1,113 @@
+# -*- 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
+from osv import fields
+import urllib,re
+import random, time
+
+def geo_find(addr):
+ import urllib,re
+ regex = '([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+) '
+ url = 'http://maps.google.com/maps/geo?q=' + urllib.quote(addr) + '&output=xml&oe=utf8&sensor=false'
+ xml = urllib.urlopen(url).read()
+ if '' in xml:
+ print 'Error'
+ return None
+ result = re.search(regex, xml, re.M|re.I)
+ if not result:
+ print 'No Regex', xml
+ return None
+ return float(result.group(1)),float(result.group(2))
+
+class res_partner(osv.osv):
+ _inherit = "res.partner"
+ _columns = {
+ 'partner_latitude': fields.float('Geo Latitude', digits=(16,2)),
+ 'partner_longitude': fields.float('Geo Longitude', digits=(16,2)),
+ 'partner_weight': fields.integer('Weight',
+ help="Gives the probability to assign a lead to this partner. (0 means no assignation.)"),
+ }
+ _defaults = {
+ 'partner_weight': lambda *args: 0
+ }
+ def geo_localize(self, cr, uid, ids, context=None):
+ regex = '([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+) '
+ for partner in self.browse(cr, uid, ids, context=context):
+ part = partner.address[0]
+ addr = ', '.join(filter(None, [part.street, part.street2, (part.zip or '')+' '+(part.city or ''), part.state_id and part.state_id.name, part.country_id and part.country_id.name]))
+ result = geo_find(addr)
+ if result:
+ print 'Write', {
+ 'partner_latitude': result[0],
+ 'partner_longitude': result[1]
+ }
+ self.write(cr, uid, [partner.id], {
+ 'partner_latitude': result[0],
+ 'partner_longitude': result[1]
+ }, context=context)
+ return True
+res_partner()
+
+class crm_lead(osv.osv):
+ _inherit = "crm.lead"
+ _columns = {
+ 'partner_latitude': fields.float('Geo Latitude', digits=(16,2)),
+ 'partner_longitude': fields.float('Geo Longitude', digits=(16,2)),
+ 'partner_assigned_id': fields.many2one('res.partner','Assigned Partner')
+ 'date_assign': fields.date('Assignation Date')
+ }
+ def assign_partner(self, cr, uid, ids, context=None):
+ for part in self.browse(cr, uid, ids, context=context):
+ if not part.country_id:
+ continue
+ addr = ', '.join(filter(None, [part.street, part.street2, (part.zip or '')+' '+(part.city or ''), part.state_id and part.state_id.name, part.country_id and part.country_id.name]))
+ result = geo_find(addr)
+ if result:
+ self.write(cr, uid, [part.id], {
+ 'partner_latitude': result[0],
+ 'partner_longitude': result[1]
+ }, context=context)
+
+ part_ids = self.pool.get('res.partner').search(cr, uid, [
+ ('partner_weight','>',0),
+ ('partner_latitude','>',result[0]-2), ('partner_latitude','<',result[0]+2),
+ ('partner_longitude','>',result[1]-1.5), ('partner_longitude','<',result[1]+1.5)
+ ], context=context)
+ if not part_ids:
+ part_ids = self.pool.get('res.partner').search(cr, uid, [
+ ('partner_weight','>',0),
+ ('partner_latitude','>',result[0]-4), ('partner_latitude','<',result[0]+4),
+ ('partner_longitude','>',result[1]-3), ('partner_longitude','<',result[1]+3)
+ ], context=context)
+ total = 0
+ toassign = []
+ for part2 in self.pool.get('res.partner').browse(cr, uid, part_ids, context=context):
+ total += part2.partner_weight
+ toassign.append( (part2.id, total) )
+ mypartner = random.randint(0,total)
+ for t in toassign:
+ if mypartner<=t[1]:
+ self.write(cr, uid, [part.id], {'partner_assigned_id': t[0], 'date_assign': time.strftime('%Y-%m-%d')}, context=context)
+ break
+ return True
+crm_lead()
+
diff --git a/addons/partner_geo_assign/res_partner_view.xml b/addons/partner_geo_assign/res_partner_view.xml
new file mode 100644
index 00000000000..d5f4f918d98
--- /dev/null
+++ b/addons/partner_geo_assign/res_partner_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ crm.lead.geo_assign.inherit
+ crm.lead
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ res.partner.geo.inherit
+ res.partner
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/point_of_sale/multi_company_demo.xml b/addons/point_of_sale/multi_company_demo.xml
index e0e58ad75d7..9ae66800ff9 100644
--- a/addons/point_of_sale/multi_company_demo.xml
+++ b/addons/point_of_sale/multi_company_demo.xml
@@ -1,32 +1,7 @@
-
- OpenERP Editor
-
-
- OpenERP Editor
-
-
- Free Business Solutions
- Web: http://tiny.be - Tel: (+32).81.81.37.00 - Bank: CPH 126-2013269-07
- IBAN: BE74 1262 0132 6907 - SWIFT: GKCCBEBB - VAT: BE0477.472.701
-
-
-
- OpenERP Integrator
-
-
-
- OpenERP Integrator
-
-
- Free Business Solutions
- Web: http://tiny.be - Tel: (+32).81.81.37.00 - Bank: CPH 126-2013269-07
- IBAN: BE74 1262 0132 6907 - SWIFT: GKCCBEBB - VAT: BE0477.472.701
-
-
diff --git a/addons/point_of_sale/multi_company_stock_data.xml b/addons/point_of_sale/multi_company_stock_data.xml
index a74ea0a56e9..cc8d30d080d 100644
--- a/addons/point_of_sale/multi_company_stock_data.xml
+++ b/addons/point_of_sale/multi_company_stock_data.xml
@@ -1,41 +1,5 @@
-
-
-
- property_stock_account_output
-
-
-
-
-
- property_stock_account_input
-
-
-
-
-
- property_stock_account_output_categ
-
-
-
-
-
- property_stock_account_input_categ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index 5d4df5a5f10..e0e2d9c5c5d 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -193,10 +193,10 @@ class pos_order(osv.osv):
res[order.id]['amount_tax'])
else:
res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2),
- tax_obj.compute(cr, uid, line.product_id.taxes_id,
+ tax_obj.compute_all(cr, uid, line.product_id.taxes_id,
line.price_unit * \
- (1-(line.discount or 0.0)/100.0), line.qty),
- res[order.id]['amount_tax'])
+ (1-(line.discount or 0.0)/100.0), line.qty)['taxes'],
+ res[order.id]['amount_tax'])
return res
@@ -789,8 +789,8 @@ class pos_order(osv.osv):
tax_amount = 0
taxes = [t for t in line.product_id.taxes_id]
if order.price_type=='tax_excluded':
- computed_taxes = account_tax_obj.compute(
- cr, uid, taxes, line.price_unit, line.qty)
+ computed_taxes = account_tax_obj.compute_all(
+ cr, uid, taxes, line.price_unit, line.qty)['taxes']
else:
computed_taxes = account_tax_obj.compute_inv(
cr, uid, taxes, line.price_unit, line.qty)
@@ -1058,7 +1058,7 @@ class pos_order_line(osv.osv):
for line in self.browse(cr, uid, ids):
tax_amount = 0.0
taxes = [t for t in line.product_id.taxes_id]
- computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty)
+ computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
for tax in computed_taxes:
tax_amount += tax['amount']
price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id)
diff --git a/addons/point_of_sale/pos_data.xml b/addons/point_of_sale/pos_data.xml
index b36bd0827c2..14710cf8f37 100644
--- a/addons/point_of_sale/pos_data.xml
+++ b/addons/point_of_sale/pos_data.xml
@@ -1,58 +1,6 @@
-
- Paiement
-
-
- Acompte
-
- service
- 0.0
- 0.0
-
-
-
-
- Reparation
-
- service
- 100.0
- 100.0
-
-
-
-
-
- Bon
-
-
-
- GIFT
- produce
- 1.0
- 1.0
-
-
- 0.0
- Cheque cadeau
-
-
-
-
- PORT01
- produce
- 1.0
- 1.0
-
-
- 0.0
- Shipping cost
-
- service
- 0
-
-
diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml
index b548f12d8e7..14710cf8f37 100644
--- a/addons/point_of_sale/pos_demo.xml
+++ b/addons/point_of_sale/pos_demo.xml
@@ -1,190 +1,6 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Main Receivable
- x 40000
- receivable
-
-
-
-
-
-
-
-This chart of account is used for automated testing purpose. It is installed
-only if you selected demo data during your database creation. Modules can
-do black box testing on entries on this chart of account, without modifying
-your own chart of account.
-
-
-
-
diff --git a/addons/point_of_sale/pos_report.xml b/addons/point_of_sale/pos_report.xml
index 9123502d288..b079f6b9177 100644
--- a/addons/point_of_sale/pos_report.xml
+++ b/addons/point_of_sale/pos_report.xml
@@ -1,112 +1,112 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
diff --git a/addons/point_of_sale/pos_sequence.xml b/addons/point_of_sale/pos_sequence.xml
index 42bc4334b89..691b35a8f1a 100644
--- a/addons/point_of_sale/pos_sequence.xml
+++ b/addons/point_of_sale/pos_sequence.xml
@@ -2,42 +2,42 @@
- #
- # Sequences for pos.order
- #
+ #
+ # Sequences for pos.order
+ #
-
- POS Order
- pos.order
-
-
- POS Order
- pos.order
- POS/
- 3
-
+
+ POS Order
+ pos.order
+
+
+ POS Order
+ pos.order
+ POS/
+ 3
+
-
- POS Payment
- pos.payment
-
-
- POS Payment
- pos.payment
- Payment/
- 2
-
+
+ POS Payment
+ pos.payment
+
+
+ POS Payment
+ pos.payment
+ Payment/
+ 2
+
-
- POS order line
- pos.order.line
-
-
- POS order line
- pos.order.line
- Order Line/
- 2
-
+
+ POS order line
+ pos.order.line
+
+
+ POS order line
+ pos.order.line
+ Order Line/
+ 2
+
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index b3c784f6ea2..22e46933365 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -1,6 +1,9 @@
+
pos.order
@@ -9,11 +12,11 @@
-
-
-
+
+
+
-
+
@@ -90,7 +93,7 @@
-
+
@@ -112,7 +115,7 @@
-
+
@@ -156,7 +159,7 @@
-
+
@@ -169,7 +172,6 @@
-
@@ -186,7 +188,7 @@
['|',('state_2','=','to_verify'),('state','=','advance')]
{"search_default_user_id":uid}
-
+
@@ -199,7 +201,7 @@
[('state','!=', 'invoiced')]
{"search_default_user_id":uid}
-
+
@@ -212,7 +214,7 @@
tree,form
[('state','=', 'paid')]
{"search_default_user_id":uid}
-
+
Point of Sale
@@ -222,7 +224,7 @@
tree,form
[('date_order','<=', time.strftime('%Y-%m-%d 23:59:59'))]
{"search_default_user_id":uid}
-
+
@@ -232,7 +234,7 @@
form
tree,form
{"search_default_user_id":uid}
-
+
Opened Sales
@@ -241,7 +243,7 @@
form
form,tree
{"search_default_user_id":uid}
-
+
diff --git a/addons/point_of_sale/pos_workflow.xml b/addons/point_of_sale/pos_workflow.xml
index 11cd9481343..189b38e348f 100644
--- a/addons/point_of_sale/pos_workflow.xml
+++ b/addons/point_of_sale/pos_workflow.xml
@@ -1,84 +1,84 @@
-
- Pos workflow
- pos.order
- True
-
+
+ Pos workflow
+ pos.order
+ True
+
-
+
-
- POS - Confirmation
-
+
+ POS - Confirmation
+
-
-
- True
- draft
-
+
+
+ True
+ draft
+
-
-
- paid
- action_paid()
- function
-
+
+
+ paid
+ action_paid()
+ function
+
-
-
- done
- True
- action_done()
- function
-
+
+
+ done
+ True
+ action_done()
+ function
+
-
-
- invoiced
- True
- action_invoice()
- function
-
+
+
+ invoiced
+ True
+ action_invoice()
+ function
+
-
-
- cancel
- True
- action_cancel()
- function
-
+
+
+ cancel
+ True
+ action_cancel()
+ function
+
-
-
-
- test_paid()
- paid
-
+
+
+
+ test_paid()
+ paid
+
-
-
-
- done
-
+
+
+
+ done
+
-
-
-
- invoice
-
+
+
+
+ invoice
+
-
-
-
- cancel
-
+
+
+
+ cancel
+
diff --git a/addons/point_of_sale/posr_data.xml b/addons/point_of_sale/posr_data.xml
index de0ec465950..3ba8df59b13 100644
--- a/addons/point_of_sale/posr_data.xml
+++ b/addons/point_of_sale/posr_data.xml
@@ -1,74 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/addons/point_of_sale/posrule_data.xml b/addons/point_of_sale/posrule_data.xml
index 905e78e6e7a..f2ac2d664af 100644
--- a/addons/point_of_sale/posrule_data.xml
+++ b/addons/point_of_sale/posrule_data.xml
@@ -1,505 +1,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- POS line
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
-
-
-
-
-
-
-
-
- ['|',('user_id','=',False),('user_id','=',[user.id])]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/point_of_sale/posrule_data2.xml b/addons/point_of_sale/posrule_data2.xml
index 7ac787db54c..1010f75d055 100644
--- a/addons/point_of_sale/posrule_data2.xml
+++ b/addons/point_of_sale/posrule_data2.xml
@@ -1,592 +1,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/addons/point_of_sale/singer_statement_demo.xml b/addons/point_of_sale/singer_statement_demo.xml
index 68f889cddee..43b25437173 100644
--- a/addons/point_of_sale/singer_statement_demo.xml
+++ b/addons/point_of_sale/singer_statement_demo.xml
@@ -1,324 +1,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CashOut
-
- service
- True
- 0.0
- 0.0
-
-
-
-
-
-
- CashIn
-
- service
- True
- 0.0
- 0.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cofinoga Shop2
- COF
- cash
-
-
-
-
-
-
-
-
- Sales Journal Shop 2
- SAJ
- sale
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cofinoga Shop1
- COF
- cash
-
-
-
-
-
-
-
-
- Sales Journal Shop1
- SAJ
- sale
-
-
-
-
-
-
-
-
-
- Cofinoga Central
- COF
- cash
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/point_of_sale/statement_data.xml b/addons/point_of_sale/statement_data.xml
index 5172e0e70d4..3ba8df59b13 100644
--- a/addons/point_of_sale/statement_data.xml
+++ b/addons/point_of_sale/statement_data.xml
@@ -1,41 +1,6 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/point_of_sale/statement_report.xml b/addons/point_of_sale/statement_report.xml
index 73b2c914dd3..fb1be16419e 100644
--- a/addons/point_of_sale/statement_report.xml
+++ b/addons/point_of_sale/statement_report.xml
@@ -1,69 +1,69 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/addons/point_of_sale/statement_rules.xml b/addons/point_of_sale/statement_rules.xml
index eba649f3ec5..3ba8df59b13 100644
--- a/addons/point_of_sale/statement_rules.xml
+++ b/addons/point_of_sale/statement_rules.xml
@@ -1,5 +1,6 @@
-
-
+
+
+
diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml
index 69c3232f1a0..a4acd7429ec 100644
--- a/addons/point_of_sale/statement_view.xml
+++ b/addons/point_of_sale/statement_view.xml
@@ -55,32 +55,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -132,18 +132,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -185,18 +185,18 @@
[('user_id','=',uid)]
-
-
- tree
-
-
-
-
-
- form
-
-
-
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
@@ -265,32 +265,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -332,45 +332,45 @@
[('state','=','draft'),('user_id','=',uid)]
-
-
- tree
-
-
-
-
-
- form
-
-
-
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
-
+
All Cashboxes
ir.actions.act_window
account.bank.statement
form
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
-
+
All My Cashboxes
ir.actions.act_window
account.bank.statement
@@ -378,22 +378,22 @@
[('user_id','=',uid)]
-
- tree
-
-
-
+
+ tree
+
+
+
-
-
- form
-
-
-
-
-
+
+
+ form
+
+
+
+
+
-
+
Cashboxes to Close
ir.actions.act_window
account.bank.statement
@@ -401,44 +401,44 @@
tree,form
[('state','=','draft')]
-
-
- tree
-
-
-
-
-
- form
-
-
-
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
-
+
-
+ action="action_report_all_closed_cashbox_of_the_day"
+ id="menu_all_closed_cashbox_of_the_day"
+ parent="menu_statement_tree_all"/>
-
+ action="action_report_all_closed_cashbox_of_the_day"
+ id="menu_all_closed_cashbox_of_the_day"
+ parent="menu_point_report_register"/>
-
+
diff --git a/addons/point_of_sale/statement_wizard.xml b/addons/point_of_sale/statement_wizard.xml
index dd9715db628..8220eda8bed 100644
--- a/addons/point_of_sale/statement_wizard.xml
+++ b/addons/point_of_sale/statement_wizard.xml
@@ -1,12 +1,13 @@
-
-
-
-
+ action="action_report_all_closed_cashbox_of_the_day"
+ id="menu_all_closed_cashbox_of_the_day"
+ parent="menu_point_report_register"/>
diff --git a/addons/procurement/board_mrp_procurement_view.xml b/addons/procurement/board_mrp_procurement_view.xml
index 0a236352538..d5f71f6d4bc 100644
--- a/addons/procurement/board_mrp_procurement_view.xml
+++ b/addons/procurement/board_mrp_procurement_view.xml
@@ -8,7 +8,7 @@
form
-
+
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index 6a4e2736dbd..bdc37c1b660 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -37,7 +37,9 @@ class procurement_order(osv.osv):
context = {}
if use_new_cursor:
+ print 'Cursor New', cr,
cr = pooler.get_db(use_new_cursor).cursor()
+ print cr
wf_service = netsvc.LocalService("workflow")
procurement_obj = self.pool.get('procurement.order')
@@ -122,6 +124,7 @@ class procurement_order(osv.osv):
})
if use_new_cursor:
cr.commit()
+ print 'Cursor Close', cr
cr.close()
return {}
@@ -172,7 +175,9 @@ class procurement_order(osv.osv):
if not context:
context = {}
if use_new_cursor:
+ print 'Cursor New', cr,
cr = pooler.get_db(use_new_cursor).cursor()
+ print cr
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
location_obj = self.pool.get('stock.location')
procurement_obj = self.pool.get('procurement.order')
@@ -236,6 +241,7 @@ class procurement_order(osv.osv):
})
if use_new_cursor:
cr.commit()
+ print 'Cursor Close', cr
cr.close()
return {}
procurement_order()
diff --git a/addons/procurement/security/ir.model.access.csv b/addons/procurement/security/ir.model.access.csv
index f13decfa9f2..6cc6cc8acb4 100644
--- a/addons/procurement/security/ir.model.access.csv
+++ b/addons/procurement/security/ir.model.access.csv
@@ -1,9 +1,11 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_mrp_property_group","mrp.property.group","model_mrp_property_group",stock.group_stock_manager,1,1,1,1
+"access_mrp_property","mrp.property","model_mrp_property",stock.group_stock_manager,1,1,1,1
"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
-"access_mrp_property","mrp.property","model_mrp_property",,1,0,0,0
-"access_procurement","procurement.order","model_procurement_order",,1,0,0,0
-"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",,1,0,0,0
-"access_procurement_compute_all","procurement.order.compute.all","model_procurement_order_compute_all",,1,0,0,0
-"access_procurement_orderpoint_compute","procurement.orderpoint.compute","model_procurement_orderpoint_compute",,1,0,0,0
-"access_mrp_make_procurement","make.procurement","model_make_procurement",,1,0,0,0
-"access_mrp_make_procurement","procurement.order.compute","model_procurement_order_compute",,1,0,0,0
+"access_mrp_property","mrp.property","model_mrp_property",base.group_user,1,0,0,0
+"access_procurement","procurement.order","model_procurement_order",base.group_user,1,0,0,0
+"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",stock.group_stock_manager,1,1,1,1
+"access_procurement_compute_all","procurement.order.compute.all","model_procurement_order_compute_all",stock.group_stock_manager,1,1,1,1
+"access_procurement_orderpoint_compute","procurement.orderpoint.compute","model_procurement_orderpoint_compute",stock.group_stock_manager,1,1,1,1
+"access_mrp_make_procurement","make.procurement","model_make_procurement",stock.group_stock_manager,1,1,1,1
+"access_mrp_make_procurement","procurement.order.compute","model_procurement_order_compute",stock.group_stock_manager,1,1,1,1
diff --git a/addons/procurement/wizard/mrp_procurement.py b/addons/procurement/wizard/mrp_procurement.py
index 466a462a55d..659a2ad4d51 100644
--- a/addons/procurement/wizard/mrp_procurement.py
+++ b/addons/procurement/wizard/mrp_procurement.py
@@ -31,7 +31,8 @@ class procurement_compute(osv.osv_memory):
proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
finally:
- cr.close()
+ pass
+ #cr.close()
return {}
def procure_calculation(self, cr, uid, ids, context):
diff --git a/addons/procurement/wizard/schedulers_all.py b/addons/procurement/wizard/schedulers_all.py
index 6a02048ed71..73efc77d017 100644
--- a/addons/procurement/wizard/schedulers_all.py
+++ b/addons/procurement/wizard/schedulers_all.py
@@ -45,10 +45,12 @@ class procurement_compute_all(osv.osv_memory):
"""
proc_obj = self.pool.get('procurement.order')
for proc in self.browse(cr, uid, ids):
+ print 'Cursor', cr
proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
context=context)
+ print 'Cursor', cr
return {}
-
+
def procure_calculation(self, cr, uid, ids, context):
"""
@param self: The object pointer.
diff --git a/addons/product/i18n/vi.po b/addons/product/i18n/vi.po
index c6b06e8b29d..ac596518e54 100644
--- a/addons/product/i18n/vi.po
+++ b/addons/product/i18n/vi.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-08 16:40+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-06-13 07:00+0000\n"
+"Last-Translator: Vu Duc Tiep \n"
"Language-Team: Vietnamese \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:10+0000\n"
+"X-Launchpad-Export-Date: 2010-06-15 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product
@@ -163,7 +163,7 @@ msgstr "Công ty"
#. module: product
#: field:product.template,rental:0
msgid "Rentable Product"
-msgstr ""
+msgstr "Sản phẩm có thể cho thuê"
#. module: product
#: field:product.product,lst_price:0
@@ -244,7 +244,7 @@ msgstr ""
#. module: product
#: model:process.transition,note:product.process_transition_supplierofproduct0
msgid "You can see the list of suppliers for that product."
-msgstr ""
+msgstr "Bạn có thể thấy danh sách các nhà cung cấp sản phầm này"
#. module: product
#: help:product.packaging,rows:0
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 93a489245c4..edd5e9e3499 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -12,8 +12,8 @@
-
-
+
+
@@ -65,6 +65,7 @@
+
@@ -74,10 +75,9 @@
-
+
-
@@ -466,7 +466,7 @@
form
-
+
@@ -520,7 +520,6 @@
-
@@ -606,7 +605,7 @@
-
+
Products
ir.ui.menu
diff --git a/addons/product/security/ir.model.access.csv b/addons/product/security/ir.model.access.csv
index 062db9e34e8..f1c24509ac9 100644
--- a/addons/product/security/ir.model.access.csv
+++ b/addons/product/security/ir.model.access.csv
@@ -18,7 +18,6 @@
"access_product_ul_user","product.ul.user","model_product_ul","base.group_user",1,0,0,0
"access_product_category_user","product.category.user","model_product_category","base.group_user",1,0,0,0
"access_product_template_user","product.template.user","model_product_template","base.group_user",1,0,0,0
-"access_product_product_user","product.product.user","model_product_product","base.group_user",1,0,0,0
"access_product_packaging_user","product.packaging.user","model_product_packaging","base.group_user",1,0,0,0
"access_product_supplierinfo_user","product.supplierinfo.user","model_product_supplierinfo","base.group_user",1,0,0,0
"access_pricelist_partnerinfo_user","pricelist.partnerinfo.user","model_pricelist_partnerinfo","base.group_user",1,0,0,0
diff --git a/addons/product_expiry/__init__.py b/addons/product_expiry/__init__.py
new file mode 100644
index 00000000000..3b5500415c2
--- /dev/null
+++ b/addons/product_expiry/__init__.py
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 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/__terp__.py
new file mode 100644
index 00000000000..1983088a484
--- /dev/null
+++ b/addons/product_expiry/__terp__.py
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 .
+#
+##############################################################################
+{
+ "name" : "Products date of expiry",
+ "version" : "1.0",
+ "author" : "Tiny",
+ "category" : "Enterprise Specific Modules/Food Industries",
+ "depends" : ["base", "account", "product", "stock"],
+ "init_xml" : [],
+ "demo_xml" : ["product_expiry_demo.xml"],
+ "description": '''Track different dates on products and production lots:
+ - end of life
+ - best before date
+ - removal date
+ - alert date
+Used, for example, in food industries.''',
+ "update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml"],
+ "active": False,
+ "installable": True
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product_expiry/i18n/ca.po b/addons/product_expiry/i18n/ca.po
new file mode 100644
index 00000000000..3bffba540b9
--- /dev/null
+++ b/addons/product_expiry/i18n/ca.po
@@ -0,0 +1,180 @@
+# Catalan 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.
+#
+msgid ""
+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-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-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_expiry
+#: field:product.product,life_time:0
+msgid "Product lifetime"
+msgstr "Cicle de vida producte"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_from_product_template
+msgid "Ham"
+msgstr "Pernil"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_lait_product_template
+msgid "Cow milk"
+msgstr "Llet de vaca"
+
+#. module: product_expiry
+#: model:ir.module.module,shortdesc:product_expiry.module_meta_information
+msgid "Products date of expiry"
+msgstr "Data de caducitat de productes"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid ""
+"Error: The default UOM and the purchase UOM must be in the same category."
+msgstr ""
+"Error: La UdM per defecte i la UdM de compra han d'estar en la mateixa "
+"categoria."
+
+#. module: product_expiry
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML no vàlid per a la definició de la vista!"
+
+#. module: product_expiry
+#: help:stock.production.lot,life_date:0
+msgid "The date the lot may become dangerous and should not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,removal_date:0
+msgid "Removal Date"
+msgstr ""
+
+#. module: product_expiry
+#: model:ir.module.module,description:product_expiry.module_meta_information
+msgid ""
+"Track different dates on products and production lots:\n"
+" - end of life\n"
+" - best before date\n"
+" - removal date\n"
+" - alert date\n"
+"Used, for example, in food industries."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_pain_product_template
+msgid "Bread"
+msgstr "Pa"
+
+#. module: product_expiry
+#: model:product.uom,name:product_expiry.product_uom_ltr
+#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol
+msgid "LTR"
+msgstr ""
+
+#. module: product_expiry
+#: view:product.product:0
+#: view:stock.production.lot:0
+msgid "Dates"
+msgstr "Dates"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: UOS must be in a different category than the UOM"
+msgstr "Error: La UdV ha d'estar en una categoria diferent que la UdM."
+
+#. module: product_expiry
+#: field:stock.production.lot,life_date:0
+msgid "End of Life Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,use_date:0
+msgid "Best before Date"
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,use_date:0
+msgid "The date the lot starts deteriorating without becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_jambon_product_template
+msgid "French cheese Camenbert"
+msgstr "Formatge Camembert francès"
+
+#. module: product_expiry
+#: help:product.product,removal_time:0
+msgid "The number of days before a production lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,use_time:0
+msgid "Product usetime"
+msgstr "Temps d'ús producte"
+
+#. module: product_expiry
+#: field:stock.production.lot,alert_date:0
+msgid "Alert Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,removal_time:0
+msgid "Product removal time"
+msgstr "Data eliminació producte"
+
+#. module: product_expiry
+#: help:product.product,use_time:0
+msgid ""
+"The number of days before a production lot starts deteriorating without "
+"becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Error: Codi EAN erroni"
+
+#. module: product_expiry
+#: help:product.product,life_time:0
+msgid ""
+"The number of days before a production lot may become dangerous and should "
+"not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,removal_date:0
+msgid "The date the lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: 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
new file mode 100644
index 00000000000..c0b8140f48b
--- /dev/null
+++ b/addons/product_expiry/i18n/es.po
@@ -0,0 +1,180 @@
+# Spanish 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.
+#
+msgid ""
+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-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-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_expiry
+#: field:product.product,life_time:0
+msgid "Product lifetime"
+msgstr "Ciclo de vida producto"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_from_product_template
+msgid "Ham"
+msgstr "Jamón"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_lait_product_template
+msgid "Cow milk"
+msgstr "Leche de vaca"
+
+#. module: product_expiry
+#: model:ir.module.module,shortdesc:product_expiry.module_meta_information
+msgid "Products date of expiry"
+msgstr "Fecha de caducidad de productos"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid ""
+"Error: The default UOM and the purchase UOM must be in the same category."
+msgstr ""
+"Error: La UdM por defecto y la UdM de compra deben estar en la misma "
+"categoría."
+
+#. module: product_expiry
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "¡XML no válido para la definición de la vista!"
+
+#. module: product_expiry
+#: help:stock.production.lot,life_date:0
+msgid "The date the lot may become dangerous and should not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,removal_date:0
+msgid "Removal Date"
+msgstr ""
+
+#. module: product_expiry
+#: model:ir.module.module,description:product_expiry.module_meta_information
+msgid ""
+"Track different dates on products and production lots:\n"
+" - end of life\n"
+" - best before date\n"
+" - removal date\n"
+" - alert date\n"
+"Used, for example, in food industries."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_pain_product_template
+msgid "Bread"
+msgstr "Pan"
+
+#. module: product_expiry
+#: model:product.uom,name:product_expiry.product_uom_ltr
+#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol
+msgid "LTR"
+msgstr "LTR"
+
+#. module: product_expiry
+#: view:product.product:0
+#: view:stock.production.lot:0
+msgid "Dates"
+msgstr "Fechas"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: UOS must be in a different category than the UOM"
+msgstr "Error: La UdV debe estar en una categoría diferente que la UdM."
+
+#. module: product_expiry
+#: field:stock.production.lot,life_date:0
+msgid "End of Life Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,use_date:0
+msgid "Best before Date"
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,use_date:0
+msgid "The date the lot starts deteriorating without becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_jambon_product_template
+msgid "French cheese Camenbert"
+msgstr "Queso Camembert francés"
+
+#. module: product_expiry
+#: help:product.product,removal_time:0
+msgid "The number of days before a production lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,use_time:0
+msgid "Product usetime"
+msgstr "Tiempo de uso producto"
+
+#. module: product_expiry
+#: field:stock.production.lot,alert_date:0
+msgid "Alert Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,removal_time:0
+msgid "Product removal time"
+msgstr "Fecha eliminación producto"
+
+#. module: product_expiry
+#: help:product.product,use_time:0
+msgid ""
+"The number of days before a production lot starts deteriorating without "
+"becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Error: Código EAN erróneo"
+
+#. module: product_expiry
+#: help:product.product,life_time:0
+msgid ""
+"The number of days before a production lot may become dangerous and should "
+"not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,removal_date:0
+msgid "The date the lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: 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
new file mode 100644
index 00000000000..27fa25095b2
--- /dev/null
+++ b/addons/product_expiry/i18n/fr.po
@@ -0,0 +1,178 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_expiry
+#
+msgid ""
+msgstr ""
+"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-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-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_expiry
+#: field:product.product,life_time:0
+msgid "Product lifetime"
+msgstr "Durée limite de consommation"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_from_product_template
+msgid "Ham"
+msgstr "Jambon"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_lait_product_template
+msgid "Cow milk"
+msgstr "Lait de vache"
+
+#. module: product_expiry
+#: model:ir.module.module,shortdesc:product_expiry.module_meta_information
+msgid "Products date of expiry"
+msgstr "Dates de péremption des produits"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid ""
+"Error: The default UOM and the purchase UOM must be in the same category."
+msgstr ""
+"Erreur: l'unité de mesure par défaut et l'unité de mesure d'achat doivent "
+"faire partie de la même catégorie"
+
+#. module: product_expiry
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: product_expiry
+#: help:stock.production.lot,life_date:0
+msgid "The date the lot may become dangerous and should not be consumed."
+msgstr ""
+"La date à laquelle le lot peut devenir dangereux et ne doit plus être "
+"consommé."
+
+#. module: product_expiry
+#: field:stock.production.lot,removal_date:0
+msgid "Removal Date"
+msgstr "Date de retrait"
+
+#. module: product_expiry
+#: model:ir.module.module,description:product_expiry.module_meta_information
+msgid ""
+"Track different dates on products and production lots:\n"
+" - end of life\n"
+" - best before date\n"
+" - removal date\n"
+" - alert date\n"
+"Used, for example, in food industries."
+msgstr ""
+"Suit les différentes dates des produits et des lots de production\n"
+" - Date limite de consommation\n"
+" - DLUO\n"
+" - Date de retrait\n"
+" - Date d'alerte\n"
+"Utilisé par exemple dans les industries alimentaires"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_pain_product_template
+msgid "Bread"
+msgstr "Pain"
+
+#. module: product_expiry
+#: model:product.uom,name:product_expiry.product_uom_ltr
+#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol
+msgid "LTR"
+msgstr "LTR"
+
+#. module: product_expiry
+#: view:product.product:0
+#: view:stock.production.lot:0
+msgid "Dates"
+msgstr "Dates"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: UOS must be in a different category than the UOM"
+msgstr ""
+"Erreur: l'unité de vente doit appartenir à une catégorie différente que "
+"l'unité de mesure"
+
+#. module: product_expiry
+#: field:stock.production.lot,life_date:0
+msgid "End of Life Date"
+msgstr "Date limite de consommation"
+
+#. module: product_expiry
+#: field:stock.production.lot,use_date:0
+msgid "Best before Date"
+msgstr "Date limite d'utilisation optimale"
+
+#. module: product_expiry
+#: help:stock.production.lot,use_date:0
+msgid "The date the lot starts deteriorating without becoming dangerous."
+msgstr ""
+"La date à laquelle le lot commencera à se déteriorer sans devenir dangereux."
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_jambon_product_template
+msgid "French cheese Camenbert"
+msgstr "Fromage Camembert Français"
+
+#. module: product_expiry
+#: help:product.product,removal_time:0
+msgid "The number of days before a production lot should be removed."
+msgstr ""
+"Le nombre de jours après lesquels un lot de production doit être retiré."
+
+#. module: product_expiry
+#: field:product.product,use_time:0
+msgid "Product usetime"
+msgstr "Durée limite d'utilisation optimale"
+
+#. module: product_expiry
+#: field:stock.production.lot,alert_date:0
+msgid "Alert Date"
+msgstr "Date d'alerte"
+
+#. module: product_expiry
+#: field:product.product,removal_time:0
+msgid "Product removal time"
+msgstr "Durée avant retrait"
+
+#. module: product_expiry
+#: help:product.product,use_time:0
+msgid ""
+"The number of days before a production lot starts deteriorating without "
+"becoming dangerous."
+msgstr ""
+"Le nombre de jours après lesquels un lot de production commencera à se "
+"déteriorer sans devenir dangereux"
+
+#. module: product_expiry
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Erreur: code EAN invalide"
+
+#. module: product_expiry
+#: help:product.product,life_time:0
+msgid ""
+"The number of days before a production lot may become dangerous and should "
+"not be consumed."
+msgstr ""
+"Nombre de jours après lesquels un lot de production peut devenir dangereux "
+"et ne doit plus être consommé."
+
+#. module: product_expiry
+#: help:stock.production.lot,removal_date:0
+msgid "The date the lot should be removed."
+msgstr "La date à laquelle le lot doit être retiré."
+
+#. module: product_expiry
+#: field:product.product,alert_time:0
+msgid "Product alert time"
+msgstr "Durée avant alerte"
diff --git a/addons/product_expiry/i18n/fr_FR.po b/addons/product_expiry/i18n/fr_FR.po
new file mode 100644
index 00000000000..3aede86982b
--- /dev/null
+++ b/addons/product_expiry/i18n/fr_FR.po
@@ -0,0 +1,159 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_expiry
+#
+msgid ""
+msgstr ""
+"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:36+0000\n"
+"PO-Revision-Date: 2009-06-30 15:09:36+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: product_expiry
+#: field:product.product,life_time:0
+msgid "Product lifetime"
+msgstr "Durée limite de consommation"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_from_product_template
+msgid "Ham"
+msgstr "Jambon"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_lait_product_template
+msgid "Cow milk"
+msgstr "Lait de vache"
+
+#. module: product_expiry
+#: model:ir.module.module,shortdesc:product_expiry.module_meta_information
+msgid "Products date of expiry"
+msgstr "Dates de péremption des produits"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: The default UOM and the purchase UOM must be in the same category."
+msgstr "Erreur: l'unité de mesure par défaut et l'unité de mesure d'achat doivent faire partie de la même catégorie"
+
+#. module: product_expiry
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: product_expiry
+#: help:stock.production.lot,life_date:0
+msgid "The date the lot may become dangerous and should not be consumed."
+msgstr "La date à laquelle le lot peut devenir dangereux et ne doit plus être consommé."
+
+#. module: product_expiry
+#: field:stock.production.lot,removal_date:0
+msgid "Removal Date"
+msgstr "Date de retrait"
+
+#. module: product_expiry
+#: model:ir.module.module,description:product_expiry.module_meta_information
+msgid "Track different dates on products and production lots:\n"
+" - end of life\n"
+" - best before date\n"
+" - removal date\n"
+" - alert date\n"
+"Used, for example, in food industries."
+msgstr "Suit les différentes dates des produits et des lots de production\n"
+" - Date limite de consommation\n"
+" - DLUO\n"
+" - Date de retrait\n"
+" - Date d'alerte\n"
+"Utilisé par exemple dans les industries alimentaires"
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_pain_product_template
+msgid "Bread"
+msgstr "Pain"
+
+#. module: product_expiry
+#: model:product.uom,name:product_expiry.product_uom_ltr
+#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol
+msgid "LTR"
+msgstr "LTR"
+
+#. module: product_expiry
+#: view:product.product:0
+#: view:stock.production.lot:0
+msgid "Dates"
+msgstr "Dates"
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: UOS must be in a different category than the UOM"
+msgstr "Erreur: l'unité de vente doit appartenir à une catégorie différente que l'unité de mesure"
+
+#. module: product_expiry
+#: field:stock.production.lot,life_date:0
+msgid "End of Life Date"
+msgstr "Date limite de consommation"
+
+#. module: product_expiry
+#: field:stock.production.lot,use_date:0
+msgid "Best before Date"
+msgstr "Date limite d'utilisation optimale"
+
+#. module: product_expiry
+#: help:stock.production.lot,use_date:0
+msgid "The date the lot starts deteriorating without becoming dangerous."
+msgstr "La date à laquelle le lot commencera à se déteriorer sans devenir dangereux."
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_jambon_product_template
+msgid "French cheese Camenbert"
+msgstr "Fromage Camembert Français"
+
+#. module: product_expiry
+#: help:product.product,removal_time:0
+msgid "The number of days before a production lot should be removed."
+msgstr "Le nombre de jours après lesquels un lot de production doit être retiré."
+
+#. module: product_expiry
+#: field:product.product,use_time:0
+msgid "Product usetime"
+msgstr "Durée limite d'utilisation optimale"
+
+#. module: product_expiry
+#: field:stock.production.lot,alert_date:0
+msgid "Alert Date"
+msgstr "Date d'alerte"
+
+#. module: product_expiry
+#: field:product.product,removal_time:0
+msgid "Product removal time"
+msgstr "Durée avant retrait"
+
+#. module: product_expiry
+#: help:product.product,use_time:0
+msgid "The number of days before a production lot starts deteriorating without becoming dangerous."
+msgstr "Le nombre de jours après lesquels un lot de production commencera à se déteriorer sans devenir dangereux"
+
+#. module: product_expiry
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Erreur: code EAN invalide"
+
+#. module: product_expiry
+#: help:product.product,life_time:0
+msgid "The number of days before a production lot may become dangerous and should not be consumed."
+msgstr "Nombre de jours après lesquels un lot de production peut devenir dangereux et ne doit plus être consommé."
+
+#. module: product_expiry
+#: help:stock.production.lot,removal_date:0
+msgid "The date the lot should be removed."
+msgstr "La date à laquelle le lot doit être retiré."
+
+#. module: product_expiry
+#: field:product.product,alert_time:0
+msgid "Product alert time"
+msgstr "Durée avant alerte"
+
diff --git a/addons/product_expiry/i18n/product_expiry.pot b/addons/product_expiry/i18n/product_expiry.pot
new file mode 100644
index 00000000000..d56ff324485
--- /dev/null
+++ b/addons/product_expiry/i18n/product_expiry.pot
@@ -0,0 +1,154 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_expiry
+#
+msgid ""
+msgstr ""
+"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:08+0000\n"
+"PO-Revision-Date: 2009-06-30 15:09:08+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: product_expiry
+#: field:product.product,life_time:0
+msgid "Product lifetime"
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_from_product_template
+msgid "Ham"
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_lait_product_template
+msgid "Cow milk"
+msgstr ""
+
+#. module: product_expiry
+#: model:ir.module.module,shortdesc:product_expiry.module_meta_information
+msgid "Products date of expiry"
+msgstr ""
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: The default UOM and the purchase UOM must be in the same category."
+msgstr ""
+
+#. module: product_expiry
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,life_date:0
+msgid "The date the lot may become dangerous and should not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,removal_date:0
+msgid "Removal Date"
+msgstr ""
+
+#. module: product_expiry
+#: model:ir.module.module,description:product_expiry.module_meta_information
+msgid "Track different dates on products and production lots:\n"
+" - end of life\n"
+" - best before date\n"
+" - removal date\n"
+" - alert date\n"
+"Used, for example, in food industries."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_pain_product_template
+msgid "Bread"
+msgstr ""
+
+#. module: product_expiry
+#: model:product.uom,name:product_expiry.product_uom_ltr
+#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol
+msgid "LTR"
+msgstr ""
+
+#. module: product_expiry
+#: view:product.product:0
+#: view:stock.production.lot:0
+msgid "Dates"
+msgstr ""
+
+#. module: product_expiry
+#: constraint:product.template:0
+msgid "Error: UOS must be in a different category than the UOM"
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,life_date:0
+msgid "End of Life Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,use_date:0
+msgid "Best before Date"
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,use_date:0
+msgid "The date the lot starts deteriorating without becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: model:product.template,name:product_expiry.product_product_jambon_product_template
+msgid "French cheese Camenbert"
+msgstr ""
+
+#. module: product_expiry
+#: help:product.product,removal_time:0
+msgid "The number of days before a production lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,use_time:0
+msgid "Product usetime"
+msgstr ""
+
+#. module: product_expiry
+#: field:stock.production.lot,alert_date:0
+msgid "Alert Date"
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,removal_time:0
+msgid "Product removal time"
+msgstr ""
+
+#. module: product_expiry
+#: help:product.product,use_time:0
+msgid "The number of days before a production lot starts deteriorating without becoming dangerous."
+msgstr ""
+
+#. module: product_expiry
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr ""
+
+#. module: product_expiry
+#: help:product.product,life_time:0
+msgid "The number of days before a production lot may become dangerous and should not be consumed."
+msgstr ""
+
+#. module: product_expiry
+#: help:stock.production.lot,removal_date:0
+msgid "The date the lot should be removed."
+msgstr ""
+
+#. module: product_expiry
+#: field:product.product,alert_time:0
+msgid "Product alert time"
+msgstr ""
+
diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py
new file mode 100644
index 00000000000..92dc7974bf7
--- /dev/null
+++ b/addons/product_expiry/product_expiry.py
@@ -0,0 +1,79 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 datetime
+from osv import fields, osv
+import pooler
+
+class stock_production_lot(osv.osv):
+ _name = 'stock.production.lot'
+ _inherit = 'stock.production.lot'
+
+ def _get_date(dtype):
+ """Return a function to compute the limit date for this type"""
+ def calc_date(self, cr, uid, context=None):
+ """Compute the limit date for a given date"""
+ if context is None:
+ context = {}
+ if not context.get('product_id', False):
+ date = False
+ else:
+ product = pooler.get_pool(cr.dbname).get('product.product').browse(
+ cr, uid, context['product_id'])
+ duration = getattr(product, dtype)
+ # 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 calc_date
+
+ _columns = {
+ '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'),
+ }
+
+ _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'),
+ }
+stock_production_lot()
+
+class product_product(osv.osv):
+ _inherit = 'product.product'
+ _name = 'product.product'
+ _columns = {
+ 'life_time': fields.integer('Product lifetime',
+ help='The number of days before a production lot may become dangerous and should not be consumed.'),
+ 'use_time': fields.integer('Product usetime',
+ help='The number of days before a production lot starts deteriorating without becoming dangerous.'),
+ 'removal_time': fields.integer('Product removal time',
+ help='The number of days before a production lot should be removed.'),
+ 'alert_time': fields.integer('Product alert time'),
+ }
+product_product()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product_expiry/product_expiry_demo.xml b/addons/product_expiry/product_expiry_demo.xml
new file mode 100644
index 00000000000..b5e8adc6b07
--- /dev/null
+++ b/addons/product_expiry/product_expiry_demo.xml
@@ -0,0 +1,128 @@
+
+
+
+
+ LTR
+
+
+
+ LTR
+
+
+
+ buy
+ 7.0
+ 5.0
+
+
+
+ 3
+ French cheese Camenbert
+ 15
+ 10
+ 6
+ 5
+ JKB
+ 3307630302014
+
+
+
+ box of 10
+ 12
+
+ 6
+ 4
+
+ 12345678901234
+ 10
+ 240
+
+
+
+ buy
+ 8.0
+ 6.0
+
+
+
+ 0.5
+ Ham
+ 30
+ 25
+ 20
+ 19
+ FKS
+ 3307631101876
+
+
+
+ Box of 5
+ 12
+
+ 6
+ 4
+
+ 12345678901234
+ 10
+ 240
+
+
+
+ buy
+ 8.0
+ 6.0
+
+
+
+ 0.5
+ Bread
+ 30
+ 25
+ 20
+ 19
+ PKB
+ 3307631102323
+
+
+
+ Bag of 2
+ 6
+
+ 6
+ 4
+
+ 12345678901234
+ 10
+ 240
+
+
+
+ buy
+ 8.0
+ 6.0
+
+
+
+ 0.5
+ Cow milk
+ 30
+ 25
+ 20
+ 19
+ LEX
+ 3307630302045
+
+
+
+ Boxes of 1 liter
+ 4
+
+ 6
+ 4
+
+ 12345678901234
+ 10
+ 240
+
+
+
diff --git a/addons/product_expiry/product_expiry_view.xml b/addons/product_expiry/product_expiry_view.xml
new file mode 100644
index 00000000000..245a4a2c600
--- /dev/null
+++ b/addons/product_expiry/product_expiry_view.xml
@@ -0,0 +1,39 @@
+
+
+
+
+ stock.production.lot.form
+ stock.production.lot
+
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+ product.normal.form
+ product.product
+
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/product_expiry/report/__init__.py b/addons/product_expiry/report/__init__.py
new file mode 100644
index 00000000000..a6006ed47b3
--- /dev/null
+++ b/addons/product_expiry/report/__init__.py
@@ -0,0 +1,25 @@
+# -*- 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
new file mode 100644
index 00000000000..bef64eaffa6
--- /dev/null
+++ b/addons/product_expiry/report/report_stock.py
@@ -0,0 +1,121 @@
+# -*- 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
new file mode 100644
index 00000000000..68198e87dd3
--- /dev/null
+++ b/addons/product_expiry/report/report_stock_view.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+ 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
new file mode 100644
index 00000000000..2b1b55ed6e0
--- /dev/null
+++ b/addons/product_expiry/wizard/__init__.py
@@ -0,0 +1 @@
+import stock_partial
diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py
new file mode 100644
index 00000000000..4edb01073e7
--- /dev/null
+++ b/addons/product_expiry/wizard/stock_partial.py
@@ -0,0 +1,64 @@
+# -*- 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
+import wizard
+
+class stock_partial_lot_picking(osv.osv_memory):
+ _inherit = "stock.partial.picking"
+ _name = "stock.partial.picking"
+ _description = "Partial Picking"
+
+ def do_partial(self, cr, uid, ids, context):
+ res = super(stock_partial_lot_picking, self).do_partial(cr, uid, ids, context=context)
+ prodlot_obj = self.pool.get('stock.production.lot')
+ pick_obj = self.pool.get('stock.picking')
+ picking_ids = context.get('active_ids', False)
+ partial = self.browse(cr, uid, ids[0], context)
+ for pick in pick_obj.browse(cr, uid, picking_ids):
+ for m in pick.move_lines:
+ for pick in pick_obj.browse(cr, uid, picking_ids):
+ for m in pick.move_lines:
+ res = {}
+ if (pick.type == 'in') and m.prodlot_id:
+ if not m.prodlot_id.life_date:
+ date_life = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.life_time))
+ res['life_date'] = date_life.strftime('%Y-%m-%d')
+ if not m.prodlot_id.use_date:
+ date_use = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.use_time))
+ res['use_date'] = date_use.strftime('%Y-%m-%d')
+ if not m.prodlot_id.removal_date:
+ date_removal = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.removal_time))
+ res['removal_date'] = date_removal.strftime('%Y-%m-%d')
+ if not m.prodlot_id.alert_date:
+ date_alert = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.alert_time))
+ res['alert_date'] = date_alert.strftime('%Y-%m-%d')
+ prodlot_obj.write(cr, uid, [m.prodlot_id.id], res)
+ return res
+stock_partial_lot_picking()
+
diff --git a/addons/product_manufacturer/__init__.py b/addons/product_manufacturer/__init__.py
new file mode 100644
index 00000000000..3c3dce04d51
--- /dev/null
+++ b/addons/product_manufacturer/__init__.py
@@ -0,0 +1,23 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 product_manufacturer
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product_manufacturer/__openerp__.py b/addons/product_manufacturer/__openerp__.py
new file mode 100644
index 00000000000..5d7e8922520
--- /dev/null
+++ b/addons/product_manufacturer/__openerp__.py
@@ -0,0 +1,34 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 .
+#
+##############################################################################
+{
+ "name" : "Products Attributes & Manufacturers",
+ "version" : "1.0",
+ "author" : "Tiny",
+ "category" : "Enterprise Specific Modules/Industries",
+ "depends" : ["base", "account", "product", "stock"],
+ "init_xml" : [],
+ "demo_xml" : [],
+ "description": "A module that add manufacturers and attributes on the product form",
+ "update_xml" : ["security/ir.model.access.csv","product_manufacturer_view.xml"],
+ "active": False,
+ "installable": True
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product_manufacturer/i18n/fr_BE.po b/addons/product_manufacturer/i18n/fr_BE.po
new file mode 100644
index 00000000000..2fc936e9dfc
--- /dev/null
+++ b/addons/product_manufacturer/i18n/fr_BE.po
@@ -0,0 +1,103 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_electronic
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-25 13:27:55+0000\n"
+"PO-Revision-Date: 2009-11-25 13:27:55+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: product_electronic
+#: model:ir.module.module,description:product_electronic.module_meta_information
+msgid "A module that add manufacturers and attributes on the product form"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer_pref:0
+msgid "Manufacturer product code"
+msgstr ""
+
+#. module: product_electronic
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.electronic.attribute:0
+msgid "Product Template Name"
+msgstr ""
+
+#. module: product_electronic
+#: 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
+msgid "Product attributes"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Manufacturing data"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Product reference"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,name:0
+msgid "Attribute"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,value:0
+msgid "Value"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Manufacturing Data"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Product name"
+msgstr ""
+
+#. module: product_electronic
+#: 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
+msgid "Products Attributes & Manufacturers"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer_pname:0
+msgid "Manufacturer product name"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer:0
+msgid "Manufacturer"
+msgstr ""
+
diff --git a/addons/product_manufacturer/i18n/product_manufacturer.pot b/addons/product_manufacturer/i18n/product_manufacturer.pot
new file mode 100644
index 00000000000..2fc936e9dfc
--- /dev/null
+++ b/addons/product_manufacturer/i18n/product_manufacturer.pot
@@ -0,0 +1,103 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_electronic
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-25 13:27:55+0000\n"
+"PO-Revision-Date: 2009-11-25 13:27:55+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: product_electronic
+#: model:ir.module.module,description:product_electronic.module_meta_information
+msgid "A module that add manufacturers and attributes on the product form"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer_pref:0
+msgid "Manufacturer product code"
+msgstr ""
+
+#. module: product_electronic
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.electronic.attribute:0
+msgid "Product Template Name"
+msgstr ""
+
+#. module: product_electronic
+#: 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
+msgid "Product attributes"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Manufacturing data"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Product reference"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,name:0
+msgid "Attribute"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.electronic.attribute,value:0
+msgid "Value"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Manufacturing Data"
+msgstr ""
+
+#. module: product_electronic
+#: view:product.product:0
+msgid "Product name"
+msgstr ""
+
+#. module: product_electronic
+#: 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
+msgid "Products Attributes & Manufacturers"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer_pname:0
+msgid "Manufacturer product name"
+msgstr ""
+
+#. module: product_electronic
+#: field:product.product,manufacturer:0
+msgid "Manufacturer"
+msgstr ""
+
diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py
new file mode 100644
index 00000000000..d77ab518efe
--- /dev/null
+++ b/addons/product_manufacturer/product_manufacturer.py
@@ -0,0 +1,59 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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
+
+class product_product(osv.osv):
+ _inherit = 'product.product'
+ _name = 'product.product'
+ _columns = {
+ '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"
+ _columns = {
+ 'name' : fields.char('Attribute', size=64, required=True),
+ 'value' : fields.char('Value', size=64),
+ 'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
+ }
+product_attribute()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product_manufacturer/product_manufacturer_view.xml b/addons/product_manufacturer/product_manufacturer_view.xml
new file mode 100644
index 00000000000..cfd7f23ae8d
--- /dev/null
+++ b/addons/product_manufacturer/product_manufacturer_view.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+ product.normal.form
+ product.product
+
+ 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
new file mode 100644
index 00000000000..9a65d0355ff
--- /dev/null
+++ b/addons/product_manufacturer/security/ir.model.access.csv
@@ -0,0 +1,5 @@
+"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","product.group_uos",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","product.group_uos",1,0,0,0
+"access_partner_manufacturer_manager","res.partner.manufacturer","model_res_partner_manufacturer","product.group_uos",1,1,1,1
diff --git a/addons/profile_tools/security/ir.model.access.csv b/addons/profile_tools/security/ir.model.access.csv
index dbe55929ecc..a46b61c89a2 100644
--- a/addons/profile_tools/security/ir.model.access.csv
+++ b/addons/profile_tools/security/ir.model.access.csv
@@ -1,2 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_misc_tools_installer","misc_tools.installer","model_misc_tools_installer",,1,1,1,1
+"access_misc_tools_installer","misc_tools.installer","model_misc_tools_installer",base.group_system,1,1,1,1
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index f58f026d484..004ed9ba429 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -40,8 +40,6 @@
-
-
@@ -50,12 +48,16 @@
-
+
+
+
+
@@ -240,7 +242,7 @@
-
+
@@ -415,10 +417,10 @@
-
+
-
+
@@ -540,27 +542,27 @@
- res.users.project.form1
- res.users
- form
-
-
-
-
-
-
-
+ res.users.project.form1
+ res.users
+ form
+
+
+
+
+
+
+
- view.users.form.project.modif.inherited1
- res.users
-
- form
-
-
+ view.users.form.project.modif.inherited1
+ res.users
+
+ form
+
+
-
+
@@ -607,11 +609,10 @@
-
-
-
-
-
+
+
+
+
@@ -639,6 +640,6 @@
-
+
diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv
index 0cbe980f2e6..1a2fac38c6a 100644
--- a/addons/project/security/ir.model.access.csv
+++ b/addons/project/security/ir.model.access.csv
@@ -1,9 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_project_project_manager","project.project manager","model_project_project","project.group_project_manager",1,1,1,1
-"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","project.group_project_user",1,1,1,1
+"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","project.group_project_manager",1,1,1,1
"access_project_project","project.project","model_project_project","project.group_project_user",1,0,0,0
"access_account_analytic_account","account.analytic.account","analytic.model_account_analytic_account","project.group_project_user",1,0,0,0
-"access_project_task_type_user","project.task.type user","model_project_task_type","project.group_project_user",1,0,0,1
+"access_project_task_type_user","project.task.type user","model_project_task_type","project.group_project_user",1,0,0,0
"access_project_task_type","project.task.type","model_project_task_type","project.group_project_manager",1,1,1,1
"access_project_task_manager","project.task manager","model_project_task","project.group_project_manager",1,1,1,1
"access_project_task","project.task","model_project_task","project.group_project_user",1,1,1,1
@@ -11,10 +11,18 @@
"access_project_task_work_manager","project.task.work.manager","model_project_task_work","project.group_project_manager",1,1,1,1
"access_config_compute_remaining","project.config.compute.remaining","model_config_compute_remaining","project.group_project_user",1,1,1,1
"access_config_compute_remaining_manager","project.config.compute.remaining.manager","model_config_compute_remaining","project.group_project_manager",1,1,1,1
-"access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0
-"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0
+"access_project_message","project.message","model_project_message","project.group_project_user",1,1,1,1
+"access_project_installer","project.installer","model_project_installer","base.group_system",1,1,1,1
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0
"access_project_vs_remaining_hours","project.vs.remaining.hours","model_project_vs_remaining_hours","project.group_project_user",1,1,1,1
"access_task_by_days_vs_planned_hours","task.by.days.vs.planned.hour","model_task_by_days_vs_planned_hours","project.group_project_user",1,1,1,1
"access_task_by_days","task.by.days","model_task_by_days","project.group_project_user",1,1,1,1
-"access_close_task","close.task","model_close_task","project.group_project_manager",1,1,1,1
+"access_close_task","close.task","model_close_task","project.group_project_user",1,1,1,1
+"access_close_task_manager","close.task manager","model_close_task","project.group_project_manager",1,1,1,1
+"access_resource_calendar_project_user","resource.resource.calendar project user","resource.model_resource_calendar","project.group_project_user",1,0,0,0
+"access_resource_calendar_project_manager","resource.resource.calendar project manager","resource.model_resource_calendar","project.group_project_manager",1,1,1,1
+"access_fiscalyear_sequence_project_manager","account.sequence.fiscalyear project manager","account.model_account_sequence_fiscalyear","project.group_project_manager",1,1,0,0
+"access_partner_task user","base.res.partner user","base.model_res_partner","project.group_project_user",1,0,0,0
+"access_partner_task manager","base.res.partner manager","base.model_res_partner","project.group_project_manager",1,0,0,0
+"access_partner_address_task user","base.res.partner.address user","base.model_res_partner_address","project.group_project_user",1,0,0,0
+"access_partner_address_task manager","base.res.partner.address manager","base.model_res_partner_address","project.group_project_manager",1,0,0,0
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index 447ee1af39e..dbb28db165e 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -13,25 +13,25 @@
- Project multi-company
+ Project multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Task multi-company
+ Task multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Tasks According to User and Project
+ Tasks According to User and Project
['|','|','|',('user_id','=',False),('user_id','=',user.id),('project_id.members','=',user.id),('project_id.user_id','=',user.id)]
diff --git a/addons/project_caldav/project_caldav_view.xml b/addons/project_caldav/project_caldav_view.xml
index 541cc3c396e..885878cfcd8 100644
--- a/addons/project_caldav/project_caldav_view.xml
+++ b/addons/project_caldav/project_caldav_view.xml
@@ -2,100 +2,100 @@
-
- project.task.caldav.form
- project.task
-
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ project.task.caldav.form
+ project.task
+
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- project.task.caldav.form1
- project.task
-
- form
-
-
-
-
-
-
+
+ project.task.caldav.form1
+ project.task
+
+ form
+
+
+
+
+
+
-
- project.task.caldav.form2
- project.task
-
- form
-
-
-
-
-
-
-
-
-
+
+ project.task.caldav.form2
+ project.task
+
+ form
+
+
+
+
+
+
+
+
+
-
- project.task.caldav.form3
- project.task
-
- form
-
-
-
-
-
-
-
-
-
-
+
+ project.task.caldav.form3
+ project.task
+
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/project_gtd/security/ir.model.access.csv b/addons/project_gtd/security/ir.model.access.csv
index 52e1b466740..0398fbfb0ee 100644
--- a/addons/project_gtd/security/ir.model.access.csv
+++ b/addons/project_gtd/security/ir.model.access.csv
@@ -1,3 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_project_gtd_context","project.gtd.context","model_project_gtd_context","group_project_getting",1,1,1,1
"access_project_gtd_timebox","project.gtd.timebox","model_project_gtd_timebox","group_project_getting",1,1,1,1
+"access_project_gtd_context_user","project.gtd.context project user","model_project_gtd_context","project.group_project_user",1,0,0,0
+"access_project_gtd_timebox_user","project.gtd.timebox project user","model_project_gtd_timebox","project.group_project_user",1,0,0,0
+"access_project_gtd_context_manager","project.gtd.context project manager","model_project_gtd_context","project.group_project_manager",1,1,1,1
+"access_project_gtd_timebox_manager","project.gtd.timebox project manager","model_project_gtd_timebox","project.group_project_manager",1,1,1,1
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index a5009b7eb47..673f4239971 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -106,9 +106,9 @@
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'new', 'model': 'project.issue'}"
+ icon="gtk-go-forward" type="action" />
@@ -187,10 +187,10 @@
-
+
-
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -298,12 +298,12 @@
-
+
-
+
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 212af8a30dc..57fbd1abb5f 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -256,115 +256,7 @@ class task(osv.osv):
_inherit = "project.task"
_columns = {
'phase_id': fields.many2one('project.phase', 'Project Phase'),
- 'occupation_rate': fields.float('Occupation Rate', help='The occupation rate fields indicates how much of his time a user is working on a task. A 100% occupation rate means the user works full time on the tasks. The ending date of a task is computed like this: Starting Date + Duration / Occupation Rate.'),
- 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
}
- _defaults = {
- 'occupation_rate': '1'
- }
-
- def onchange_planned(self, cr, uid, ids, project, user_id=False, planned=0.0, effective=0.0, date_start=None, occupation_rate=0.0):
- result = {}
- resource = False
- resource_obj = self.pool.get('resource.resource')
- project_pool = self.pool.get('project.project')
- resource_calendar = self.pool.get('resource.calendar')
- if not project:
- return {'value' : result}
- if date_start:
- hrs = float(planned / float(occupation_rate))
- calendar_id = project_pool.browse(cr, uid, project).resource_calendar_id.id
- dt_start = mx.DateTime.strptime(date_start, '%Y-%m-%d %H:%M:%S')
- resource_id = resource_obj.search(cr, uid, [('user_id','=',user_id)])
- if resource_id:
- resource_data = resource_obj.browse(cr, uid, resource_id)[0]
- resource = resource_data.id
- hrs = planned / (float(occupation_rate) * resource_data.time_efficiency)
- if resource_data.calendar_id.id:
- calendar_id = resource_data.calendar_id.id
- work_times = resource_calendar.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource or False)
- if work_times:
- result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
- result['remaining_hours'] = planned - effective
- return {'value' : result}
-
- def _check_date_start(self, cr, uid, task, date_end, context={}):
- """
- Check And Compute date_end of task if change in date_start < older time.
- """
- resource_calendar_obj = self.pool.get('resource.calendar')
- resource_obj = self.pool.get('resource.resource')
- calendar_id = task.project_id.resource_calendar_id and task.project_id.resource_calendar_id.id or False
- hours = task.planned_hours / task.occupation_rate
- resource_id = resource_obj.search(cr, uid, [('user_id', '=', task.user_id.id)], context=context)
- if resource_id:
- resource = resource_obj.browse(cr, uid, resource_id[0], context=context)
- if resource.calendar_id.id:
- calendar_id = resource.calendar_id and resource.calendar_id.id or False
- hours = task.planned_hours / (float(task.occupation_rate) * resource.time_efficiency)
- work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, date_end, hours or 0.0, resource_id and resource_id[0] or False)
- dt_start = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
- self.write(cr, uid, [task.id], {'date_start' : dt_start,'date_end' : date_end.strftime('%Y-%m-%d %H:%M:%S')})
-
- def _check_date_end(self, cr, uid, task, date_start, context={}):
- """
- Check And Compute date_end of task if change in date_end > older time.
- """
- resource_calendar_obj = self.pool.get('resource.calendar')
- resource_obj = self.pool.get('resource.resource')
- calendar_id = task.project_id.resource_calendar_id and task.project_id.resource_calendar_id.id or False
- hours = task.planned_hours / task.occupation_rate
- resource_id = resource_obj.search(cr,uid,[('user_id', '=', task.user_id.id)], context=context)
- if resource_id:
- resource = resource_obj.browse(cr, uid, resource_id[0], context=context)
- if resource.calendar_id.id:
- calendar_id = resource.calendar_id and resource.calendar_id.id or False
- hours = task.planned_hours / (float(task.occupation_rate) * resource.time_efficiency)
- work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, date_start, hours or 0.0, resource_id and resource_id[0] or False)
- dt_end = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
- self.write(cr, uid, [task.id], {'date_start': date_start.strftime('%Y-%m-%d %H:%M:%S'),'date_end' : dt_end}, context=context)
-
- def write(self, cr, uid, ids, vals, context={}):
- resource_calendar_obj = self.pool.get('resource.calendar')
- resource_obj = self.pool.get('resource.resource')
- if not context:
- context = {}
- if context.get('scheduler',False):
- return super(task, self).write(cr, uid, ids, vals, context=context)
-
- # Consider calendar and efficiency if the task is performed by a resource
- # otherwise consider the project's working calendar
- task_id = ids
- if isinstance(ids, list):
- task_id = ids[0]
- task_rec = self.browse(cr, uid, task_id, context=context)
- calendar_id = task_rec.project_id.resource_calendar_id and task_rec.project_id.resource_calendar_id.id or False
- hrs = task_rec.planned_hours / task_rec.occupation_rate
- resource_id = resource_obj.search(cr, uid, [('user_id', '=', task_rec.user_id.id)], context=context)
- if resource_id:
- resource = resource_obj.browse(cr, uid, resource_id[0], context=context)
- if resource.calendar_id.id:
- calendar_id = resource.calendar_id and resource.calendar_id.id or False
- hrs = task_rec.planned_hours / (float(task_rec.occupation_rate) * resource.time_efficiency)
-
- # Change the date_start and date_end
- # for previous and next tasks respectively based on valid condition
- if vals.get('date_start', False) and vals['date_start'] < task_rec.date_start:
- dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S')
- work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource.id or False)
- if work_times:
- vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
- for prv_task in task_rec.parent_ids:
- self._check_date_start(cr, uid, prv_task, dt_start)
- if vals.get('date_end', False) and vals['date_end'] > task_rec.date_end:
- dt_end = mx.DateTime.strptime(vals['date_end'], '%Y-%m-%d %H:%M:%S')
- work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, dt_end, hrs or 0.0, resource.id or False)
- if work_times:
- vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
- for next_task in task_rec.child_ids:
- self._check_date_end(cr, uid, next_task, dt_end)
-
- return super(task, self).write(cr, uid, ids, vals, context=context)
task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/project_long_term_demo.xml b/addons/project_long_term/project_long_term_demo.xml
index 24bc7ff9438..657658eba46 100644
--- a/addons/project_long_term/project_long_term_demo.xml
+++ b/addons/project_long_term/project_long_term_demo.xml
@@ -404,7 +404,6 @@
2
draft
-
@@ -424,7 +423,6 @@
2
draft
-
@@ -444,7 +442,6 @@
2
draft
-
@@ -464,7 +461,6 @@
2
draft
-
@@ -484,7 +480,6 @@
2
draft
-
@@ -504,7 +499,6 @@
2
draft
-
@@ -524,7 +518,6 @@
2
draft
-
@@ -544,7 +537,6 @@
2
draft
-
@@ -564,7 +556,6 @@
2
draft
-
@@ -584,7 +575,6 @@
2
draft
-
@@ -604,7 +594,6 @@
2
draft
-
@@ -623,7 +612,6 @@
2
draft
-
@@ -642,7 +630,6 @@
2
draft
-
@@ -661,7 +648,6 @@
2
draft
-
@@ -680,7 +666,6 @@
2
draft
-
@@ -699,7 +684,6 @@
2
draft
-
@@ -718,7 +702,6 @@
2
draft
-
@@ -737,7 +720,6 @@
2
draft
-
@@ -756,7 +738,6 @@
2
draft
-
@@ -776,7 +757,6 @@
2
draft
-
@@ -796,7 +776,6 @@
2
draft
-
@@ -816,7 +795,6 @@
2
draft
-
@@ -836,7 +814,6 @@
2
draft
-
@@ -856,7 +833,6 @@
2
draft
-
@@ -876,7 +852,6 @@
2
draft
-
@@ -897,7 +872,6 @@
2
draft
-
@@ -909,4 +883,4 @@
-
\ No newline at end of file
+
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index 92b8a34ee9c..583822ccb8d 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -2,7 +2,7 @@
-
+
# ------------------------------------------------------
# Project Resource Allocation
@@ -29,7 +29,7 @@
-
+
@@ -42,8 +42,8 @@
-
-
+
+
@@ -59,7 +59,7 @@
project.resource.allocation
form
tree,form
- {'search_default_resource': 1}
+ {'search_default_resource': 1}
@@ -128,7 +128,7 @@
-
+
@@ -142,11 +142,10 @@
-
-
+
@@ -157,7 +156,7 @@
-
+
@@ -223,10 +222,10 @@
-
+
-
+
@@ -245,7 +244,7 @@
project.phase
form
gantt,tree,form,calendar
- {'search_default_responsible_id':uid}
+ {'search_default_responsible_id':uid}
@@ -280,32 +279,7 @@
# Project Task
# ------------------------------------------------------
-
- project.phase.task.form1
- project.task
- form
-
-
-
-
-
-
-
-
-
-
- project.phase.task.form2
- project.task
- form
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_long_term/security/ir.model.access.csv b/addons/project_long_term/security/ir.model.access.csv
index 7a91ce257ed..b829675772e 100644
--- a/addons/project_long_term/security/ir.model.access.csv
+++ b/addons/project_long_term/security/ir.model.access.csv
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_project_phase","project.phase","model_project_phase",,1,1,1,1
-"access_project_resource_allocation","project.resource.allocation","model_project_resource_allocation",,1,1,1,1
+"access_project_phase","project.phase","model_project_phase",project.group_project_user,1,1,1,1
+"access_project_resource_allocation","project.resource.allocation","model_project_resource_allocation",project.group_project_user,1,1,1,1
diff --git a/addons/project_long_term/wizard/project_compute_tasks.py b/addons/project_long_term/wizard/project_compute_tasks.py
index af5ceaea676..bd569abf90e 100644
--- a/addons/project_long_term/wizard/project_compute_tasks.py
+++ b/addons/project_long_term/wizard/project_compute_tasks.py
@@ -108,7 +108,7 @@ class project_compute_tasks(osv.osv_memory):
# Dynamic Creation of tasks
i = 0
for each_task in tasks:
- hours = str(each_task.planned_hours / each_task.occupation_rate)+ 'H'
+ hours = str(each_task.planned_hours )+ 'H'
if each_task.priority in priority_dict.keys():
priorty = priority_dict[each_task.priority]
if each_task.user_id:
@@ -139,4 +139,4 @@ class project_compute_tasks(osv.osv_memory):
return {}
project_compute_tasks()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/wizard/project_schedule_tasks.py b/addons/project_long_term/wizard/project_schedule_tasks.py
index 3e01c25e975..78ad2166698 100644
--- a/addons/project_long_term/wizard/project_schedule_tasks.py
+++ b/addons/project_long_term/wizard/project_schedule_tasks.py
@@ -127,7 +127,7 @@ class project_schedule_task(osv.osv_memory):
# Dynamic creation of tasks
i = 0
for each_task in tasks:
- hours = str(each_task.planned_hours / each_task.occupation_rate)+ 'H'
+ hours = str(each_task.planned_hours )+ 'H'
if each_task.priority in priority_dict.keys():
priorty = priority_dict[each_task.priority]
if each_task.user_id:
diff --git a/addons/project_messages/security/ir.model.access.csv b/addons/project_messages/security/ir.model.access.csv
index 96782d5fc82..b79a32fb2f5 100644
--- a/addons/project_messages/security/ir.model.access.csv
+++ b/addons/project_messages/security/ir.model.access.csv
@@ -1,2 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_project_messages","project.messages","model_project_messages",,1,1,1,1
+"access_project_messages","project.messages","model_project_messages",project.group_project_user,1,1,1,1
diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml
index fd9d586f21e..d7d2880714c 100644
--- a/addons/project_planning/project_planning_view.xml
+++ b/addons/project_planning/project_planning_view.xml
@@ -164,10 +164,10 @@
-
-
-
-
+
+
+
+
diff --git a/addons/project_timesheet/process/project_timesheet_process.xml b/addons/project_timesheet/process/project_timesheet_process.xml
index d6ca5cde8bc..bfabe6ba5ad 100644
--- a/addons/project_timesheet/process/project_timesheet_process.xml
+++ b/addons/project_timesheet/process/project_timesheet_process.xml
@@ -28,7 +28,7 @@
-
+
diff --git a/addons/purchase/board_purchase_view.xml b/addons/purchase/board_purchase_view.xml
index 5548b3f2838..bdfb5663f66 100644
--- a/addons/purchase/board_purchase_view.xml
+++ b/addons/purchase/board_purchase_view.xml
@@ -2,28 +2,28 @@
-
+
-
+
Draft Purchases
ir.actions.act_window
purchase.order
form
tree,form
- [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','=','draft')]
+ [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','=','draft')]
-
+
Quotation Request
ir.actions.act_window
purchase.order
form
tree,form
- [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','in',('wait','confirmed'))]
+ [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','in',('wait','confirmed'))]
@@ -39,15 +39,15 @@
-
-
+
+
-
+
Purchase Dashboard
board.board
form
@@ -55,7 +55,7 @@
menu
-
-
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 2c02de8bb98..eb51a19ccb2 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -65,7 +65,6 @@ class purchase_order(osv.osv):
res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val)
res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
- print res
return res
def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context):
@@ -168,7 +167,7 @@ class purchase_order(osv.osv):
'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True),
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
- 'notes': fields.text('Notes', translate=True),
+ 'notes': fields.text('Notes'),
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
'picking_ids': fields.one2many('stock.picking', 'purchase_id', 'Picking List', readonly=True, help="This is the list of picking list that have been generated for this purchase"),
'shipped':fields.boolean('Received', readonly=True, select=True),
@@ -441,6 +440,7 @@ class purchase_order(osv.osv):
'product_uom': order_line.product_uom.id,
'product_uos': order_line.product_uom.id,
'date_planned': order_line.date_planned,
+ 'date_expected': order_line.date_planned,
'location_id': loc_id,
'location_dest_id': dest,
'picking_id': picking_id,
@@ -604,7 +604,7 @@ class purchase_order_line(osv.osv):
'move_dest_id': fields.many2one('stock.move', 'Reservation Destination', ondelete='set null'),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Purchase Price')),
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Purchase Price')),
- 'notes': fields.text('Notes', translate=True),
+ 'notes': fields.text('Notes'),
'order_id': fields.many2one('purchase.order', 'Order Reference', select=True, required=True, ondelete='cascade'),
'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',),
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company'),
@@ -646,7 +646,7 @@ class purchase_order_line(osv.osv):
prod= self.pool.get('product.product').browse(cr, uid,product)
lang=False
if partner_id:
- lang=self.pool.get('res.partner').read(cr, uid, partner_id)['lang']
+ lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang']
context={'lang':lang}
context['partner_id'] = partner_id
@@ -739,17 +739,16 @@ class procurement_order(osv.osv):
po_obj = self.pool.get('purchase.order')
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
- partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in procurement.product_id.seller_ids if partner_id])
- partner_rec = partner_list and partner_list[0] and partner_list[0][1] or False
- partner = partner_rec.name or False
- partner_id = partner_rec.id or False
+ partner = procurement.product_id.seller_ids[0].name
+ partner_id = partner.id
+ partner_rec = procurement.product_id.seller_ids[0]
address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
pricelist_id = partner.property_product_pricelist_purchase.id
uom_id = procurement.product_id.uom_po_id.id
qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
- if partner_rec.qty:
+ if procurement.product_id.seller_ids[0].qty:
qty = max(qty,partner_rec.qty)
price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 502c33bd5f9..3a7277a4766 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -3,7 +3,7 @@
-
@@ -21,7 +21,7 @@
parent="base.menu_purchase_root" sequence="4"/>
-
+
-
+
-
@@ -159,7 +158,7 @@
-
+
@@ -233,7 +232,13 @@
+
+
+
+
+
@@ -243,17 +248,14 @@
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
@@ -286,7 +288,7 @@
-
+
@@ -313,7 +315,7 @@
src_model="product.product"
groups="base.group_extended"/>
- procurement.order.form.inherit
- procurement.order
-
- form
-
-
-
-
-
+ procurement.order.form.inherit
+ procurement.order
+
+ form
+
+
+
+
+
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index ff3d4bdcee8..d5688e5bd22 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -31,7 +31,7 @@ class purchase_report(osv.osv):
_description = "Purchases Orders"
_auto = False
_columns = {
- 'date': fields.date('Date order', readonly=True),
+ 'date': fields.date('Order Date', readonly=True),
'name': fields.char('Year',size=64,required=False, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'state': fields.selection([
@@ -44,32 +44,26 @@ class purchase_report(osv.osv):
('done','Done'),
('cancel','Cancel')
], 'Order State', readonly=True),
- 'invoice_method': fields.selection([
- ('manual','Manual'),
- ('order','From Order'),
- ('picking','From Picking')
- ],'Invoicing Control', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
- 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'partner_address_id':fields.many2one('res.partner.address', 'Address Contact Name', readonly=True),
'dest_address_id':fields.many2one('res.partner.address', 'Dest. Address Contact Name',readonly=True),
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', readonly=True),
'date_approve':fields.date('Date Approved', readonly=True),
'expected_date':fields.date('Expected Date', readonly=True),
- 'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
+ 'validator' : fields.many2one('res.users', 'Validated By', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
- 'shipped_qty':fields.integer('Received Qty', readonly=True),
- 'invoiced_qty':fields.integer('Invoiced Qty', readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
- 'delay':fields.float('Days to Close', digits=(16,2), readonly=True),
- 'delay_pass':fields.float('Overpassed expected', digits=(16,2), readonly=True),
+ 'delay':fields.float('Days to Validate', digits=(16,2), readonly=True, group_operator="avg"),
+ 'delay_pass':fields.float('Days to Deliver', digits=(16,2), readonly=True, group_operator="avg"),
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
- 'price_average': fields.float('Average Price', readonly=True),
- 'nbr': fields.integer('# of Ordered Lines', readonly=True),
+ 'price_average': fields.float('Unit Price', readonly=True, group_operator="avg"),
+ 'negociation': fields.float('Purchase-Standard Price', readonly=True, group_operator="avg"),
+ 'price_standard': fields.float('Products Value', readonly=True, group_operator="sum"),
+ 'nbr': fields.integer('# of PO Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
@@ -94,36 +88,34 @@ class purchase_report(osv.osv):
s.validator,
s.warehouse_id as warehouse_id,
s.partner_id as partner_id,
- s.fiscal_position,
s.create_uid as user_id,
s.company_id as company_id,
- s.invoice_method,
- s.shipped::integer as shipped_qty,
- l.invoiced::integer as invoiced_qty,
l.product_id,
s.location_id as location_id,
sum(l.product_qty*u.factor) as quantity,
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
- extract(epoch from age(s.minimum_planned_date,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
+ extract(epoch from age(l.date_planned,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
- l.price_unit*l.product_qty*u.factor as price_total,
+ (l.price_unit*l.product_qty*u.factor)::decimal(16,2) as price_total,
+ avg(100.0 * (l.price_unit*l.product_qty*u.factor) / (t.standard_price*l.product_qty*u.factor))::decimal(16,2) as negociation,
+ sum(t.standard_price*l.product_qty*u.factor)::decimal(16,2) as price_standard,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
+ left join product_product p on (l.product_id=p.id)
+ left join product_template t on (p.product_tmpl_id=t.id)
left join product_uom u on (u.id=l.product_uom)
where l.product_id is not null
group by
s.company_id,
s.create_uid,
- s.shipped,
- l.invoiced,
s.partner_id,
l.product_qty,
u.factor,
s.location_id,
l.price_unit,
s.date_approve,
- s.minimum_planned_date,
+ l.date_planned,
date_trunc('day',s.minimum_planned_date),
s.partner_address_id,
s.pricelist_id,
@@ -135,74 +127,8 @@ class purchase_report(osv.osv):
to_char(s.date_order, 'MM'),
to_char(s.date_order, 'YYYY-MM-DD'),
s.state,
- s.warehouse_id,
- s.fiscal_position,
- s.invoice_method
+ s.warehouse_id
)
""")
purchase_report()
-class purchase_order_qty_amount(osv.osv):
- _name = "purchase.order.qty.amount"
- _description = "Quantity and amount per month"
- _auto = False
- _columns = {
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
- ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'total_qty' : fields.float('Total Qty'),
- 'total_amount' : fields.float('Total Amount'),
-
- }
- def init(self, cr):
- tools.sql.drop_view_if_exists(cr, 'purchase_order_qty_amount')
- cr.execute("""
- create or replace view purchase_order_qty_amount as (
- select
- min(id) as id,
- to_char(create_date, 'MM') as month,
- sum(product_qty) as total_qty,
- sum(price_unit*product_qty) as total_amount
- from
- purchase_order_line
- where
- to_char(create_date,'YYYY') = to_char(current_date,'YYYY')
- group by
- to_char(create_date, 'MM')
-
- )
- """)
-purchase_order_qty_amount()
-
-class purchase_order_by_user(osv.osv):
- _name = "purchase.order.by.user"
- _description = "Purchase Order by user per month"
- _auto = False
- _columns = {
- 'name' : fields.char('User',size=64,required=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
- ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'nbr' : fields.integer('Total Orders'),
-
- }
- _order = 'name desc'
- def init(self, cr):
- tools.sql.drop_view_if_exists(cr, 'purchase_order_by_user')
- cr.execute("""
- create or replace view purchase_order_by_user as (
- select
- min(po.id) as id,
- rs.name as name,
- count(po.id) as nbr,
- to_char(po.date_order, 'MM') as month
- from
- purchase_order as po,res_users as rs
- where
- po.create_uid = rs.id
- group by
- rs.name,po.date_order
-
- )
- """)
-purchase_order_by_user()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index db6cc6273de..2d18ae18b36 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -8,7 +8,6 @@
-
@@ -20,13 +19,13 @@
tree
-
-
-
-
-
+
+
+
+
+
-
+
@@ -34,14 +33,14 @@
-
-
-
-
+
+
-
-
-
+
+
+
+
+
@@ -53,65 +52,56 @@
-
+
+ name="month"
+ domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
+ help="Tasks performed in this month"/>
+ string="Quotations"
+ name="quotes"
+ domain="[('state','=','draft')]"/>
-
-
-
+ string="Orders"
+ name="orders"
+ domain="[('state','<>','draft'),('state','<>','cancel')]"/>
-
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
+
-
@@ -122,82 +112,70 @@
+
+ purchase.order.qty.amount.graph
+ purchase.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ purchase.order.by.user.graph
+ purchase.report
+ graph
+
+
+
+
+
+
+
+
+
+
Purchase Orders
purchase.report
form
tree,graph
-
- {'search_default_month':1,'search_default_Responsible':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_group_partner_id':1,'search_default_group_product_id': 1, 'search_default_orders': 1, 'group_by_no_leaf':1,'group_by':[]}
+
+ Total Qty and Amount by month
+ purchase.report
+ form
+ graph,tree
+
+
+
+
+ Total Orders by User per month
+ purchase.report
+ form
+ graph,tree
+
+
+
+
-
- purchase.order.qty.amount.graph
- purchase.order.qty.amount
- graph
-
-
-
-
-
-
-
-
+
+ Receptions Analysis
+ report.stock.move
+ form
+ tree,graph
+ {'search_default_month':1, 'search_default_group_product':1, 'search_default_group_partner':1, 'search_default_done':1, 'search_default_in': 1, 'group_by':[], 'group_by_no_leaf':1}
+
+
-
- purchase.order.qty.amount.tree
- purchase.order.qty.amount
- tree
-
-
-
-
-
-
-
-
-
- Total Qty and Amount by month
- purchase.order.qty.amount
- form
- graph,tree
-
-
-
- purchase.order.by.user.graph
- purchase.order.by.user
- graph
-
-
-
-
-
-
-
-
-
-
- purchase.order.by.user.tree
- purchase.order.by.user
- tree
-
-
-
-
-
-
-
-
-
-
- Total Orders by User per month
- purchase.order.by.user
- form
- graph,tree
-
diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv
index 9b0f8bc184e..c6a09d5d728 100644
--- a/addons/purchase/security/ir.model.access.csv
+++ b/addons/purchase/security/ir.model.access.csv
@@ -17,3 +17,10 @@
"access_stock_picking_purchase_user_manager","stock.picking","stock.model_stock_picking","purchase.group_purchase_manager",1,1,1,1
"access_stock_move_purchase_user_manager","stock.move","stock.model_stock_move","purchase.group_purchase_manager",1,1,1,1
"access_account_tax_purchase_user_manager","account.tax","account.model_account_tax","purchase.group_purchase_manager",1,0,0,0
+"access_product_product_purchase_user","product.product.purchase.user","product.model_product_product","group_purchase_user",1,0,0,0
+"access_account_invoice_purchase","account_invoice purchase","account.model_account_invoice","group_purchase_user",1,1,1,1
+"access_account_invoice_line_purchase","account_invoice.line purchase","account.model_account_invoice_line","group_purchase_user",1,1,1,1
+"access_account_fiscal_position_purchase_user","account.fiscal.position purchase","account.model_account_fiscal_position","group_purchase_user",1,0,0,0
+"access_account_sequence_fiscalyear_purchase_user","account.sequence.fiscalyear purchase","account.model_account_sequence_fiscalyear","group_purchase_user",1,1,1,1
+"access_res_partner_purchase_user","res.partner purchase","base.model_res_partner","group_purchase_user",1,0,0,0
+"access_res_partner_address_purchase_user","res.partner.address purchase","base.model_res_partner_address","group_purchase_user",1,0,0,0
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 186815c9bc3..172be8c06e8 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -39,7 +39,7 @@
-
+
@@ -52,41 +52,41 @@
-
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -110,7 +110,7 @@
-
+
purchase.requisition.list.select
purchase.requisition
search
@@ -118,22 +118,22 @@
-
+
-
+
-
+
-
+
@@ -145,8 +145,8 @@
ir.actions.act_window
purchase.requisition
form
- tree,form
- {"search_default_user_id":uid}
+ tree,form
+ {"search_default_user_id":uid}
diff --git a/addons/report_designer/security/ir.model.access.csv b/addons/report_designer/security/ir.model.access.csv
index 81d2854dc14..e6500199afe 100644
--- a/addons/report_designer/security/ir.model.access.csv
+++ b/addons/report_designer/security/ir.model.access.csv
@@ -1,2 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_report_designer_installer","report_designer.installer","model_report_designer_installer",,1,1,1,1
+"access_report_designer_installer","report_designer.installer","model_report_designer_installer",base.group_system,1,1,1,1
diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml
index df0974fd9ed..d00074cf54e 100644
--- a/addons/resource/resource_view.xml
+++ b/addons/resource/resource_view.xml
@@ -12,7 +12,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
@@ -52,7 +52,7 @@
-
+
diff --git a/addons/resource/security/ir.model.access.csv b/addons/resource/security/ir.model.access.csv
index 796d29dcb94..83e06121937 100644
--- a/addons/resource/security/ir.model.access.csv
+++ b/addons/resource/security/ir.model.access.csv
@@ -1,5 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_resource_calendar","resource.calendar","model_resource_calendar","base.group_user",1,0,0,0
-"access_resource_calendar_week","resource.calendar.week","model_resource_calendar_week","base.group_user",1,0,0,0
-"access_resource_resource","resource.resource","model_resource_resource","base.group_user",1,0,0,0
-"access_resource_calendar_leaves","resource.calendar.leaves","model_resource_calendar_leaves","base.group_user",1,0,0,0
\ No newline at end of file
+"access_resource_calendar","resource.calendar","model_resource_calendar","base.group_system",1,1,1,1
+"access_resource_calendar_week","resource.calendar.week","model_resource_calendar_week","base.group_system",1,1,1,1
+"access_resource_resource","resource.resource","model_resource_resource","base.group_system",1,1,1,1
+"access_resource_resource_all","resource.resource all","model_resource_resource",,1,0,0,0
+"access_resource_calendar_leaves","resource.calendar.leaves","model_resource_calendar_leaves","base.group_system",1,1,1,1
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index 9cac508b1b8..d60b132a827 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -48,7 +48,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['product', 'stock', 'mrp_procurement', 'process','board'],
+ 'depends': ['product', 'stock', 'procurement', 'process','board'],
'init_xml': [],
'update_xml': [
'wizard/sale_make_invoice_advance.xml',
diff --git a/addons/sale/i18n/ru.po b/addons/sale/i18n/ru.po
index d6858cc9f75..ce9c8c51095 100644
--- a/addons/sale/i18n/ru.po
+++ b/addons/sale/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-02-04 05:56+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-06-11 16:29+0000\n"
+"Last-Translator: Sios \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-04-17 04:09+0000\n"
+"X-Launchpad-Export-Date: 2010-06-12 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
@@ -117,7 +117,7 @@ msgstr ""
#. module: sale
#: model:ir.model,name:sale.model_sale_config_picking_policy
msgid "sale.config.picking_policy"
-msgstr ""
+msgstr "sale.config.picking_policy"
#. module: sale
#: model:process.transition.action,name:sale.process_transition_action_validate0
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index b47d59e5400..7cfc84427da 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -53,7 +53,7 @@ class sale_report(osv.osv):
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
'delay':fields.float('Days to Close', digits=(16,2), readonly=True),
- 'price_average':fields.float('Average Price', readonly=True),
+ 'price_average':fields.float('Average Price', readonly=True,group_operator="avg"),
'categ_id': fields.many2one('product.category','Category of Product', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'state': fields.selection([
@@ -92,7 +92,7 @@ class sale_report(osv.osv):
s.shipped::integer as shipped_qty_1,
s.pricelist_id as pricelist_id,
s.project_id as analytic_account_id
- from
+ from
sale_order s,
(
select l.id as id,
@@ -100,7 +100,7 @@ class sale_report(osv.osv):
u.name as uom_name,
sum(l.product_uom_qty * u.factor) as product_uom_qty,
sum(l.product_uom_qty*l.price_unit) as price_total,
- (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor))::decimal(16,2) as price_average,
+ (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor)*count(l.product_id))::decimal(16,2) as price_average,
pt.categ_id, l.order_id
from
sale_order_line l
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index f6090638891..4e6d75694fe 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -19,7 +19,7 @@
-
+
@@ -128,6 +128,16 @@
+
+ Shipments Analysis
+ report.stock.move
+ form
+ tree,graph
+ {'search_default_month':1, 'search_default_group_product':1, 'search_default_group_partner':1, 'search_default_done':1, 'search_default_out': 1, 'group_by':[], 'group_by_no_leaf':1}
+
+
+
+
sale.order.by.clients.tree
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index a87ce4a3ce4..0aadc2fdae2 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -253,7 +253,7 @@ class sale_order(osv.osv):
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoiced': fields.function(_invoiced, method=True, string='Paid',
fnct_search=_invoiced_search, type='boolean'),
- 'note': fields.text('Notes', translate=True),
+ 'note': fields.text('Notes'),
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount',
store = {
@@ -656,6 +656,7 @@ class sale_order(osv.osv):
'picking_id': picking_id,
'product_id': line.product_id.id,
'date_planned': date_planned,
+ 'date_expected': date_planned,
'product_qty': line.product_uom_qty,
'product_uom': line.product_uom.id,
'product_uos_qty': line.product_uos_qty,
@@ -836,7 +837,7 @@ class sale_order_line(osv.osv):
'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True),
'discount': fields.float('Discount (%)', digits=(16, 2), readonly=True, states={'draft':[('readonly',False)]}),
'number_packages': fields.function(_number_packages, method=True, type='integer', string='Number Packages'),
- 'notes': fields.text('Notes', translate=True),
+ 'notes': fields.text('Notes'),
'th_weight': fields.float('Weight'),
'state': fields.selection([('draft', 'Draft'),('confirmed', 'Confirmed'),('done', 'Done'),('cancel', 'Cancelled'),('exception', 'Exception')], 'State', required=True, readonly=True,
help=' * The \'Draft\' state is set automatically when sale order in draft state. \
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 6214613c47d..528ad7fd1cd 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -92,6 +92,15 @@
+
+
+
sale.order.form
sale.order
@@ -112,7 +121,7 @@
-
+
@@ -187,12 +196,13 @@
-
+
+
-
-
+
+
@@ -258,7 +268,7 @@
-
+
@@ -278,7 +288,6 @@
sale.order
form
tree,form,calendar,graph
- {"search_default_user_id":uid}
@@ -426,7 +435,7 @@
-
+
@@ -512,16 +521,16 @@
Sales Configuration
- Configure Sale Order Logistic
-
-
- Setup your sales workflow and default values.
-
+
+
+ Setup your sales workflow and default values.
+
- 15
-
-
+ 15
+
+
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index de0f55b80b1..7328793e2f3 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -16,12 +16,12 @@
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
"access_sale_order_line_manager","sale.order.line.manager","model_sale_order_line","group_sale_manager",1,1,1,1
-"access_sale_report","sale.report","model_sale_report","group_sale_user",1,1,1,0
-"access_sale_report_manager","sale.report","model_sale_report","group_sale_manager",1,1,1,1
+"access_sale_report_manager","sale.report","model_sale_report","group_sale_manager",1,0,0,0
"access_sale_order_line_make_invoice","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_user",1,1,1,0
"access_sale_order_line_make_invoice_manager","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_manager",1,1,1,1
"access_sale_advance_payment_inv","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_user",1,1,1,0
"access_sale_advance_payment_inv_manager","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_manager",1,1,1,1
"access_sale_open_invoice","sale.open.invoice","model_sale_open_invoice","group_sale_user",1,1,1,0
"access_sale_open_invoice_manager","sale.open.invoice","model_sale_open_invoice","group_sale_manager",1,1,1,1
-
+"access_product_product_sale_user","product.product.sale.user","model_product_product","group_sale_user",1,0,0,0
+"access_sale_account_journal","account.journal sale order.user","account.model_account_journal","group_sale_user",1,0,0,0
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index fd8b3e0d3c7..8e5c8360d07 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -14,14 +14,14 @@
- Sale Order multi-company
+ Sale Order multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Sale Order Line multi-company
+ Sale Order Line multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml
index 5fc8b993921..a4f48554166 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.xml
+++ b/addons/sale/wizard/sale_make_invoice_advance.xml
@@ -1,59 +1,50 @@
-
- Sale Advance Payment Invoive
+
+ Deposit Invoice
sale.advance.payment.inv
form
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
Open Invoice
sale.open.invoice
form
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
Open Invoice
ir.actions.act_window
sale.open.invoice
form
form
new
-
+
diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml
index bf5f1aaac52..565fd687b4e 100644
--- a/addons/sale_crm/sale_crm_view.xml
+++ b/addons/sale_crm/sale_crm_view.xml
@@ -9,8 +9,7 @@
-
-
+
@@ -34,9 +33,9 @@
-
+
diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml
index 7e4cc33b283..5b3d2de5652 100644
--- a/addons/sale_journal/sale_journal_view.xml
+++ b/addons/sale_journal/sale_journal_view.xml
@@ -3,467 +3,467 @@
-
- sale_journal.invoice.type.form
- sale_journal.invoice.type
- form
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.invoice.type.form
+ sale_journal.invoice.type
+ form
+
+
+
+
+
+
+
+
+
+
-
+
-
- sale_journal.invoice.type.tree
- sale_journal.invoice.type
- tree
-
-
-
-
-
-
-
+
+ sale_journal.invoice.type.tree
+ sale_journal.invoice.type
+ tree
+
+
+
+
+
+
+
-
+
-
- sale_journal.invoice.type
- form
- tree,form
-
+
+ sale_journal.invoice.type
+ form
+ tree,form
+
-
+
-
+
-
- sale_journal.sale.journal.form
- sale_journal.sale.journal
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.sale.journal.form
+ sale_journal.sale.journal
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- sale_journal.sale.journal.tree
- sale_journal.sale.journal
- tree
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.sale.journal.tree
+ sale_journal.sale.journal
+ tree
+
+
+
+
+
+
+
+
+
+
-
+
-
- sale_journal.sale.journal.search
- sale_journal.sale.journal
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.sale.journal.search
+ sale_journal.sale.journal
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- sale_journal.sale.journal
- form
- tree,form
-
-
+
+ sale_journal.sale.journal
+ form
+ tree,form
+
+
-
+
-
+
-
- sale.order.journal.view.form
- form
- sale.order
-
-
-
+
+ sale.order.journal.view.form
+ form
+ sale.order
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
- sale.order.journal.view.tree
- tree
- sale.order
-
-
-
-
-
-
-
-
+
+ sale.order.journal.view.tree
+ tree
+ sale.order
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.form
- form
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.tree
- tree
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.tree
+ tree
+ stock.picking
+
+
+
+
+
+
+
+
+
-
+
-
- stock.picking.journal.view.form
- form
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
-
+
-
- stock.picking.journal.view.tree
- tree
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.tree
+ tree
+ stock.picking
+
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.form
- form
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.tree
- tree
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.tree
+ tree
+ stock.picking
+
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.form
- form
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
-
- stock.picking.journal.view.tree
- tree
- stock.picking
-
-
-
-
-
-
-
-
-
+
+ stock.picking.journal.view.tree
+ tree
+ stock.picking
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
- res.partner.journal.property.form.inherit
- res.partner
- form
-
-
-
-
-
-
-
+
+ res.partner.journal.property.form.inherit
+ res.partner
+ form
+
+
+
+
+
+
+
-
-
-
+
+
+
-
- sale_journal.picking.journal.form
- sale_journal.picking.journal
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.picking.journal.form
+ sale_journal.picking.journal
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- sale_journal.picking.journal.tree
- sale_journal.picking.journal
- tree
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.picking.journal.tree
+ sale_journal.picking.journal
+ tree
+
+
+
+
+
+
+
+
+
+
-
- sale_journal.picking.journal.search
- sale_journal.picking.journal
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ sale_journal.picking.journal.search
+ sale_journal.picking.journal
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Picking Journals
- sale_journal.picking.journal
- form
- tree,form
-
-
+
+ Picking Journals
+ sale_journal.picking.journal
+ form
+ tree,form
+
+
-
+
-
- Picking by invoice_method
- sale_journal.invoice.type
- ir.actions.act_window
- tree
-
+
+ Picking by invoice_method
+ sale_journal.invoice.type
+ ir.actions.act_window
+ tree
+
-
- Picking to invoice
- stock.picking
- ir.actions.act_window
- form
- tree,form
- [('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]
-
+
+ Picking to invoice
+ stock.picking
+ ir.actions.act_window
+ form
+ tree,form
+ [('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]
+
-
- tree_but_open
- sale_journal.invoice.type
- Picking to invoice
-
-
-
+
+ tree_but_open
+ sale_journal.invoice.type
+ Picking to invoice
+
+
+
diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml
index d4631a680ca..b076e98038a 100644
--- a/addons/scrum/scrum_view.xml
+++ b/addons/scrum/scrum_view.xml
@@ -141,8 +141,8 @@
-
-
+
+
-
+
@@ -188,7 +188,7 @@
scrum.sprint
tree
-
+
@@ -268,8 +268,8 @@
-
-
+
+
@@ -357,10 +357,10 @@
-
+
-
+
diff --git a/addons/scrum/security/ir.model.access.csv b/addons/scrum/security/ir.model.access.csv
index a52a9c2f3f2..76ba229e952 100644
--- a/addons/scrum/security/ir.model.access.csv
+++ b/addons/scrum/security/ir.model.access.csv
@@ -1,7 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_scrum_sprint","scrum.sprint","model_scrum_sprint","project.group_project_user",1,,,
+"access_scrum_sprint","scrum.sprint","model_scrum_sprint","project.group_project_user",1,0,0,0
"access_scrum_product_backlog","scrum.product.backlog","model_scrum_product_backlog","project.group_project_user",1,1,1,1
-"access_scrum_meeting","scrum.meeting","model_scrum_meeting","project.group_project_user",1,,,
+"access_scrum_meeting","scrum.meeting","model_scrum_meeting","project.group_project_user",1,0,0,0
"access_scrum_meeting_manager","scrum.meeting.manager","model_scrum_meeting","project.group_project_manager",1,1,1,1
"access_scrum_sprint_manager","scrum.sprint.manager","model_scrum_sprint","project.group_project_manager",1,1,1,1
"access_scrum_product_backlog_manager","scrum.product.backlog manager","model_scrum_product_backlog","project.group_project_manager",1,1,1,1
+"access_product_uom_project_manager","product.uom project manager","product.model_product_uom","project.group_project_manager",1,1,1,1
+"access_product_uom_project_user","product.uom project user","product.model_product_uom","project.group_project_user",1,0,0,0
diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py
index 60ccea7d137..dd830143e6f 100644
--- a/addons/stock/__openerp__.py
+++ b/addons/stock/__openerp__.py
@@ -69,7 +69,6 @@ Thanks to the double entry management, the inventory controlling is powerful and
"partner_view.xml",
"report/report_stock_move_view.xml",
"report/report_stock_view.xml",
- "report/report_stock_picking_view.xml",
"security/stock_security.xml",
"security/ir.model.access.csv",
"board_warehouse_view.xml"
@@ -79,4 +78,3 @@ Thanks to the double entry management, the inventory controlling is powerful and
'active': False,
'certificate': '0055421559965',
}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml
index 08ece3f821d..0c13e83cd84 100644
--- a/addons/stock/board_warehouse_view.xml
+++ b/addons/stock/board_warehouse_view.xml
@@ -23,7 +23,6 @@
-
diff --git a/addons/stock/i18n/nl.po b/addons/stock/i18n/nl.po
index b3085199524..445249906e7 100644
--- a/addons/stock/i18n/nl.po
+++ b/addons/stock/i18n/nl.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-17 10:48+0000\n"
-"Last-Translator: Marcel van der Boom (HS-Development BV) \n"
+"PO-Revision-Date: 2010-06-14 13:39+0000\n"
+"Last-Translator: Marcel van der Boom (HS-Development BV) \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-04-17 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-06-15 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
@@ -44,13 +44,13 @@ msgstr "terp-account"
#. module: stock
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Ongeldige modelnaam in de definitie van de actie."
#. module: stock
#: model:ir.module.module,shortdesc:stock.module_meta_information
#: model:ir.ui.menu,name:stock.menu_stock_root
msgid "Inventory Management"
-msgstr ""
+msgstr "Voorraadbeheer"
#. module: stock
#: selection:stock.location,icon:0
@@ -70,7 +70,7 @@ msgstr "STOCK_MEDIA_FORWARD"
#. module: stock
#: rml:lot.location:0
msgid "Total :"
-msgstr ""
+msgstr "Totaal :"
#. module: stock
#: selection:stock.location,icon:0
@@ -81,7 +81,7 @@ msgstr "STOCK_ZOOM_100"
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "UoM"
-msgstr ""
+msgstr "Meeteenheid"
#. module: stock
#: model:ir.actions.wizard,name:stock.return_picking
@@ -109,7 +109,7 @@ msgstr "Paklijst"
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Amount"
-msgstr ""
+msgstr "Hoeveelheid"
#. module: stock
#: view:stock.picking:0
@@ -141,8 +141,7 @@ msgstr "Relatie"
#. module: stock
#: help:product.product,track_incoming:0
msgid "Force to use a Production Lot during receptions"
-msgstr ""
-"Forceer om een productie-eenheid te gebruiken tijdens goederenontvangst."
+msgstr "Forceer het gebruik van een batchnummer bij goederenontvangst"
#. module: stock
#: field:stock.move,move_history_ids:0
@@ -155,7 +154,7 @@ msgstr "Notatie"
#: field:stock.production.lot.revision,lot_id:0
#: field:stock.report.prodlots,prodlot_id:0
msgid "Production lot"
-msgstr "Seriegrootte"
+msgstr "Batchnummer"
#. module: stock
#: selection:stock.location,icon:0
@@ -306,7 +305,7 @@ msgstr "STOCK_FLOPPY"
#. module: stock
#: view:stock.production.lot.revision:0
msgid "Production Lot Revisions"
-msgstr "Herziening productie-eenheden"
+msgstr "Batchnummer herzieningen"
#. module: stock
#: view:stock.location:0
@@ -371,7 +370,7 @@ msgstr "Leveringslocatie"
#: model:ir.actions.act_window,name:stock.action_production_lot_form
#: model:ir.ui.menu,name:stock.menu_action_production_lot_form
msgid "Production Lots"
-msgstr "Productie-eenheden"
+msgstr "Batchnummers"
#. module: stock
#: rml:stock.picking.list:0
@@ -425,9 +424,7 @@ msgstr "Locatieadres"
#. module: stock
#: help:stock.move,prodlot_id:0
msgid "Production lot is used to put a serial number on the production"
-msgstr ""
-"Productie-eenheid wordt gebruikt om een serienummer aan de productie toe te "
-"voegen."
+msgstr "Batchnummers worden gebruikt om productie-eenheden te identificeren."
#. module: stock
#: model:stock.location,name:stock.stock_location_13
@@ -493,8 +490,7 @@ msgstr "Voorraadlocatie"
#. module: stock
#: help:product.product,track_production:0
msgid "Force to use a Production Lot during production order"
-msgstr ""
-"Forceer deze op een productie-eenheid te gebruiken tijdens de productieorder"
+msgstr "Forceer het gebruik van een batchnummer bij productieorders"
#. module: stock
#: selection:stock.location,icon:0
@@ -537,7 +533,7 @@ msgstr "Leveringskalender"
#. module: stock
#: field:product.product,track_incoming:0
msgid "Track Incomming Lots"
-msgstr "Traceer inkomende pakketten"
+msgstr "Traceer binnenkomende batches"
#. module: stock
#: model:ir.actions.act_window,name:stock.act_stock_product_location_open
@@ -552,7 +548,7 @@ msgstr "STOCK_SAVE_AS"
#. module: stock
#: model:ir.model,name:stock.model_stock_report_prodlots
msgid "Stock report by production lots"
-msgstr "Voorraadrapport met productie-eenheden"
+msgstr "Voorraadrapport met batchnummers"
#. module: stock
#: field:stock.location,stock_virtual:0
@@ -598,7 +594,7 @@ msgstr "Nieuw ontvangstbon aanmaken"
#. module: stock
#: wizard_field:stock.move.track,init,quantity:0
msgid "Quantity per lot"
-msgstr "Aantal per eenheid"
+msgstr "Aantal per batch"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_move_form2
@@ -661,7 +657,7 @@ msgstr "Verwachte verzenddatum"
#. module: stock
#: rml:stock.picking.list:0
msgid "Shipping Address :"
-msgstr ""
+msgstr "Afleveradres :"
#. module: stock
#: view:stock.tracking:0
@@ -727,7 +723,7 @@ msgstr "Van"
#. module: stock
#: rml:stock.picking.list:0
msgid "weight"
-msgstr ""
+msgstr "gewicht"
#. module: stock
#: rml:stock.picking.list:0
@@ -742,7 +738,7 @@ msgstr "Factuurcontrole"
#. module: stock
#: model:ir.model,name:stock.model_stock_production_lot_revision
msgid "Production lot revisions"
-msgstr "Heroverweeg productie-eenheden"
+msgstr "Batchnummer herzieningen"
#. module: stock
#: view:stock.picking:0
@@ -1554,7 +1550,7 @@ msgstr "Revisiedatum"
#. module: stock
#: rml:stock.picking.list:0
msgid "Lot"
-msgstr "Overdoos"
+msgstr "Batch"
#. module: stock
#: wizard_view:inventory.merge.stock.zero,init:0
@@ -1628,7 +1624,7 @@ msgstr "Leveringsvoorwaarden"
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Total:"
-msgstr ""
+msgstr "Totaal:"
#. module: stock
#: selection:stock.location,icon:0
@@ -1731,7 +1727,7 @@ msgstr "Magazijnen"
#. module: stock
#: help:product.product,track_outgoing:0
msgid "Force to use a Production Lot during deliveries"
-msgstr "Forceer om productie-eenheiden te gebruiken om te leveren"
+msgstr "Forceer het gebruik van batchnummers bij leveringen"
#. module: stock
#: view:stock.picking:0
@@ -1790,7 +1786,7 @@ msgstr "Product eenh."
#: rml:lot.stock.overview:0
#: rml:lot.stock.overview_all:0
msgid "Variants"
-msgstr ""
+msgstr "Varianten"
#. module: stock
#: field:stock.location,posx:0
@@ -1870,7 +1866,7 @@ msgstr "STOCK_MEDIA_PAUSE"
#. module: stock
#: view:product.product:0
msgid "Lots"
-msgstr "Aantallen"
+msgstr "Batches"
#. module: stock
#: selection:stock.picking,move_type:0
@@ -1880,7 +1876,7 @@ msgstr "Allen te gelijk"
#. module: stock
#: field:product.product,track_outgoing:0
msgid "Track Outging Lots"
-msgstr "Uitgaande voorraadeenheden"
+msgstr "Traceer uitgaande batches"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_stock_line_date
@@ -1903,7 +1899,7 @@ msgstr "STOCK_FIND"
#. module: stock
#: view:stock.inventory:0
msgid "Lot Inventory"
-msgstr "Partijvoorraad"
+msgstr "Batchvoorraad"
#. module: stock
#: help:stock.location,chained_auto_packing:0
@@ -2088,7 +2084,7 @@ msgstr "terp-project"
#: model:ir.ui.menu,name:stock.menu_stock_report_prodlots
#: view:stock.report.prodlots:0
msgid "Stock by Lots"
-msgstr "In voorraad per verpakkingseenheid"
+msgstr "Voorraad per batch"
#. module: stock
#: field:stock.move,auto_validate:0
@@ -2199,7 +2195,7 @@ msgstr "STOCK_REVERT_TO_SAVED"
#. module: stock
#: field:product.product,track_production:0
msgid "Track Production Lots"
-msgstr "Traceerd productie-eenheden"
+msgstr "Traceer productiebatches"
#. module: stock
#: view:stock.picking:0
@@ -2232,7 +2228,7 @@ msgstr "stock.picking.move.wizard"
#: field:stock.move,prodlot_id:0
#: view:stock.production.lot:0
msgid "Production Lot"
-msgstr "Productie-eenheid."
+msgstr "Productie batch"
#. module: stock
#: model:ir.ui.menu,name:stock.menu_traceability
diff --git a/addons/stock/i18n/pl.po b/addons/stock/i18n/pl.po
index a4406384e8e..c1d33bc694d 100644
--- a/addons/stock/i18n/pl.po
+++ b/addons/stock/i18n/pl.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-05-21 08:22+0000\n"
+"PO-Revision-Date: 2010-06-14 14:56+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) \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-05-22 04:00+0000\n"
+"X-Launchpad-Export-Date: 2010-06-15 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
@@ -86,7 +86,7 @@ msgstr "JM"
#. module: stock
#: model:ir.actions.wizard,name:stock.return_picking
msgid "Return packing"
-msgstr "Lista przesunięć zwrotnych"
+msgstr "Zwrot"
#. module: stock
#: field:product.category,property_stock_journal:0
@@ -103,7 +103,7 @@ msgstr "Wypełnij inwentaryzację dla podanej strefy mag."
#: view:stock.picking:0
#: field:stock.picking.move.wizard,picking_id:0
msgid "Packing list"
-msgstr "Lista przesunięć"
+msgstr "Pobranie"
#. module: stock
#: rml:lot.stock.overview:0
@@ -120,7 +120,7 @@ msgstr "Otrzymane produkty"
#: model:ir.actions.act_window,name:stock.action_picking_tree4
#: model:ir.ui.menu,name:stock.menu_action_picking_tree4
msgid "Incoming Products"
-msgstr "Przyjmowanie produktów"
+msgstr "Przyjęcia zewnętrzne"
#. module: stock
#: field:stock.picking,name:0
@@ -206,7 +206,7 @@ msgstr "Wykonaj paczkę (przesunięcie)"
#. module: stock
#: wizard_view:stock.partial_picking,end2:0
msgid "Packing result"
-msgstr "Rezultat listy przesunięć"
+msgstr "Rezultat pobrania"
#. module: stock
#: selection:stock.location,icon:0
@@ -592,7 +592,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_picking_form
#: model:ir.ui.menu,name:stock.menu_action_picking_form
msgid "New Reception Packing"
-msgstr "Nowy odbiór listy przesunięć"
+msgstr "Nowe przyjęcia zewnętrzne"
#. module: stock
#: wizard_field:stock.move.track,init,quantity:0
@@ -708,7 +708,7 @@ msgstr "terp-stock"
#. module: stock
#: rml:stock.picking.list:0
msgid "Packing List:"
-msgstr "Lista przesunięć:"
+msgstr "Pobranie:"
#. module: stock
#: selection:stock.location,icon:0
@@ -748,7 +748,7 @@ msgstr "Wersja partii produkcyjnej"
#. module: stock
#: view:stock.picking:0
msgid "Packing Done"
-msgstr "Listę przesunięć wykonano"
+msgstr "Pobranie wykonane"
#. module: stock
#: selection:stock.move,state:0
@@ -762,7 +762,7 @@ msgstr "Oczekiwanie"
#: model:ir.ui.menu,name:stock.menu_action_picking_tree7
#: model:ir.ui.menu,name:stock.menu_picking_waiting
msgid "Available Packing"
-msgstr "Dostępne listy przesunięć"
+msgstr "Dostępne pobrania"
#. module: stock
#: model:ir.model,name:stock.model_stock_warehouse
@@ -815,7 +815,7 @@ msgstr ""
#: model:ir.ui.menu,name:stock.menu_action_picking_all
#: wizard_field:stock.picking.make,init,pickings:0
msgid "Packing"
-msgstr "Listy przesunięć"
+msgstr "Pobrania"
#. module: stock
#: selection:stock.location,icon:0
@@ -837,7 +837,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_picking_tree9
#: model:ir.ui.menu,name:stock.menu_action_picking_tree9
msgid "New Internal Packing"
-msgstr "Nowa lista przesunięć wewnętrznych"
+msgstr "Nowe przesunięcie wewnętrzne"
#. module: stock
#: view:stock.inventory:0
@@ -988,7 +988,7 @@ msgstr ""
#. module: stock
#: wizard_view:stock.partial_picking,end2:0
msgid "The packing has been successfully made !"
-msgstr "Lista przesunięć zostało poprawnie wykonana !"
+msgstr "Pobranie wykonano poprawnie !"
#. module: stock
#: field:stock.move,address_id:0
@@ -1158,13 +1158,13 @@ msgstr ""
#. module: stock
#: view:stock.picking:0
msgid "Input Packing List"
-msgstr "Lista przesunięć wchodzących"
+msgstr "Przyjęcie zewnętrzne"
#. module: stock
#: model:ir.model,name:stock.model_stock_picking
#: field:stock.move,picking_id:0
msgid "Packing List"
-msgstr "Lista przesunięć"
+msgstr "Pobranie"
#. module: stock
#: selection:stock.location,icon:0
@@ -1205,7 +1205,7 @@ msgstr ""
#. module: stock
#: selection:stock.picking,invoice_state:0
msgid "Not from Packing"
-msgstr "Nie z listy przesunięć"
+msgstr "Nie z pobrania"
#. module: stock
#: view:stock.location:0
@@ -1299,7 +1299,7 @@ msgstr "Metoda dostawy"
#. module: stock
#: model:ir.actions.wizard,name:stock.partial_picking
msgid "Partial packing"
-msgstr "Częściowa lista przesunięć"
+msgstr "Pobranie częściowe"
#. module: stock
#: selection:stock.location,icon:0
@@ -1330,7 +1330,7 @@ msgstr "Cel przesunięcia"
#: model:ir.actions.act_window,name:stock.action_inventory_form_new
#: model:ir.ui.menu,name:stock.menu_action_inventory_form_new
msgid "New Periodical Inventory"
-msgstr "Nowa inentaryzacja okresowa"
+msgstr "Nowa inwentaryzacja okresowa"
#. module: stock
#: field:stock.production.lot,revisions:0
@@ -1346,7 +1346,7 @@ msgstr "FIFO"
#: model:ir.actions.act_window,name:stock.action_picking_tree2_delivery
#: model:ir.ui.menu,name:stock.menu_picking_waiting_delivery
msgid "Delivery Orders to Process"
-msgstr "Zamówienia dostawy do przetworzenia"
+msgstr "Wydania zewnętrzne do obsługi"
#. module: stock
#: field:stock.move,priority:0
@@ -1370,7 +1370,7 @@ msgstr "Strefa magazynowa"
#. module: stock
#: field:stock.picking,invoice_state:0
msgid "Invoice Status"
-msgstr "Stan faktury"
+msgstr "Fakturowanie"
#. module: stock
#: rml:lot.location:0
@@ -1493,7 +1493,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_picking_tree3_delivery
#: model:ir.ui.menu,name:stock.menu_action_picking_tree3_delivery
msgid "Future Delivery Orders"
-msgstr "Przyszłe zamówienia dostawy"
+msgstr "Przyszłe wydania zewnętrzne"
#. module: stock
#: selection:stock.location,icon:0
@@ -1572,7 +1572,7 @@ msgstr "Ilość (JS)"
#: model:ir.actions.act_window,name:stock.action_picking_tree5
#: model:ir.ui.menu,name:stock.menu_action_picking_tree5
msgid "Packing to Process"
-msgstr "Listy przesunięć do obróbki"
+msgstr "Pobrania do wykonania"
#. module: stock
#: selection:stock.location,icon:0
@@ -1588,12 +1588,12 @@ msgstr "Ustaw jako dostępne"
#: model:ir.actions.wizard,name:stock.make_picking
#: wizard_view:stock.picking.make,init:0
msgid "Make packing"
-msgstr "Wykonaj listę przesunięć"
+msgstr "Wykonaj pobranie"
#. module: stock
#: field:stock.picking,backorder_id:0
msgid "Back Order"
-msgstr "Zamówienie zaległe"
+msgstr "Pobranie częściowe"
#. module: stock
#: selection:stock.location,icon:0
@@ -1770,7 +1770,7 @@ msgstr "Zwrot"
#. module: stock
#: field:stock.picking,auto_picking:0
msgid "Auto-Packing"
-msgstr "Auto-przesunięcie"
+msgstr "Auto-pobranie"
#. module: stock
#: field:stock.move,product_uos:0
@@ -1990,7 +1990,7 @@ msgstr ""
#: model:ir.actions.act_window,name:stock.action_picking_tree_delivery
#: model:ir.ui.menu,name:stock.menu_action_picking_tree_delivery
msgid "Delivery Orders"
-msgstr "Zamówienia dostawy"
+msgstr "Wydania zewnętrzne"
#. module: stock
#: selection:stock.location,icon:0
@@ -2172,7 +2172,7 @@ msgstr ""
#: model:ir.ui.menu,name:stock.menu_action_picking_tree3
#: model:ir.ui.menu,name:stock.menu_action_picking_tree8
msgid "Confirmed Packing Waiting Availability"
-msgstr "Potwierdzone listy przesunięć oczekujące na dostępność"
+msgstr "Potwierdzone pobrania oczekujące na dostępność"
#. module: stock
#: field:stock.location,posy:0
@@ -2197,7 +2197,7 @@ msgstr "Czy chcesz ustawić zapasy na 0 ?"
#. module: stock
#: selection:stock.picking,move_type:0
msgid "Direct Delivery"
-msgstr "Dostawa bezpośrednia"
+msgstr "Dostawa częściowa"
#. module: stock
#: selection:stock.location,icon:0
@@ -2257,7 +2257,7 @@ msgstr "Data zamówienia"
#. module: stock
#: selection:stock.invoice_onshipping,init,type:0
msgid "Supplier Invoice"
-msgstr "Faktura dostawcy"
+msgstr "Faktura od dostawcy"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_location_form
@@ -2345,7 +2345,7 @@ msgstr ""
#. module: stock
#: selection:stock.picking,type:0
msgid "Delivery"
-msgstr "Dostawa"
+msgstr "Wydanie zewnętrzne"
#. module: stock
#: model:ir.actions.act_window,name:stock.action5
diff --git a/addons/stock/partner_view.xml b/addons/stock/partner_view.xml
index be2ed4bfc55..9ba4073e2e2 100644
--- a/addons/stock/partner_view.xml
+++ b/addons/stock/partner_view.xml
@@ -12,10 +12,10 @@
-
-
-
-
+
+
+
+
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 16db5f4e1f2..9a19d3e84c3 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -24,8 +24,7 @@ from tools.translate import _
class product_product(osv.osv):
- _inherit = "product.product"
-
+ _inherit = "product.product"
def get_product_accounts(self, cr, uid, product_id, context=None):
""" To get the stock input account, stock output account and stock journal related to product.
@@ -71,8 +70,8 @@ class product_product(osv.osv):
product_obj=self.browse(cr,uid,ids)[0]
account_variation = product_obj.categ_id.property_stock_variation
move_ids = []
+ loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
for rec_id in ids:
- loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
for location in location_obj.browse(cr, uid, loc_ids):
c = context.copy()
c.update({
@@ -202,6 +201,8 @@ class product_product(osv.osv):
if context.get('location', False):
if type(context['location']) == type(1):
location_ids = [context['location']]
+ elif type(context['location']) in (type(''), type(u'')):
+ location_ids = self.pool.get('stock.location').search(cr, uid, [('name','ilike',context['location'])], context=context)
else:
location_ids = context['location']
else:
@@ -312,7 +313,7 @@ class product_product(osv.osv):
'track_production': fields.boolean('Track Production Lots' , help="Forces to use a Production Lot during production order"),
'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to use a tracking lot during receptions"),
'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to use a tracking lot during deliveries"),
- 'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]),
+ 'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one'),
'valuation':fields.selection([('manual_periodic', 'Periodic (manual)'),
('real_time','Real Time (automatized)'),], 'Stock Valuation', help="Decide if the system must automatically creates account moves based on stock moves", required=True),
}
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 4f6ede6c460..36ba20b3b05 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -8,8 +8,8 @@
search
-
-
+
+
@@ -43,9 +43,9 @@
-
-
-
+
+
+
@@ -115,9 +115,9 @@
-
-
-
+
+
+
diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py
index a0a4bcb8ea5..381644fcd32 100644
--- a/addons/stock/report/__init__.py
+++ b/addons/stock/report/__init__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-#import lot_overview
import product_stock
import lot_location
import ups
@@ -28,7 +27,4 @@ import lot_overview
import lot_overview_all
import report_stock
import report_stock_move
-import report_stock_picking
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
old mode 100755
new mode 100644
index 8d905a4c4d7..4d70466c031
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -34,42 +34,158 @@ class report_stock_move(osv.osv):
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
- 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
+ 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'company_id':fields.many2one('res.company', 'Company', readonly=True),
+ 'picking_id':fields.many2one('stock.picking', 'Packing', readonly=True),
+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
- 'product_qty':fields.integer('Qty',readonly=True),
+ 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
+ 'product_qty_in':fields.integer('In Qty',readonly=True),
+ 'product_qty_out':fields.integer('Out Qty',readonly=True),
'value' : fields.float('Total Value', required=True),
- 'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
- 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
- help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
- \nThe state is \'Waiting\' if the move is waiting for another one.'),
- 'day_diff':fields.integer('Expected Performance',readonly=True),
+ 'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
+ 'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),
+ 'day_diff':fields.float('Real (Days)',readonly=True, digits=(16,2), group_operator="avg"),
}
-
+
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_move')
cr.execute("""
create or replace view report_stock_move as (
- select min(m.id) as id,
- m.date_planned as date_planned,
- to_char(date_trunc('day',m.date_planned), 'YYYY') as year,
- to_char(date_trunc('day',m.date_planned), 'MM') as month,
- to_char(date_trunc('day',m.date_planned), 'YYYY-MM-DD') as day,
- (date(m.date_planned)-date(m.date_expected)) as day_diff,
- m.address_id as partner_id,
- m.location_id as location_id,
- m.location_dest_id as location_dest_id,
- m.product_id as product_id,
- m.state as state,
- m.product_uom as product_uom,
- sum(m.product_qty) as product_qty,
- pt.standard_price * sum(m.product_qty) as value
- from stock_move m ,product_product pp,product_template pt
- where
- m.product_id=pp.id and pp.product_tmpl_id=pt.id
- group by
- m.id, m.product_id,m.address_id, m.location_id, m.location_dest_id,
- m.date_planned, m.state, m.product_uom,pt.standard_price,m.date_expected )
+ select
+ min(sm_id) as id,
+ sum(value) as value,
+ al.dp as date_planned,
+ al.curr_year as year,
+ al.curr_month as month,
+ al.curr_day as day,
+ al.curr_day_diff as day_diff,
+ al.curr_day_diff1 as day_diff1,
+ al.curr_day_diff2 as day_diff2,
+ al.location_id as location_id,
+ al.picking_id as picking_id,
+ al.company_id as company_id,
+ al.location_dest_id as location_dest_id,
+ al.out_qty as product_qty_out,
+ al.in_qty as product_qty_in,
+ al.address_id as partner_id,
+ al.product_id as product_id,
+ al.state as state ,
+ al.product_uom as product_uom,
+ al.type as type
+ FROM (SELECT
+
+ CASE WHEN sp.type in ('out','delivery') THEN
+ sum(sm.product_qty) END AS out_qty,
+ CASE WHEN sp.type in ('in') THEN
+ sum(sm.product_qty) END AS in_qty,
+ min(sm.id) as sm_id,
+ sm.date_planned as dp,
+ to_char(date_trunc('day',sm.date_planned), 'YYYY') as curr_year,
+ to_char(date_trunc('day',sm.date_planned), 'MM') as curr_month,
+ to_char(date_trunc('day',sm.date_planned), 'YYYY-MM-DD') as curr_day,
+ avg(date(sm.date_planned)-date(sm.create_date)) as curr_day_diff,
+ avg(date(sm.date_expected)-date(sm.create_date)) as curr_day_diff1,
+ avg(date(sm.date_planned)-date(sm.date_expected)) as curr_day_diff2,
+ sm.location_id as location_id,
+ sm.location_dest_id as location_dest_id,
+ pt.standard_price * sum(sm.product_qty) as value,
+ sm.address_id as address_id,
+ sm.product_id as product_id,
+ sm.picking_id as picking_id,
+ sm.company_id as company_id,
+ sm.state as state,
+ sm.product_uom as product_uom,
+ sp.type as type
+ from
+ stock_move sm
+ left join stock_picking sp on (sm.picking_id=sp.id)
+ left join product_product pp on (sm.product_id=pp.id)
+ left join product_template pt on (pp.product_tmpl_id=pt.id)
+ left join stock_location sl on (sm.location_id = sl.id)
+
+ group by
+ sm.id,sp.type, sm.date_planned,sm.address_id,
+ sm.product_id,sm.state,sm.product_uom,sm.date_expected,
+ sm.product_id,pt.standard_price, sm.picking_id,
+ sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id)
+ as al
+
+ group by
+ al.out_qty,al.in_qty,al.curr_year,al.curr_month,
+ al.curr_day,al.curr_day_diff,al.curr_day_diff1,al.curr_day_diff2,al.dp,al.location_id,al.location_dest_id,
+ al.address_id,al.product_id,al.state,al.product_uom,
+ al.picking_id,al.company_id,al.type
+ )
""")
+
report_stock_move()
+
+
+class report_stock_inventory(osv.osv):
+ _name = "report.stock.inventory"
+ _description = "Stock Statistics"
+ _auto = False
+ _columns = {
+ 'date_planned': fields.datetime('Date', readonly=True),
+ 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
+ 'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'location_id': fields.many2one('stock.location', 'Location', readonly=True),
+ 'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'product_qty':fields.float('Qty', digits=(16,2), readonly=True),
+ 'value' : fields.float('Total Value', digits=(16,2), required=True),
+ 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
+ help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
+ \nThe state is \'Waiting\' if the move is waiting for another one.'),
+ 'location_type': fields.selection([('supplier', 'Supplier Location'), ('view', 'View'), ('internal', 'Internal Location'), ('customer', 'Customer Location'), ('inventory', 'Inventory'), ('procurement', 'Procurement'), ('production', 'Production'), ('transit', 'Transit Location for Inter-Companies Transfers')], 'Location Type', required=True),
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_stock_inventory')
+ cr.execute("""
+create or replace view report_stock_inventory as (
+ (select
+ min(m.id) as id, m.date_planned as date_planned,
+ m.address_id as partner_id, m.location_id as location_id,
+ m.product_id as product_id, l.usage as location_type,
+ m.company_id,
+ m.state as state, m.prodlot_id as prodlot_id,
+ sum(-m.product_qty*u.factor)::decimal(16,2) as product_qty,
+ sum(-pt.standard_price * m.product_qty * u.factor)::decimal(16,2) as value
+ from
+ stock_move m
+ left join stock_picking p on (m.picking_id=p.id)
+ left join product_product pp on (m.product_id=pp.id)
+ left join product_template pt on (pp.product_tmpl_id=pt.id)
+ left join product_uom u on (m.product_uom=u.id)
+ left join stock_location l on (m.location_id=l.id)
+ group by
+ m.id, m.product_id, m.address_id, m.location_id, m.prodlot_id,
+ m.date_planned, m.state, l.usage, m.company_id
+) union all (
+ select
+ -m.id as id, m.date_planned as date_planned,
+ m.address_id as partner_id, m.location_dest_id as location_id,
+ m.product_id as product_id, l.usage as location_type,
+ m.company_id,
+ m.state as state, m.prodlot_id as prodlot_id,
+ sum(m.product_qty*u.factor)::decimal(16,2) as product_qty,
+ sum(pt.standard_price * m.product_qty * u.factor)::decimal(16,2) as value
+ from
+ stock_move m
+ left join stock_picking p on (m.picking_id=p.id)
+ left join product_product pp on (m.product_id=pp.id)
+ left join product_template pt on (pp.product_tmpl_id=pt.id)
+ left join product_uom u on (m.product_uom=u.id)
+ left join stock_location l on (m.location_dest_id=l.id)
+ group by
+ m.id, m.product_id, m.address_id, m.location_id, m.location_dest_id,
+ m.prodlot_id, m.date_planned, m.state, l.usage, m.company_id
+ )
+);
+ """)
+report_stock_inventory()
+
+
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
old mode 100755
new mode 100644
index 458fc250091..e8ec9ed2983
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -1,25 +1,36 @@
+
+
+
report.stock.move.tree
report.stock.move
tree
-
-
-
+
+
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
@@ -29,9 +40,9 @@
report.stock.move
graph
-
+
-
+
@@ -41,50 +52,51 @@
report.stock.move
search
-
+
-
-
-
-
-
+ name="done"
+ icon="terp-dialog-close"
+ domain="[('state','=','done')]"
+ help = "Completed Stock-Moves"/>
+
-
-
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
@@ -92,9 +104,12 @@
-
-
-
+
+
+
+
+
+
@@ -102,20 +117,110 @@
- Stock Moves
+ Moves Analysis
report.stock.move
form
tree,graph
-
- {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[], 'group_by_no_leaf':1}
+
+ {'contact_display': 'partner', 'search_default_month':1, 'search_default_group_product':1,'search_default_done':1,'group_by':[], 'group_by_no_leaf':1}
+
+
+
+
+
+
+ report.stock.inventory.tree
+ report.stock.inventory
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+ report.stock.inventory.graph
+ report.stock.inventory
+ graph
+
+
+
+
+
+
+
+
+
+ report.stock.inventory.search
+ report.stock.inventory
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Inventory Analysis
+ report.stock.inventory
+ form
+ tree,graph
+
+ {'contact_display': 'partner', 'search_default_real':1, 'search_default_location_type_internal':1,'search_default_group_product':1,'search_default_group_location':1,'group_by':[], 'group_by_no_leaf':1}
+
+
-
diff --git a/addons/stock/report/report_stock_view.xml b/addons/stock/report/report_stock_view.xml
index 34121d0c9ed..5732513e07a 100644
--- a/addons/stock/report/report_stock_view.xml
+++ b/addons/stock/report/report_stock_view.xml
@@ -2,104 +2,6 @@
-
- stock.report.prodlots.filter
- stock.report.prodlots
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots
- form
-
-
-
-
-
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots
- tree
-
-
-
-
-
-
-
-
-
-
-
- stock.report.prodlots.view
- stock.report.prodlots
- graph
-
-
-
-
-
-
-
-
-
-
- Inventory by Location
- ir.actions.act_window
- stock.report.prodlots
- form
- tree,form
- {'full':'1','search_default_internal_locations':1}
-
-
-
- stock.report.tracklots.view
- stock.report.tracklots
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index ca36c8460a7..9265ac0b2c9 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -1,5 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_stock_incoterms_all","stock.incoterms all","model_stock_incoterms",,1,0,0,0
+"access_stock_incoterms_manager","stock.incoterms manager","model_stock_incoterms",stock.group_stock_manager,1,1,1,1
"access_stock_warehouse_manager","stock.warehouse.manager","model_stock_warehouse","stock.group_stock_manager",1,1,1,1
"access_stock_warehouse_user","stock.warehouse.user","model_stock_warehouse","base.group_user",1,0,0,0
"access_stock_location_manager","stock.location.manager","model_stock_location","stock.group_stock_manager",1,1,1,1
@@ -13,36 +14,29 @@
"access_stock_inventory","stock.inventory","model_stock_inventory","stock.group_stock_user",1,1,1,1
"access_stock_inventory_line","stock.inventory.line","model_stock_inventory_line","stock.group_stock_user",1,1,1,1
"access_stock_report_prodlots","stock.report.prodlots","model_stock_report_prodlots","stock.group_stock_manager",1,0,0,0
-"access_stock_location_product_manager","stock.location product manager","model_stock_location","product.group_product_manager",1,0,0,0
-"access_stock_lines_date","report.stock.lines.date all","model_report_stock_lines_date",,1,0,0,0
+"access_stock_location_product_manager","stock.location product manager","model_stock_location","product.group_product_manager",1,1,1,1
+"access_stock_lines_date","report.stock.lines.date all","model_report_stock_lines_date",stock.group_stock_user,1,0,0,0
"access_stock_report_tracklots","stock.report.tracklots","model_stock_report_tracklots","stock.group_stock_user",1,1,1,1
-"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,0,0,0
-"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,0,0,0
-"access_stock_move_track","stock.move.track","model_stock_move_track","stock.group_stock_user",1,0,0,0
-"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0
-"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0
-"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0
-"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0
-"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,0,0,0
-"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,0,0,0
-"access_stock_move_track","stock.move.track","model_stock_move_track","stock.group_stock_user",1,0,0,0
-"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0
-"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0
-"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0
-"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0
-"access_stock_inventory_set_stock_zero","stock.inventory.set.stock.zero","model_stock_inventory_set_stock_zero","stock.group_stock_user",1,0,0,0
-"access_stock_fill_inventory","stock.fill.inventory","model_stock_fill_inventory","stock.group_stock_user",1,0,0,0
-"access_stock_inventory_line_split","stock.inventory.line.split","model_stock_inventory_line_split","stock.group_stock_user",1,0,0,0
-"access_stock_invoice_onshipping","stock.invoice.onshipping","model_stock_invoice_onshipping","stock.group_stock_user",1,0,0,0
-"access_stock_location_product","stock.location.product","model_stock_location_product","stock.group_stock_user",1,0,0,0
-"access_report_stock_picking","report.stock.picking","model_report_stock_picking","stock.group_stock_user",1,0,0,0
-"access_stock_delivery","stock.delivery","model_stock_delivery","stock.group_stock_user",1,0,0,0
-"access_stock_traceability_upstream","stock.traceability.upstream","model_stock_traceability_upstream","stock.group_stock_user",1,0,0,0
-"access_stock_traceability_downstream","stock.traceability.downstream","model_stock_traceability_downstream","stock.group_stock_user",1,0,0,0
-"access_stock_traceability_lot_upstream","stock.traceability.lot.upstream","model_stock_traceability_lot_upstream","stock.group_stock_user",1,0,0,0
-"access_stock_traceability_lot_downstream","stock.traceability.lot.downstream","model_stock_traceability_lot_downstream","stock.group_stock_user",1,0,0,0
-"access_stock_partial_picking",stock.partial.picking","model_stock_partial_picking","stock.group_stock_user",1,0,0,0
-"access_stock_partial_move","stock.partial.move","model_stock_partial_move","stock.group_stock_user",1,0,0,0
+"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,1,1,1
+"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,1,1,1
+"access_stock_move_track","stock.move.track","model_stock_move_track","stock.group_stock_user",1,1,1,1
+"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,1,1,1
+"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,1,1,1
+"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,1,1,1
+"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,1,1,1
+"access_stock_move_split_lines_exist","stock.move.split.lines.exist","model_stock_move_split_lines_exist","stock.group_stock_user",1,1,1,1
+"access_stock_inventory_set_stock_zero","stock.inventory.set.stock.zero","model_stock_inventory_set_stock_zero","stock.group_stock_user",1,1,1,1
+"access_stock_fill_inventory","stock.fill.inventory","model_stock_fill_inventory","stock.group_stock_user",1,1,1,1
+"access_stock_inventory_line_split","stock.inventory.line.split","model_stock_inventory_line_split","stock.group_stock_user",1,1,1,1
+"access_stock_invoice_onshipping","stock.invoice.onshipping","model_stock_invoice_onshipping","stock.group_stock_user",1,1,1,1
+"access_stock_location_product","stock.location.product","model_stock_location_product","stock.group_stock_user",1,1,1,1
+"access_stock_location_product_manager","stock.location.product manager","model_stock_location_product","stock.group_stock_manager",1,1,1,1
+"access_stock_traceability_upstream","stock.traceability.upstream","model_stock_traceability_upstream","stock.group_stock_user",1,1,1,1
+"access_stock_traceability_downstream","stock.traceability.downstream","model_stock_traceability_downstream","stock.group_stock_user",1,1,1,1
+"access_stock_traceability_lot_upstream","stock.traceability.lot.upstream","model_stock_traceability_lot_upstream","stock.group_stock_user",1,1,1,1
+"access_stock_traceability_lot_downstream","stock.traceability.lot.downstream","model_stock_traceability_lot_downstream","stock.group_stock_user",1,1,1,1
+"access_stock_partial_picking",stock.partial.picking","model_stock_partial_picking",,1,1,1,1
+"access_stock_partial_move","stock.partial.move","model_stock_partial_move",,1,1,1,1
"access_stock_inventory_merge","stock.inventory.merge","model_stock_inventory_merge","stock.group_stock_user",1,0,0,0
"access_stock_change_standard_price","stock.change.standard.price","model_stock_change_standard_price","stock.group_stock_user",1,0,0,0
"access_action_traceability","action.traceability","model_action_traceability","stock.group_stock_user",1,0,0,0
diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml
index 4dad60a3c97..099e32a889b 100644
--- a/addons/stock/security/stock_security.xml
+++ b/addons/stock/security/stock_security.xml
@@ -3,10 +3,10 @@
- Stock / Manager
+ Inventory / Manager
- Stock / Worker
+ Inventory / Worker
@@ -716,7 +713,7 @@
-
+
@@ -785,7 +782,7 @@
-
-
-
@@ -907,7 +901,7 @@
calendar
-
+
#
# Sending Products
@@ -921,14 +915,13 @@
-
+
-
@@ -952,27 +945,33 @@
-
-
+
+
-
-
+
+
@@ -996,7 +995,7 @@
on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
-
+
@@ -1005,9 +1004,6 @@
-
-
-
@@ -1044,14 +1040,15 @@
-
-
+
+
+
+
-
-
-
+
+
@@ -1065,13 +1062,13 @@
- Outgoing Products
+ Outgoing Packings
stock.picking
ir.actions.act_window
form
tree,form,calendar
[('type','=','out')]
- {'contact_display': 'partner'}
+ {'contact_display': 'partner', 'search_default_available': 1}
@@ -1143,7 +1140,7 @@
-
+
@@ -1184,10 +1181,7 @@
-
-
-
-
+
@@ -1307,7 +1301,7 @@
{'contact_display': 'partner',"search_default_confirmed":1}
-
+
stock.move.tree
@@ -1320,7 +1314,15 @@
+
+
@@ -1347,7 +1349,8 @@
-
+
+
@@ -1374,12 +1377,9 @@
context="{'location_id':location_id, 'product_id':product_id}"
domain="[('product_id','=?',product_id)]"
on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
-
+
-
-
-
@@ -1454,15 +1454,23 @@
-
-
+
+
+
+
-
+
+
-
@@ -1482,7 +1490,8 @@
-
+
+
@@ -1501,7 +1510,7 @@
-
+
@@ -1513,9 +1522,6 @@
-
@@ -1529,37 +1535,38 @@
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
-
-
+
- Incoming Packings
+ Incoming Products
stock.move
ir.actions.act_window
form
tree,form
- [('picking_id','!=',False),('picking_id.type','=','in')]
+ [('picking_id.type','=','in')]
{"search_default_receive":1}
@@ -1738,7 +1745,7 @@
- Outcoming Shipments
+ Customers Packings
stock.picking
ir.actions.act_window
form
@@ -1766,7 +1773,7 @@
- Outcoming Packings
+ Outgoing Products
stock.move
ir.actions.act_window
form
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index bce550e74ff..8616f939bb8 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -25,25 +25,25 @@ from tools.translate import _
class stock_move_track(osv.osv_memory):
_name = "stock.move.track"
_description = "Track moves"
-
+
_columns = {
- 'tracking_prefix': fields.char('Tracking prefix', size=64),
+ 'tracking_prefix': fields.char('Tracking prefix', size=64),
'quantity': fields.float("Quantity per lot")
}
_defaults = {
'quantity': lambda *x: 1
}
-
+
def track_lines(self, cr, uid, ids, context={}):
""" To track stock moves lines
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: An ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+ """
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
@@ -54,11 +54,11 @@ stock_move_track()
class stock_move_consume(osv.osv_memory):
_name = "stock.move.consume"
_description = "Consume Products"
-
+
_columns = {
- 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
- 'product_qty': fields.float('Quantity', required=True),
- 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
+ 'product_qty': fields.float('Quantity', required=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'location_id': fields.many2one('stock.location', 'Location', required=True)
}
@@ -67,37 +67,37 @@ class stock_move_consume(osv.osv_memory):
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
@return: default values of fields
"""
- res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
+ res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
if 'product_id' in fields:
- res.update({'product_id': move.product_id.id})
+ res.update({'product_id': move.product_id.id})
if 'product_uom' in fields:
- res.update({'product_uom': move.product_uom.id})
+ res.update({'product_uom': move.product_uom.id})
if 'product_qty' in fields:
res.update({'product_qty': move.product_qty})
if 'location_id' in fields:
res.update({'location_id': move.location_id.id})
-
- return res
-
+
+ return res
+
def do_move_consume(self, cr, uid, ids, context={}):
""" To move consumed products
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+ """
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
- for data in self.read(cr, uid, ids):
- move_obj.action_consume(cr, uid, move_ids,
- data['product_qty'], data['location_id'],
+ for data in self.read(cr, uid, ids):
+ move_obj.action_consume(cr, uid, move_ids,
+ data['product_qty'], data['location_id'],
context=context)
return {}
@@ -108,7 +108,7 @@ class stock_move_scrap(osv.osv_memory):
_name = "stock.move.scrap"
_description = "Scrap Products"
_inherit = "stock.move.consume"
-
+
_defaults = {
'location_id': lambda *x: False
}
@@ -118,19 +118,19 @@ class stock_move_scrap(osv.osv_memory):
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
@return: default values of fields
"""
- res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
+ res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
location_obj = self.pool.get('stock.location')
scrpaed_location_ids = location_obj.search(cr, uid, [('scrap_location','=',True)])
-
+
if 'product_id' in fields:
- res.update({'product_id': move.product_id.id})
+ res.update({'product_id': move.product_id.id})
if 'product_uom' in fields:
- res.update({'product_uom': move.product_uom.id})
+ res.update({'product_uom': move.product_uom.id})
if 'product_qty' in fields:
res.update({'product_qty': move.product_qty})
if 'location_id' in fields:
@@ -138,23 +138,23 @@ class stock_move_scrap(osv.osv_memory):
res.update({'location_id': scrpaed_location_ids[0]})
else:
res.update({'location_id': False})
-
+
return res
-
+
def move_scrap(self, cr, uid, ids, context={}):
""" To move scraped products
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
- move_obj = self.pool.get('stock.move')
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+ """
+ move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
- move_obj.action_scrap(cr, uid, move_ids,
- data['product_qty'], data['location_id'],
+ move_obj.action_scrap(cr, uid, move_ids,
+ data['product_qty'], data['location_id'],
context=context)
return {}
@@ -164,42 +164,42 @@ stock_move_scrap()
class split_in_production_lot(osv.osv_memory):
_name = "stock.move.split"
_description = "Split in Production lots"
-
+
def default_get(self, cr, uid, fields, context=None):
""" Get default values
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
@return: Default values of fields
"""
-
- res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
+
+ res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
+ move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
if 'product_id' in fields:
- res.update({'product_id': move.product_id.id})
+ res.update({'product_id': move.product_id.id})
if 'qty' in fields:
- res.update({'qty': move.product_qty})
+ res.update({'qty': move.product_qty})
return res
-
+
_columns = {
- 'qty': fields.integer('Quantity'),
+ 'qty': fields.integer('Quantity'),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number'),
'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Lots Existing Numbers'),
'use_exist' : fields.boolean('Use Exist'),
}
-
+
def split_lot(self, cr, uid, ids, context=None):
""" To split a lot
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: An ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+ """
self.split(cr, uid, ids, context.get('active_ids'), context=context)
return {}
@@ -208,21 +208,21 @@ class split_in_production_lot(osv.osv_memory):
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
+ @param ids: the ID or list of IDs if we want more than one
@param move_ids: the ID or list of IDs of stock move we want to split
- @param context: A standard dictionary
- @return:
- """
+ @param context: A standard dictionary
+ @return:
+ """
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
move_obj = self.pool.get('stock.move')
- new_move = []
+ new_move = []
for data in self.browse(cr, uid, ids):
for move in move_obj.browse(cr, uid, move_ids):
move_qty = move.product_qty
quantity_rest = move.product_qty
uos_qty_rest = move.product_uos_qty
- new_move = []
+ new_move = []
if data.use_exist:
lines = [l for l in data.line_exist_ids if l]
else:
@@ -238,12 +238,13 @@ class split_in_production_lot(osv.osv_memory):
quantity_rest = quantity
break
default_val = {
- 'product_qty': quantity,
- 'product_uos_qty': uos_qty,
+ 'product_qty': quantity,
+ 'product_uos_qty': uos_qty,
'state': move.state
}
if quantity_rest > 0:
current_move = move_obj.copy(cr, uid, move.id, default_val)
+ move_obj.action_confirm(cr, uid, [current_move])
new_move.append(current_move)
if quantity_rest == 0:
current_move = move.id
@@ -255,19 +256,19 @@ class split_in_production_lot(osv.osv_memory):
if not prodlot_id:
# sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
prodlot_id = prodlot_obj.create(cr, uid, {'name': line.name},
- # 'prefix' : line.name},
- {'product_id': move.product_id.id})
+ # 'prefix' : line.name},
+ {'product_id': move.product_id.id})
move_obj.write(cr, uid, [current_move], {'prodlot_id': prodlot_id})
- prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
+ prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
# ref = '%d' % (move.id)
# if prodlot.ref:
- # ref = '%s, %s' % (prodlot.ref, ref)
+ # ref = '%s, %s' % (prodlot.ref, ref)
# prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})
-
+
update_val = {}
- if quantity_rest > 0:
+ if quantity_rest > 0:
update_val['product_qty'] = quantity_rest
- update_val['product_uos_qty'] = uos_qty_rest
+ update_val['product_uos_qty'] = uos_qty_rest
move_obj.write(cr, uid, [move.id], update_val)
return new_move
split_in_production_lot()
@@ -276,8 +277,8 @@ class stock_move_split_lines_exist(osv.osv_memory):
_name = "stock.move.split.lines.exist"
_description = "Exist Split lines"
_columns = {
- 'name': fields.char('Tracking serial', size=64),
- 'quantity': fields.integer('Quantity'),
+ 'name': fields.char('Tracking serial', size=64),
+ 'quantity': fields.integer('Quantity'),
'lot_id': fields.many2one('stock.move.split', 'Lot'),
'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'),
}
@@ -291,16 +292,14 @@ class stock_move_split_lines(osv.osv_memory):
_name = "stock.move.split.lines"
_description = "Split lines"
_columns = {
- 'name': fields.char('Tracking serial', size=64),
- 'quantity': fields.integer('Quantity'),
+ 'name': fields.char('Tracking serial', size=64),
+ 'quantity': fields.integer('Quantity'),
'use_exist' : fields.boolean('Use Exist'),
'lot_id': fields.many2one('stock.move.split', 'Lot'),
'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'),
}
-
_defaults = {
'quantity': lambda *x: 1,
- 'action' : lambda *x: 'split',
+ 'action' : lambda *x: 'split',
}
-
stock_move_split_lines()
diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py
index 0f538748a98..8f283ebee62 100644
--- a/addons/stock/wizard/stock_partial_move.py
+++ b/addons/stock/wizard/stock_partial_move.py
@@ -31,8 +31,9 @@ class stock_partial_move(osv.osv_memory):
_description = "Partial Move"
_columns = {
'date': fields.datetime('Date', required=True),
- 'partner_id': fields.many2one('res.partner',string="Partner", required=True),
- 'address_id': fields.many2one('res.partner.address', 'Delivery Address', help="Address where goods are to be delivered", required=True),
+ 'partner_id': fields.many2one('res.partner',string="Partner"),
+ 'type': fields.char("Type", size=3),
+ 'address_id': fields.many2one('res.partner.address', 'Delivery Address', help="Address where goods are to be delivered"),
}
def view_init(self, cr, uid, fields_list, context=None):
@@ -66,11 +67,14 @@ class stock_partial_move(osv.osv_memory):
_moves_arch_lst = """
-
-
+
+
+
+
+
- """
+ """
_moves_fields = result['fields']
if move_ids and view_type in ['form']:
for m in move_obj.browse(cr, uid, move_ids, context):
@@ -152,7 +156,7 @@ class stock_partial_move(osv.osv_memory):
move_obj = self.pool.get('stock.move')
if not context:
context={}
- moveids = []
+ moveids = address_delivery = address_default = []
if 'date' in fields:
res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
move_ids = context.get('active_ids', [])
@@ -160,14 +164,23 @@ class stock_partial_move(osv.osv_memory):
for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
if m.state in ('done', 'cancel'):
continue
+ res['type'] = m.picking_id and m.picking_id.type or ''
address_ids = list(set([(pick.address_id and pick.address_id.id, pick.address_id and pick.address_id.partner_id and pick.address_id.partner_id.id) for pick in move_obj.browse(cr, uid, move_ids)]))
- if len(address_ids) == 1:
- address_id = address_ids[0][0]
- partner_id = address_ids[0][1]
- res['address_id'] = address_ids[0][0]
- res['partner_id'] = address_ids[0][1]
- else:
- address_id = partner_id = False
+ address_ids1 = list(set([(pick.address_id and pick.address_id.id, pick.address_id and pick.address_id.partner_id and pick.address_id.partner_id.id) for pick in move_obj.browse(cr, uid, move_ids) if pick.address_id]))
+ if len(address_ids1) == 1:
+ if m.picking_id and m.picking_id.type=='out':
+ res['address_id'] = address_ids[0][0] or False
+ res['partner_id'] = address_ids[0][1] or False
+ if m.picking_id and m.picking_id.type=='in':
+ res['partner_id'] = m.company_id.partner_id.id or False
+ if m.company_id.partner_id:
+ address_default = [add.id for add in m.company_id.partner_id.address if add.type=='default']
+ address_delivery = [add.id for add in m.company_id.partner_id.address if add.type=='delivery']
+ if len(address_delivery):
+ res['address_id'] = address_delivery and address_delivery[0] or False
+ else:
+ res['address_id'] = address_default and address_default[0] or False
+
if 'move%s_product_id'%(m.id) in fields:
res['move%s_product_id'%(m.id)] = m.product_id.id
if 'move%s_product_qty'%(m.id) in fields:
diff --git a/addons/stock/wizard/stock_partial_move_view.xml b/addons/stock/wizard/stock_partial_move_view.xml
index 30b7f3fca0e..a7b4271a5b2 100644
--- a/addons/stock/wizard/stock_partial_move_view.xml
+++ b/addons/stock/wizard/stock_partial_move_view.xml
@@ -1,25 +1,14 @@
-
+
-
- Delivery Product
- stock.partial.move
- form
-
-
-
-
-
-
-
-
+
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index 0feac97010b..1326050dd7d 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -32,6 +32,7 @@ class stock_partial_picking(osv.osv_memory):
'date': fields.datetime('Date', required=True),
'partner_id': fields.many2one('res.partner',string="Partner", required=True),
'address_id': fields.many2one('res.partner.address', 'Delivery Address', help="Address where goods are to be delivered", required=True),
+ 'type': fields.char("Type", size=3),
}
def view_init(self, cr, uid, fields_list, context=None):
@@ -65,9 +66,12 @@ class stock_partial_picking(osv.osv_memory):
_moves_arch_lst = """
-
-
+
+
+
+
+
"""
_moves_fields = result['fields']
@@ -163,6 +167,23 @@ class stock_partial_picking(osv.osv_memory):
for m in pick.move_lines:
if m.state in ('done', 'cancel'):
continue
+ res['type'] = m.picking_id and m.picking_id.type or ''
+ address_ids = list(set([(pick.address_id and pick.address_id.id, pick.address_id and pick.address_id.partner_id and pick.address_id.partner_id.id) for pick in pick_obj.browse(cr, uid, context.get('active_ids', []))]))
+ address_ids1 = list(set([(pick.address_id and pick.address_id.id, pick.address_id and pick.address_id.partner_id and pick.address_id.partner_id.id) for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])) if pick.address_id]))
+ if len(address_ids1) == 1:
+ if m.picking_id and m.picking_id.type=='out':
+ res['address_id'] = address_ids[0] and address_ids[0][0] or False
+ res['partner_id'] = address_ids[0][1] or False
+ if m.picking_id and m.picking_id.type=='in':
+ res['partner_id'] = m.company_id.partner_id.id or False
+ partner_company = m.company_id.partner_id and m.company_id.partner_id
+ if partner_company:
+ address_default = [add.id for add in m.company_id.partner_id.address if add.type=='default']
+ address_delivery = [add.id for add in m.company_id.partner_id.address if add.type=='delivery']
+ if len(address_delivery):
+ res['address_id'] = address_delivery and address_delivery[0] or False
+ else:
+ res['address_id'] = address_default and address_default[0] or False
if 'move%s_product_id'%(m.id) in fields:
res['move%s_product_id'%(m.id)] = m.product_id.id
if 'move%s_product_qty'%(m.id) in fields:
diff --git a/addons/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml
index 2f901b9884d..b399576c83d 100644
--- a/addons/stock/wizard/stock_partial_picking_view.xml
+++ b/addons/stock/wizard/stock_partial_picking_view.xml
@@ -1,13 +1,13 @@
-
-
+
+
Making Picking
- stock.partial.picking
- form
- form
+ stock.partial.picking
+ form
+ form
new
-
+
diff --git a/addons/stock_location/mrp_pull.py b/addons/stock_location/mrp_pull.py
old mode 100755
new mode 100644
diff --git a/addons/stock_location/mrp_pull_workflow.xml b/addons/stock_location/mrp_pull_workflow.xml
old mode 100755
new mode 100644
diff --git a/addons/stock_location/security/ir.model.access.csv b/addons/stock_location/security/ir.model.access.csv
index e87f65004bb..188218b6e26 100644
--- a/addons/stock_location/security/ir.model.access.csv
+++ b/addons/stock_location/security/ir.model.access.csv
@@ -1,4 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_product_pulled_flow_user","product_pulled_flow user","model_product_pulled_flow","stock.group_stock_user",1,0,0,0
+"access_product_pulled_flow_manager","product_pulled_flow manager","model_product_pulled_flow","stock.group_stock_manager",1,1,1,1
+"access_product_pulled_flow_partner_manager","product_pulled_flow partner manager","model_product_pulled_flow","product.group_product_manager",1,1,1,1
"access_stock_location_path_user","stock location path user","model_stock_location_path","stock.group_stock_user",1,0,0,0
"access_stock_location_path_manager","stock location path manager","model_stock_location_path","stock.group_stock_manager",1,1,1,1
"access_stock_location_path_partner_manager","stock.location.path partner manager","model_stock_location_path","product.group_product_manager",1,1,1,1
diff --git a/addons/stock_location/stock.py b/addons/stock_location/stock.py
index 8611b8dba6b..4aa4a1999ed 100644
--- a/addons/stock_location/stock.py
+++ b/addons/stock_location/stock.py
@@ -58,7 +58,7 @@ stock_location_path()
class product_pulled_flow(osv.osv):
_name = 'product.pulled.flow'
- _description = "Pulled Flows."
+ _description = "Pulled Flows"
_columns = {
'name': fields.char('Name', size=64, required=True, help="This field will fill the packing Origin and the name of its moves"),
'cancel_cascade': fields.boolean('Cancel Cascade', help="Allow you to cancel moves related to the product pull flow"),
diff --git a/addons/stock_planning/stock_planning_view.xml b/addons/stock_planning/stock_planning_view.xml
index 1e9876060ce..c0ca17fc478 100644
--- a/addons/stock_planning/stock_planning_view.xml
+++ b/addons/stock_planning/stock_planning_view.xml
@@ -95,7 +95,7 @@
-
+
@@ -132,7 +132,7 @@
-
+
-
-
+
+
-
-
+
+
-
+
@@ -240,11 +240,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -275,7 +275,7 @@
form
-
+
@@ -326,8 +326,8 @@
-
-
+
+
@@ -365,7 +365,7 @@
-
+
@@ -388,7 +388,7 @@
-
+
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index a604b7c7c37..bd3f257c756 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -260,8 +260,8 @@
-
-
+
+
diff --git a/addons/thunderbird/__openerp__.py b/addons/thunderbird/__openerp__.py
index 5e60f6508cc..4c2820c78e2 100644
--- a/addons/thunderbird/__openerp__.py
+++ b/addons/thunderbird/__openerp__.py
@@ -24,7 +24,7 @@
"version" : "1.0",
"author" : "Axelor",
"website" : "http://www.axelor.com/",
- "depends" : ["base","crm"],
+ "depends" : ["base"],
"category" : "Generic Modules/Thunderbird interface",
"description": '''
This module is required for the thuderbird plug-in to work
diff --git a/addons/thunderbird/security/ir.model.access.csv b/addons/thunderbird/security/ir.model.access.csv
index b7cc3262e2d..52f5efbcb7f 100644
--- a/addons/thunderbird/security/ir.model.access.csv
+++ b/addons/thunderbird/security/ir.model.access.csv
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_tinythunderbird_partner","tinythunderbird.partner","model_tinythunderbird_partner",,1,1,1,1
-"access_thunderbird_installer","thunderbird.installer","model_thunderbird_installer","base.group_user",1,1,1,1
+"access_thunderbird_installer","thunderbird.installer","model_thunderbird_installer","base.group_system",1,1,1,1
diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml
index ca0eaccb449..8f07148fd52 100644
--- a/addons/wiki/wiki_view.xml
+++ b/addons/wiki/wiki_view.xml
@@ -160,16 +160,15 @@
search
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+