Files
odoo_source/addons/mrp/views/mrp_bom_views.xml
T
Yannick Tivisse 883c96b781 [IMP] base,mail,...: Add ribbon widget everywhere on archived records
Purpose
=======

In the following views, add a bg-danger ribbon with label 'Archived'
only visible when active=False:

account.account_tag_view_form (account.account.tag)
analytic.view_account_analytic_account_form (account.analytic.account)
analytic.account_analytic_tag_form_view (account.analytic.tag)
account_asset.view_account_asset_form (account.asset)
account.view_account_position_form (account.fiscal.position)
account.account_incoterms_form (account.incoterms)
account.view_account_journal_form (account.journal)
account.view_payment_term_form (account.payment.term)
website_blog.view_blog_blog_form (blog.blog)
website_blog.view_blog_post_form (blog.post)
calendar.view_calendar_event_form (calendar.event)
crm.crm_case_form_view_leads (crm.lead)
crm.crm_case_form_view_oppor (crm.lead)
crm.crm_lost_reason_view_form (crm.lost.reason)
sales_team.crm_team_view_form (crm.team)
documents.document_view_form (documents.document)
event.view_event_form (event.event)
website_event_track.view_event_track_form (event.track)
fleet.fleet_vehicle_view_form (fleet.vehicle)
fleet.fleet_vehicle_log_contract_view_form (fleet.vehicle.log.contract)
website_forum.view_forum_forum_form (forum.forum)
website_forum.view_forum_post_form (forum.post)
gamification.badge_form_view (gamification.badge)
helpdesk.helpdesk_sla_view_form (helpdesk.sla)
helpdesk.helpdesk_team_view_form (helpdesk.team)
helpdesk.helpdesk_ticket_view_form (helpdesk.ticket)
hr_recruitment.hr_applicant_view_form (hr.applicant)
hr_appraisal.view_hr_appraisal_form (hr.appraisal)
hr_contract.hr_contract_view_form (hr.contract)
hr.view_department_form (hr.department)
hr.view_employee_form (hr.employee)
hr.hr_employee_public_view_form (hr.employee.public)
hr_holidays.edit_holiday_status_form (hr.leave.type)
hr.hr_plan_view_form (hr.plan)
hr_payroll.hr_salary_rule_form (hr.salary.rule)
hr_work_entry.hr_work_entry_type_view_form (hr.work.entry.type)
lunch.lunch_product_view_form (lunch.product)
lunch.lunch_supplier_view_form (lunch.supplier)
mail.mail_activity_type_view_form (mail.activity.type)
mass_mailing.view_mail_mass_mailing_form (mail.mass_mailing)
mass_mailing.view_mail_mass_mailing_list_form (mail.mass_mailing.list)
maintenance.hr_equipment_view_form (maintenance.equipment)
maintenance.maintenance_team_view_form (maintenance.team)
marketing_automation.marketing_campaign_view_form (marketing.campaign)
mrp.mrp_bom_form_view (mrp.bom)
mrp_plm.mrp_eco_view_form (mrp.eco)
mrp.mrp_routing_form_view (mrp.routing)
mrp.mrp_workcenter_view (mrp.workcenter)
point_of_sale.pos_config_view_form (pos.config)
product.product_pricelist_view (product.pricelist)
hr_expense.product_product_expense_form_view (product.product)
product.product_variant_easy_edit_view (product.product)
stock_landed_costs.view_stock_landed_cost_type_form (product.product)
product.product_template_form_view (product.template)
project_forecast.project_forecast_view_form (project.forecast)
project.edit_project (project.project)
project.view_task_form2 (project.task)
industry_fsm_report.project_worksheet_template_view_form (project.worksheet.template)
quality.quality_point_view_form (quality.point)
base.view_res_bank_form (res.bank)
base.view_partner_form (res.partner)
base.view_users_form (res.users)
sale_coupon.sale_coupon_program_view_form_common (sale.coupon.program)
sale_management.sale_order_template_view_form (sale.order.template)
sale_subscription.sale_subscription_alert_view_form (sale.subscription.alert)
sale_subscription.sale_subscription_template_view_form (sale.subscription.template)
sign.sign_request_view_form (sign.request)
sign.sign_template_view_form (sign.template)
website_slides.view_slide_channel_form (slide.channel)
website_slides.view_slide_slide_form (slide.slide)
stock.view_location_form (stock.location)
stock.stock_location_route_form_view (stock.location.route)
stock.view_picking_type_form (stock.picking.type)
stock.view_stock_rule_form (stock.rule)
stock.view_warehouse (stock.warehouse)
stock.view_warehouse_orderpoint_form (stock.warehouse.orderpoint)
survey.survey_form (survey.survey)
website_crm_score.view_crm_score_form (website.crm.score)
website_twitter_wall.website_twitter_wall_view_form (website.twitter.wall)
2019-07-12 13:01:36 +02:00

