Skip to content

Commit

Permalink
[FIX] Alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Nov 28, 2019
1 parent c676782 commit 4537e18
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
16 changes: 8 additions & 8 deletions account_operating_unit/models/account_invoice.py
Expand Up @@ -10,14 +10,14 @@
class AccountInvoice(models.Model):
_inherit = "account.invoice"

operating_unit_id = fields.Many2one('operating.unit', 'Operating Unit',
default=lambda self:
self.env['res.users'].
operating_unit_default_get(self._uid),
domain="[('user_ids', '=', uid)]",
readonly=True,
states={'draft': [('readonly',
False)]})
operating_unit_id = fields.Many2one(
comodel_name='operating.unit',
string='Operating Unit',
default=lambda self: self.env['res.users'].operating_unit_default_get(
self._uid),
domain="[('user_ids', '=', uid)]",
readonly=True,
states={'draft': [('readonly', False)]})

@api.onchange('operating_unit_id')
def _onchange_operating_unit(self):
Expand Down
12 changes: 6 additions & 6 deletions account_operating_unit/models/account_journal.py
Expand Up @@ -9,12 +9,12 @@
class AccountJournal(models.Model):
_inherit = "account.journal"

operating_unit_id = fields.Many2one(comodel_name='operating.unit',
string='Operating Unit',
domain="[('user_ids', '=', uid)]",
help="Operating Unit that will be "
"used in payments, when this "
"journal is used.")
operating_unit_id = fields.Many2one(
comodel_name='operating.unit',
string='Operating Unit',
domain="[('user_ids', '=', uid)]",
help="Operating Unit that will be used in payments, "
"when this journal is used.")

@api.multi
@api.constrains('type')
Expand Down
17 changes: 10 additions & 7 deletions account_operating_unit/models/account_move.py
Expand Up @@ -9,8 +9,10 @@
class AccountMoveLine(models.Model):
_inherit = "account.move.line"

operating_unit_id = fields.Many2one('operating.unit', 'Operating Unit',
domain="[('user_ids', '=', uid)]",)
operating_unit_id = fields.Many2one(
comodel_name='operating.unit',
string='Operating Unit',
domain="[('user_ids', '=', uid)]",)

@api.model
def create(self, vals):
Expand Down Expand Up @@ -54,11 +56,12 @@ def _check_move_operating_unit(self):
class AccountMove(models.Model):
_inherit = "account.move"

operating_unit_id = fields.Many2one('operating.unit',
'Default operating unit',
domain="[('user_ids', '=', uid)]",
help="This operating unit will "
"be defaulted in the move lines.")
operating_unit_id = fields.Many2one(
comodel_name='operating.unit',
string='Default operating unit',
domain="[('user_ids', '=', uid)]",
help="This operating unit will be "
"defaulted in the move lines.")

@api.multi
def _prepare_inter_ou_balancing_move_line(self, move, ou_id,
Expand Down
2 changes: 1 addition & 1 deletion account_operating_unit/models/account_payment.py
Expand Up @@ -23,7 +23,7 @@ def _compute_operating_unit_id(self):
def _get_counterpart_move_line_vals(self, invoice=False):
res = super(AccountPayment,
self)._get_counterpart_move_line_vals(invoice=invoice)
if len(invoice) == 1:
if invoice and len(invoice) == 1:
res['operating_unit_id'] = invoice.operating_unit_id.id or False
else:
res['operating_unit_id'] = self.operating_unit_id.id or False
Expand Down
8 changes: 4 additions & 4 deletions stock_operating_unit/model/stock_warehouse.py
Expand Up @@ -46,7 +46,7 @@ def _check_location(self):
if (rec.warehouse_id and rec.location_id and
rec.warehouse_id.operating_unit_id !=
rec.location_id.operating_unit_id):
raise UserError(
_('Configuration Error. The Operating Unit of the '
'Warehouse and the Location must be the same. ')
)
raise UserError(
_('Configuration Error. The Operating Unit of the '
'Warehouse and the Location must be the same. ')
)

0 comments on commit 4537e18

Please sign in to comment.