[IMP] pms_purchase

This commit is contained in:
Freni Patel
2022-05-12 16:47:45 +05:30
committed by Maxime Chambreuil
parent 125c6c1a1e
commit 449a92dab7
2 changed files with 27 additions and 1 deletions

View File

@@ -1,11 +1,24 @@
# Copyright (c) 2022 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
from odoo import api, fields, models
class StockPutawayRule(models.Model):
_inherit = "stock.putaway.rule"
location_out_id = fields.Many2one(
"stock.location",
"Store to",
check_company=True,
domain="[('id', 'child_of', location_in_id),"
" ('id', '!=', location_in_id),"
" '|',"
" ('company_id', '=', False),"
" ('company_id', '=', company_id)]",
ondelete="cascade",
required=False,
)
@api.model
def _get_putaway_options(self):
res = super()._get_putaway_options()

View File

@@ -17,5 +17,18 @@
</field>
</field>
</record>
<record id="view_putaway_list_inherit_pms_purchase" model="ir.ui.view">
<field name="name">stock.putaway.rule.list</field>
<field name="model">stock.putaway.rule</field>
<field name="inherit_id" ref="stock.stock_putaway_list" />
<field name="arch" type="xml">
<field name="location_out_id" position="attributes">
<attribute
name="attrs"
>{'required': [('method', '!=', 'move_to_property')]}</attribute>
</field>
</field>
</record>
</odoo>