[IMP] food_distribution: add demo data and scrap reason#1984
[IMP] food_distribution: add demo data and scrap reason#1984chga-odoo wants to merge 1 commit intoodoo:saas-19.2from
Conversation
affe923 to
28f9094
Compare
|
@chga-odoo Good work. Just a few feed backs. |
28f9094 to
b5a9869
Compare
| 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) |
There was a problem hiding this comment.
| 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> |
There was a problem hiding this comment.
| <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> |
There was a problem hiding this comment.
| <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> |
There was a problem hiding this comment.
| <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"/> |
There was a problem hiding this comment.
| <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 & Dicing</field> |
There was a problem hiding this comment.
| <field name="title">Plling & Dicing</field> | |
| <field name="title">Peeling & 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> |
There was a problem hiding this comment.
| <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" /> | |||
There was a problem hiding this comment.
| <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([ | |||
There was a problem hiding this comment.
You can directly use search like -
| <value model="stock.move.line" eval="obj().search([ | |
| <value model="stock.move.line" search="[.....]"/> | |
b5a9869 to
a5a8489
Compare
| <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> |
There was a problem hiding this comment.
sorry, we need store=true and readonly=true here.
There was a problem hiding this comment.
why store? It's only in an invisible condition in a view 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I believe performance carries more weight than storage. Any how re computation every time leads to performance issue.
There was a problem hiding this comment.
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
a5a8489 to
eedaf02
Compare
- 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>

Task: 6036099