From 1677796ce7f93b17dd4f56440575274ac6105710 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20G=C3=B6ttsch?=
Date: Tue, 25 Feb 2025 16:33:19 +0100
Subject: [PATCH] [117][FIX] nfu_ecommerce: make publish on website multi
company
---
nfu_ecommerce/README.rst | 3 ++-
nfu_ecommerce/models/product_template.py | 6 +++++-
nfu_ecommerce/readme/HISTORY.rst | 3 ++-
nfu_ecommerce/static/description/index.html | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/nfu_ecommerce/README.rst b/nfu_ecommerce/README.rst
index af6a9a5..3cc0636 100644
--- a/nfu_ecommerce/README.rst
+++ b/nfu_ecommerce/README.rst
@@ -38,7 +38,8 @@ Changelog
:0.0.1: Initial module.
:1.0.0: Live
:1.1.0: Add Open Packagings Filter and fix rounding issue
-:1.1.1: Pass arguemnts to super again
+:1.1.1: Pass arguments to super again
+:1.1.1: Make publish on website multi company
Bug Tracker
===========
diff --git a/nfu_ecommerce/models/product_template.py b/nfu_ecommerce/models/product_template.py
index 9ea29dc..f6fe7fd 100644
--- a/nfu_ecommerce/models/product_template.py
+++ b/nfu_ecommerce/models/product_template.py
@@ -1,9 +1,13 @@
-from odoo import models
+from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
+ is_published = fields.Boolean(
+ copy=False, default=lambda self: self._default_is_published(), index=True, company_dependent=True
+ )
+
def action_publish_on_website(self):
for product in self:
product.is_published = True
diff --git a/nfu_ecommerce/readme/HISTORY.rst b/nfu_ecommerce/readme/HISTORY.rst
index dbcabc5..11c32a8 100644
--- a/nfu_ecommerce/readme/HISTORY.rst
+++ b/nfu_ecommerce/readme/HISTORY.rst
@@ -1,4 +1,5 @@
:0.0.1: Initial module.
:1.0.0: Live
:1.1.0: Add Open Packagings Filter and fix rounding issue
-:1.1.1: Pass arguemnts to super again
\ No newline at end of file
+:1.1.1: Pass arguments to super again
+:1.1.1: Make publish on website multi company
\ No newline at end of file
diff --git a/nfu_ecommerce/static/description/index.html b/nfu_ecommerce/static/description/index.html
index b3946cc..29cd34d 100644
--- a/nfu_ecommerce/static/description/index.html
+++ b/nfu_ecommerce/static/description/index.html
@@ -399,7 +399,9 @@ and after the current order.
| 1.1.0: | Add Open Packagings Filter and fix rounding issue |
-| 1.1.1: | Pass arguemnts to super again |
+
|---|
| 1.1.1: | Pass arguments to super again |
+
+| 1.1.1: | Make publish on website multi company |