robert 6 роки тому
батько
коміт
949c9da6c3

+ 1 - 1
controllers/decimal_precision.py

@@ -5,6 +5,6 @@ from openerp.http import request as r
 def check_discount_precision():
     discount_precision = r.env['decimal.precision'].search([('name', '=', 'Discount')])
 
-    discount_precision.write({
+    discount_precision.sudo().write({
         'digits': 9
     })

+ 10 - 5
controllers/res_currency.py

@@ -1,14 +1,19 @@
 # -*- coding: utf-8 -*-
 from openerp.http import request
 
-_MODEL = 'res.currency'
-
 
 def check_base_currency():
-    base_currency = request.env[_MODEL].search([('base', '=', True)])
+    company_currency = request.env.user.company_id.currency_id
+    other_currencies = request.env['res.currency'].search([('base', '=', True), ('id', '!=', company_currency.id)])
+
+    if other_currencies:
+        for c in other_currencies:
+            c.write({
+                'base': False
+            })
 
-    if not base_currency:
-        request.env.user.company_id.currency_id.write({
+    if not company_currency.base:
+        company_currency.write({
             'base': True
         })
 

+ 1 - 0
src/components/steps/Product.vue

@@ -9,6 +9,7 @@
             )
             .products-grid
                 store-selector(
+                    v-if='showWarehouseSelector'
                     :items='warehouses'
                     :selected='selectedWarehouse'
                     @onSelect='selectWarehouse'