Skip to content

[IMP] food_distribution: add demo data and scrap reason#1984

Closed
chga-odoo wants to merge 1 commit intoodoo:saas-19.2from
odoo-dev:saas-19.2-food-distribution-imp-chga
Closed

[IMP] food_distribution: add demo data and scrap reason#1984
chga-odoo wants to merge 1 commit intoodoo:saas-19.2from
odoo-dev:saas-19.2-food-distribution-imp-chga

Conversation

@chga-odoo
Copy link
Copy Markdown
Contributor

  • Added new products and BOMs
  • Created demo SOs, Purchase Orders, and Transfers
  • Added scrap reason 'Non-compliance'
  • Updated knowledge article as per specifications

Task: 6036099

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented Apr 9, 2026

Pull request status dashboard

@chga-odoo chga-odoo force-pushed the saas-19.2-food-distribution-imp-chga branch 3 times, most recently from affe923 to 28f9094 Compare April 17, 2026 05:07
@pgu-odoo
Copy link
Copy Markdown
Contributor

@chga-odoo Good work. Just a few feed backs.
Don't forget to make the version up.

@chga-odoo chga-odoo force-pushed the saas-19.2-food-distribution-imp-chga branch from 28f9094 to b5a9869 Compare April 28, 2026 07:18
mto_route = self.env.ref('stock.route_warehouse0_mto', raise_if_not_found=False)
for rec in self:
routes = rec.order_line.mapped('product_template_id.route_ids')
rec['x_is_mto_without_date'] = (mto_route in routes and not rec.commitment_date)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rec['x_is_mto_without_date'] = (mto_route in routes and not rec.commitment_date)
rec['x_is_mto_without_date'] = bool(mto_route in routes and not rec.commitment_date)

Just for better practise.

<field name="operation_id" ref="mrp_routing_workcenter_5"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="test_type_id" ref="quality.test_type_instructions"/>
<field name="note"><![CDATA[<div data-oe-version="2.0">Start the process for pilling and dicing.</div>]]></field>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="note"><![CDATA[<div data-oe-version="2.0">Start the process for pilling and dicing.</div>]]></field>
<field name="note"><![CDATA[<div>Start the process for pilling and dicing.</div>]]></field>

<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info"
aria-label="Banner Info">💡</i>
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
<p>This setup relies on Odoo standard MTO capability: Potato Fresh Salad operation routes includes the MTO route.</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>This setup relies on Odoo standard MTO capability: Potato Fresh Salad operation routes includes the MTO route.</p>
<p>This setup relies on Odoo's standard MTO capability: Potato Fresh Salad operation routes include the MTO route.</p>

</ul>
<h5>Scraping the non-compliant ingredients</h5>
<ul>
<li>Then go to Operations, Scrap menu and create a new entry.</li>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>Then go to Operations, Scrap menu and create a new entry.</li>
<li>Then go to the Operations > Scrap menu and create a new entry.</li>

looks better.

<field name="uom_ids" eval="[(6, 0, [ref('uom_uom_39'), ref('uom_uom_40')])]"/>
<field name="barcode">EAN041190012854</field>
<field name="is_favorite" eval="True"/>
<field name="responsible_id" eval="False"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="responsible_id" eval="False"/>
<field name="responsible_id" eval="base.user_admin"/>

better to set it.

</record>
<record id="quality_point_21" model="quality.point">
<field name="name">QCP00002</field>
<field name="title">Plling &amp; Dicing</field>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="title">Plling &amp; Dicing</field>
<field name="title">Peeling &amp; Dicing</field>

<field name="operation_id" ref="mrp_routing_workcenter_5"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="test_type_id" ref="quality.test_type_instructions"/>
<field name="note"><![CDATA[<div data-oe-version="2.0">Start the process for pilling and dicing.</div>]]></field>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="note"><![CDATA[<div data-oe-version="2.0">Start the process for pilling and dicing.</div>]]></field>
<field name="note"><![CDATA[<div data-oe-version="2.0">Start the process for peeling and dicing.</div>]]></field>

@@ -16,4 +16,14 @@
<field name="reminder_date_before_receipt">1</field>
<field name="date_planned" eval="(DateTime.today().date() + relativedelta(days=3))" />
</record>
<record id="purchase_order_4" model="purchase.order">
<field name="partner_id" ref="base_industry_data.res_partner_31"/>
<field name="user_id" eval="False" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="user_id" eval="False" />
<field name="user_id" eval="base.user_admin" />

@@ -43,11 +45,19 @@
('picking_id', '=', obj().env.ref('food_distribution.purchase_order_2').picking_ids.id)], limit=1).id"/>
<value model="stock.lot" eval="{'lot_id': ref('stock_lot_5')}"/>
</function>
<function name="write" model="stock.move.line">
<value model="stock.move.line" eval="obj().search([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can directly use search like -

Suggested change
<value model="stock.move.line" eval="obj().search([
<value model="stock.move.line" search="[.....]"/>

@chga-odoo chga-odoo force-pushed the saas-19.2-food-distribution-imp-chga branch from b5a9869 to a5a8489 Compare April 29, 2026 05:45
Copy link
Copy Markdown
Collaborator

@vava-odoo vava-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robodoo delegate=pgu-odoo

<field name="ttype">boolean</field>
<field name="field_description">Is MTO without date</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="name">x_is_mto_without_date</field>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readonly not stored?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, we need store=true and readonly=true here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why store? It's only in an invisible condition in a view 🤔

Copy link
Copy Markdown
Contributor Author

@chga-odoo chga-odoo Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if it is not stored, it is recomputed every time the Sales Order is opened, whereas it should only be recomputed when commitment_date or the route_id of a linked product in the sales order lines changes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's the spirit of non-stored field 😄
on the other hand, storing such useless information in the table makes no sense.
I still think I'd unstore this.
@pgu-odoo ? any idea?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe performance carries more weight than storage. Any how re computation every time leads to performance issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, let's merge and discuss this later ;-)

- Added new products, BOMs, quality points and work center
- Set MTO, relocate delivery and add worning on SO
- Created demo SOs, Purchase Orders, and Transfers
- Added scrap reason 'Non-compliance'
- Updated knowledge article as per specifications

Task: 6036099
@chga-odoo chga-odoo force-pushed the saas-19.2-food-distribution-imp-chga branch from a5a8489 to eedaf02 Compare April 29, 2026 12:34
@vava-odoo
Copy link
Copy Markdown
Collaborator

@robodoo override=ci/industry
@robodoo r+

robodoo pushed a commit that referenced this pull request Apr 29, 2026
- Added new products, BOMs, quality points and work center
- Set MTO, relocate delivery and add worning on SO
- Created demo SOs, Purchase Orders, and Transfers
- Added scrap reason 'Non-compliance'
- Updated knowledge article as per specifications

closes #1984

Task: 6036099
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
@robodoo robodoo closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants