mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] subscription_oca: product-subscription_template company issues
Make company required on subscription_template. Make subcription_template_id a company-dependent field on product_template.
This commit is contained in:
@@ -8,5 +8,7 @@ class Product(models.Model):
|
||||
|
||||
subscribable = fields.Boolean(string="Subscribable product")
|
||||
subscription_template_id = fields.Many2one(
|
||||
comodel_name="sale.subscription.template", string="Subscription template"
|
||||
comodel_name="sale.subscription.template",
|
||||
string="Subscription template",
|
||||
company_dependent=True,
|
||||
)
|
||||
|
||||
@@ -46,6 +46,7 @@ class SaleSubscriptionTemplate(models.Model):
|
||||
company_id = fields.Many2one(
|
||||
"res.company",
|
||||
"Company",
|
||||
required=True,
|
||||
default=lambda self: self.env.company,
|
||||
domain=lambda self: [("id", "in", self.env.companies.ids)],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user