Skip to content

Commit

Permalink
pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
gborelli committed Nov 10, 2014
1 parent a65cd84 commit c4594c2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
5 changes: 3 additions & 2 deletions sale_commission/model/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ def do_check_commission_and_recalculate(self):
"""
commission = self.commission_id
if commission:
commission_obj = self.pool.get('commission')
# XXX: unused
# commission_obj = self.pool.get('commission')
agent_commission = self.agent_id.commission
subtotal = self.invoice_line_id.price_subtotal
self.quantity = subtotal * (agent.commission.fix_qty / 100.0)
self.quantity = subtotal * (agent_commission.fix_qty / 100.0)

if self.agent_id and commission.sections:
if commission.id != agent_commission.id:
Expand Down
4 changes: 2 additions & 2 deletions sale_commission/model/sale_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api
from openerp import models, fields


class commission(models.Model):
Expand Down Expand Up @@ -50,7 +50,7 @@ def calcula_tramos(self, cr, uid, ids, base, context=None):
if context is None:
context = {}
commission = self.browse(cr, uid, ids, context=context)[0]
#Cálculo de tramos
# Cálculo de tramos
for section in commission.sections:
if base >= section.commission_from and (
base < section.commission_until or
Expand Down
5 changes: 2 additions & 3 deletions sale_commission/model/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def do_check_commission(self):
when selected commission is not the default provided for sale agent
and default partner commission have sections
"""
context = {}
result = {}

commission = self.commission_id
if commission.id:
agent_commission = self.agent_id.commission
Expand Down Expand Up @@ -153,7 +152,7 @@ def onchange_partner_id(self, cr, uid, ids, part, context=None):
vals = {
'agent_id': partner_agent.agent_id.id,
'commission_id': partner_agent.commission_id.id,
#'sale_id':ids
# 'sale_id':ids
}
# FIXME: What is going on in this block?
if ids:
Expand Down
12 changes: 6 additions & 6 deletions sale_commission/model/settled.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
##############################################################################
"""Objetos sobre las liquidación"""

from openerp import models, fields, api, _
from openerp import models, fields, _
from openerp import tools
from openerp import exceptions

Expand Down Expand Up @@ -91,7 +91,7 @@ def action_invoice_create(self, cursor, user, ids,
def calculate(self, cr, uid, ids, agent_ids,
date_from, date_to, context=None):
"""genera una entrada de liquidación por agente"""
# Busca todas las líneas de liquidación facturadas en un período
# Busca todas las líneas de liquidación facturadas en un período
if context is None:
context = {}
sale_agent_pool = self.pool.get('sale.agent')
Expand Down Expand Up @@ -241,7 +241,7 @@ def action_invoice_create(self, cr, uid,
raise exceptions.Warning(
_('Agent to settle hasn\'t assigned partner.')
)
#El tipo es de facura de proveedor
# El tipo es de facura de proveedor
account_id = partner.property_account_payable.id
address_default_id, address_contact_id, address_invoice_id = (
self._get_address_invoice(
Expand Down Expand Up @@ -294,7 +294,7 @@ def action_invoice_create(self, cr, uid,
name = invoice.invoice_number
price_unit = invoice.settled_amount
discount = 0
#set UoS if it's a sale and the picking doesn't have one
# set UoS if it's a sale and the picking doesn't have one
uos_id = False
account_id = account_fiscal_position_pool.map_account(
cr, uid,
Expand Down Expand Up @@ -431,9 +431,9 @@ def calculate(self, cr, uid, ids, date_from, date_to, context=None):
'base': line.invoice_line_id.price_subtotal,
'lines': [line]
}
#Tramos para cada tipo de comisión creados
# Tramos para cada tipo de comisión creados
for tramo in sections:
#Cálculo de la comisión para cada tramo
# Cálculo de la comisión para cada tramo
tramo = sections[tramo]
sections[tramo].update(
{
Expand Down
2 changes: 1 addition & 1 deletion sale_commission/model/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, _
from openerp import models, fields


class product_product(models.Model):
Expand Down
4 changes: 2 additions & 2 deletions sale_commission/wizard/wizard_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _
from openerp import models, fields, _
from openerp import exceptions


Expand Down Expand Up @@ -60,7 +60,7 @@ def create_invoice(self, cr, uid, ids, context=None):
action = {}
if not invoice_ids[0]:
raise exceptions.Warning(_('No Invoices were created'))
#change state settlement
# change state settlement
settlement_obj.write(
cr, uid,
context['active_ids'],
Expand Down

0 comments on commit c4594c2

Please sign in to comment.