[fix] create call and date_order condition
This commit is contained in:
parent
51b505ba23
commit
7fcc323d0b
2 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ class SaleOrder(models.Model):
|
||||||
"""
|
"""
|
||||||
batch = self.env["sale.order.batch"].search([("state", "=", "open")], limit=1)
|
batch = self.env["sale.order.batch"].search([("state", "=", "open")], limit=1)
|
||||||
if not batch:
|
if not batch:
|
||||||
batch = self.env["sale.order.batch"].create()
|
batch = self.env["sale.order.batch"].create({})
|
||||||
for sale_order in self:
|
for sale_order in self:
|
||||||
if not sale_order.batch_id and sale_order.state in ["draft", "sent"]:
|
if not sale_order.batch_id and sale_order.state in ["draft", "sent"]:
|
||||||
sale_order.batch_id = batch
|
sale_order.batch_id = batch
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class SaleOrderBatch(models.Model):
|
||||||
required=True,
|
required=True,
|
||||||
readonly=False,
|
readonly=False,
|
||||||
copy=False,
|
copy=False,
|
||||||
states={"closed": [("readonly", False)]},
|
states={"closed": [("readonly", True)]},
|
||||||
help="Creation date of order batch,\nConfirmation date of confirmed orders.",
|
help="Creation date of order batch,\nConfirmation date of confirmed orders.",
|
||||||
default=fields.Datetime.now,
|
default=fields.Datetime.now,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue