mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 22:12:07 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding='UTF-8'?>
|
||||
<odoo>
|
||||
<record id="view_product_form_expiry" model="ir.ui.view">
|
||||
<field name="name">product.template.inherit.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="traceability" position="inside">
|
||||
<field name="use_expiration_date" string="Expiration Date" attrs="{'invisible': [('tracking', '=','none')]}"/>
|
||||
</group>
|
||||
<group name="stock_property" position="after">
|
||||
<group string="Dates" name="expiry_and_lots" groups="stock.group_production_lot"
|
||||
attrs="{'invisible': ['|', ('tracking', '=','none'), ('use_expiration_date', '=', False)]}">
|
||||
<label for="expiration_time"/>
|
||||
<div>
|
||||
<field name="expiration_time" class="oe_inline"/>
|
||||
<span> days after receipt</span>
|
||||
</div>
|
||||
<label for="use_time"/>
|
||||
<div>
|
||||
<field name="use_time" class="oe_inline"/>
|
||||
<span> days before expiration date</span>
|
||||
</div>
|
||||
<label for="removal_time"/>
|
||||
<div>
|
||||
<field name="removal_time" class="oe_inline"/>
|
||||
<span> days before expiration date</span>
|
||||
</div>
|
||||
<label for="alert_time"/>
|
||||
<div>
|
||||
<field name="alert_time" class="oe_inline"/>
|
||||
<span> days before expiration date</span>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding='UTF-8'?>
|
||||
<odoo>
|
||||
<record id="view_move_form_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.inherit.form</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='description']" position="before">
|
||||
<page string="Dates" name="expiration_dates" attrs="{'invisible': [('use_expiration_date', '=', False)]}">
|
||||
<field name="use_expiration_date" invisible="1"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="expiration_date" />
|
||||
<field name="removal_date" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="use_date" />
|
||||
<field name="alert_date" />
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('oe_title')]" position="inside">
|
||||
<field name="product_expiry_alert" invisible="1"/>
|
||||
<span class="badge text-bg-danger" attrs="{'invisible': [('product_expiry_alert', '=', False)]}">Expiration Alert</span>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="search_product_lot_filter_inherit_product_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.search.inherit</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after">
|
||||
<filter string="Expiration Alerts" name="expiration_alerts" domain="[('alert_date', '<=', time.strftime('%Y-%m-%d %H:%M:%S'))]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_production_lot_view_tree" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.tree.inherit.product.expiry</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='create_date']" position="after">
|
||||
<field name="product_qty" invisible="1"/>
|
||||
<field name="alert_date" optional="hide" widget='remaining_days' attrs="{'invisible': [('product_qty', '<=', 0)]}"/>
|
||||
<field name="use_date" optional="hide"/>
|
||||
<field name="removal_date" optional="hide"/>
|
||||
<field name="expiration_date" optional="hide"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form_stock" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.product.expiry.stock</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='group_lot_on_delivery_slip']" position="after">
|
||||
<div class="col-12 col-lg-6 o_setting_box" attrs="{'invisible': ['|', ('group_lot_on_delivery_slip', '=', False), ('module_product_expiry', '=', False)]}" id="group_expiry_date_on_delivery_slip">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_expiry_date_on_delivery_slip"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_expiry_date_on_delivery_slip"/>
|
||||
<div class="text-muted">
|
||||
Expiration dates will appear on the delivery slip
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_move_operations_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.move.operations.inherit.form</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_operations"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after" >
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="use_expiration_date" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_move_line_operation_tree_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.inherit.tree</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='lot_id']" position="after">
|
||||
<field name="is_expired" invisible="1"/>
|
||||
<button class="fa fa-exclamation-triangle text-danger"
|
||||
title="This lot is expired." string="This lot is expired"
|
||||
disabled="1"
|
||||
attrs="{'invisible': [('is_expired', '=', False)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='lot_name']" position="after" >
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="expiration_date" force_save="1" attrs="{
|
||||
'column_invisible': ['|', ('parent.use_expiration_date', '!=', True), ('parent.picking_code', '!=', 'incoming')],
|
||||
'readonly': [('picking_type_use_existing_lots', '=', True)],
|
||||
}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_move_line_detailed_operation_tree_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.inherit.tree</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='lot_name']" position="after">
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="expiration_date" force_save="1" attrs="{
|
||||
'column_invisible': [('parent.picking_type_code', '!=', 'incoming')],
|
||||
'readonly': [('picking_type_use_existing_lots', '=', True)],
|
||||
}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='lot_id']" position="after">
|
||||
<field name="is_expired" invisible="1"/>
|
||||
<button class="fa fa-exclamation-triangle text-danger"
|
||||
title="This lot is expired." string="This lot is expired"
|
||||
disabled="1"
|
||||
attrs="{'invisible': [('is_expired', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding='UTF-8'?>
|
||||
<odoo>
|
||||
<record id="view_stock_quant_tree_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.quant.inherit.form</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="decoration-danger">
|
||||
removal_date < current_date or quantity < 0
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='quantity']" position="after" >
|
||||
<field name="removal_date"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree_editable_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.quant.inherit.form</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='lot_id']" position="after">
|
||||
<field name="use_expiration_date" invisible="1"/>
|
||||
<field name="removal_date" optional="hide"
|
||||
invisible="context.get('hide_removal_date')" attrs="{'readonly': ['|', ('tracking', '=', 'none'), ('use_expiration_date', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="quant_search_view_inherit_product_expiry" model="ir.ui.view">
|
||||
<field name="name">stock.quant.search.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.quant_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='reserved']" position="after">
|
||||
<separator/>
|
||||
<filter string="Expiration Alerts" name="expiration_alerts"
|
||||
domain="[('lot_id.alert_date', '<=', context_today().strftime('%Y-%m-%d'))]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue