From 9ebf7cdb4c3278df9e77647c18bb3a05436eadc3 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 9 Jul 2018 11:43:22 +0200 Subject: [PATCH] FIX my previous commit: related_sudo -> compute_sudo --- account_usability/account.py | 2 +- hr_expense_usability/hr_expense.py | 4 ++-- hr_holidays_lunch_voucher/purchase_config_settings.py | 4 ++-- .../purchase_config_settings.py | 4 ++-- hr_holidays_usability/hr_holidays.py | 6 +++--- product_usability/product.py | 2 +- sale_margin_no_onchange/sale.py | 4 ++-- sale_order_add_bom/mrp_bom.py | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/account_usability/account.py b/account_usability/account.py index 7f12dfa..915bc7f 100644 --- a/account_usability/account.py +++ b/account_usability/account.py @@ -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') diff --git a/hr_expense_usability/hr_expense.py b/hr_expense_usability/hr_expense.py index a4b9614..3a37092 100644 --- a/hr_expense_usability/hr_expense.py +++ b/hr_expense_usability/hr_expense.py @@ -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, diff --git a/hr_holidays_lunch_voucher/purchase_config_settings.py b/hr_holidays_lunch_voucher/purchase_config_settings.py index c59f802..268ca8f 100644 --- a/hr_holidays_lunch_voucher/purchase_config_settings.py +++ b/hr_holidays_lunch_voucher/purchase_config_settings.py @@ -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) diff --git a/hr_holidays_lunch_voucher_natixis/purchase_config_settings.py b/hr_holidays_lunch_voucher_natixis/purchase_config_settings.py index cc599f9..123c200 100644 --- a/hr_holidays_lunch_voucher_natixis/purchase_config_settings.py +++ b/hr_holidays_lunch_voucher_natixis/purchase_config_settings.py @@ -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) diff --git a/hr_holidays_usability/hr_holidays.py b/hr_holidays_usability/hr_holidays.py index 2746f6c..f12b572 100644 --- a/hr_holidays_usability/hr_holidays.py +++ b/hr_holidays_usability/hr_holidays.py @@ -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) diff --git a/product_usability/product.py b/product_usability/product.py index 9d1cca0..60cb234 100644 --- a/product_usability/product.py +++ b/product_usability/product.py @@ -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') diff --git a/sale_margin_no_onchange/sale.py b/sale_margin_no_onchange/sale.py index 0060061..4b5c06f 100644 --- a/sale_margin_no_onchange/sale.py +++ b/sale_margin_no_onchange/sale.py @@ -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', diff --git a/sale_order_add_bom/mrp_bom.py b/sale_order_add_bom/mrp_bom.py index 90ebce4..527216f 100644 --- a/sale_order_add_bom/mrp_bom.py +++ b/sale_order_add_bom/mrp_bom.py @@ -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)