[MERGE] addons 16 sale
bzr revid: fp@openerp.com-20121102162611-3nt9oo1zcyzjh81l
This commit is contained in:
commit
f47bf0fd0b
|
@ -277,7 +277,7 @@
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<section>
|
<section>
|
||||||
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer</para>
|
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer.</para>
|
||||||
</section>
|
</section>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
|
|
|
@ -236,7 +236,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||||
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
|
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
|
||||||
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
|
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||||
'phone': fields.char("Phone", size=64),
|
'phone': fields.char("Phone", size=64),
|
||||||
'date_deadline': fields.date('Expected Closing'),
|
'date_deadline': fields.date('Expected Closing', help="Estimate of the date on which the opportunity will be won."),
|
||||||
'date_action': fields.date('Next Action Date', select=True),
|
'date_action': fields.date('Next Action Date', select=True),
|
||||||
'title_action': fields.char('Next Action', size=64),
|
'title_action': fields.char('Next Action', size=64),
|
||||||
'color': fields.integer('Color Index'),
|
'color': fields.integer('Color Index'),
|
||||||
|
|
|
@ -338,7 +338,7 @@ class event_registration(osv.osv):
|
||||||
'date_closed': fields.datetime('Attended Date', readonly=True),
|
'date_closed': fields.datetime('Attended Date', readonly=True),
|
||||||
'date_open': fields.datetime('Registration Date', readonly=True),
|
'date_open': fields.datetime('Registration Date', readonly=True),
|
||||||
'reply_to': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
|
'reply_to': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
|
||||||
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('email_from', '=', False),('model','=',_name)]),
|
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('model','=',_name)]),
|
||||||
'event_end_date': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
|
'event_end_date': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
|
||||||
'event_begin_date': fields.related('event_id', 'date_begin', type='datetime', string="Event Start Date", readonly=True),
|
'event_begin_date': fields.related('event_id', 'date_begin', type='datetime', string="Event Start Date", readonly=True),
|
||||||
'user_id': fields.many2one('res.users', 'User', states={'done': [('readonly', True)]}),
|
'user_id': fields.many2one('res.users', 'User', states={'done': [('readonly', True)]}),
|
||||||
|
|
|
@ -4,10 +4,13 @@ import random
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
import urllib2
|
import urllib2
|
||||||
|
import logging
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from openerp.tools.misc import html2plaintext
|
from openerp.tools.misc import html2plaintext
|
||||||
from py_etherpad import EtherpadLiteClient
|
from py_etherpad import EtherpadLiteClient
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class pad_common(osv.osv_memory):
|
class pad_common(osv.osv_memory):
|
||||||
_name = 'pad.common'
|
_name = 'pad.common'
|
||||||
|
|
||||||
|
@ -59,10 +62,13 @@ class pad_common(osv.osv_memory):
|
||||||
def pad_get_content(self, cr, uid, url, context=None):
|
def pad_get_content(self, cr, uid, url, context=None):
|
||||||
content = ''
|
content = ''
|
||||||
if url:
|
if url:
|
||||||
page = urllib2.urlopen('%s/export/html'%url).read()
|
try:
|
||||||
mo = re.search('<body>(.*)</body>',page)
|
page = urllib2.urlopen('%s/export/html'%url).read()
|
||||||
if mo:
|
mo = re.search('<body>(.*)</body>',page)
|
||||||
content = mo.group(1)
|
if mo:
|
||||||
|
content = mo.group(1)
|
||||||
|
except:
|
||||||
|
_logger.warning("No url found '%s'.", url)
|
||||||
return content
|
return content
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
|
@ -636,7 +636,7 @@ class sale_advance_payment_inv(osv.osv_memory):
|
||||||
result = super(sale_advance_payment_inv, self)._create_invoices(cr, uid, inv_values, sale_id, context=context)
|
result = super(sale_advance_payment_inv, self)._create_invoices(cr, uid, inv_values, sale_id, context=context)
|
||||||
sale_obj = self.pool.get('sale.order')
|
sale_obj = self.pool.get('sale.order')
|
||||||
sale_line_obj = self.pool.get('sale.order.line')
|
sale_line_obj = self.pool.get('sale.order.line')
|
||||||
wizard = self.browse(cr, uid, ids[0], context)
|
wizard = self.browse(cr, uid, [result], context)
|
||||||
sale = sale_obj.browse(cr, uid, sale_id, context=context)
|
sale = sale_obj.browse(cr, uid, sale_id, context=context)
|
||||||
if sale.order_policy == 'postpaid':
|
if sale.order_policy == 'postpaid':
|
||||||
raise osv.except_osv(
|
raise osv.except_osv(
|
||||||
|
@ -646,8 +646,8 @@ class sale_advance_payment_inv(osv.osv_memory):
|
||||||
|
|
||||||
# If invoice on picking: add the cost on the SO
|
# If invoice on picking: add the cost on the SO
|
||||||
# If not, the advance will be deduced when generating the final invoice
|
# If not, the advance will be deduced when generating the final invoice
|
||||||
line_name = inv_values.get('invoice_line') and inv_values.get('invoice_line')[2].get('name') or ''
|
line_name = inv_values.get('invoice_line') and inv_values.get('invoice_line')[0][2].get('name') or ''
|
||||||
line_tax = inv_values.get('invoice_line') and inv_values.get('invoice_line')[2].get('invoice_line_tax_id') or False
|
line_tax = inv_values.get('invoice_line') and inv_values.get('invoice_line')[0][2].get('invoice_line_tax_id') or False
|
||||||
if sale.order_policy == 'picking':
|
if sale.order_policy == 'picking':
|
||||||
vals = {
|
vals = {
|
||||||
'order_id': sale.id,
|
'order_id': sale.id,
|
||||||
|
|
Loading…
Reference in New Issue