中国本土应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.5KB

  1. ###################################################################################
  2. #
  3. # Copyright (c) 2017-today MuK IT GmbH.
  4. #
  5. # This file is part of MuK Backend Theme
  6. # (see https://mukit.at).
  7. #
  8. # MuK Proprietary License v1.0
  9. #
  10. # This software and associated files (the "Software") may only be used
  11. # (executed, modified, executed after modifications) if you have
  12. # purchased a valid license from MuK IT GmbH.
  13. #
  14. # The above permissions are granted for a single database per purchased
  15. # license. Furthermore, with a valid license it is permitted to use the
  16. # software on other databases as long as the usage is limited to a testing
  17. # or development environment.
  18. #
  19. # You may develop modules based on the Software or that use the Software
  20. # as a library (typically by depending on it, importing it and using its
  21. # resources), but without copying any source code or material from the
  22. # Software. You may distribute those modules under the license of your
  23. # choice, provided that this license is compatible with the terms of the
  24. # MuK Proprietary License (For example: LGPL, MIT, or proprietary licenses
  25. # similar to this one).
  26. #
  27. # It is forbidden to publish, distribute, sublicense, or sell copies of
  28. # the Software or modified copies of the Software.
  29. #
  30. # The above copyright notice and this permission notice must be included
  31. # in all copies or substantial portions of the Software.
  32. #
  33. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  34. # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  35. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  36. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  37. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  38. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  39. # DEALINGS IN THE SOFTWARE.
  40. #
  41. ###################################################################################
  42. from odoo import models, fields, api
  43. class IrAsset(models.Model):
  44. _inherit = 'ir.asset'
  45. # ----------------------------------------------------------
  46. # ORM
  47. # ----------------------------------------------------------
  48. @api.model_create_multi
  49. def create(self, vals_list):
  50. if self.env.context.get('theme_variables', False):
  51. for vals in vals_list:
  52. vals.pop('website_id', False)
  53. return super().create(vals_list)
上海开阖软件有限公司 沪ICP备12045867号-1