[MERGE] forward port branch saas-11 up to 459ea4ab4d
This commit is contained in:
@@ -50,7 +50,9 @@ class ReportTrialBalance(models.AbstractModel):
|
||||
res['balance'] = account_result[account.id].get('balance')
|
||||
if display_account == 'all':
|
||||
account_res.append(res)
|
||||
if display_account in ['movement', 'not_zero'] and not currency.is_zero(res['balance']):
|
||||
if display_account == 'not_zero' and not currency.is_zero(res['balance']):
|
||||
account_res.append(res)
|
||||
if display_account == 'movement' and (not currency.is_zero(res['debit']) or not currency.is_zero(res['credit'])):
|
||||
account_res.append(res)
|
||||
return account_res
|
||||
|
||||
|
||||
@@ -294,6 +294,11 @@ class Lead(FormatAddress, models.Model):
|
||||
|
||||
if vals.get('user_id') and 'date_open' not in vals:
|
||||
vals['date_open'] = fields.Datetime.now()
|
||||
|
||||
if context.get('default_partner_id') and not vals.get('email_from'):
|
||||
partner = self.env['res.partner'].browse(context['default_partner_id'])
|
||||
vals['email_from'] = partner.email
|
||||
|
||||
# context: no_log, because subtype already handle this
|
||||
return super(Lead, self.with_context(context, mail_create_nolog=True)).create(vals)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ class SaleOrder(models.Model):
|
||||
('cancel', 'Cancelled'),
|
||||
], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft')
|
||||
date_order = fields.Datetime(string='Order Date', required=True, readonly=True, index=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, copy=False, default=fields.Datetime.now)
|
||||
validity_date = fields.Date(string='Expiration Date', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
|
||||
validity_date = fields.Date(string='Expiration Date', readonly=True, copy=False, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
|
||||
help="Manually set the expiration date of your quotation (offer), or it will set the date automatically based on the template if online quotation is installed.")
|
||||
create_date = fields.Datetime(string='Creation Date', readonly=True, index=True, help="Date on which sales order is created.")
|
||||
confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sale order is confirmed.", oldname="date_confirm")
|
||||
|
||||
Reference in New Issue
Block a user