Source

trytond-sale_shop / sale.py

Diff from to
                     'have permission to edit edit in this shop.',
             })
 
-    @staticmethod
-    def default_shop():
-        User = Pool().get('res.user')
-        user = User(Transaction().user)
-
-        return user.shop and user.shop.id or False
-
     def on_change_party(self):
         User = Pool().get('res.user')
         Shop = Pool().get('sale.shop')
         return res
 
     @staticmethod
+    def default_company():
+        User = Pool().get('res.user')
+        user = User(Transaction().user)
+        return user.shop and user.shop.company.id or Transaction().context.get('company')
+
+    @staticmethod
+    def default_shop():
+        User = Pool().get('res.user')
+        user = User(Transaction().user)
+        return user.shop and user.shop.id or False
+
+    @staticmethod
     def default_invoice_method():
         User = Pool().get('res.user')
         user = User(Transaction().user)