[IMP] *: restrict the deletion of used currencies

This commit is contained in:
Victor Feyens
2020-11-27 16:10:01 +00:00
parent ab76c421c2
commit e64f03c185
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class LunchCashMove(models.Model):
_description = 'Lunch Cashmove'
_order = 'date desc'
currency_id = fields.Many2one('res.currency', default=lambda self: self.env.company.currency_id)
currency_id = fields.Many2one('res.currency', default=lambda self: self.env.company.currency_id, required=True)
user_id = fields.Many2one('res.users', 'User',
default=lambda self: self.env.uid)
date = fields.Date('Date', required=True, default=fields.Date.context_today)
+1 -1
View File
@@ -190,7 +190,7 @@ class SaleOrder(models.Model):
required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", tracking=1,
help="If you change the pricelist, only newly added lines will be affected.")
currency_id = fields.Many2one(related='pricelist_id.currency_id', depends=["pricelist_id"], store=True)
currency_id = fields.Many2one(related='pricelist_id.currency_id', depends=["pricelist_id"], store=True, ondelete="restrict")
analytic_account_id = fields.Many2one(
'account.analytic.account', 'Analytic Account',
readonly=True, copy=False, check_company=True, # Unrequired company