diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py
index 3930b9b3e11..94f023e0cab 100644
--- a/addons/account/__terp__.py
+++ b/addons/account/__terp__.py
@@ -35,9 +35,7 @@
Customer and Supplier Invoices
Bank statements
""",
- 'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['product', 'base', 'process'],
'init_xml': [],
'update_xml': [
'security/account_security.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index b6dd4bfb11b..bfd48d55b00 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -2152,7 +2152,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
for key,value in todo_dict.items():
if value['account_collected_id'] or value['account_paid_id']:
- obj_acc_tax.write(cr, uid, [key], vals={
+ obj_acc_tax.write(cr, uid, [key], {
'account_collected_id': acc_template_ref[value['account_collected_id']],
'account_paid_id': acc_template_ref[value['account_paid_id']],
})
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 56c4ddba96e..63baf5165e4 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -124,7 +124,7 @@ class account_bank_statement(osv.osv):
states={'confirm':[('readonly', True)]}),
'move_line_ids': fields.one2many('account.move.line', 'statement_id',
'Entry lines', states={'confirm':[('readonly',True)]}),
- 'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirm')],
+ 'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],
'State', required=True,
states={'confirm': [('readonly', True)]}, readonly="1"),
'currency': fields.function(_currency, method=True, string='Currency',
@@ -157,7 +157,7 @@ class account_bank_statement(osv.osv):
if not st.state=='draft':
continue
- if not (abs(st.balance_end - st.balance_end_real) < 0.0001):
+ if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
raise osv.except_osv(_('Error !'),
_('The statement balance is incorrect !\n') +
_('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
@@ -578,11 +578,13 @@ class account_bank_statement_line(osv.osv):
'note': fields.text('Notes'),
'reconcile_amount': fields.function(_reconcile_amount,
string='Amount reconciled', method=True, type='float'),
+ 'sequence': fields.integer('Sequence'),
}
_defaults = {
'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'),
'date': lambda *a: time.strftime('%Y-%m-%d'),
'type': lambda *a: 'general',
+ 'sequence': lambda *a: 10,
}
account_bank_statement_line()
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 6d14f25427c..d7ca374a64c 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -179,7 +179,7 @@
-
+
@@ -188,7 +188,7 @@
-
+
@@ -269,7 +269,7 @@
-
+
@@ -318,6 +318,29 @@
+
+ account.invoice.select
+ account.invoice
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Invoicesaccount.invoice
@@ -325,6 +348,7 @@
tree,form,calendar,graph{'type':'out_invoice'}
+
@@ -347,6 +371,7 @@
[('type','=','out_invoice')]{'type':'out_invoice'}
+
@@ -369,7 +394,7 @@
[('type','=','out_invoice')]{'type':'out_invoice'}
-
+
Supplier Invoices
@@ -379,6 +404,7 @@
[('type','=','in_invoice')]{'type':'in_invoice'}
+
@@ -390,7 +416,7 @@
[('type','=','in_invoice')]{'type':'in_invoice'}
-
+
Customer Refunds
@@ -400,6 +426,7 @@
[('type','=','out_refund')]{'type':'out_refund'}
+
@@ -412,7 +439,7 @@
[('type','=','out_refund')]{'type':'out_refund'}
-
+
Supplier Refunds
@@ -422,6 +449,7 @@
[('type','=','in_refund')]{'type':'in_refund'}
+
@@ -434,7 +462,7 @@
[('type','=','in_refund')]{'type':'in_refund'}
-
+
@@ -444,6 +472,8 @@
tree,form,calendar,graph[('state','=','draft'),('type','=','out_invoice')]{'type':'out_invoice'}
+
+
@@ -457,7 +487,7 @@
-
+
PRO-FORMA Customer Invoices
@@ -466,6 +496,8 @@
tree,form,calendar,graph[('state','=','proforma2'),('type','=','out_invoice')]{'type':'out_invoice'}
+
+
@@ -479,7 +511,7 @@
-
+
Unpaid Customer Invoices
@@ -488,6 +520,8 @@
tree,form,calendar,graph[('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','out_invoice')]{'type':'out_invoice'}
+
+
@@ -501,7 +535,7 @@
-
+
Draft Supplier Invoices
@@ -510,6 +544,8 @@
tree,form,calendar,graph[('state','=','draft'),('type','=','in_invoice')]{'type':'in_invoice'}
+
+
@@ -523,7 +559,7 @@
-
+
Unpaid Supplier Invoices
@@ -532,6 +568,8 @@
tree,form,calendar,graph[('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','in_invoice')]{'type':'in_invoice'}
+
+
@@ -545,7 +583,7 @@
-
+
Draft Customer Refunds
@@ -554,6 +592,8 @@
tree,form,calendar,graph[('state','=','draft'),('type','=','out_refund')]{'type':'out_refund'}
+
+
@@ -567,7 +607,7 @@
-
+
Unpaid Customer Refunds
@@ -576,6 +616,8 @@
tree,form,calendar,graph[('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','out_refund')]{'type':'out_refund'}
+
+
@@ -589,7 +631,7 @@
-
+
Draft Supplier Refunds
@@ -598,6 +640,8 @@
tree,form,calendar,graph[('state','=','draft'),('type','=','in_refund')]{'type':'in_refund'}
+
+
@@ -611,7 +655,7 @@
-
+
Unpaid Supplier Refunds
@@ -620,6 +664,8 @@
tree,form,calendar,graph[('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','in_refund')]{'type':'in_refund'}
+
+
@@ -633,7 +679,7 @@
-
+
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 1ed28ff2588..49ebdd8ea11 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -659,8 +659,8 @@ class account_move_line(osv.osv):
return j+(p and (':'+p) or '')
return False
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
- result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar)
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
+ result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar, submenu=submenu)
if view_type=='tree' and 'journal_id' in context:
title = self.view_header_get(cr, uid, view_id, view_type, context)
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 8353695f76e..2be40d868d9 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -30,8 +30,8 @@
-
-
+
+
@@ -78,7 +78,7 @@
-
+
@@ -323,7 +323,7 @@
+ string="Import Invoice" type="action" attrs="{'invisible':[('state','=','confirm')]}" icon="gtk-open"/>
@@ -332,6 +332,7 @@
+
@@ -351,6 +352,7 @@
+
@@ -363,9 +365,9 @@
-
-
-
+
+
+
@@ -384,8 +386,9 @@
formtree,form[('state','=','draft')]
+
-
+
New Statement
@@ -422,7 +425,7 @@
-
+
@@ -884,8 +887,8 @@
-
-
+
+
@@ -984,8 +987,8 @@
-
-
+
+
@@ -1110,7 +1113,7 @@
-
+
@@ -1255,8 +1258,8 @@
-
-
+
+
@@ -1264,7 +1267,7 @@
-
+
@@ -1283,8 +1286,9 @@
formtree,form[('state','=','running')]
+
-
+
New Subscription
diff --git a/addons/account/product.py b/addons/account/product.py
index f061e22cb14..f9ae9598e69 100644
--- a/addons/account/product.py
+++ b/addons/account/product.py
@@ -34,7 +34,7 @@ class product_category(osv.osv):
string="Income Account",
method=True,
view_load=True,
- help="This account will be used to value incoming stock for the current product category"),
+ help="This account will be used to value incoming stock(i.e. credit of incoming goods) for the current product category"),
'property_account_expense_categ': fields.property(
'account.account',
type='many2one',
@@ -42,7 +42,7 @@ class product_category(osv.osv):
string="Expense Account",
method=True,
view_load=True,
- help="This account will be used to value outgoing stock for the current product category"),
+ help="This account will be used to value outgoing stock(i.e. debit of outgoing goods) for the current product category"),
}
product_category()
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 02842c47333..94e311db9c5 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -24,7 +24,7 @@
treechild_ids
-
+
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
index 8d9ffff97f9..cd2148c7255 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
@@ -43,9 +43,10 @@
formtree,form,graph[('user_id','=',uid),('state','=','open')]
+
-
+
My Pending Accounts
@@ -53,9 +54,10 @@
formtree,form,graph[('user_id','=',uid),('state','=','pending')]
+
-
+
New Analytic Account
@@ -101,8 +103,9 @@
tree,form,graph[('state','=','open')]
+
-
+
Pending Analytic Accounts
@@ -111,8 +114,9 @@
tree,form,graph[('state','=','pending')]
+
-
+
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index 393c681dc01..6132baee654 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -133,9 +133,9 @@ class account_analytic_plan_instance(osv.osv):
ids = self.search(cr, uid, args, limit=limit, context=context or {})
return self.name_get(cr, uid, ids, context or {})
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False):
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
wiz_id = self.pool.get('ir.actions.wizard').search(cr, uid, [("wiz_name","=","create.model")])
- res = super(account_analytic_plan_instance,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar)
+ res = super(account_analytic_plan_instance,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if (res['type']=='form'):
plan_id = False
diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py
index 93cf7c9bd93..54b6de41648 100644
--- a/addons/account_budget/crossovered_budget.py
+++ b/addons/account_budget/crossovered_budget.py
@@ -44,9 +44,12 @@ class account_budget_post(osv.osv):
'dotation_ids': fields.one2many('account.budget.post.dotation', 'post_id', 'Spreading'),
'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts'),
'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'),
+ 'sequence': fields.integer('Sequence'),
}
_defaults = {
+ 'sequence': lambda *a: 1,
}
+ _order = "sequence, name"
def spread(self, cr, uid, ids, fiscalyear_id=False, amount=0.0):
dobj = self.pool.get('account.budget.post.dotation')
@@ -228,7 +231,7 @@ class crossovered_budget_lines(osv.osv):
res = {}
for line in self.browse(cr, uid, ids):
if line.theoritical_amount<>0.00:
- res[line.id]=float(line.practical_amount / line.theoritical_amount)*100
+ res[line.id]=float(line.practical_amount or 0.0 / line.theoritical_amount)*100
else:
res[line.id]=0.00
return res
diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml
index 6e30323c39d..5c6c527543e 100644
--- a/addons/account_budget/crossovered_budget_view.xml
+++ b/addons/account_budget/crossovered_budget_view.xml
@@ -19,6 +19,7 @@
tree
+
@@ -67,12 +68,13 @@
-
-
-
-
+
+
+
+
diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml
index 36009a105bd..b1ad3d54f53 100644
--- a/addons/account_payment/payment_view.xml
+++ b/addons/account_payment/payment_view.xml
@@ -96,7 +96,7 @@
-
+
@@ -190,8 +190,9 @@
formtree,form[('state','=','draft')]
+
-
+
Payment Orders to Validate
@@ -199,8 +200,9 @@
formtree,form[('state','=','open')]
+
-
+
New Payment Order
@@ -291,7 +293,7 @@
-
+
diff --git a/addons/account_report/account.py b/addons/account_report/account.py
index 29a2fe08f0f..4a7b1efd05b 100644
--- a/addons/account_report/account.py
+++ b/addons/account_report/account.py
@@ -59,9 +59,9 @@ class account_report(osv.osv):
def _calc_context(key,obj):
if key==0:
- return obj.find(cr,uid,exception=False)
+ return obj.find(cr, uid, exception=False)
else:
- obj_key=obj.browse(cr,uid,obj.find(cr,uid,exception=False))
+ obj_key=obj.browse(cr,uid,obj.find(cr, uid, exception=False))
if isinstance(obj_key,list):
obj_key=obj_key[0]
key_ids=obj.search(cr,uid,[('date_stop','<',obj_key.date_start)])
diff --git a/addons/account_voucher/account.py b/addons/account_voucher/account.py
index 4006cde9863..33ebecbc08a 100644
--- a/addons/account_voucher/account.py
+++ b/addons/account_voucher/account.py
@@ -256,4 +256,4 @@ class account_account_template(osv.osv):
account_account_template()
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/report/rml_parse.py b/addons/account_voucher/report/rml_parse.py
index 31bd26617cd..66362754457 100644
--- a/addons/account_voucher/report/rml_parse.py
+++ b/addons/account_voucher/report/rml_parse.py
@@ -162,5 +162,4 @@ class rml_parse(report_sxw.rml_parse):
rml_head = rml_head.replace('','''[[company.logo]] ''')
return True
-
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index d1dc30c6b67..69709f8bc23 100755
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -248,7 +248,8 @@ class account_voucher(osv.osv):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
-
+
+ acc_id = None
date = inv.date
total_currency = 0
acc_id = None
diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml
index bbaa12a3601..39217968ef7 100644
--- a/addons/auction/auction_view.xml
+++ b/addons/auction/auction_view.xml
@@ -76,7 +76,7 @@
=======================================================
-Auction Management/Auction Dates/New Auction Dates
+ Auction Management/Auction Dates/New Auction Dates
=======================================================
Auction dates
@@ -114,7 +114,7 @@ Auction Management/Auction Dates/New Auction Dates
-
+
@@ -150,8 +150,8 @@ Auction Management/Auction Dates/New Auction Dates
-=======================================================
-Auction Management/Auction Dates/Reporting
+ =======================================================
+ Auction Management/Auction Dates/Reporting
=======================================================
@@ -287,11 +287,11 @@ Auction Management/Auction Dates/Reporting
-
-
-
-
-
+
+
+
+
+
@@ -369,28 +369,31 @@ Auction Management/Auction Dates/Reporting
auction.lotsform[('state','=','sold')]
+
-
+
auction.lotsformtree,form[('state','<>','sold')]
+
-
+
auction.lotsformtree,form[('auction_id','=', False),('state','=','draft')]
+
-
+
@@ -400,12 +403,14 @@ Auction Management/Auction Dates/Reporting
auction.lotsform[('state','=','unsold')]
+
+ id="menu_all_objects_unsold"
+ groups="base.group_extended_menu"/>
@@ -449,11 +454,11 @@ Auction Management/Auction Dates/Reporting
-
-
-
-
-
+
+
+
+
+ report.unclassified.objectsformtree,form
+
-
+
Auction.deposit.tree
diff --git a/addons/auction/wizard/wizard_auction_invoice_buyer.py b/addons/auction/wizard/wizard_auction_invoice_buyer.py
index 2cf68656d8c..3de71962774 100644
--- a/addons/auction/wizard/wizard_auction_invoice_buyer.py
+++ b/addons/auction/wizard/wizard_auction_invoice_buyer.py
@@ -66,9 +66,12 @@ def _values(self,cr,uid, datas,context={}):
def _makeInvoices(self, cr, uid, data, context):
- order_obj = pooler.get_pool(cr.dbname).get('auction.lots')
newinv = []
pool = pooler.get_pool(cr.dbname)
+ order_obj = pool.get('auction.lots')
+ mod_obj = pool.get('ir.model.data')
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
lots= order_obj.browse(cr,uid,data['ids'])
invoice_number=data['form']['number']
for lot in lots:
@@ -84,7 +87,8 @@ def _makeInvoices(self, cr, uid, data, context):
'res_model': 'account.invoice',
'view_id': False,
'context': "{'type':'in_refund'}",
- 'type': 'ir.actions.act_window'
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
}
return {}
diff --git a/addons/auction/wizard/wizard_auction_journal.py b/addons/auction/wizard/wizard_auction_journal.py
index 93e742cfc62..0ce0a14ae5c 100644
--- a/addons/auction/wizard/wizard_auction_journal.py
+++ b/addons/auction/wizard/wizard_auction_journal.py
@@ -64,7 +64,11 @@ def _values(self,cr,uid, datas,context={}):
def _makeInvoices(self, cr, uid, data, context):
- order_obj = pooler.get_pool(cr.dbname).get('auction.lots')
+ pool = pooler.get_pool(cr.dbname)
+ order_obj = pool.get('auction.lots')
+ mod_obj = pool.get('ir.model.data')
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
newinv = []
ids = order_obj.seller_trans_create(cr, uid, data['ids'],context)
cr.commit()
@@ -76,7 +80,8 @@ def _makeInvoices(self, cr, uid, data, context):
'res_model': 'account.invoice',
'view_id': False,
'context': "{'type':'out_refund'}",
- 'type': 'ir.actions.act_window'
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
}
return {}
diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
index ee23e790e7b..a7ae0f59075 100644
--- a/addons/audittrail/audittrail.py
+++ b/addons/audittrail/audittrail.py
@@ -22,11 +22,11 @@
import ir
-from osv import fields,osv
+from osv import fields, osv
import netsvc
import pooler
import string
-import time,copy
+import time, copy
from tools.translate import _
class audittrail_rule(osv.osv):
diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py
index b00a5745935..b29bff9c5ac 100644
--- a/addons/base_contact/base_contact.py
+++ b/addons/base_contact/base_contact.py
@@ -49,10 +49,16 @@ class res_partner_contact(osv.osv):
'function_id':fields.related('job_ids','function_id',type='many2one', relation='res.partner.function', string='Main Function'),
'job_id':fields.related('job_ids',type='many2one', relation='res.partner.job', string='Main Job'),
'email': fields.char('E-Mail', size=240),
+ 'comment' : fields.text('Notes', translate=True),
+ 'photo' : fields.binary('Image'),
+
}
_defaults = {
'active' : lambda *a: True,
}
+
+ _order = "name,first_name"
+
def name_get(self, cr, user, ids, context={}):
#will return name and first_name.......
if not len(ids):
@@ -117,20 +123,20 @@ class res_partner_job(osv.osv):
_description ='Contact Partner Function'
_order = 'sequence_contact'
_columns = {
- 'name': fields.related('address_id','partner_id', type='many2one', relation='res.partner', string='Partner'),
- 'address_id':fields.many2one('res.partner.address','Address'),
+ 'name': fields.related('address_id','partner_id', type='many2one', relation='res.partner', string='Partner', help="You may enter Address first,Partner will be linked automatically if any."),
+ 'address_id':fields.many2one('res.partner.address','Address', help='Address which is linked to the Partner'),
'contact_id':fields.many2one('res.partner.contact','Contact', required=True, ondelete='cascade'),
- 'function_id': fields.many2one('res.partner.function','Partner Function'),
+ 'function_id': fields.many2one('res.partner.function','Partner Function', help="Function of this contact with this partner"),
'sequence_contact':fields.integer('Contact Seq.',help='Order of importance of this address in the list of addresses of the linked contact'),
'sequence_partner':fields.integer('Partner Seq.',help='Order of importance of this job title in the list of job title of the linked partner'),
- 'email': fields.char('E-Mail', size=240),
- 'phone': fields.char('Phone', size=64),
- 'fax': fields.char('Fax', size=64),
+ 'email': fields.char('E-Mail', size=240, help="Job E-Mail"),
+ 'phone': fields.char('Phone', size=64, help="Job Phone no."),
+ 'fax': fields.char('Fax', size=64, help="Job FAX no."),
'extension': fields.char('Extension', size=64, help='Internal/External extension phone number'),
'other': fields.char('Other', size=64, help='Additional phone field'),
- 'date_start' : fields.date('Date Start'),
- 'date_stop' : fields.date('Date Stop'),
- 'state' : fields.selection([('past', 'Past'),('current', 'Current')], 'State', required=True),
+ 'date_start' : fields.date('Date Start',help="Start date of job(Joining Date)"),
+ 'date_stop' : fields.date('Date Stop', help="Last date of job"),
+ 'state' : fields.selection([('past', 'Past'),('current', 'Current')], 'State', required=True, help="Status of Address"),
}
_defaults = {
diff --git a/addons/base_contact/base_contact_demo.xml b/addons/base_contact/base_contact_demo.xml
index 9dbac13dcf0..1945e1dd899 100644
--- a/addons/base_contact/base_contact_demo.xml
+++ b/addons/base_contact/base_contact_demo.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml
index 9b2a9c179fc..58650e3eed7 100644
--- a/addons/base_contact/base_contact_view.xml
+++ b/addons/base_contact/base_contact_view.xml
@@ -1,4 +1,4 @@
-
+
@@ -32,29 +32,36 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -74,6 +81,12 @@
+
+
+
+
+
+
@@ -101,21 +114,20 @@
diff --git a/addons/base_module_record/__terp__.py b/addons/base_module_record/__terp__.py
index 8c6edb399a3..9b9cbca2bf0 100644
--- a/addons/base_module_record/__terp__.py
+++ b/addons/base_module_record/__terp__.py
@@ -22,7 +22,7 @@
{
- 'name': 'Module Recorder',
+ 'name': 'Module Record',
'version': '1.0',
'category': 'Generic Modules/Base',
'description': """
@@ -39,10 +39,8 @@ This should help you to easily create reusable and publishable modules
for custom configurations and demo/testing data.
How to use it:
-1. Start the recording
-2. Do stuff in your Open ERP client
-3. Stop the recording session
-4. Export to a reusable module
+Run Administration/Customization/Module Creation/Export Customizations As a Module wizard.
+Select datetime critearea of recording and objects to be recorded and Record module.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py
index d9cf8368528..144c7f2c80e 100644
--- a/addons/base_module_record/base_module_record.py
+++ b/addons/base_module_record/base_module_record.py
@@ -39,7 +39,7 @@ class recording_objects_proxy(objects_proxy):
pool = pooler.get_pool(args[0])
mod = pool.get('ir.module.record')
if mod and mod.recording:
- if args[4] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc'):
+ if args[4] in ('copy','write','unlink','create'):
if _old_args is not None:
args[5].update(_old_args)
if args[5]:
@@ -198,6 +198,8 @@ class base_module_record(osv.osv):
if mod_fields[key]['type'] == 'many2one':
if type(data[key])==type(True) or type(data[key])==type(1):
result[key]=data[key]
+ elif not data[key]:
+ result[key] = False
else:
result[key]=data[key][0]
diff --git a/addons/base_module_record/base_module_record_wizard.xml b/addons/base_module_record/base_module_record_wizard.xml
index abced76678a..8eb9c48fac9 100644
--- a/addons/base_module_record/base_module_record_wizard.xml
+++ b/addons/base_module_record/base_module_record_wizard.xml
@@ -1,57 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -74,7 +74,7 @@
-
+
diff --git a/addons/base_report_designer/__terp__.py b/addons/base_report_designer/__terp__.py
index c66be0ec379..9782fba2786 100644
--- a/addons/base_report_designer/__terp__.py
+++ b/addons/base_report_designer/__terp__.py
@@ -32,9 +32,9 @@ OpenOffice.
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base'],
- 'init_xml': [],
+ 'init_xml': ['base_report_data.xml'],
'update_xml': ['base_report_designer_wizard.xml'],
- 'demo_xml': ['base_report_data.xml'],
+ 'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0056379010493',
diff --git a/addons/base_report_designer/base_report_data.xml b/addons/base_report_designer/base_report_data.xml
index 865a1181a22..f709e6c7be7 100644
--- a/addons/base_report_designer/base_report_data.xml
+++ b/addons/base_report_designer/base_report_data.xml
@@ -7,5 +7,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl
index 644f9209968..50ffb3d81be 100644
--- a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl
+++ b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl
@@ -649,16 +649,16 @@
- Times-BoldItalic
+ Helvetica-BoldOblique
- Times-Bold
+ Helvetica-Bold
- Times-Italic
+ Helvetica-Oblique
- Times-Roman
+ Helvetica
@@ -666,7 +666,7 @@
- Times-Roman
+ Helvetica
diff --git a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_oo2rml.xsl b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_oo2rml.xsl
index 097564eaccc..66ef0b5b53c 100644
--- a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_oo2rml.xsl
+++ b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_oo2rml.xsl
@@ -650,16 +650,16 @@
- Times-BoldItalic
+ Helvetica-BoldOblique
- Times-Bold
+ Helvetica-Bold
- Times-Italic
+ Helvetica-Oblique
- Times-Roman
+ Helvetica
@@ -667,7 +667,7 @@
- Times-Roman
+ Helvetica
diff --git a/addons/board/board.py b/addons/board/board.py
index c6bb5d158aa..120ebbf5600 100644
--- a/addons/board/board.py
+++ b/addons/board/board.py
@@ -86,9 +86,9 @@ class board_board(osv.osv):
return id
- def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False):
+ def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = {}
- res = super(board_board, self).fields_view_get(cr, user, view_id, view_type, context, toolbar)
+ res = super(board_board, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
vids = self.pool.get('ir.ui.view.custom').search(cr, user, [('user_id','=',user), ('ref_id','=',view_id)])
if vids:
diff --git a/addons/board/board_view.xml b/addons/board/board_view.xml
index e196f5cc682..5904607223a 100644
--- a/addons/board/board_view.xml
+++ b/addons/board/board_view.xml
@@ -57,7 +57,7 @@
-
+
diff --git a/addons/board_auction/board_auction_manager_view.xml b/addons/board_auction/board_auction_manager_view.xml
index b4d863c1c41..d132c8f619b 100644
--- a/addons/board_auction/board_auction_manager_view.xml
+++ b/addons/board_auction/board_auction_manager_view.xml
@@ -36,7 +36,7 @@
diff --git a/addons/board_auction/board_auction_view.xml b/addons/board_auction/board_auction_view.xml
index 6e1c49965b5..0c5feecea12 100644
--- a/addons/board_auction/board_auction_view.xml
+++ b/addons/board_auction/board_auction_view.xml
@@ -30,7 +30,7 @@
diff --git a/addons/board_crm_configuration/__terp__.py b/addons/board_crm_configuration/__terp__.py
index a00a88a5048..5c869a997d3 100644
--- a/addons/board_crm_configuration/__terp__.py
+++ b/addons/board_crm_configuration/__terp__.py
@@ -27,8 +27,8 @@
'category': 'Board/CRM',
'description': """
This module implements a dashboard for CRM that includes:
- * My Leads (list)
- * Leads by Stage (graph)
+ * My Prospects (list)
+ * Prospects by Stage (graph)
* My Meetings (list)
* Sales Pipeline by Stage (graph)
* My Cases (list)
diff --git a/addons/board_crm_configuration/board_crm_statistical_view.xml b/addons/board_crm_configuration/board_crm_statistical_view.xml
index f5e9015a66b..9b9c34334d9 100644
--- a/addons/board_crm_configuration/board_crm_statistical_view.xml
+++ b/addons/board_crm_configuration/board_crm_statistical_view.xml
@@ -5,11 +5,11 @@
Board for statistical view of the sections
-->
- Leads By Stage - Graph
+ Prospects By Stage - Graphreport.crm.case.section.stagegraph
-
+
@@ -43,7 +43,7 @@
formgraph,tree,form
- [('section_id', '=', 'Leads'),('state','!=','done'),('state','!=','cancel')]
+ [('section_id', '=', 'Prospects'),('state','!=','done'),('state','!=','cancel')]
-
@@ -91,7 +91,7 @@
diff --git a/addons/board_crm_configuration/board_crm_view.xml b/addons/board_crm_configuration/board_crm_view.xml
index 0606665bb74..d5600eff893 100644
--- a/addons/board_crm_configuration/board_crm_view.xml
+++ b/addons/board_crm_configuration/board_crm_view.xml
@@ -22,7 +22,7 @@
formtree,form
- [('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+ [('section_id.name', '=', 'Prospects'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
@@ -45,7 +45,7 @@
formgraph,tree,form
- [('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+ [('section_id.name', '=', 'Prospects'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
@@ -75,7 +75,7 @@
diff --git a/addons/board_project/board_project_manager_view.xml b/addons/board_project/board_project_manager_view.xml
index a0cadfaa58e..79f627af24f 100644
--- a/addons/board_project/board_project_manager_view.xml
+++ b/addons/board_project/board_project_manager_view.xml
@@ -61,7 +61,7 @@
-
+
diff --git a/addons/board_sale/board_sale_view.xml b/addons/board_sale/board_sale_view.xml
index 6770638c1cd..a457f58a04a 100644
--- a/addons/board_sale/board_sale_view.xml
+++ b/addons/board_sale/board_sale_view.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py
index 29450cc9e71..045bcfa85fe 100644
--- a/addons/crm/__terp__.py
+++ b/addons/crm/__terp__.py
@@ -27,7 +27,7 @@
'category': 'Generic Modules/CRM & SRM',
'description': """The generic Open ERP Customer Relationship Management
system enables a group of people to intelligently and efficiently manage
-leads, opportunities, tasks, issues, requests, bugs, campaign, claims, etc.
+prospects, opportunities, tasks, issues, requests, bugs, campaign, claims, etc.
It manages key tasks such as communication, identification, prioritization,
assignment, resolution and notification.
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index a4cab48b1c5..09b0d4d25c6 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -21,13 +21,19 @@
##############################################################################
import time
-import tools
-from osv import fields,osv,orm
+import re
+import os
import mx.DateTime
import base64
+
from tools.translate import _
+import tools
+from osv import fields,osv,orm
+from osv.orm import except_orm
+
+
MAX_LEVEL = 15
AVAILABLE_STATES = [
('draft','Draft'),
@@ -64,6 +70,7 @@ class crm_case_section(osv.osv):
'reply_to': fields.char('Reply-To', size=64, help="The email address put in the 'Reply-To' of all emails sent by Open ERP about cases in this section"),
'parent_id': fields.many2one('crm.case.section', 'Parent Section'),
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Sections'),
+ "gateway_ids" : fields.one2many("crm.email.gateway",'section_id',"Email Gateway")
}
_defaults = {
'active': lambda *a: 1,
@@ -197,6 +204,101 @@ class crm_case_section(osv.osv):
return res
crm_case_section()
+class crm_email_gateway(osv.osv):
+ _name = "crm.email.gateway"
+ _description = "Email Gateway"
+ _rec_name="login"
+ _columns = {
+ 'pop': fields.char('POP Server Name',size=64,required=True ,help="POP Server Name Of Email gateway"),
+ 'login': fields.char('User',size=64,required=True,help="User Login Id of Email gateway"),
+ 'password': fields.char('Password',size=64,required=True,help="User Password Of Email gateway"),
+ 'email': fields.char('Email Id',size=64,help="Default eMail in case of any trouble."),
+ 'mailgateway':fields.selection([("fetchmail","Using Fetchmail"),("postfix","Using Postfix")],"EMail gateway", readonly=True),
+ 'section_id':fields.many2one('crm.case.section',"Section"),
+ 'path':fields.char("Path ",size=255,required= True,help ="Path of script file of Email gateway"),
+ 'port':fields.integer("Port" , help="Port Number "),
+ 'ssl':fields.boolean('Use Secure Authentication',help ="Use Secure Authentication"),
+ }
+ _defaults = {
+ 'path': lambda *a: tools.config['addons_path']+"/crm/scripts/openerp-mailgate/openerp-mailgate.py",
+ 'port':lambda * a:110,
+ 'mailgateway':lambda * a:'fetchmail',
+ }
+
+ def _get_fetchmail_path(self, cr):
+ return os.path.join(tools.config['root_path'], '.fetchmail', cr.dbname)
+
+ def fetch_mail(self, cr, uid, section_ids=[], context={}):
+ path = self._get_fetchmail_path(cr)
+ sect_obj = self.pool.get("crm.case.section")
+ if not len(section_ids):
+ section_ids = sect_obj.search(cr, uid, [])
+ for section in sect_obj.browse(cr, uid, section_ids):
+ fetch_file = path + "/" +section.name
+ if os.path.isfile(fetch_file):
+ try :
+ os.system("fetchmail -f %s" %(fetch_file))
+ except Exception, e:
+ import netsvc
+ netsvc.Logger().notifyChannel('fetchmail', netsvc.LOG_ERROR, "%s" % e)
+ return True
+
+ def make_fetchmail(self, cr, uid, section_ids=[], context={}):
+ sect_obj = self.pool.get("crm.case.section")
+ user_obj = self.pool.get("res.users")
+ for section in sect_obj.browse(cr, uid, section_ids, context):
+ user = user_obj.browse(cr,uid,uid)
+ path = self._get_fetchmail_path(cr)
+ if not os.path.isdir(path):
+ try:
+ os.makedirs(path)
+ except:
+ raise except_orm(_('Permission Denied !'), _('You do not permissions to write on the server side.'))
+
+ fmail_path = path + "/" +section.name
+ fmail = open(fmail_path , 'w')
+ os.chmod(fmail_path,0710)
+ for mailgateway in section.gateway_ids:
+ mdatext = '%s -u %d -p %s -s %d -d %s '%(mailgateway.path,uid,user.password,mailgateway.section_id.id,cr.dbname)
+ if mailgateway.email:
+ mdatext += ' -m %s'%(mailgateway.email)
+ if section.reply_to:
+ mdatext += ' -e %s'%(section.reply_to)
+ text = "\npoll %s user '%s' password '%s'"%(mailgateway.pop,mailgateway.login,mailgateway.password)
+ if mailgateway.port:
+ text += ' port %d' % (mailgateway.port)
+ if mailgateway.ssl:
+ text += ' ssl'
+ text += " mda '%s'"%(mdatext)
+ fmail.write(text)
+ fmail.close()
+
+ def create(self, cr, uid, vals, context=None):
+ res = super(crm_email_gateway, self).create(cr, uid, vals, context=context)
+ self.make_fetchmail(cr, uid, [vals['section_id']])
+ return res
+
+ def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
+ res = super(crm_email_gateway, self).write(cr, uid, ids, vals, context)
+ section_ids = []
+ for gateway in self.browse(cr, uid, ids, context):
+ if gateway.section_id.id not in section_ids:
+ section_ids.append(gateway.section_id.id)
+ self.make_fetchmail(cr, uid, section_ids)
+ return res
+
+ def unlink(self, cr, uid, ids, context={}, check=True):
+ section_ids = []
+ for gateway in self.browse(cr, uid, ids, context):
+ if gateway.section_id.id not in section_ids:
+ section_ids.append(gateway.section_id.id)
+ res = super(crm_email_gateway, self).unlink(cr, uid,ids, context=context)
+
+ self.make_fetchmail(cr, uid, section_ids)
+ return res
+
+crm_email_gateway()
+
class crm_case_categ(osv.osv):
_name = "crm.case.categ"
_description = "Category of case"
@@ -228,7 +330,8 @@ class crm_case_rule(osv.osv):
('deadline','Deadline'),
('date','Date'),
], 'Trigger Date', size=16),
- 'trg_date_range': fields.integer('Delay after trigger date'),
+ 'trg_date_range': fields.integer('Delay after trigger date',help="Delay After Trigger Date, specifies you can put a negative number " \
+ "if you need a delay before the trigger date, like sending a reminder 15 minutes before a meeting."),
'trg_date_range_type': fields.selection([('minutes', 'Minutes'),('hour','Hours'),('day','Days'),('month','Months')], 'Delay type'),
'trg_section_id': fields.many2one('crm.case.section', 'Section'),
@@ -247,17 +350,21 @@ class crm_case_rule(osv.osv):
'act_section_id': fields.many2one('crm.case.section', 'Set section to'),
'act_user_id': fields.many2one('res.users', 'Set responsible to'),
'act_priority': fields.selection([('','')] + AVAILABLE_PRIORITIES, 'Set priority to'),
- 'act_email_cc': fields.char('Add watchers (Cc)', size=250, help="These people will receive a copy of the futur communication between partner and users by email"),
+ 'act_email_cc': fields.char('Add watchers (Cc)', size=250, help="These people will receive a copy of the future communication between partner and users by email"),
'act_remind_partner': fields.boolean('Remind Partner', help="Check this if you want the rule to send a reminder by email to the partner."),
'act_remind_user': fields.boolean('Remind responsible', help="Check this if you want the rule to send a reminder by email to the user."),
'act_remind_attach': fields.boolean('Remind with attachment', help="Check this if you want that all documents attached to the case be attached to the reminder email sent."),
- 'act_mail_to_user': fields.boolean('Mail to responsible'),
- 'act_mail_to_partner': fields.boolean('Mail to partner'),
- 'act_mail_to_watchers': fields.boolean('Mail to watchers (Cc)'),
- 'act_mail_to_email': fields.char('Mail to these emails', size=128),
- 'act_mail_body': fields.text('Mail body')
+ 'act_mail_to_user': fields.boolean('Mail to responsible',help="Check this if you want the rule to send an email to the responsible person."),
+ 'act_mail_to_partner': fields.boolean('Mail to partner',help="Check this if you want the rule to send an email to the partner."),
+ 'act_mail_to_watchers': fields.boolean('Mail to watchers (CC)',help="Check this if you want the rule to mark CC(mail to any other person defined in actions)."),
+ 'act_mail_to_email': fields.char('Mail to these emails', size=128,help="Email-id of the persons whom mail is to be sent"),
+ 'act_mail_body': fields.text('Mail body',help="Content of mail"),
+ 'regex_name' : fields.char('Regular Expression on Case Name', size=128),
+ 'regex_history' : fields.char('Regular Expression on Case History', size=128),
+ 'server_action_id' : fields.many2one('ir.actions.server','Server Action',help="Describes the action name." \
+ "eg:on which object which ation to be taken on basis of which condition"),
}
_defaults = {
'active': lambda *a: 1,
@@ -334,23 +441,27 @@ class crm_case(osv.osv):
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'active': fields.boolean('Active'),
'description': fields.text('Your action'),
- 'section_id': fields.many2one('crm.case.section', 'Section', required=True, select=True),
- 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"),
+ 'section_id': fields.many2one('crm.case.section', 'Section', required=True, select=True, help='Section to which Case belongs to. Define Responsible user and Email account for mail gateway.'),
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]", help='Category related to the section.Subdivide the CRM cases independently or section-wise.'),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
'probability': fields.float('Probability (%)'),
- 'email_from': fields.char('Partner Email', size=128),
- 'email_cc': fields.char('Watchers Emails', size=252),
+ 'email_from': fields.char('Partner Email', size=128, help="These people will receive email."),
+ 'email_cc': fields.char('Watchers Emails', size=252 , help="These people will receive a copy of the future" \
+ " communication between partner and users by email"),
'email_last': fields.function(_email_last, method=True,
string='Latest E-Mail', type='text'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', domain="[('partner_id','=',partner_id)]"),
- 'som': fields.many2one('res.partner.som', 'State of Mind'),
+ 'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
+ "the partner mentality in relation to our services.The scale has" \
+ "to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'date': fields.datetime('Date'),
'create_date': fields.datetime('Created' ,readonly=True),
'date_deadline': fields.datetime('Deadline'),
'date_closed': fields.datetime('Closed', readonly=True),
- 'canal_id': fields.many2one('res.partner.canal', 'Channel'),
+ 'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
+ " With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'user_id': fields.many2one('res.users', 'Responsible'),
'history_line': fields.one2many('crm.case.history', 'case_id', 'Communication', readonly=1),
'log_ids': fields.one2many('crm.case.log', 'case_id', 'Logs History', readonly=1),
@@ -429,6 +540,28 @@ class crm_case(osv.osv):
)
ok = ok and (not action.trg_priority_from or action.trg_priority_from>=case.priority)
ok = ok and (not action.trg_priority_to or action.trg_priority_to<=case.priority)
+
+ reg_name = action.regex_name
+ result_name = True
+ if reg_name:
+ ptrn = re.compile(str(reg_name))
+ _result = ptrn.search(str(case.name))
+ if not _result:
+ result_name = False
+ regex_n = not reg_name or result_name
+ ok = ok and regex_n
+
+ reg_history = action.regex_history
+ result_history = True
+ if reg_history:
+ ptrn = re.compile(str(reg_history))
+ if case.history_line:
+ _result = ptrn.search(str(case.history_line[0].description))
+ if not _result:
+ result_history = False
+ regex_h = not reg_history or result_history
+ ok = ok and regex_h
+
if not ok:
continue
@@ -466,6 +599,9 @@ class crm_case(osv.osv):
ok = action.trg_date_type=='none'
if ok:
+ if action.server_action_id:
+ context.update({'active_id':case.id,'active_ids':[case.id]})
+ self.pool.get('ir.actions.server').run(cr, uid, [action.server_action_id.id], context)
write = {}
if action.act_state:
case.state = action.act_state
@@ -515,7 +651,7 @@ class crm_case(osv.osv):
return True
def format_body(self, body):
- return (body or u'').encode('utf8', 'replace')
+ return body and tools.ustr(body.encode('ascii', 'replace')) or ''
def format_mail(self, case, body):
data = {
@@ -610,13 +746,13 @@ class crm_case(osv.osv):
def remind_user(self, cr, uid, ids, context={}, attach=False,
destination=True):
for case in self.browse(cr, uid, ids):
+ if not case.section_id.reply_to:
+ raise osv.except_osv(_('Error!'),("Reply TO is not specified in Section"))
+ if not case.email_from:
+ raise osv.except_osv(_('Error!'),("Partner Email is not specified in Case"))
if case.section_id.reply_to and case.email_from:
src = case.email_from
- if not src:
- raise osv.except_osv(_('Error!'),
- _("No E-Mail ID Found for the Responsible Partner or missing reply address in section!"))
-
dest = case.section_id.reply_to
body = case.email_last or case.description
if not destination:
@@ -633,7 +769,7 @@ class crm_case(osv.osv):
attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send)
# Send an email
- tools.email_send(
+ flag = tools.email_send(
src,
dest,
"Reminder: [%s] %s" % (str(case.id), case.name, ),
@@ -642,7 +778,10 @@ class crm_case(osv.osv):
tinycrm=str(case.id),
attach=attach_to_send
)
-
+ if flag:
+ raise osv.except_osv(_('Email!'),("Email Successfully Sent"))
+ else:
+ raise osv.except_osv(_('Email Fail!'),("Email is not sent successfully"))
return True
def add_reply(self, cursor, user, ids, context=None):
@@ -802,7 +941,7 @@ class crm_case_log(osv.osv):
_description = "Case Communication History"
_order = "id desc"
_columns = {
- 'name': fields.char('Action', size=64),
+ 'name': fields.char('Status', size=64),
'som': fields.many2one('res.partner.som', 'State of Mind'),
'date': fields.datetime('Date'),
'canal_id': fields.many2one('res.partner.canal', 'Channel'),
diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml
index 7ba270d268f..5cef12fa45a 100644
--- a/addons/crm/crm_data.xml
+++ b/addons/crm/crm_data.xml
@@ -66,6 +66,17 @@
-
+
+
+ Check Email (Fetchmail)
+ 5
+ minutes
+ -1
+
+
+
+
+
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index 3b425ba0f3c..161795a89cb 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -3,6 +3,8 @@
+
+ res.partner.events.form
@@ -37,7 +39,32 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+ crm.email.gateway.tree
+ crm.email.gateway
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ Email Gateway
+ crm.email.gateway
+ form
+ tree,form
+
+
+
diff --git a/addons/crm/crm_wizard.xml b/addons/crm/crm_wizard.xml
index 079dd3191c1..9e96530a782 100644
--- a/addons/crm/crm_wizard.xml
+++ b/addons/crm/crm_wizard.xml
@@ -2,6 +2,12 @@
+
+
+
diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py
index 6901fde7a14..e3a10d1a5c8 100755
--- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py
+++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py
@@ -101,7 +101,8 @@ class email_parser(object):
'email_cc': self._decode_header(msg['Cc'] or ''),
'canal_id': self.canal_id,
'user_id': False,
- 'history_line': [(0, 0, {'name': 'Create','section_id': self.section_id,'canal_id': self.canal_id,'description': message['body'], 'email': msg['From'] })],
+ 'description': message['body'],
+ 'history_line': [(0, 0, {'description': message['body'], 'email': msg['From'] })],
}
try:
data.update(self.partner_get(self._decode_header(msg['From'])))
@@ -154,7 +155,7 @@ class email_parser(object):
if part.get_content_maintype() == 'multipart':
continue
- if part.get_content_maintype()=='text' and part.get_content_subtype() == 'plain':
+ if part.get_content_maintype()=='text' and part.get_content_subtype() in ('plain','html'):
buf = part.get_payload(decode=True)
if buf:
txt = buf.decode(part.get_charsets()[0] or 'ascii', 'replace')
@@ -191,7 +192,8 @@ class email_parser(object):
body['body'] = body_data
data = {
- 'history_line': [(0, 0, {'name': 'Close','section_id': self.section_id,'canal_id': self.canal_id,'description': body['body'], 'email': msg['From']})],
+ 'description': body['body'],
+ 'history_line': [(0, 0, {'description': body['body'], 'email': msg['From']})],
}
act = 'case_close'
if 'state' in actions:
@@ -246,7 +248,8 @@ class email_parser(object):
self.rpc('crm.case', act, [id])
body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n')))
data = {
- 'history_line': [(0, 0, {'name': 'Open','section_id': self.section_id,'canal_id': self.canal_id,'description': body, 'email': msg['From'][:84]})],
+ 'description':body,
+ 'history_line': [(0, 0, {'description': body, 'email': msg['From'][:84]})],
}
self.rpc('crm.case', 'write', [id], data)
return id
diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py
index aef0ed3d143..0ee363ca04e 100644
--- a/addons/crm/wizard/__init__.py
+++ b/addons/crm/wizard/__init__.py
@@ -21,6 +21,9 @@
##############################################################################
import crm_wizard
+import wizard_crm_send_email
+import wizard_crm_new_send_email
+import wizard_fetch_mail
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/wizard/wizard_crm_new_send_email.py b/addons/crm/wizard/wizard_crm_new_send_email.py
new file mode 100644
index 00000000000..5375676bf79
--- /dev/null
+++ b/addons/crm/wizard/wizard_crm_new_send_email.py
@@ -0,0 +1,101 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from mx.DateTime import now
+
+import wizard
+import netsvc
+import ir
+import pooler
+import tools
+from tools.translate import _
+
+
+email_send_form = '''
+
+
+
+
+
+
+
+
+
'''
+
+email_send_fields = {
+ 'to': {'string':"To", 'type':'char', 'size':64, 'required':True},
+ 'cc': {'string':"CC", 'type':'char', 'size':128,},
+ 'subject': {'string':'Subject', 'type':'char', 'size':128, 'required':True},
+ 'text': {'string':'Message', 'type':'text_tag', 'required':True}
+}
+
+# this sends an email to ALL the addresses of the selected partners.
+def _mass_mail_send(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ case_pool=pool.get('crm.case')
+
+ case = case_pool.browse(cr,uid,data['ids'])[0]
+ case_pool._history(cr, uid, [case], _('Send'), history=True, email=False)
+ case_pool.write(cr, uid, [case.id], {
+ 'som': False,
+ 'canal_id': False,
+ })
+ emails = [data['form']['to']] + (data['form']['cc'] or '').split(',')
+ emails = filter(None, emails)
+ body = data['form']['text']
+ if case.user_id.signature:
+ body += '\n\n%s' % (case.user_id.signature)
+ tools.email_send(
+ case.user_id.address_id.email,
+ emails,
+ data['form']['subject'],
+ case_pool.format_body(body),
+ reply_to=case.section_id.reply_to,
+ tinycrm=str(case.id)
+ )
+ return {}
+
+def _get_info(self, cr, uid, data, context):
+ if not data['id']:
+ return {}
+ pool = pooler.get_pool(cr.dbname)
+ case = pool.get('crm.case').browse(cr,uid,data['ids'])[0]
+ if not case.email_from:
+ raise wizard.except_wizard(_('Error'),_('You must put a Partner eMail to use this action!'))
+ if not case.user_id:
+ raise wizard.except_wizard(_('Error'),_('You must define a responsible user for this case in order to use this action!'))
+ return {'to': case.email_from,'subject': '['+str(case.id)+'] '+case.name,'cc': case.email_cc or ''}
+
+class wizard_send_mail(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [_get_info],
+ 'result': {'type': 'form', 'arch': email_send_form, 'fields': email_send_fields, 'state':[('end','Cancel','gtk-cancel'), ('send','Send Email','gtk-go-forward')]}
+ },
+ 'send': {
+ 'actions': [_mass_mail_send],
+ 'result': {'type': 'state', 'state':'end'}
+ }
+ }
+wizard_send_mail('crm.new.send.mail')
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/crm/wizard/wizard_crm_send_email.py b/addons/crm/wizard/wizard_crm_send_email.py
new file mode 100644
index 00000000000..669aa885c6a
--- /dev/null
+++ b/addons/crm/wizard/wizard_crm_send_email.py
@@ -0,0 +1,103 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from mx.DateTime import now
+
+import wizard
+import netsvc
+import ir
+import pooler
+import tools
+from tools.translate import _
+
+
+email_send_form = '''
+
+
+
+
+
+
+
+
+
'''
+
+email_send_fields = {
+ 'to': {'string':"To", 'type':'char', 'size':64, 'required':True},
+ 'cc': {'string':"CC", 'type':'char', 'size':128,},
+ 'subject': {'string':'Subject', 'type':'char', 'size':128, 'required':True},
+ 'text': {'string':'Message', 'type':'text_tag', 'required':True}
+}
+
+# this sends an email to ALL the addresses of the selected partners.
+def _mass_mail_send(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ case_pool=pool.get('crm.case')
+
+ hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0]
+ case = hist_obj.log_id.case_id
+ case_pool._history(cr, uid, [case], _('Send'), history=True, email=False)
+ case_pool.write(cr, uid, [case.id], {
+ 'som': False,
+ 'canal_id': False,
+ })
+ emails = [data['form']['to']] + (data['form']['cc'] or '').split(',')
+ emails = filter(None, emails)
+ body = data['form']['text']
+ if case.user_id.signature:
+ body += '\n\n%s' % (case.user_id.signature)
+ tools.email_send(
+ case.user_id.address_id.email,
+ emails,
+ data['form']['subject'],
+ case_pool.format_body(body),
+ reply_to=case.section_id.reply_to,
+ tinycrm=str(case.id)
+ )
+ return {}
+
+def _get_info(self, cr, uid, data, context):
+ if not data['id']:
+ raise wizard.except_wizard(_('Error'),_('There is no mail to reply!'))
+ pool = pooler.get_pool(cr.dbname)
+ hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0]
+ case = hist_obj.log_id.case_id
+ if not case.email_from:
+ raise wizard.except_wizard(_('Error'),_('You must put a Partner eMail to use this action!'))
+ if not case.user_id:
+ raise wizard.except_wizard(_('Error'),_('You must define a responsible user for this case in order to use this action!'))
+ return {'to': case.email_from,'subject': '['+str(case.id)+'] '+case.name,'cc': case.email_cc or '', 'text': '> ' + case.description.replace('\n','\n> ')}
+
+class wizard_send_mail(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [_get_info],
+ 'result': {'type': 'form', 'arch': email_send_form, 'fields': email_send_fields, 'state':[('end','Cancel','gtk-cancel'), ('send','Send Email','gtk-go-forward')]}
+ },
+ 'send': {
+ 'actions': [_mass_mail_send],
+ 'result': {'type': 'state', 'state':'end'}
+ }
+ }
+wizard_send_mail('crm.send.mail')
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/crm/wizard/wizard_fetch_mail.py b/addons/crm/wizard/wizard_fetch_mail.py
new file mode 100644
index 00000000000..54206dad0db
--- /dev/null
+++ b/addons/crm/wizard/wizard_fetch_mail.py
@@ -0,0 +1,53 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import wizard
+import time
+import pooler
+import tools
+import os
+_email_form = '''
+
+
+
'''
+
+_email_fields = {
+ }
+
+def fetch_mail(self , cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ gateway_pool=pool.get('crm.email.gateway')
+ gateway_pool.fetch_mail(cr, uid, data['ids'], context=context)
+ return {}
+
+class wiz_fetch_mail(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch':_email_form, 'fields':_email_fields, 'state':[('run','Run','gtk-execute'),('end','Cancel','gtk-cancel')]}
+ },
+ 'run': {
+ 'actions': [fetch_mail],
+ 'result': {'type': 'state', 'state': 'end'}
+ },
+ }
+wiz_fetch_mail('crm.case.section.fetchmail')
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_configuration/__terp__.py b/addons/crm_configuration/__terp__.py
index 6d0cd665546..0964b63b369 100644
--- a/addons/crm_configuration/__terp__.py
+++ b/addons/crm_configuration/__terp__.py
@@ -31,7 +31,7 @@ people to intelligently and efficiently manage tasks, issues,
and requests. It manages key tasks such as communication,
identification, prioritization, assignment, resolution and notification.
-This module provide screens like: jobs hiring process, leads, business
+This module provide screens like: jobs hiring process, prospects, business
opportunities, fund raising tracking, support & helpdesk, calendar of
meetings, eso.
""",
diff --git a/addons/crm_configuration/crm_bugs_menu.xml b/addons/crm_configuration/crm_bugs_menu.xml
index 810b46e4d43..218acd0e420 100644
--- a/addons/crm_configuration/crm_bugs_menu.xml
+++ b/addons/crm_configuration/crm_bugs_menu.xml
@@ -40,6 +40,8 @@
tree,calendar
+
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -92,10 +92,33 @@
+
+
+ hr.expense.expense.filter
+ hr.expense.expense
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
All expenseshr.expense.expenseform
+
@@ -191,8 +191,9 @@
formtree,form[('state','=','open')]
+
-
+
@@ -202,7 +203,7 @@
tree,form[('user_id', '=', uid)]
-
+ My Draft Ideas
@@ -210,12 +211,13 @@
formtree,form[('state','=','draft'),('user_id','=',uid)]
+
-
+ action="action_idea_idea_draft_my"
+ groups="base.group_extended_menu" />
My Open Ideas
@@ -223,11 +225,14 @@
formtree,form[('state','=','open'),('user_id','=',uid)]
+
+ action="action_idea_idea_open_my"
+ groups="base.group_extended_menu"
+ />
idea.vote_stat.graph
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index caef74d4540..f5d4c7cd15e 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -127,9 +127,11 @@ class mrp_routing_workcenter(osv.osv):
'name': fields.char('Name', size=64, required=True),
'sequence': fields.integer('Sequence'),
'cycle_nbr': fields.float('Number of Cycle', required=True,
- help="A cycle is defined in the workcenter definition."),
- 'hour_nbr': fields.float('Number of Hours', required=True),
- 'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True),
+ help="Time in hours for doing one cycle."),
+ 'hour_nbr': fields.float('Number of Hours', required=True, help="Cost per hour"),
+ 'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True,
+ help="routing indicates all the workcenters used, for how long and/or cycles." \
+ "If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."),
'note': fields.text('Description')
}
_defaults = {
@@ -186,9 +188,9 @@ class mrp_bom(osv.osv):
'position': fields.char('Internal Ref.', size=64, help="Reference to a position in an external plan."),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_uos_qty': fields.float('Product UOS Qty'),
- 'product_uos': fields.many2one('product.uom', 'Product UOS'),
+ 'product_uos': fields.many2one('product.uom', 'Product UOS', help="Product UOS (Unit of Sale) is the unit of measurement for the invoicing and promotion of stock."),
'product_qty': fields.float('Product Qty', required=True),
- 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, help="UoM (Unit of Measure) is the unit of measurement for the inventory control"),
'product_rounding': fields.float('Product Rounding', help="Rounding applied on the product quantity. For integer only values, put 1.0"),
'product_efficiency': fields.float('Product Efficiency', required=True, help="Efficiency on the production. A factor of 0.9 means a loss of 10% in the production."),
'bom_lines': fields.one2many('mrp.bom', 'bom_id', 'BoM Lines'),
@@ -421,7 +423,7 @@ class mrp_production(osv.osv):
'date_finnished': fields.datetime('End Date'),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)]),
- 'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null'),
+ 'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', help="The list of operations (list of workcenters) to produce the finished product. The routing is mainly used to compute workcenter costs during operations and to plan futur loads on workcenters based on production plannification."),
'picking_id': fields.many2one('stock.picking', 'Packing list', readonly=True,
help="This is the internal picking list take bring the raw materials to the production plan."),
@@ -432,7 +434,7 @@ class mrp_production(osv.osv):
'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods'),
'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Workcenters Utilisation'),
- 'state': fields.selection([('draft','Draft'),('picking_except', 'Packing Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Canceled'),('done','Done')],'Status', readonly=True),
+ 'state': fields.selection([('draft','Draft'),('picking_except', 'Packing Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'Status', readonly=True),
'hour_total': fields.function(_production_calc, method=True, type='float', string='Total Hours', multi='workorder'),
'cycle_total': fields.function(_production_calc, method=True, type='float', string='Total Cycles', multi='workorder'),
@@ -779,6 +781,7 @@ mrp_production_product_line()
class mrp_procurement(osv.osv):
_name = "mrp.procurement"
_description = "Procurement"
+ _order = 'priority,date_planned'
_columns = {
'name': fields.char('Name', size=64, required=True),
'origin': fields.char('Origin', size=64,
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 83a1b4423a8..04a93ac71ee 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -453,7 +453,7 @@
-
+
@@ -470,13 +470,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -518,6 +518,26 @@
+
+
+ mrp.production.select
+ mrp.production
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Production Ordersir.actions.act_window
@@ -525,6 +545,7 @@
formtree,form,calendar,graph,gantt
+
@@ -540,7 +561,7 @@
action="mrp_production_action2_gantt"
id="menu_production_orders_start_gantt"
parent="menu_mrp_production_action"
- sequence="20"/>
+ sequence="20" icon="terp-calendar"/>
Production Orders To Start
@@ -549,8 +570,10 @@
formtree,form,calendar,graph,gantt[('state','=','ready')]
+
+
-
+ Production Orders in Progressir.actions.act_window
@@ -558,8 +581,10 @@
formtree,form,calendar,graph,gantt[('state','=','in_production')]
+
+
-
+ Production Orders Waiting Productsir.actions.act_window
@@ -567,8 +592,10 @@
formtree,form,calendar,graph,gantt[('state','=','confirmed')]
+
+
-
+ New Production Order
@@ -696,11 +723,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -738,7 +765,7 @@
tree,form[('state','=','confirmed')]
-
+ Exceptions Procurements
@@ -748,7 +775,7 @@
tree,form[('state','=','exception')]
-
+ Exceptions Procurements to Fix
@@ -758,7 +785,7 @@
tree,form[('state','=','exception'), ('message', '<>', '')]
-
+ Temporary Procurement Exceptions
@@ -768,7 +795,7 @@
tree,form[('state','=','exception'), ('message', '=', '')]
-
+ New Procurement
diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py
index 22bca594c95..4cbd01aa60e 100644
--- a/addons/mrp/schedulers.py
+++ b/addons/mrp/schedulers.py
@@ -58,7 +58,7 @@ class mrp_procurement(osv.osv):
report_except = 0
report_later = 0
while True:
- cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset))
+ cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset))
ids = map(lambda x: x[0], cr.fetchall())
for proc in procurement_obj.browse(cr, uid, ids):
if (maxdate.strftime('%Y-%m-%d')>=proc.date_planned) or (proc.procure_method=='make_to_order'):
diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py
index 059f6a5a0e1..19e9c3ebaf7 100644
--- a/addons/mrp_operations/mrp_operations.py
+++ b/addons/mrp_operations/mrp_operations.py
@@ -72,7 +72,7 @@ class mrp_production_workcenter_line(osv.osv):
_columns = {
'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Canceled'),('done','Finished')],'Status', readonly=True),
'date_start_date': fields.function(_get_date_date, method=True, string='Start Date', type='date'),
- 'date_planned': fields.datetime('Scheduled Date'),
+ 'date_planned': fields.related('production_id', 'date_planned', type='datetime', string='Date Planned'),
'date_planned_end': fields.function(_get_date_end, method=True, string='End Date', type='datetime'),
'date_start': fields.datetime('Start Date'),
'date_finnished': fields.datetime('End Date'),
@@ -290,7 +290,7 @@ class mrp_operations_operation_code(osv.osv):
_columns={
'name': fields.char('Operation Name',size=64, required=True),
'code': fields.char('Code', size=16, required=True),
- 'start_stop': fields.selection([('start','Start'),('pause','Pause'),('resume','Resume'),('cancel','Cancel'),('done','Done')], 'Status', required=True),
+ 'start_stop': fields.selection([('start','Start'),('pause','Pause'),('resume','Resume'),('cancel','Cancelled'),('done','Done')], 'Status', required=True),
}
mrp_operations_operation_code()
diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml
index 7f248929dd5..7341c31c8d5 100644
--- a/addons/mrp_operations/mrp_operations_view.xml
+++ b/addons/mrp_operations/mrp_operations_view.xml
@@ -19,8 +19,8 @@
-
-
+
+
@@ -151,6 +151,7 @@
formtree,form,graph,gantt,calendar[('production_state','=','ready')]
+
@@ -162,6 +163,7 @@
formtree,form,graph[('state','=','draft')]
+
diff --git a/addons/product/product.py b/addons/product/product.py
index 12201761466..207e29cc11c 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -102,6 +102,11 @@ class product_uom(osv.osv):
'rounding': lambda *a: 0.01,
}
+ _sql_constraints = [
+ ('factor_gt_zero', 'CHECK (factor!=0)', 'Value of the factor can never be 0 !'),
+ ('factor_inv_data_gt_zero', 'CHECK (factor_inv_data!=0)', 'Value of the factor_inv_data can never be 0 !'),
+ ]
+
def _compute_qty(self, cr, uid, from_uom_id, qty, to_uom_id=False):
if not from_uom_id or not qty or not to_uom_id:
return qty
@@ -246,7 +251,7 @@ class product_template(osv.osv):
'sale_delay': fields.float('Customer Lead Time', help="This is the average time between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
'produce_delay': fields.float('Manufacturing Lead Time', help="Average time to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different delays will be summed for all levels and purchase orders."),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procure Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
- 'rental': fields.boolean('Rentable Product'),
+ 'rental': fields.boolean('Can be Rent'),
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True),
'list_price': fields.float('Sale Price', digits=(16, int(config['price_accuracy'])), help="Base price for computing the customer price. Sometimes called the catalog price."),
'standard_price': fields.float('Cost Price', required=True, digits=(16, int(config['price_accuracy'])), help="The cost of the product for accounting stock valuation. It can serves as a base price for supplier price."),
@@ -390,8 +395,8 @@ class product_product(osv.osv):
product = self.browse(cr, uid, [product_id], context)[0]
for supinfo in product.seller_ids:
if supinfo.name.id == partner_id:
- return {'code': supinfo.product_code, 'name': supinfo.product_name}
- return {'code' : product.default_code, 'name' : product.name}
+ return {'code': supinfo.product_code, 'name': supinfo.product_name, 'variants': ''}
+ return {'code' : product.default_code, 'name' : product.name, 'variants': product.variants}
def _product_code(self, cr, uid, ids, name, arg, context={}):
res = {}
@@ -403,12 +408,14 @@ class product_product(osv.osv):
res = {}
for p in self.browse(cr, uid, ids, context):
data = self._get_partner_code_name(cr, uid, [], p.id, context.get('partner_id', None), context)
+ if not data['variants']:
+ data['variants'] = p.variants
if not data['code']:
data['code'] = p.code
if not data['name']:
data['name'] = p.name
res[p.id] = (data['code'] and ('['+data['code']+'] ') or '') + \
- (data['name'] or '')
+ (data['name'] or '') + (data['variants'] and (' - '+data['variants']) or '')
return res
_defaults = {
@@ -438,6 +445,7 @@ class product_product(osv.osv):
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the packing order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits=(16, int(config['price_accuracy']))),
'price_margin': fields.float('Variant Price Margin', digits=(16, int(config['price_accuracy']))),
+ 'pricelist_id': fields.dummy(string='Pricelist',relation='product.pricelist', type='many2one'),
}
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
@@ -530,7 +538,13 @@ class product_product(osv.osv):
if not context:
context={}
- if ('variant' in context) and context['variant']:
+ product = self.read(cr, uid, id, ['name'], context=context)
+ if not default:
+ default = {}
+ default = default.copy()
+ default['name'] = product['name'] + _(' (copy)')
+
+ if context.get('variant',False):
fields = ['product_tmpl_id', 'active', 'variants', 'default_code',
'price_margin', 'price_extra']
data = self.read(cr, uid, id, fields=fields, context=context)
@@ -573,6 +587,18 @@ class product_packaging(osv.osv):
'length': fields.float('Length', help='The length of the package'),
}
+ _order = 'sequence'
+
+ def name_get(self, cr, uid, ids, context={}):
+ if not len(ids):
+ return []
+ res = []
+ for pckg in self.browse(cr, uid, ids,context=context):
+ p_name = pckg.ean and '[' + pckg.ean + '] ' or ''
+ p_name += pckg.ul.name
+ res.append((pckg.id,p_name))
+ return res
+
def _get_1st_ul(self, cr, uid, context={}):
cr.execute('select id from product_ul order by id asc limit 1')
res = cr.fetchone()
diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml
index 87b28be3bdb..2f000fdbfc6 100644
--- a/addons/product/product_data.xml
+++ b/addons/product/product_data.xml
@@ -12,6 +12,9 @@
Weight
+
+ Working Time
+
+
+
+ Analysis
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 29c67ee640a..5177fce9f88 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -12,11 +12,13 @@
form