opt putaway

This commit is contained in:
ivan deng
2019-01-04 03:31:34 +08:00
parent b0b74ba1c9
commit 08e1dd8fb3
6 changed files with 71 additions and 8 deletions

View File

@@ -29,12 +29,14 @@
""",
'description': """
上架策略菜单。
每个上架策略只适用于指定位置
广州尚鹏Sunpop.cn 的odoo模块。
""",
'depends': ['stock'],
'images': [],
'data': [
'views/stock_location_views.xml',
'views/product_putaway_views.xml',
],
'demo': [

View File

@@ -4,10 +4,10 @@
#
msgid ""
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"
"POT-Creation-Date: 2018-11-04 20:04+0000\n"
"PO-Revision-Date: 2018-11-04 20:04+0000\n"
"POT-Creation-Date: 2019-01-03 19:28+0000\n"
"PO-Revision-Date: 2019-01-03 19:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,15 +16,25 @@ msgstr ""
"Plural-Forms: \n"
#. module: app_stock_putaway
#: model:ir.actions.act_window,help:app_stock_putaway.action_product_putaway
msgid "Click to define a new picking type group."
msgstr "点击创建一条新的记录."
#: model:ir.model.fields,field_description:app_stock_putaway.field_product_putaway__location_id
msgid "Location"
msgstr "适用位置"
#. module: app_stock_putaway
#: model:ir.ui.view,arch_db:app_stock_putaway.app_view_strock_putaway_tree
msgid "Stock Put Away Strategy"
#: model_terms:ir.actions.act_window,help:app_stock_putaway.action_product_putaway
msgid "Please go to \"Configuration-&gt;Warehouse Management-&gt;Locations\" to Create a Stock Putaway Strategy."
msgstr "请在 \"配置-&gt;仓库管理-&gt;位置\" 中创建上架策略"
#. module: app_stock_putaway
#: model:ir.model,name:app_stock_putaway.model_product_putaway
msgid "Put Away Strategy"
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
#: model:ir.actions.act_window,name:app_stock_putaway.action_product_putaway
#: model:ir.ui.menu,name:app_stock_putaway.menu_putaway

View File

@@ -1 +1,4 @@
# -*- coding: utf-8 -*-
from . import product_strategy

View 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)

View File

@@ -6,11 +6,27 @@
<field name="arch" type="xml">
<tree string="Stock Put Away Strategy" create="false">
<field name="name"/>
<field name="location_id"/>
<field name="product_location_ids"/>
<field name="fixed_location_ids"/>
</tree>
</field>
</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">
<field name="name">Stock Putaway Strategy</field>
<field name="res_model">product.putaway</field>

View 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>