-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add preparation weekdays to stock.release.channel
- Loading branch information
1 parent
47944ce
commit d72404a
Showing
7 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import res_partner | ||
from . import stock_release_channel | ||
from . import stock_release_channel_preparation_plan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import api, fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
stock_release_channel_delivery_weekday_ids = fields.Many2many( | ||
"time.weekday", | ||
compute="_compute_stock_release_channel_delivery_weekday_ids", | ||
readonly=True, | ||
store=True, | ||
) | ||
|
||
@api.depends("stock_release_channel_ids.preparation_weekday_ids") | ||
def _compute_stock_release_channel_delivery_weekday_ids(self): | ||
for partner in self: | ||
partner.stock_release_channel_delivery_weekday_ids = ( | ||
partner.stock_release_channel_ids.preparation_weekday_ids | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="res_partner_form_view"> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="stock_release_channel.res_partner_form_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="stock_release_channel_ids" position="after"> | ||
<field name="stock_release_channel_delivery_weekday_ids" /> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters