mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt putaway
This commit is contained in:
@@ -29,12 +29,14 @@
|
|||||||
""",
|
""",
|
||||||
'description': """
|
'description': """
|
||||||
上架策略菜单。
|
上架策略菜单。
|
||||||
|
每个上架策略只适用于指定位置
|
||||||
广州尚鹏,Sunpop.cn 的odoo模块。
|
广州尚鹏,Sunpop.cn 的odoo模块。
|
||||||
""",
|
""",
|
||||||
'depends': ['stock'],
|
'depends': ['stock'],
|
||||||
'images': [],
|
'images': [],
|
||||||
|
|
||||||
'data': [
|
'data': [
|
||||||
|
'views/stock_location_views.xml',
|
||||||
'views/product_putaway_views.xml',
|
'views/product_putaway_views.xml',
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 11.0+e-20180915\n"
|
"Project-Id-Version: Odoo Server 12.0+e-20181221\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-11-04 20:04+0000\n"
|
"POT-Creation-Date: 2019-01-03 19:28+0000\n"
|
||||||
"PO-Revision-Date: 2018-11-04 20:04+0000\n"
|
"PO-Revision-Date: 2019-01-03 19:28+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -16,15 +16,25 @@ msgstr ""
|
|||||||
"Plural-Forms: \n"
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
#. module: app_stock_putaway
|
#. module: app_stock_putaway
|
||||||
#: model:ir.actions.act_window,help:app_stock_putaway.action_product_putaway
|
#: model:ir.model.fields,field_description:app_stock_putaway.field_product_putaway__location_id
|
||||||
msgid "Click to define a new picking type group."
|
msgid "Location"
|
||||||
msgstr "点击创建一条新的记录."
|
msgstr "适用位置"
|
||||||
|
|
||||||
#. module: app_stock_putaway
|
#. module: app_stock_putaway
|
||||||
#: model:ir.ui.view,arch_db:app_stock_putaway.app_view_strock_putaway_tree
|
#: model_terms:ir.actions.act_window,help:app_stock_putaway.action_product_putaway
|
||||||
msgid "Stock Put Away Strategy"
|
msgid "Please go to \"Configuration->Warehouse Management->Locations\" to Create a Stock Putaway Strategy."
|
||||||
|
msgstr "请在 \"配置->仓库管理->位置\" 中创建上架策略"
|
||||||
|
|
||||||
|
#. module: app_stock_putaway
|
||||||
|
#: model:ir.model,name:app_stock_putaway.model_product_putaway
|
||||||
|
msgid "Put Away Strategy"
|
||||||
msgstr "上架策略"
|
msgstr "上架策略"
|
||||||
|
|
||||||
|
#. module: app_stock_putaway
|
||||||
|
#: model_terms:ir.ui.view,arch_db:app_stock_putaway.app_view_strock_putaway_tree
|
||||||
|
msgid "Stock Put Away Strategy"
|
||||||
|
msgstr "仓库上架策略"
|
||||||
|
|
||||||
#. module: app_stock_putaway
|
#. module: app_stock_putaway
|
||||||
#: model:ir.actions.act_window,name:app_stock_putaway.action_product_putaway
|
#: model:ir.actions.act_window,name:app_stock_putaway.action_product_putaway
|
||||||
#: model:ir.ui.menu,name:app_stock_putaway.menu_putaway
|
#: model:ir.ui.menu,name:app_stock_putaway.menu_putaway
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import product_strategy
|
||||||
|
|
||||||
|
|||||||
18
app_stock_putaway/models/product_strategy.py
Normal file
18
app_stock_putaway/models/product_strategy.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from odoo import fields, models, api
|
||||||
|
|
||||||
|
class PutAwayStrategy(models.Model):
|
||||||
|
_inherit = 'product.putaway'
|
||||||
|
|
||||||
|
# 增加默认父位置
|
||||||
|
location_id = fields.Many2one('stock.location', 'Location')
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def create(self, vals):
|
||||||
|
location_id = self.env.context.get('location_id')
|
||||||
|
vals['location_id'] = location_id
|
||||||
|
return super(PutAwayStrategy, self).create(vals)
|
||||||
|
|
||||||
|
|
||||||
@@ -6,11 +6,27 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Stock Put Away Strategy" create="false">
|
<tree string="Stock Put Away Strategy" create="false">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
|
<field name="location_id"/>
|
||||||
|
<field name="product_location_ids"/>
|
||||||
<field name="fixed_location_ids"/>
|
<field name="fixed_location_ids"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="app_view_putaway">
|
||||||
|
<field name="name">app.product.putaway.form</field>
|
||||||
|
<field name="model">product.putaway</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_putaway"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
|
<field name="location_id" required="1" attrs="{'invisible': [('location_id', '!=', False)]}"/>
|
||||||
|
</xpath>
|
||||||
|
<!--<xpath expr="//field[@name='fixed_location_id']" position="attributes">-->
|
||||||
|
<!--<attribute name="domain">[('id', 'child_of', parent.location_id))]</attribute>-->
|
||||||
|
<!--</xpath>-->
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="action_product_putaway" model="ir.actions.act_window">
|
<record id="action_product_putaway" model="ir.actions.act_window">
|
||||||
<field name="name">Stock Putaway Strategy</field>
|
<field name="name">Stock Putaway Strategy</field>
|
||||||
<field name="res_model">product.putaway</field>
|
<field name="res_model">product.putaway</field>
|
||||||
|
|||||||
14
app_stock_putaway/views/stock_location_views.xml
Normal file
14
app_stock_putaway/views/stock_location_views.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="app_view_location_form">
|
||||||
|
<field name="name">app.stock.location.form</field>
|
||||||
|
<field name="model">stock.location</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_location_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='putaway_strategy_id']" position="attributes">
|
||||||
|
<attribute name="context">{'location_id': active_id, 'default_location_id': active_id}</attribute>
|
||||||
|
<attribute name="domain">[('location_id','=',active_id)]</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user