diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 81f5c30dedc..5bdf40ae7b1 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -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 diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index bdfb34f523f..576c54c271d 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -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) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 176fbe12e90..e8da762a4ff 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -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")