19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:47 +01:00
parent accf5918df
commit 6e65e8c877
688 changed files with 225434 additions and 199401 deletions

View file

@ -1,9 +1,7 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { BomOverviewComponentsBlock } from "@mrp/components/bom_overview_components_block/mrp_bom_overview_components_block";
import { BomOverviewSpecialLine } from "@mrp/components/bom_overview_special_line/mrp_bom_overview_special_line";
patch(BomOverviewComponentsBlock, "mrp_subcontracting", {
patch(BomOverviewComponentsBlock, {
components: { ...BomOverviewComponentsBlock.components, BomOverviewSpecialLine },
});

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="mrp_subcontracting.BomOverviewComponentsBlock" t-inherit="mrp.BomOverviewComponentsBlock" t-inherit-mode="extension" owl="1">
<t t-name="mrp_subcontracting.BomOverviewComponentsBlock" t-inherit="mrp.BomOverviewComponentsBlock" t-inherit-mode="extension">
<xpath expr="//t[@name='byproducts']" position="after">
<t t-if="data.subcontracting">
<BomOverviewSpecialLine

View file

@ -1,9 +1,7 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { BomOverviewLine } from "@mrp/components/bom_overview_line/mrp_bom_overview_line";
patch(BomOverviewLine.prototype, "mrp_subcontracting", {
patch(BomOverviewLine.prototype, {
/**
* @override
*/
@ -11,6 +9,6 @@ patch(BomOverviewLine.prototype, "mrp_subcontracting", {
if (routeType == "subcontract") {
return this.goToAction(this.data.link_id, this.data.link_model);
}
return this._super(...arguments);
return super.goToRoute(...arguments);
}
});

View file

@ -1,12 +1,10 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";
import { BomOverviewSpecialLine } from "@mrp/components/bom_overview_special_line/mrp_bom_overview_special_line";
patch(BomOverviewSpecialLine.prototype, "mrp_subcontracting", {
patch(BomOverviewSpecialLine.prototype, {
setup() {
this._super.apply();
super.setup();
this.actionService = useService("action");
},

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="mrp_subcontracting.BomOverviewSpecialLine" t-inherit="mrp.BomOverviewSpecialLine" t-inherit-mode="extension" owl="1">
<t t-name="mrp_subcontracting.BomOverviewSpecialLine" t-inherit="mrp.BomOverviewSpecialLine" t-inherit-mode="extension">
<xpath expr="//td[@name='td_mrp_bom']" position="inside">
<t t-if="props.type == 'subcontracting'">Subcontracting: <a href="#" t-on-click.prevent="goToSubcontractor" t-esc="subcontracting.name"/></t>
</xpath>
@ -17,10 +17,6 @@
<xpath expr="//td[@name='bom_cost']" position="inside">
<span t-if="props.type == 'subcontracting'" t-esc="formatMonetary(subcontracting.bom_cost)"/>
</xpath>
<xpath expr="//td[@name='prod_cost']" position="inside">
<span t-if="props.type == 'subcontracting'" t-esc="formatMonetary(subcontracting.prod_cost)"/>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,8 @@
import { patch } from "@web/core/utils/patch";
import { SMLX2ManyField } from "@stock/fields/stock_move_line_x2_many_field";
patch(SMLX2ManyField.prototype, {
get quantListViewShowOnHandOnly(){
return this.props.context.mrp_subcontracting ? false : super.quantListViewShowOnHandOnly;
}
});

View file

@ -0,0 +1,34 @@
import { registry } from "@web/core/registry";
import { FormController } from "@web/views/form/form_controller";
import { formView } from "@web/views/form/form_view";
import { _t } from "@web/core/l10n/translation";
class SubcontractingProductionFormController extends FormController {
get actionMenuItems() {
return {
action: [
{
key: "assign",
description: _t("Check Availability"),
callback: () => {
this.model.orm.call('mrp.production', 'action_assign', [this.model.root.resId]);
this.model.load();
},
},
{
key: "split",
description: _t("Create New Production"),
callback: async () => {
const res = await this.model.orm.call('mrp.production', 'action_split_subcontracting', [this.model.root.resId]);
this.model.action.doAction(res);
}
}
]
};
}
}
registry.category("views").add("subcontracting_production_form", {
...formView,
Controller: SubcontractingProductionFormController,
});

View file

@ -0,0 +1,16 @@
import { registry } from "@web/core/registry";
import { ListController } from "@web/views/list/list_controller";
import { listView } from "@web/views/list/list_view";
class SubcontractingProductionListController extends ListController {
get actionMenuItems() {
let items = super.actionMenuItems;
items.action = []
return items;
}
}
registry.category("views").add("subcontracting_production_list", {
...listView,
Controller: SubcontractingProductionListController,
});

View file

@ -0,0 +1,16 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M56.3871 19.5678C56.3008 19.5031 52.5034 17.4931 52.5034 17.4931L53.539 14.6235C54.0137 13.2858 53.9058 11.9696 53.237 11.4734L49.9574 8.99214C49.8927 8.94898 38.932 2.64876 38.932 2.64876C38.2847 2.3467 37.3569 2.7998 36.6449 3.7923L35.5877 5.2379L31.553 2.90768L31.4882 2.8861C31.1214 2.67033 30.6683 2.69191 30.1505 2.99399L25.4901 5.66944C24.5623 6.20885 23.7424 7.52498 23.5051 8.86272L22.7067 13.6742C22.4263 13.9763 22.1458 14.2999 21.8653 14.6235L18.9957 13.9547C18.1974 13.7605 17.1617 14.5372 16.5144 15.7886L13.2133 22.0673C12.5444 23.3403 12.4365 24.7643 12.9112 25.5626L14.6589 28.3891C14.5294 28.8206 14.4215 29.2521 14.3137 29.7052L11.0557 32.6396C10.1063 33.5674 9.54535 34.8404 9.5022 36.1565V42.3704C9.5022 43.2551 9.82583 43.8808 10.3652 44.075L13.9685 46.1463L12.9328 49.0159C12.4366 50.3536 12.566 51.6482 13.2133 52.166L27.3241 60.8828C27.993 61.379 29.007 60.9475 29.8054 59.8471L30.8194 58.4447L35.0484 60.8828L35.0915 60.8396C35.4799 60.9691 35.9114 60.9044 36.2566 60.667L40.9171 57.97C41.8449 57.4306 42.6648 56.1144 42.8805 54.7767L43.6788 49.9868C43.9593 49.6848 44.2398 49.3611 44.5203 49.0375L47.3899 49.7063C48.1882 49.9005 49.2239 49.1238 49.8712 47.8724L53.1507 41.5937C53.8196 40.3208 53.9275 38.8967 53.4528 38.0984L51.7267 35.2935C51.8562 34.862 51.964 34.4089 52.0719 33.9774L55.3299 31.043C56.2792 30.1152 56.8402 28.8422 56.8834 27.5261V21.1429C56.9697 20.3877 56.7539 19.8483 56.3871 19.5678Z" fill="#C1DBF6"/>
<path d="M23.8275 7.08959L23.9277 6.89606C24.2771 6.22083 24.7773 5.68223 25.4146 5.29539L30.0791 2.59585C30.3478 2.42465 30.6749 2.32776 30.9919 2.32776C31.2158 2.32776 31.4459 2.38602 31.6233 2.48735L42.2857 8.6479L42.1179 9.0735C42.0121 9.03823 41.9056 9.02038 41.8016 9.02038C41.5704 9.02038 41.3304 9.09203 41.1257 9.22193L36.4567 11.9027C35.9132 12.2525 35.4556 12.7594 35.1436 13.363L35.0333 13.5759L23.8275 7.08959Z" fill="#FBDBD0"/>
<path d="M30.9919 2.5563C31.1645 2.5563 31.3587 2.59943 31.5098 2.68574L42.19 8.85653C42.0605 8.8134 41.931 8.7918 41.8016 8.7918C41.5211 8.7918 41.2406 8.87813 41.0033 9.02917L36.3428 11.7046C35.7387 12.093 35.264 12.6324 34.9404 13.2581L24.1307 7.00099C24.4544 6.3753 24.9291 5.85747 25.5332 5.49066L30.1936 2.79365C30.431 2.64261 30.7115 2.5563 30.9919 2.5563ZM30.992 2.09918C30.6351 2.09918 30.2679 2.20686 29.9569 2.4025L25.3042 5.095C24.6316 5.50325 24.0883 6.088 23.7247 6.79098L23.5244 7.17822L23.9017 7.39665L34.7114 13.6537L35.1262 13.8939L35.3464 13.4681C35.6384 12.9036 36.0651 12.429 36.5807 12.0952L41.2309 9.42563L41.2399 9.42044L41.2487 9.41486C41.4168 9.30789 41.6132 9.24896 41.8016 9.24896C41.8823 9.24896 41.9621 9.26247 42.0455 9.29027C42.0455 9.29027 42.5783 9.3195 43.0355 9.42563C42.9212 8.86235 42.4187 8.46074 42.4187 8.46074L31.7385 2.28995C31.5256 2.16833 31.2542 2.09918 30.992 2.09918Z" fill="#374874"/>
<path d="M12.5497 25.7742L12.5191 25.7226C11.9928 24.8374 12.1117 23.3429 12.8152 22.0041L16.1163 15.7041C16.7582 14.4891 17.7182 13.7045 18.5626 13.7045C18.6656 13.7045 18.7721 13.7045 18.8719 13.7376L18.894 13.7449L31.6926 21.128L29.537 20.407C29.5077 20.3971 29.4294 20.3971 29.3723 20.3971C28.6954 20.3971 27.8752 21.1018 27.3312 22.1507L24.0513 28.4302C23.433 29.6072 23.3029 30.9822 23.7418 31.7005L24.2071 32.4621L12.5497 25.7742Z" fill="#FBDBD0"/>
<path d="M18.5627 13.9331C18.649 13.9331 18.7353 13.9331 18.8 13.9547L29.6097 20.1902C29.5449 20.1686 29.4586 20.1686 29.3723 20.1686C28.6172 20.1686 27.7325 20.8806 27.1284 22.0457L23.8488 28.3244C23.1799 29.5974 23.0721 31.043 23.5468 31.8197L12.7155 25.6058C12.2409 24.8074 12.3487 23.3834 13.0176 22.1104L16.3187 15.8102C16.9229 14.6666 17.8075 13.9331 18.5627 13.9331ZM18.5627 13.476C17.6203 13.476 16.6056 14.2886 15.9145 15.5967L12.6127 21.8983C11.8738 23.3045 11.7572 24.8885 12.3226 25.8394L12.3839 25.9426L12.4881 26.0023L23.3193 32.2162L24.8677 33.1046L23.9368 31.5813C23.5436 30.9378 23.6797 29.6291 24.2535 28.537L27.5336 22.2573C28.1183 21.1299 28.8782 20.6257 29.3723 20.6257C29.4058 20.6257 29.455 20.6257 29.4777 20.6281L33.7613 22.0573L29.8381 19.7942L19.0284 13.5587L18.9884 13.5356L18.9445 13.521C18.8095 13.476 18.6726 13.476 18.5627 13.476Z" fill="#374874"/>
<path d="M10.0667 44.3034C9.44462 44.059 9.07385 43.3465 9.07385 42.392V36.1996C9.11984 34.9978 9.53266 33.8845 10.2679 32.9711L10.3906 32.8186L21.6003 39.2849L21.434 39.4927C20.7841 40.305 20.4034 41.3454 20.362 42.4224L20.3623 48.6275C20.3623 49.2925 20.5644 49.817 20.903 50.0309L20.6858 50.2857L10.0667 44.3034Z" fill="#FBDBD0"/>
<path d="M10.4459 33.1143L21.2555 39.3498C20.5651 40.2128 20.1767 41.2916 20.1336 42.4136V48.6275C20.1336 49.3827 20.3429 49.8376 20.3429 49.8376L10.1654 44.0965C9.64757 43.9023 9.30236 43.2766 9.30236 42.392V36.1996C9.34551 35.0777 9.73388 33.9989 10.4459 33.1143ZM10.3352 32.5226L10.0898 32.8276C9.32359 33.7795 8.89335 34.9395 8.84556 36.182L8.84521 36.1909V42.392C8.84521 43.4362 9.26352 44.224 9.96661 44.5096L20.8 50.4L21.025 49.8376C20.7571 49.6685 20.5907 49.2048 20.5907 48.6275V42.4226C20.632 41.3972 20.9947 40.4077 21.6125 39.6353L21.945 39.2198L21.484 38.9538L10.6743 32.7183L10.3352 32.5226Z" fill="#374874"/>
<path d="M12.9882 52.4559C12.5874 52.1563 12.3484 51.6378 12.2982 50.9842L12.265 50.5521L23.5762 57.0864L23.5851 57.207C23.6242 57.7333 23.7942 58.1237 24.077 58.3358L27.3573 60.8175L27.0991 61.1942L12.9882 52.4559Z" fill="#FBDBD0"/>
<path d="M12.526 50.9669L23.3572 57.224C23.4004 57.8065 23.5946 58.2597 23.9398 58.5185L27.2193 60.9998L13.1085 52.2615C12.7633 52.0026 12.5691 51.5279 12.526 50.9669ZM12.0037 50.1372L12.0702 51.002C12.1256 51.722 12.3969 52.2992 12.8342 52.6272L12.8505 52.6394L12.8679 52.6501L26.9787 61.3885L27.4952 60.6353L24.2156 58.154C23.9256 57.9365 23.8368 57.51 23.8131 57.1903L23.7953 56.9492L23.5859 56.8282L12.7547 50.5711L12.0037 50.1372Z" fill="#374874"/>
<path d="M28.0144 61.2152C27.7562 61.2152 27.5224 61.1431 27.2997 60.9947L24.0313 58.5213C23.3268 57.9882 23.1931 56.6789 23.6987 55.2635L25.4325 50.4791L25.1104 49.6737L21.9612 50.4554C21.8529 50.4726 21.7372 50.4918 21.6063 50.4918C20.8139 50.4918 20.2814 49.7427 20.2814 48.6276V42.4137C20.3229 41.0439 20.9021 39.7338 21.8705 38.8262L25.1117 35.9135L25.4334 34.6519L23.7212 31.8724C23.2247 31.0581 23.3456 29.5468 24.0095 28.2793L27.2892 22.0006C27.8889 20.8613 28.8221 20.0952 29.611 20.0952C29.6973 20.0952 29.7951 20.1148 29.8896 20.1338L32.6911 20.7889L33.4721 19.9039L34.2596 15.1356C34.5114 13.7519 35.344 12.4057 36.2839 11.8657L40.9451 9.1684C41.2386 9.00054 41.5192 8.91862 41.8016 8.91862C42.4321 8.91862 42.8935 9.37219 43.0672 10.1633L43.8393 13.9559L44.5553 13.9184L47.4027 9.96728C47.9725 9.16147 48.6933 8.68134 49.3317 8.68134C49.594 8.68134 49.821 8.75834 50.0069 8.91014L53.2931 11.397C53.9924 11.9407 54.127 13.2505 53.6259 14.6546L51.8884 19.4492L51.9321 19.5369C51.9502 19.5733 51.9672 19.6282 51.9922 19.703C52.0228 19.7948 52.0616 19.9117 52.1174 20.0566L52.19 20.2446L55.3629 19.4626C55.4748 19.4263 55.5821 19.4262 55.7181 19.4262C56.5107 19.4262 57.0431 20.1753 57.0431 21.2905V27.5046C57.0016 28.8742 56.4223 30.1843 55.454 31.0921L52.2141 34.0035L52.1965 34.0684C52.1358 34.2912 51.9822 34.8816 51.9139 35.1774L51.8929 35.2687L53.6032 38.0457C54.0998 38.8599 53.9788 40.3713 53.315 41.6387L50.0565 47.918C49.457 49.057 48.5239 49.8231 47.7351 49.8231C47.6498 49.8231 47.5558 49.8041 47.4565 49.7843L44.6549 49.1292L43.8739 50.0144L43.0864 54.7827C42.8614 56.1325 42.0101 57.5077 41.0621 58.0524L36.3791 60.7713C36.1154 60.9336 35.8132 61.0211 35.5228 61.0211C34.8922 61.0211 34.4311 60.5675 34.2574 59.7765L33.4873 55.9939H32.7735L29.9433 59.9294C29.3735 60.7352 28.6528 61.2152 28.0144 61.2152Z" fill="white"/>
<path d="M49.3317 8.90985C49.5429 8.90985 49.7164 8.96779 49.8621 9.08699L49.8688 9.09252L49.8758 9.09776L53.1505 11.5753C53.7644 12.0528 53.8714 13.2874 53.4113 14.5756L51.7068 19.2792L51.6393 19.4624L51.7271 19.6381C51.7361 19.6574 51.758 19.7233 51.7757 19.7763C51.8056 19.8659 51.8464 19.9885 51.9041 20.1385L52.0488 20.5147L52.4401 20.4182L55.4176 19.6846L55.4355 19.6802L55.4529 19.6744C55.5119 19.6547 55.5985 19.6547 55.7182 19.6547C56.3842 19.6547 56.8146 20.2968 56.8146 21.2905V27.4975C56.7729 28.8112 56.2203 30.0602 55.3048 30.9187L52.1115 33.7883L52.0114 33.8782L51.976 34.008C51.9143 34.2343 51.7592 34.8306 51.6911 35.1259L51.6489 35.3087L51.7473 35.4685L53.4076 38.1637C53.8656 38.9149 53.7415 40.3317 53.1117 41.5341L49.8549 47.8104C49.2933 48.8774 48.4414 49.5943 47.735 49.5943C47.6741 49.5943 47.5937 49.5786 47.5084 49.5615L44.84 48.9375L44.5739 48.8753L44.3931 49.0802L43.7459 49.8138L43.659 49.9122L43.6376 50.0418L42.861 54.7447C42.6462 56.033 41.8418 57.3407 40.9463 57.8552L36.2643 60.5738L36.2592 60.5767L36.2542 60.5797C36.0346 60.7149 35.768 60.7924 35.5229 60.7924C34.8195 60.7924 34.568 60.1252 34.4821 59.7344L33.7485 56.1311L33.674 55.7651H32.6563L32.5195 55.9554L29.7556 59.7989C29.2296 60.5426 28.5787 60.9866 28.0144 60.9866C27.8067 60.9866 27.6177 60.9292 27.437 60.8114L24.1692 58.339C23.5447 57.8664 23.4421 56.6614 23.9132 55.3424L25.6177 50.6388L25.6771 50.475L25.6123 50.3133L25.3966 49.7738L25.2486 49.404L24.862 49.5L21.9234 50.2293C21.8119 50.2478 21.7139 50.2632 21.6063 50.2632C20.9403 50.2632 20.5099 49.6212 20.5099 48.6275V42.4205C20.5515 41.1069 21.1042 39.8578 22.0197 38.9993L25.213 36.1297L25.3162 36.037L25.3504 35.9026L25.6309 34.8022L25.6787 34.6145L25.5771 34.4495L23.9169 31.7543C23.4588 31.0031 23.583 29.5863 24.2123 28.385L27.4912 22.1076C28.0528 21.0405 28.9047 20.3236 29.611 20.3236C29.672 20.3236 29.7523 20.3394 29.8376 20.3564L32.506 20.9805L32.7721 21.0427L32.9529 20.8378L33.6002 20.1042L33.687 20.0057L33.7084 19.8762L34.4839 15.1799C34.7211 13.8752 35.5261 12.5647 36.3992 12.0632L41.0574 9.36738C41.3168 9.2192 41.5602 9.14713 41.8016 9.14713C42.505 9.14713 42.7565 9.81431 42.8424 10.2052L43.576 13.8085L43.6545 14.1945L44.048 14.1738L44.4579 14.1522L44.6766 14.1406L44.8047 13.9629L47.5904 10.0975C48.1164 9.3538 48.7674 8.90985 49.3317 8.90985ZM49.3316 8.45266C48.6196 8.45266 47.8429 8.94891 47.2172 9.83355L44.4338 13.6957L44.0239 13.7173L43.2903 10.114C43.0961 9.22939 42.5567 8.68999 41.8015 8.68999C41.4563 8.68999 41.1327 8.79787 40.8306 8.97049L36.1702 11.6675C35.1561 12.2501 34.293 13.6741 34.0341 15.0981L33.2574 19.8017L32.6101 20.5353L29.9346 19.9096C29.8267 19.888 29.7189 19.8664 29.611 19.8664C28.7264 19.8664 27.7339 20.6648 27.0866 21.8946L23.807 28.1733C23.095 29.5326 22.9871 31.1076 23.5265 31.9922L25.1879 34.6893L24.9074 35.7896L21.7141 38.6593C20.6784 39.6302 20.0959 40.9895 20.0527 42.4135V48.6274C20.0527 49.8789 20.6784 50.7203 21.6062 50.7203C21.7573 50.7203 21.8867 50.6988 22.0162 50.6772L24.9721 49.9436L25.1879 50.483L23.4833 55.1866C22.9439 56.6969 23.095 58.0994 23.8933 58.7035L27.1728 61.1848C27.4318 61.3574 27.7123 61.4437 28.0143 61.4437C28.7263 61.4437 29.5031 60.9474 30.1288 60.0628L32.8905 56.2223H33.3005L34.0341 59.8255C34.2283 60.7101 34.7676 61.2495 35.5228 61.2495C35.868 61.2495 36.2133 61.1416 36.4937 60.969L41.1758 58.2504C42.1899 57.6679 43.0745 56.2439 43.3118 54.8198L44.0886 50.1162L44.7359 49.3826L47.4113 50.0083C47.5192 50.0299 47.6271 50.0515 47.735 50.0515C48.6196 50.0515 49.6121 49.2531 50.2594 48.0233L53.5174 41.7447C54.2294 40.3853 54.3372 38.8103 53.7979 37.9257L52.1365 35.2287C52.2012 34.9482 52.3522 34.3656 52.417 34.1283L55.6102 31.2586C56.6459 30.2877 57.2285 28.9284 57.2716 27.5044V21.2905C57.2716 20.0391 56.6459 19.1976 55.7181 19.1976C55.5671 19.1976 55.4376 19.1976 55.3082 19.2407L52.3307 19.9743C52.2228 19.6938 52.1796 19.5212 52.1365 19.4349L53.841 14.7313C54.3804 13.221 54.2078 11.8185 53.431 11.2144L50.1515 8.73314C49.9141 8.53895 49.6337 8.45266 49.3316 8.45266Z" fill="#374874"/>
<path d="M44.1519 31.8657C44.1519 35.8041 41.7486 40.3937 38.8025 42.0993C35.8565 43.8049 33.4531 41.9908 33.4531 38.0524C33.4531 34.114 35.8565 29.5243 38.8025 27.8187C41.7486 26.1131 44.1519 27.9273 44.1519 31.8657Z" fill="#FBDBD0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M42.4441 27.908C41.5687 27.2462 40.3352 27.1954 38.917 28.0165C37.4929 28.841 36.1818 30.3758 35.2255 32.2042C34.2703 34.0306 33.6816 36.1264 33.6816 38.0523C33.6816 39.9835 34.2712 41.3374 35.1608 42.01C36.0362 42.6717 37.2697 42.7225 38.6879 41.9015C40.112 41.077 41.4231 39.5422 42.3794 37.7138C43.3346 35.8874 43.9233 33.7916 43.9233 31.8656C43.9233 29.9345 43.3337 28.5806 42.4441 27.908ZM42.7198 27.5433C43.7683 28.3361 44.3804 29.8584 44.3804 31.8656C44.3804 33.8781 43.7674 36.0463 42.7845 37.9257C41.8025 39.8031 40.439 41.416 38.917 42.2971C37.3891 43.1816 35.948 43.1782 34.8851 42.3747C33.8366 41.5819 33.2245 40.0596 33.2245 38.0523C33.2245 36.0398 33.8375 33.8717 34.8205 31.9923C35.8024 30.1149 37.1659 28.502 38.6879 27.6209C40.2158 26.7364 41.6569 26.7398 42.7198 27.5433Z" fill="#374874"/>
<path d="M38.5004 2.55629C38.6532 2.55629 38.7986 2.58649 38.9319 2.64873C38.9319 2.64873 49.0943 8.25851 49.3316 8.45273L53.4311 11.2145C54.2079 11.8186 54.3805 13.221 53.8411 14.7314L52.7822 17.6533C53.3375 17.9721 55.6331 19.1976 55.7182 19.1976C56.646 19.1976 57.2717 20.0391 57.2717 21.2905V27.5045C57.2285 28.9285 56.646 30.2878 55.6103 31.2587L52.417 34.1283C52.3523 34.3657 52.2012 34.9482 52.1365 35.2287L53.7979 37.9257C54.3373 38.8103 54.2294 40.3854 53.5174 41.7447L50.2594 48.0234C49.6121 49.2532 48.6196 50.0515 47.735 50.0515C47.6271 50.0515 47.5192 50.0299 47.4113 50.0084L44.7359 49.3827L44.0886 50.1163L43.3119 54.8199C43.0745 56.2439 42.1899 57.6679 41.1758 58.2505L36.4938 60.9691C36.2133 61.1416 35.8681 61.2495 35.5229 61.2495C34.9552 61.2495 34.5096 60.9445 34.2408 60.4173L31.1538 58.6375L30.1289 60.0628C29.5031 60.9475 28.7264 61.4437 28.0144 61.4437C27.7123 61.4437 27.4318 61.3574 27.1729 61.1849L25.6161 60.007L13.1085 52.2614C12.7633 52.0025 12.5691 51.5278 12.526 50.9669C12.526 50.9669 12.662 49.7454 12.9327 49.0159L13.9249 46.2666L10.1654 44.0965C9.64756 43.9023 9.30235 43.2766 9.30235 42.3919V36.1996C9.3455 35.0777 9.73387 33.9988 10.4459 33.1142L14.3135 29.7052C14.4214 29.2521 14.5293 28.8206 14.6588 28.389L12.7155 25.6057C12.2409 24.8074 12.3487 23.3834 13.0176 22.1103L16.3187 15.8101C16.9229 14.6666 17.8075 13.933 18.5626 13.933C18.5811 13.933 18.5986 13.9339 18.6168 13.9341C18.618 13.934 18.6195 13.9339 18.6213 13.9339C18.8068 13.934 21.8652 14.6234 21.8652 14.6234C22.1457 14.2998 22.4262 13.9762 22.7066 13.674L23.505 8.8626C23.6187 8.22164 24.1307 7.00091 24.1307 7.00091C24.4543 6.37522 24.929 5.85734 25.5331 5.49058L30.1936 2.79353C30.4309 2.64249 30.7114 2.55622 30.9919 2.55622C31.1645 2.55622 31.3587 2.59935 31.5097 2.68566L35.6884 5.09997L36.6449 3.79218C37.2101 3.00418 37.9114 2.55629 38.5004 2.55629ZM38.5004 1.64189C37.5864 1.64189 36.6393 2.2314 35.902 3.25924L35.435 3.89764L31.9671 1.89398C31.6813 1.73067 31.3363 1.64191 30.9919 1.64191C30.5464 1.64191 30.1075 1.76934 29.721 2.01067L25.0752 4.69919L25.0669 4.70402L25.0587 4.70902C24.3226 5.1559 23.7209 5.80317 23.3186 6.58082L23.3018 6.61341L23.2876 6.64726C23.2311 6.7818 22.7325 7.98255 22.6047 8.70287L21.8491 13.2568C21.7433 13.3738 21.638 13.4927 21.5335 13.6118C18.8882 13.0197 18.7292 13.0197 18.6217 13.0196H18.6186C18.5965 13.019 18.5798 13.0187 18.5626 13.0187C17.4503 13.0187 16.2808 13.9246 15.5103 15.383L12.2077 21.686C11.398 23.2271 11.286 24.9905 11.9297 26.0729L11.9467 26.1016L11.9659 26.129L13.6603 28.556C13.5996 28.7791 13.5442 28.9979 13.4923 29.2102L9.84134 32.4283L9.78269 32.48L9.73366 32.5409C8.90539 33.57 8.44034 34.8229 8.38875 36.1644L8.38806 36.182V42.3919C8.38806 43.5965 8.9125 44.5555 9.76303 44.9199L12.8052 46.6759L12.0727 48.7054C11.7745 49.5092 11.6325 50.7291 11.6173 50.8656L11.6078 50.9511L11.6144 51.0369C11.68 51.8901 12.0158 52.5847 12.56 52.9928L12.5926 53.0172L12.6272 53.0387L25.0985 60.7618L26.6213 61.9139L26.6431 61.9304L26.6659 61.9456C27.0765 62.2192 27.5302 62.358 28.0144 62.358C29.0382 62.358 30.081 61.7138 30.8753 60.5907L31.4134 59.8424C32.1581 60.2718 34.174 61.4518 34.6299 61.7545C35.2986 62.1985 36.2875 62.1649 36.9618 61.7545L41.635 59.0411C42.8905 58.3198 43.9283 56.6829 44.2137 54.9701L44.9479 50.5242L45.0599 50.3973L47.2032 50.8985L47.2176 50.9019L47.2324 50.9049C47.368 50.9319 47.5367 50.9657 47.735 50.9657C48.9742 50.9657 50.2515 50.0014 51.0685 48.4491L54.3289 42.1657C55.1921 40.5179 55.293 38.6214 54.5785 37.4496L53.1153 35.0744C53.1527 34.926 53.194 34.7656 53.2305 34.6264L56.2214 31.9386L56.2286 31.9322L56.2356 31.9256C57.4239 30.8116 58.1347 29.2102 58.1855 27.5321L58.1859 27.5182V21.2904C58.1859 19.6057 57.2229 18.9235 55.9265 18.2919C55.5773 18.1218 54.6126 17.6119 53.9079 17.2302L54.7006 15.0428C55.3802 13.1399 55.1017 11.3554 53.9924 10.4926L53.9678 10.4735L53.9419 10.4561L49.8425 7.69435L49.8415 7.69579C49.5726 7.52132 48.1828 6.71087 39.3738 1.84818L39.3466 1.83318L39.3186 1.82006C39.0652 1.70182 38.7899 1.64189 38.5004 1.64189Z" fill="#374874"/>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1,3 @@
.o_subcontracting_portal {
height: 80vh;
}

View file

@ -1,5 +1,28 @@
/** @odoo-module **/
import { startWebClient } from '@web/start';
import { SubcontractingPortalWebClient } from './subcontracting_portal';
import { startWebClient } from "@web/start";
import { SubcontractingPortalWebClient } from "./subcontracting_portal";
import { registry } from "@web/core/registry";
const servicesToRemove = ["menu"];
const servicesRegistry = registry.category("services");
/**
* Remove services unsued in subcontracting portal feature.
*
* This function is used before starting the webclient
* to remove the services that we don't want in the registry.
* In this case, the home_menu service is removed via the assets
* but the services in web_studio depends on this service and are not removed.
* Since this module has not web_studio module in this dependencies, this function will remove
* the services that we don't want instead of create a new module just to remove the services in assets.
*/
export function removeServices() {
for (const service of servicesToRemove) {
if (servicesRegistry.contains(service)) {
servicesRegistry.remove(service);
}
}
}
removeServices();
startWebClient(SubcontractingPortalWebClient);

View file

@ -1,5 +1,3 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { listView } from "@web/views/list/list_view";

View file

@ -1,12 +1,11 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { FormController } from "@web/views/form/form_controller";
import { formView } from "@web/views/form/form_view";
class PickingFormController extends FormController {}
PickingFormController.template = "mrp_subcontracting.PickingFormController";
class PickingFormController extends FormController {
static template = "mrp_subcontracting.PickingFormController";
}
const PickingFormView = {
...formView,

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-name="mrp_subcontracting.PickingFormController" t-inherit="web.FormView" t-inherit-mode="primary" owl="1">
<xpath expr="//ActionMenus" position="replace"/>
<t t-name="mrp_subcontracting.PickingFormController" t-inherit="web.FormView" t-inherit-mode="primary">
<xpath expr="//t[@t-set-slot='control-panel-additional-actions']" position="replace"/>
</t>
</templates>

View file

@ -1,21 +1,17 @@
/** @odoo-module **/
import { useService } from '@web/core/utils/hooks';
import { ActionContainer } from '@web/webclient/actions/action_container';
import { MainComponentsContainer } from "@web/core/main_components_container";
import { useOwnDebugContext } from "@web/core/debug/debug_context";
import { ErrorHandler } from "@web/core/utils/components";
import { session } from '@web/session';
import { LegacyComponent } from "@web/legacy/legacy_component";
import { Component, useEffect, useExternalListener } from "@odoo/owl";
const { useEffect} = owl;
export class SubcontractingPortalWebClient extends LegacyComponent {
export class SubcontractingPortalWebClient extends Component {
static components = { ActionContainer, MainComponentsContainer };
static template = "mrp_subcontracting.SubcontractingPortalWebClient";
static props = {};
setup() {
window.parent.document.body.style.margin = "0"; // remove the margin in the parent body
this.actionService = useService('action');
this.user = useService("user");
useService("legacy_service_provider");
useOwnDebugContext({ categories: ["default"] });
useEffect(
() => {
@ -23,19 +19,7 @@ export class SubcontractingPortalWebClient extends LegacyComponent {
},
() => []
);
}
handleComponentError(error, C) {
// remove the faulty component
this.Components.splice(this.Components.indexOf(C), 1);
/**
* we rethrow the error to notify the user something bad happened.
* We do it after a tick to make sure owl can properly finish its
* rendering
*/
Promise.resolve().then(() => {
throw error;
});
useExternalListener(window, "click", this.onGlobalClick, { capture: true });
}
async _showView() {
@ -54,7 +38,22 @@ export class SubcontractingPortalWebClient extends LegacyComponent {
}
);
}
/**
* @param {MouseEvent} ev
*/
onGlobalClick(ev) {
// When a ctrl-click occurs inside an <a href/> element
// we let the browser do the default behavior and
// we do not want any other listener to execute.
if (
ev.ctrlKey &&
((ev.target instanceof HTMLAnchorElement && ev.target.href) ||
(ev.target instanceof HTMLElement && ev.target.closest("a[href]:not([href=''])")))
) {
ev.stopImmediatePropagation();
return;
}
}
}
SubcontractingPortalWebClient.components = { ActionContainer, ErrorHandler, MainComponentsContainer };
SubcontractingPortalWebClient.template = 'mrp_subcontracting.SubcontractingPortalWebClient';

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-name="mrp_subcontracting.SubcontractingPortalWebClient" owl="1">
<t t-name="mrp_subcontracting.SubcontractingPortalWebClient">
<ActionContainer/>
<MainComponentsContainer/>
</t>