FIX my previous commit: related_sudo -> compute_sudo

This commit is contained in:
Alexis de Lattre
2018-07-09 11:43:22 +02:00
parent f34a731d95
commit 9ebf7cdb4c
8 changed files with 14 additions and 14 deletions

View File

@@ -114,7 +114,7 @@ class AccountInvoiceLine(models.Model):
related='invoice_id.date_invoice', store=True, readonly=True)
commercial_partner_id = fields.Many2one(
related='invoice_id.partner_id.commercial_partner_id',
store=True, readonly=True, related_sudo=True)
store=True, readonly=True, compute_sudo=True)
state = fields.Selection(
related='invoice_id.state', store=True, readonly=True,
string='Invoice State')

View File

@@ -103,7 +103,7 @@ class HrExpense(models.Model):
string='Untaxed Amount', currency_field='currency_id',
readonly=True, states={'draft': [('readonly', False)]})
company_currency_id = fields.Many2one(
related='company_id.currency_id', readonly=True, store=True, related_sudo=True)
related='company_id.currency_id', readonly=True, store=True, compute_sudo=True)
total_amount_company_currency = fields.Monetary(
compute='compute_amount_company_currency', readonly=True,
store=True, string='Total in Company Currency',
@@ -309,7 +309,7 @@ class HrExpenseSheet(models.Model):
responsible_id = fields.Many2one(track_visibility='onchange')
accounting_date = fields.Date(track_visibility='onchange')
company_currency_id = fields.Many2one(
related='company_id.currency_id', readonly=True, store=True, related_sudo=True)
related='company_id.currency_id', readonly=True, store=True, compute_sudo=True)
total_amount_company_currency = fields.Monetary(
compute='compute_total_company_currency',
currency_field='company_currency_id', readonly=True, store=True,

View File

@@ -9,7 +9,7 @@ class PurchaseConfigSettings(models.TransientModel):
_inherit = 'purchase.config.settings'
lunch_voucher_product_id = fields.Many2one(
related='company_id.lunch_voucher_product_id', related_sudo=True)
related='company_id.lunch_voucher_product_id', compute_sudo=True)
lunch_voucher_employer_price = fields.Monetary(
related='company_id.lunch_voucher_employer_price',
currency_field='company_currency_id', related_sudo=True)
currency_field='company_currency_id', compute_sudo=True)

View File

@@ -10,6 +10,6 @@ class PurchaseConfigSettings(models.TransientModel):
_inherit = 'purchase.config.settings'
lunch_voucher_natixis_customer_code = fields.Char(
related='company_id.lunch_voucher_natixis_customer_code', related_sudo=True)
related='company_id.lunch_voucher_natixis_customer_code', compute_sudo=True)
lunch_voucher_natixis_delivery_code = fields.Char(
related='company_id.lunch_voucher_natixis_delivery_code', related_sudo=True)
related='company_id.lunch_voucher_natixis_delivery_code', compute_sudo=True)

View File

@@ -223,7 +223,7 @@ class HrHolidays(models.Model):
readonly=True)
limit = fields.Boolean( # pose des pbs de droits
related='holiday_status_id.limit', string='Allow to Override Limit',
readonly=True, related_sudo=True)
readonly=True, compute_sudo=True)
payslip_date = fields.Date(
string='Transfer to Payslip Date', track_visibility='onchange',
readonly=True)
@@ -245,7 +245,7 @@ class HrHolidays(models.Model):
# by default, there is no company_id field on hr.holidays !
company_id = fields.Many2one(
related='employee_id.resource_id.company_id', store=True,
readonly=True, related_sudo=True)
readonly=True, compute_sudo=True)
state = fields.Selection(default='draft') # hr_holidays, default='confirm'
@api.constrains(
@@ -441,4 +441,4 @@ class BaseConfigSettings(models.TransientModel):
_inherit = 'base.config.settings'
mass_allocation_default_holiday_status_id = fields.Many2one(
related='company_id.mass_allocation_default_holiday_status_id', related_sudo=True)
related='company_id.mass_allocation_default_holiday_status_id', compute_sudo=True)

View File

@@ -69,5 +69,5 @@ class ProductPriceHistory(models.Model):
_inherit = 'product.price.history'
company_currency_id = fields.Many2one(
related='company_id.currency_id', readonly=True, related_sudo=True,
related='company_id.currency_id', readonly=True, compute_sudo=True,
string='Company Currency')

View File

@@ -14,7 +14,7 @@ class SaleOrderLine(models.Model):
# Also defined in bi_sale_company_currency
company_currency_id = fields.Many2one(
related='order_id.company_id.currency_id',
readonly=True, store=True, related_sudo=True, string='Company Currency')
readonly=True, store=True, compute_sudo=True, string='Company Currency')
standard_price_company_currency = fields.Float(
string='Cost Price in Company Currency', readonly=True,
digits=dp.get_precision('Product Price'),
@@ -108,7 +108,7 @@ class SaleOrder(models.Model):
# Also defined in bi_sale_company_currency
company_currency_id = fields.Many2one(
related='company_id.currency_id', readonly=True, store=True, related_sudo=True,
related='company_id.currency_id', readonly=True, store=True, compute_sudo=True,
string="Company Currency")
margin_sale_currency = fields.Monetary(
string='Margin in Sale Currency',

View File

@@ -9,4 +9,4 @@ class MrpBom(models.Model):
_inherit = 'mrp.bom'
_rec_name = 'product_id'
sale_ok = fields.Boolean(related='product_id.sale_ok', store=True, related_sudo=True)
sale_ok = fields.Boolean(related='product_id.sale_ok', store=True, compute_sudo=True)