Skip to content

Commit

Permalink
[IMP] base: don't add bundle name in bundles
Browse files Browse the repository at this point in the history
The bundle name is irrelevant in the bundle content and will prevent
attachment to store the same file if the bundles are exactly the same.

closes odoo#101626

Signed-off-by: Xavier Dollé (xdo) <[email protected]>
  • Loading branch information
Xavier-Do committed Oct 6, 2022
1 parent 187309f commit b1d57ad
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 82 deletions.
6 changes: 1 addition & 5 deletions odoo/addons/base/models/assetsbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,7 @@ def id(self):

@func.lazy_property
def name(self):
name = '<inline asset>' if self.inline else self.url
return "%s defined in bundle '%s'" % (name, self.bundle.name)
return '<inline asset>' if self.inline else self.url

@property
def html_url(self):
Expand Down Expand Up @@ -1030,13 +1029,11 @@ def with_header(self, content=None, minimal=True):
# format the header like
# /**************************
# * Filepath: <asset_url> *
# * Bundle: <name> *
# * Lines: 42 *
# **************************/
line_count = content.count('\n')
lines = [
f"Filepath: {self.url}",
f"Bundle: {self.bundle.name}",
f"Lines: {line_count}",
]
length = max(map(len, lines))
Expand Down Expand Up @@ -1086,7 +1083,6 @@ def with_header(self, content=None):
line_count = content.count('\n')
lines = [
f"Filepath: {self.url}",
f"Bundle: {self.bundle.name}",
f"Lines: {line_count}",
]
length = max(map(len, lines))
Expand Down
Loading

0 comments on commit b1d57ad

Please sign in to comment.