Skip to content

Commit

Permalink
[10.0][MIG] PEP8.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcosta authored and rvalyi committed Aug 30, 2019
1 parent e8d4611 commit 3e50661
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion l10n_br_stock_account/models/stock.py
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2016 Luis Felipe Miléo - KMEE
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import models, fields, api
from odoo import models, fields


class StockLocationPath(models.Model):
Expand Down
8 changes: 3 additions & 5 deletions l10n_br_stock_account/tests/test_invoicing_picking.py
Expand Up @@ -72,11 +72,9 @@ def test_invoicing_picking(self):
'Mapping Fiscal Documentation_id on wizard to create invoice fail.'
)

self.return_wizard = \
self.stock_return_picking.with_context(dict(
active_id=self.stock_picking_sp.id
)).create(dict(invoice_state='2binvoiced'))

self.return_wizard = self.stock_return_picking.with_context(
dict(active_id=self.stock_picking_sp.id)).create(
dict(invoice_state='2binvoiced'))

for line in self.return_wizard.product_return_moves :
line.quantity = line.move_id.product_uom_qty
Expand Down
19 changes: 6 additions & 13 deletions l10n_br_stock_account/wizard/stock_invoice_onshipping.py
Expand Up @@ -83,11 +83,10 @@ def _get_invoice_line_values(self, moves, invoice):
moves, invoice)
move = fields.first(moves)


fiscal_position_id = move.fiscal_position_id or \
move.picking_id.fiscal_position_id
move.picking_id.fiscal_position_id
fiscal_category_id = move.fiscal_category_id or \
move.picking_id.fiscal_category_id
move.picking_id.fiscal_category_id

values['cfop_id'] = fiscal_position_id.cfop_id.id
values['fiscal_category_id'] = fiscal_category_id.id
Expand Down Expand Up @@ -132,17 +131,10 @@ def action_generate(self):
invoices = self._action_generate_invoices()
if not invoices:
raise UserError(_('No invoice created!'))
inv_type = self._get_invoice_type()
if inv_type in ["out_invoice", "out_refund"]:
action = self.env.ref(
"l10n_br_account_product.action_invoice_tree1_view1")
else:
action = self.env.ref(
'l10n_br_account_product.action_invoice_tree1_view1')
action = self.env.ref(
'l10n_br_account_product.action_invoice_tree1_view1')
action_dict = action.with_context(dict(
fiscal_document_code='55')).read()[0]
action_dict = action.with_context(
dict(fiscal_document_code='55')).read()[0]
if action_dict:
action_dict.update({
'domain': [('id', 'in', invoices.ids)],
Expand All @@ -169,7 +161,8 @@ def _action_generate_invoices(self):
invoice_values = self._build_invoice_values_from_pickings(pickings)
invoice = self.env[
'account.invoice'].with_context(dict(
fiscal_document_code=pickings.company_id.product_invoice_id.code)
fiscal_document_code=pickings.
company_id.product_invoice_id.code)
).create(invoice_values)
moves = pickings.mapped("move_lines")
moves_list = self._group_moves(moves)
Expand Down
10 changes: 5 additions & 5 deletions l10n_br_stock_account/wizard/stock_return_picking.py
Expand Up @@ -4,7 +4,6 @@

from odoo import models, api, fields, _
from odoo.exceptions import Warning as UserError
from odoo.tools.safe_eval import safe_eval


class StockReturnPicking(models.TransientModel):
Expand Down Expand Up @@ -40,8 +39,8 @@ def _create_returns(self):

origin_picking = self.env['stock.picking'].browse(
self.env.context['active_id'])
refund_fiscal_category = (origin_picking.fiscal_category_id.
refund_fiscal_category_id)
refund_fiscal_category = (
origin_picking.fiscal_category_id.refund_fiscal_category_id)

if not refund_fiscal_category:
raise UserError(
Expand All @@ -64,7 +63,8 @@ def _create_returns(self):
'res.partner'].browse(picking.partner_id.id)
partner_invoice_id = picking_partner.address_get(
['invoice'])['invoice']
partner_invoice = self.env['res.partner'].browse(partner_invoice_id)
partner_invoice = self.env[
'res.partner'].browse(partner_invoice_id)

kwargs = {
'partner_id': picking.partner_id,
Expand All @@ -84,7 +84,7 @@ def _create_returns(self):
for move in picking.move_lines:
line_fiscal_category = (
move.origin_returned_move_id.
fiscal_category_id.refund_fiscal_category_id)
fiscal_category_id.refund_fiscal_category_id)
kwargs.update(
{'fiscal_category_id': line_fiscal_category})
fiscal_position = self._fiscal_position_map(
Expand Down

0 comments on commit 3e50661

Please sign in to comment.