We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8483710 commit 2c8eb0eCopy full SHA for 2c8eb0e
purchase_order_revision/__init__.py
@@ -1,3 +1,3 @@
1
-# - -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
2
3
from . import model
purchase_order_revision/model/purchase_order.py
@@ -72,3 +72,12 @@ def new_revision(self):
72
self.message_post(body=msg)
73
old_revision.message_post(body=msg)
74
return True
75
+
76
+ @api.model
77
+ def create(self, values):
78
+ if 'unrevisioned_name' not in values:
79
+ if values.get('name', '/') == '/':
80
+ seq = self.env['ir.sequence']
81
+ values['name'] = seq.next_by_code('purchase.order') or '/'
82
+ values['unrevisioned_name'] = values['name']
83
+ return super(purchase_order, self).create(values)
0 commit comments