mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-28 05:32:06 +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,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import stock_rules_report
|
||||
from . import sale_order_cancel
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class SaleOrderCancel(models.TransientModel):
|
||||
_inherit = 'sale.order.cancel'
|
||||
|
||||
display_delivery_alert = fields.Boolean('Delivery Alert', compute='_compute_display_delivery_alert')
|
||||
|
||||
@api.depends('order_id')
|
||||
def _compute_display_delivery_alert(self):
|
||||
for wizard in self:
|
||||
out_pickings = wizard.order_id.picking_ids.filtered(lambda p: p.picking_type_code == 'outgoing')
|
||||
wizard.display_delivery_alert = bool(any(picking.state == 'done' for picking in out_pickings))
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="sale_order_cancel_view_form_inherit" model="ir.ui.view">
|
||||
<field name="name">sale.order.cancel.form.inherit</field>
|
||||
<field name="model">sale.order.cancel</field>
|
||||
<field name="inherit_id" ref="sale.sale_order_cancel_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<span id="display_invoice_alert" position="after">
|
||||
<field name="display_delivery_alert" invisible="1"/>
|
||||
<span attrs="{'invisible': [('display_delivery_alert', '=', False)]}">
|
||||
Some deliveries are already done. Returns can be created from the Delivery Orders.
|
||||
</span>
|
||||
</span>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockRulesReport(models.TransientModel):
|
||||
_inherit = 'stock.rules.report'
|
||||
|
||||
so_route_ids = fields.Many2many('stock.route', string='Apply specific routes',
|
||||
domain="[('sale_selectable', '=', True)]", help="Choose to apply SO lines specific routes.")
|
||||
|
||||
def _prepare_report_data(self):
|
||||
data = super(StockRulesReport, self)._prepare_report_data()
|
||||
data['so_route_ids'] = self.so_route_ids.ids
|
||||
return data
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_rules_report_sale" model="ir.ui.view">
|
||||
<field name="name">Stock Rules Report Sale</field>
|
||||
<field name="model">stock.rules.report</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_rules_report"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_ids']" position="after">
|
||||
<field name="so_route_ids" widget="many2many_tags" groups="stock.group_adv_location"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue