Debian Codegraph @

addons/website_sale/static/src/js/systray_items/new_content.js

raw
1 import { patch } from "@web/core/utils/patch";
2 import {
3 NewContentSystrayItem,
4 MODULE_STATUS,
5 } from "@website/client_actions/website_preview/new_content_systray_item";
6
7 patch(NewContentSystrayItem.prototype, {
8 setup() {
9 super.setup();
10
11 const newProductElement = this.state.newContentElements.find(element => element.moduleXmlId === 'base.module_website_sale');
12 newProductElement.createNewContent = () => this.onAddContent(
13 'website_sale.product_product_action_add',
14 true,
15 );
16 newProductElement.status = MODULE_STATUS.INSTALLED;
17 newProductElement.model = 'product.product';
18 },
19 });