Skip to content

Commit

Permalink
[FIX] purchase_landed_cost: fix flake8 method-compute
Browse files Browse the repository at this point in the history
  • Loading branch information
clementmbr committed May 1, 2020
1 parent a5d1ed7 commit 5a9f239
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions purchase_landed_cost/models/purchase_cost_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _compute_product_id(self):

@api.multi
@api.depends('move_id', 'move_id.product_qty')
def _get_product_qty(self):
def _compute_product_qty(self):
for dist_line in self:
# Cannot be done via related
# field due to strange bug in update chain
Expand Down Expand Up @@ -453,7 +453,7 @@ def _compute_standard_price_old(self):
comodel_name='product.product', string='Product', store=True,
compute='_compute_product_id')
product_qty = fields.Float(
string='Quantity', compute='_get_product_qty', store=True)
string='Quantity', compute='_compute_product_qty', store=True)
product_uom = fields.Many2one(
comodel_name='uom.uom', string='Unit of measure',
related='move_id.product_uom')
Expand Down Expand Up @@ -558,15 +558,15 @@ class PurchaseCostDistributionExpense(models.Model):

@api.multi
@api.depends('distribution', 'distribution.cost_lines')
def _get_imported_lines(self):
def _compute_imported_lines(self):
for record in self:
record.imported_lines = record.env[
'purchase.cost.distribution.line']
record.imported_lines |= record.distribution.cost_lines

@api.multi
@api.depends('invoice_line')
def _get_invoice_id(self):
def _compute_invoice_id(self):
"""Link Cost Distribution Expenses to their related Invoices when updating
'invoice_line' field"""
for expense in self:
Expand All @@ -584,7 +584,7 @@ def _get_invoice_id(self):
readonly=True)
imported_lines = fields.Many2many(
comodel_name='purchase.cost.distribution.line',
string='Imported lines', compute='_get_imported_lines')
string='Imported lines', compute='_compute_imported_lines')
affected_lines = fields.Many2many(
comodel_name='purchase.cost.distribution.line', column1="expense_id",
relation="distribution_expense_aff_rel", column2="line_id",
Expand All @@ -601,7 +601,7 @@ def _get_invoice_id(self):
"('invoice_id.state', 'in', ('open', 'paid'))]")
invoice_id = fields.Many2one(
comodel_name='account.invoice',
compute='_get_invoice_id',
compute='_compute_invoice_id',
string="Invoice",
store=True)
display_name = fields.Char(compute="_compute_display_name", store=True)
Expand Down

0 comments on commit 5a9f239

Please sign in to comment.