Browse Source

fixup! [MIG][13.0] agreemnt_sale + black

pull/398/head
Iryna Vyshnevska 5 years ago
parent
commit
bb34ca493e
  1. 8
      agreement_sale/models/res_config_settings.py
  2. 25
      agreement_sale/models/sale.py

8
agreement_sale/models/res_config_settings.py

@ -2,13 +2,11 @@ from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
_inherit = "res.config.settings"
group_use_agreement_type = fields.Boolean(
'Use agreement types',
implied_group='agreement.group_use_agreement_type'
"Use agreement types", implied_group="agreement.group_use_agreement_type"
)
group_use_agreement_template = fields.Boolean(
'Use agreement template',
implied_group='agreement.group_use_agreement_template'
"Use agreement template", implied_group="agreement.group_use_agreement_template"
)

25
agreement_sale/models/sale.py

@ -2,19 +2,28 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
_inherit = "sale.order"
agreement_id = fields.Many2one(
comodel_name='agreement', string='Agreement', ondelete='restrict',
track_visibility='onchange', readonly=True, copy=False,
states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
comodel_name="agreement",
string="Agreement",
ondelete="restrict",
track_visibility="onchange",
readonly=True,
copy=False,
states={"draft": [("readonly", False)], "sent": [("readonly", False)]},
)
agreement_type_id = fields.Many2one(
comodel_name="agreement.type", string="Agreement Type",
comodel_name="agreement.type",
string="Agreement Type",
ondelete="restrict",
track_visibility='onchange', readonly=True, copy=True,
states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
track_visibility="onchange",
readonly=True,
copy=True,
states={"draft": [("readonly", False)], "sent": [("readonly", False)]},
)
Loading…
Cancel
Save