[MERGE] Forward-port of latest saas-1 bugfixes, up to rev. 8788 dle@openerp.com-20131003094541-ro29hhkas03rdvw8
bzr revid: odo@openerp.com-20131003111222-upt1ytb92db50zay
This commit is contained in:
commit
5cba82e2c9
|
@ -655,7 +655,7 @@ class account_analytic_account(osv.osv):
|
|||
if not contract.partner_id:
|
||||
raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name )
|
||||
|
||||
fpos = contract.partner_id.property_account_position.id or False
|
||||
fpos = contract.partner_id.property_account_position or False
|
||||
journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', contract.company_id.id or False)], limit=1)
|
||||
if not journal_ids:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
|
@ -673,7 +673,7 @@ class account_analytic_account(osv.osv):
|
|||
'journal_id': len(journal_ids) and journal_ids[0] or False,
|
||||
'date_invoice': contract.recurring_next_date,
|
||||
'origin': contract.name,
|
||||
'fiscal_position': fpos,
|
||||
'fiscal_position': fpos and fpos.id,
|
||||
'payment_term': partner_payment_term,
|
||||
'company_id': contract.company_id.id or False,
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ class account_analytic_account(osv.osv):
|
|||
account_id = res.categ_id.property_account_income_categ.id
|
||||
account_id = fpos_obj.map_account(cr, uid, fpos, account_id)
|
||||
|
||||
taxes = res.taxes_id and res.taxes_id or False
|
||||
taxes = res.taxes_id or False
|
||||
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
invoice_line_vals = {
|
||||
|
|
|
@ -63,7 +63,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
|||
for id in ids:
|
||||
tomerge.add(id)
|
||||
if email:
|
||||
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0]), ('probability', '<', '100')])
|
||||
ids = lead_obj.search(cr, uid, [('email_from', '=ilike', email[0]), ('probability', '<', '100')])
|
||||
for id in ids:
|
||||
tomerge.add(id)
|
||||
|
||||
|
|
|
@ -1218,7 +1218,7 @@ openerp.mail = function (session) {
|
|||
init: function (parent, datasets, options) {
|
||||
var self = this;
|
||||
this._super(parent, options);
|
||||
this.MailWidget = parent.__proto__ == mail.Widget.prototype ? parent : false;
|
||||
this.MailWidget = parent instanceof mail.Widget ? parent : false;
|
||||
this.domain = options.domain || [];
|
||||
this.context = _.extend(options.context || {});
|
||||
|
||||
|
|
|
@ -292,8 +292,10 @@ class mrp_bom(osv.osv):
|
|||
"""
|
||||
if properties is None:
|
||||
properties = []
|
||||
cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
domain = [('product_id', '=', product_id), ('bom_id', '=', False),
|
||||
'|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)),
|
||||
'|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))]
|
||||
ids = self.search(cr, uid, domain)
|
||||
max_prop = 0
|
||||
result = False
|
||||
for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):
|
||||
|
|
|
@ -162,7 +162,7 @@ class pos_details(report_sxw.rml_parse):
|
|||
for tax in line_taxes['taxes']:
|
||||
taxes.setdefault(tax['id'], {'name': tax['name'], 'amount':0.0})
|
||||
taxes[tax['id']]['amount'] += tax['amount']
|
||||
return [value for value in taxes.values()] or False
|
||||
return taxes.values()
|
||||
|
||||
def _get_user_names(self, user_ids):
|
||||
user_obj = self.pool.get('res.users')
|
||||
|
|
|
@ -31,3 +31,9 @@ class portal(osv.osv):
|
|||
'is_portal': fields.boolean('Portal', help="If checked, this group is usable as a portal."),
|
||||
}
|
||||
|
||||
class res_users(osv.Model):
|
||||
_inherit = 'res.users'
|
||||
def _signup_create_user(self, cr, uid, values, context=None):
|
||||
values['share'] = True
|
||||
return super(res_users, self)._signup_create_user(cr, uid, values, context=context)
|
||||
|
||||
|
|
|
@ -103,4 +103,10 @@
|
|||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<data>
|
||||
<record id="auth_signup.default_template_user" model="res.users">
|
||||
<field name="share" eval="True"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
Mr Demo Portal</field>
|
||||
<!-- Avoid auto-including this user in any default group -->
|
||||
<field name="groups_id" eval="[(5,)]"/>
|
||||
<field name="share" eval="True" />
|
||||
</record>
|
||||
|
||||
<!-- Add the demo user to the portal (and therefore to the portal member group) -->
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="contact_form_view"/>
|
||||
<field name="target">inline</field>
|
||||
<field name="context">{'default_type': 'lead'}</field>
|
||||
</record>
|
||||
|
||||
<!-- attach it to the portal menu -->
|
||||
|
|
|
@ -104,6 +104,14 @@ class account_invoice(osv.Model):
|
|||
pass
|
||||
return action_dict
|
||||
|
||||
def invoice_validate(self, cr, uid, ids, context=None):
|
||||
# fetch the partner's id and subscribe the partner to the invoice
|
||||
for invoice in self.browse(cr, uid, ids, context=context):
|
||||
partner = invoice.partner_id
|
||||
if partner.id not in invoice.message_follower_ids:
|
||||
self.message_subscribe(cr, uid, [invoice.id], [partner.id], context=context)
|
||||
return super(account_invoice, self).invoice_validate(cr, uid, ids, context=context)
|
||||
|
||||
def get_signup_url(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1
|
||||
document = self.browse(cr, uid, ids[0], context=context)
|
||||
|
|
|
@ -335,7 +335,7 @@ class WebKitParser(report_sxw):
|
|||
try :
|
||||
html = body_mako_tpl.render(dict(self.parser_instance.localcontext))
|
||||
htmls.append(html)
|
||||
except Exception:
|
||||
except Exception, e:
|
||||
msg = u"%s" % e
|
||||
_logger.error(msg)
|
||||
raise except_osv(_('Webkit render!'), msg)
|
||||
|
|
|
@ -151,9 +151,9 @@ class share_wizard(osv.TransientModel):
|
|||
result = dict.fromkeys(ids, '')
|
||||
for this in self.browse(cr, uid, ids, context=context):
|
||||
if this.result_line_ids:
|
||||
ctx = dict(context, share_url_template_hash_arguments=['action_id'])
|
||||
ctx = dict(context, share_url_template_hash_arguments=['action'])
|
||||
user = this.result_line_ids[0]
|
||||
data = dict(dbname=cr.dbname, login=user.login, password=user.password, action_id=this.action_id.id)
|
||||
data = dict(dbname=cr.dbname, login=user.login, password=user.password, action=this.action_id.id)
|
||||
result[this.id] = this.share_url_template(context=ctx) % data
|
||||
return result
|
||||
|
||||
|
|
Loading…
Reference in New Issue