From 0e28db88d13255434abf90af01675734d129d798 Mon Sep 17 00:00:00 2001
From: Christophe Matthieu <chm@odoo.com>
Date: Tue, 10 Oct 2017 11:38:02 +0200
Subject: [PATCH] [FIX] stock: Decimal precision on weight can not be saved

odoo issue: 774361
https://github.com/odoo/odoo/issues/13784
---
 addons/stock/models/stock_config_settings.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/addons/stock/models/stock_config_settings.py b/addons/stock/models/stock_config_settings.py
index f8bccb48eabc..a8f23d5d5a00 100644
--- a/addons/stock/models/stock_config_settings.py
+++ b/addons/stock/models/stock_config_settings.py
@@ -144,3 +144,15 @@ class StockSettings(models.TransientModel):
             warehouses.mapped('int_type_id').write({'active': active})
 
         return True
+
+    @api.model
+    def get_default_decimal_precision(self, fields):
+        # don't forward-port in v11.0, the API of config wizards changed.
+        digits = self.env.ref('product.decimal_stock_weight').digits
+        return {'decimal_precision': digits}
+
+    @api.multi
+    def set_decimal_precision(self):
+        # don't forward-port in v11.0, the API of config wizards changed.
+        for record in self:
+            self.env.ref('product.decimal_stock_weight').write({'digits': record.decimal_precision})
-- 
GitLab