Browse Source

[IMP] beesdoo_purchase: black formatter (-l 79 -t py35)

pull/184/head
Vincent Van Rossem 4 years ago
parent
commit
a4fb75f657
  1. 2
      beesdoo_purchase/models/__init__.py
  2. 14
      beesdoo_purchase/models/account_invoice.py
  3. 7
      beesdoo_purchase/models/res_config.py

2
beesdoo_purchase/models/__init__.py

@ -1,3 +1,3 @@
from . import account_invoice
from . import purchase
from . import res_config
from . import res_config

14
beesdoo_purchase/models/account_invoice.py

@ -2,13 +2,15 @@ from odoo import api, fields, models, _
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
_inherit = "account.invoice"
def _prepare_invoice_line_from_po_line(self, line):
""" Override parent's method to invert Purchase Order Reference on invoice line"""
invoice_line = super(AccountInvoice, self)._prepare_invoice_line_from_po_line(line)
invoice_line = super(
AccountInvoice, self
)._prepare_invoice_line_from_po_line(line)
if self.user_has_groups(
'beesdoo_purchase.'
'group_invert_po_ref_on_inv_line'):
invoice_line['name'] = line.name + ': ' + line.order_id.name
return invoice_line
"beesdoo_purchase." "group_invert_po_ref_on_inv_line"
):
invoice_line["name"] = line.name + ": " + line.order_id.name
return invoice_line

7
beesdoo_purchase/models/res_config.py

@ -2,13 +2,12 @@ from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
_inherit = "res.config.settings"
group_invert_po_ref_on_inv_line = fields.Boolean(
"""Allow inverting the Purchase Order Reference on the
invoice lines""",
implied_group="beesdoo_purchase."
"group_invert_po_ref_on_inv_line",
implied_group="beesdoo_purchase." "group_invert_po_ref_on_inv_line",
help="""Allows you to invert Purchase Order Reference on the
invoice lines."""
invoice lines.""",
)
Loading…
Cancel
Save