2
默认情况下,每个产品模板路由都是购买。但在我的情况下,需要一些变体来设置路由作为订购,并且需要将一些产品设置为制造和订购。但是,如果我更改产品变体的路由,那么模板下的所有其他变体也将发生变化。在ODOO中如何在同一产品下为不同的变体指定不同的路由?
默认情况下,每个产品模板路由都是购买。但在我的情况下,需要一些变体来设置路由作为订购,并且需要将一些产品设置为制造和订购。但是,如果我更改产品变体的路由,那么模板下的所有其他变体也将发生变化。在ODOO中如何在同一产品下为不同的变体指定不同的路由?
尝试加入route_ids in product.product object。
例如:
class ProductProduct(models.Model):
_inherit = 'product.product'
route_ids = fields.Many2many('stock.location.route', 'stock_route_product',
'product_id', 'route_id',
'Routes', domain="[('product_selectable', '=', True)]",
help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
有了这些,我们需要更新产品模板的每个变种/选择路由,它不会更新其他产品的不同路由。
我试过了。但仍然相同 – OmaL
这就是我曾尝试过的.stock_route_product是产品模板中指定的关系表。所以我也改变了关系表的名字。仍然无法正常工作 – OmaL
请勿更改* stock_route_product *表并尝试使用它。我已经在我的测试结束,它工作正常。并升级/卸载/重新安装您的自定义模块。 –