mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-27 04:32:02 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import sale_order_line_rma_wizard
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2024 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class SaleOrderLineRmaWizard(models.TransientModel):
|
||||
|
||||
_inherit = "sale.order.line.rma.wizard"
|
||||
|
||||
lot_id = fields.Many2one(comodel_name="stock.lot", string="Lot/Serial Number")
|
||||
lots_visible = fields.Boolean(compute="_compute_lots_visible")
|
||||
|
||||
@api.depends("product_id.tracking")
|
||||
def _compute_lots_visible(self):
|
||||
for rec in self:
|
||||
rec.lots_visible = rec.product_id.tracking != "none"
|
||||
|
||||
def _prepare_rma_values(self):
|
||||
self.ensure_one()
|
||||
values = super()._prepare_rma_values()
|
||||
values["lot_id"] = self.lot_id.id
|
||||
return values
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2024 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record model="ir.ui.view" id="sale_order_rma_wizard_form_view">
|
||||
<field name="model">sale.order.rma.wizard</field>
|
||||
<field name="inherit_id" ref="rma_sale.sale_order_rma_wizard_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after">
|
||||
<field name="lots_visible" invisible="True" />
|
||||
<field
|
||||
name="lot_id"
|
||||
groups="stock.group_production_lot"
|
||||
attrs="{'invisible': [('lots_visible', '=', False)]}"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue