[IMP] *: restrict the deletion of used currencies
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user