233 lines
14 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Bill of Materials -->
<record id="action_report_mrp_bom" model="ir.actions.client">
<field name="name">BoM Structure &amp; Cost</field>
<field name="tag">mrp_bom_report</field>
<field name="context" eval="{'model': 'report.mrp.report_bom_structure'}" />
</record>
<record id="mrp_bom_form_view" model="ir.ui.view">
<field name="name">mrp.bom.form</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<form string="Bill of Material">
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_button_box" name="button_box">
<button name="%(action_report_mrp_bom)d" type="action"
class="oe_stat_button" icon="fa-bars" string="Structure &amp; Cost" attrs="{'invisible': [('bom_line_ids', '=', [])]}"/>
</div>
<group>
<group>
<field name="active" invisible="1"/>
<field name="product_tmpl_id" context="{'default_type': 'product'}"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_id" groups="product.group_product_variant" context="{'default_type': 'product'}"/>
<label for="product_qty" string="Quantity"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
</div>
<field name="routing_id" attrs="{'invisible': [('type','not in',('normal','phantom'))]}" groups="mrp.group_mrp_routings"/>
</group>
<group>
<field name="code"/>
<field name="type" widget="radio"/>
<p colspan="2" class="oe_grey oe_edit_only" attrs="{'invisible': [('type','!=','phantom')]}">
<ul>
A BoM of type kit is used to split the product into its components.
<li>
At the creation of a Manufacturing Order.
</li>
<li>
At the creation of a Stock Transfer.
</li>
</ul>
</p>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
</group>
<notebook>
<page string="Components">
<field name="bom_line_ids" widget="one2many" context="{'default_parent_product_tmpl_id': product_tmpl_id}">
<tree string="Components" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="product_id" context="{'default_type': 'product'}"/>
<button name="action_see_attachments" type="object" icon="fa-files-o" aria-label="attachment" title="attachment"
class="float-right"/>
<field name="attachments_count" class="text-left"
string=" "/>
<field name="product_qty"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="parent_product_tmpl_id" invisible="1" />
<field name="valid_product_attribute_value_ids" invisible="1"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
<field name="attribute_value_ids" widget="many2many_tags" domain="[('id', 'in', valid_product_attribute_value_ids)]" options="{'no_create': True}" attrs="{'column_invisible': [('parent.product_id', '!=', False)]}" groups="product.group_product_variant"/>
<field name="operation_id" groups="mrp.group_mrp_routings" attrs="{'column_invisible': [('parent.type','not in', ('normal', 'phantom'))]}" domain="[('routing_id', '=', parent.routing_id)]" options="{'no_quick_create':True,'no_create_edit':True}"/>
</tree>
</field>
</page>
<page string="By-products" attrs="{'invisible': [('type','!=','normal')]}" groups="mrp.group_mrp_byproducts">
<field name="byproduct_ids">
<tree string="By-products" editable="top">
<field name="product_id" context="{'default_type': 'product'}"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="operation_id" groups="mrp.group_mrp_routings" domain="[('routing_id', '=', parent.routing_id)]" options="{'no_quick_create':True,'no_create_edit':True}"/>
</tree>
<form string="By-products">
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="operation_id" groups="mrp.group_mrp_routings" domain="[('routing_id', '=', parent.routing_id)]" options="{'no_quick_create':True,'no_create_edit':True}"/>
</form>
</field>
</page>
<page string="Miscellaneous">
<group>
<group>
<field name="sequence"/>
<field name="consumption" attrs="{'invisible': [('type','!=','normal')]}"/>
</group>
<group>
<field name="ready_to_produce" attrs="{'invisible': [('type','!=','normal')]}" string="Manufacturing Readiness"/>
<field name="picking_type_id" attrs="{'invisible': [('type','!=','normal')]}" string="Operation"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>
</record>
<record id="mrp_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.tree</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<tree string="Bill of Materials" default_order="product_tmpl_id">
<field name="active" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="product_tmpl_id"/>
<field name="code"/>
<field name="product_id" groups="product.group_product_variant"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="routing_id" groups="mrp.group_mrp_routings"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="mrp_bom_kanban_view" model="ir.ui.view">
<field name="name">mrp.bom.kanban</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="product_tmpl_id"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span clatt="mt4"><field name="product_tmpl_id"/></span></strong>
</div>
<span class="float-right badge badge-pill"><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_mrp_bom_filter" model="ir.ui.view">
<field name="name">mrp.bom.select</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<search string="Search Bill Of Material">
<field name="code" filter_domain="['|',('code','ilike',self),('product_tmpl_id','ilike',self)]"/>
<field name="bom_line_ids" string="Components"/>
<field name="product_tmpl_id" string="Product"/>
<field name="company_id" groups="base.group_multi_company"/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<separator/>
<filter string="Kit" name="phantom" domain="[('type', '=', 'phantom')]"/>
<filter string="Normal" name="normal" domain="[('type', '=', 'normal')]"/>
<group expand="0" string="Group By...">
<filter string="Product" name="product" domain="[]" context="{'group_by':'product_tmpl_id'}"/>
<filter string='Default Unit of Measure' name="default_unit_of_measure" domain="[]" context="{'group_by' : 'product_uom_id'}"/>
<filter string="Routings" name="routings" domain="[]" context="{'group_by':'routing_id'}"/>
</group>
</search>
</field>
</record>
<record id="mrp_bom_form_action" model="ir.actions.act_window">
<field name="name">Bills of Materials</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.bom</field>
<field name="domain">[]</field> <!-- force empty -->
<field name="view_mode">tree,kanban,form</field>
<field name="search_view_id" ref="view_mrp_bom_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a bill of materials
</p><p>
Bills of materials allow you to define the list of required raw
materials used to make a finished product; through a manufacturing
order or a pack of products.
</p>
</field>
</record>
<menuitem id="menu_mrp_bom_form_action"
action="mrp_bom_form_action"
parent="menu_mrp_bom"
sequence="13"/>
<!-- BOM Line -->
<record id="mrp_bom_line_view_form" model="ir.ui.view">
<field name="name">mrp.bom.line.view.form</field>
<field name="model">mrp.bom.line</field>
<field name="arch" type="xml">
<form string="Bill of Material line">
<group>
<group string="Product">
<field name="product_id"/>
<label for="product_qty" string="Quantity"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
</div>
</group>
<group string="BoM details">
<field name="sequence"/>
<field name="operation_id" groups="mrp.group_mrp_routings"/>
</group>
</group>
</form>
</field>
</record>
<record id="template_open_bom" model="ir.actions.act_window">
<field name="context">{'default_product_tmpl_id': active_id, 'search_default_product_tmpl_id': active_id}</field>
<field name="name">Bill of Materials</field>
<field name="res_model">mrp.bom</field>
</record>
<record id="product_open_bom" model="ir.actions.act_window">
<field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
<field name="name">Bill of Materials</field>
<field name="res_model">mrp.bom</field>
<field name="domain">[]</field> <!-- Force empty -->
</record>
</data>
</odoo>