Skip to content

Commit

Permalink
[flake8 / pylint]
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed May 12, 2015
1 parent 08171cd commit 690ab7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
from openerp.tools.translate import _
from openerp.addons import decimal_precision as dp

from custom_tools import _compute_integrated_prices
from .custom_tools import _compute_integrated_prices


class integrated_trade_wizard_link_product(TransientModel):
_name = 'integrated.trade.wizard.link.product'

# Default Get Section
def default_get(self, cr, uid, fields, context=None):
psi_obj = self.pool['product.supplierinfo']
pp_obj = self.pool['product.product']
pitc_obj = self.pool['product.integrated.trade.catalog']
rit_obj = self.pool['res.integrated.trade']
Expand Down Expand Up @@ -120,8 +119,9 @@ def link_product(self, cr, uid, ids, context=None):
if len(pp_qty) != 1:
raise except_osv(
_("Too Many Products for the Template!"),
_("""You can not link this Template %s because there are"""
""" %d Products associated.""") % (
_(
"""You can not link this Template %s because there"""
""" are %d Products associated.""") % (
cus_pt.name, len(pp_qty)))

# raise error if there is a product linked
Expand All @@ -132,22 +132,23 @@ def link_product(self, cr, uid, ids, context=None):
if len(pitc_ids) != 0:
raise except_osv(
_("Duplicated Reference!"),
_("""You can not link the Product Template %s because"""
_(
"""You can not link the Product Template %s because"""
""" it is yet linked to another supplier product."""
""" Please unlink the Product Template and try"""
""" again.""") % (
cus_pt.name))
""" again.""") % (cus_pt.name))

# Raise an error if Unit doesn't match
if cus_pt.uom_id.category_id.id != sup_pp.uom_id.category_id.id:
raise except_osv(
_("Unit Mismatch!"),
_("""The type of Unit of Mesure of your product"""
_(
"""The type of Unit of Mesure of your product"""
""" is '%s'.\nThe type of Unit of Mesure of the"""
""" supplier product is '%s'.\n\nThe type must"""
""" be the same.""") % (
cus_pt.uom_id.category_id.name,
sup_pp.uom_id.category_id.name))
cus_pt.uom_id.category_id.name,
sup_pp.uom_id.category_id.name))

psi_obj.create(cr, uid, psi_vals, context=context)
return True
2 changes: 1 addition & 1 deletion integrated_trade_product/model/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class product_product(Model):
'standard_price', 'list_price',
]

def copy_data(self, cr, uid, id, default=None, context=None):
def copy_data(self, cr, uid, id, default=None, context=None):
default = default and default or {}
# TODO: improve me.
# It's not necessary to remove all seller_ids, only ones that
Expand Down

0 comments on commit 690ab7b

Please sign in to comment.