Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
想做一个流水号,odoo 里面怎么实现啊,大佬们
可以使用Odoo的sequence,以purchase为例。
purchase
创建采购单的时候自动获取流水号
@api.model def create(self, vals): if vals.get('name', 'New') == 'New': vals['name'] = self.env['ir.sequence'].next_by_code('purchase.order') or '/' return super(PurchaseOrder, self).create(vals)