Skip to content

Commit

Permalink
Fix PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Mar 20, 2017
1 parent fc1bada commit 39544e6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion l10n_id_djbc_app/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"application": True,
"depends": [
"stock",
],
],
"data": [
"security/res_groups.xml",
"security/ir.model.access.csv",
Expand Down
3 changes: 1 addition & 2 deletions l10n_id_djbc_app/models/djbc_custom_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from openerp import models, fields



class CustomDocument(models.Model):
_name = "l10n_id.djbc_custom_document"
_description = "Custom Document"
Expand All @@ -23,4 +22,4 @@ class CustomDocument(models.Model):
comodel_name="l10n_id.djbc_document_type",
required=True,
ondelete="restrict",
)
)
3 changes: 1 addition & 2 deletions l10n_id_djbc_app/models/djbc_document_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from openerp import models, fields



class DocumentType(models.Model):
_name = "l10n_id.djbc_document_type"
_description = "Document Type"
Expand All @@ -23,4 +22,4 @@ class DocumentType(models.Model):
)
description = fields.Text(
string="Description",
)
)
2 changes: 0 additions & 2 deletions l10n_id_djbc_app/models/djbc_report_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from datetime import datetime



class ReportPeriod(models.Model):
_name = "l10n_id.djbc_report_period"
_description = "DJBC Report Period"
Expand Down Expand Up @@ -36,7 +35,6 @@ def _check_range(self):
strWarning = _("The start date must precede it's end date")
raise models.ValidationError(strWarning)


@api.multi
def _next_period(self, step):
self.ensure_one()
Expand Down
7 changes: 3 additions & 4 deletions l10n_id_djbc_app/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
from openerp import models, fields, api



class StockMove(models.Model):
_inherit = "stock.move"

@api.depends(
"quant_ids",
"quant_ids.djbc_custom",
)
)
@api.multi
def _compute_djbc(self):
for move in self:
Expand All @@ -26,10 +25,10 @@ def _compute_djbc(self):
string="DJBC Custom Document",
comodel_name="l10n_id.djbc_custom_document",
ondelete="restrict",
)
)
djbc_custom = fields.Boolean(
string="DJBC Marking",
compute="_compute_djbc",
store=True,
readonly=True,
)
)
7 changes: 3 additions & 4 deletions l10n_id_djbc_app/models/stock_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
from openerp import models, fields, api



class StockQuant(models.Model):
_inherit = "stock.quant"

djbc_custom = fields.Boolean(
string="DJBC Marking",
)
)

@api.model
def _quant_create(self, qty, move, lot_id=False, owner_id=False,
src_package_id=False, dest_package_id=False,
force_location_from=False, force_location_to=False,
):
quant = super(StockQuant, self)._quant_create(
qty, move, lot_id, owner_id, src_package_id, dest_package_id,
force_location_from, force_location_to)
qty, move, lot_id, owner_id, src_package_id, dest_package_id,
force_location_from, force_location_to)
if move.djbc_custom_document_id:
quant.write({"djbc_custom": True})

0 comments on commit 39544e6

Please sign in to comment.