[MERGE] Merge with dev-addons3 branch
bzr revid: psi@tinyerp.co.in-20100621132033-kkfaj8vhyqh5isql
This commit is contained in:
@@ -247,6 +247,7 @@
|
||||
<field name="count_comments" />
|
||||
<field name="count_votes" />
|
||||
<field name="state"/>
|
||||
<button name="idea_open" string="Open" states="draft" icon="terp-gtk-go-back-rtl"/>
|
||||
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" type="action" states="open" string="Submit Vote"/>
|
||||
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
|
||||
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
|
||||
@@ -372,7 +373,7 @@
|
||||
<field name="search_view_id" ref="view_idea_vote_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
<menuitem name="Votes" parent="menu_idea_reporting" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -101,6 +101,7 @@ class idea_post_vote(osv.osv_memory):
|
||||
"""
|
||||
|
||||
vote_ids = context and context.get('active_ids', []) or []
|
||||
vote_id = context['active_ids'][0]
|
||||
vote_pool = self.pool.get('idea.vote')
|
||||
idea_pool = self.pool.get('idea.idea')
|
||||
comment_pool = self.pool.get('idea.comment')
|
||||
|
||||
@@ -53,16 +53,51 @@
|
||||
<field name="state"/>
|
||||
<field name="descript"/>
|
||||
<field name="price" sum="Total price"/>
|
||||
<button colspan="1"
|
||||
name="%(action_lunch_order_confirm)d"
|
||||
string="Confirm Order"
|
||||
type="action" states="draft"
|
||||
icon="terp-gtk-go-back-rtl" />
|
||||
<button colspan="1"
|
||||
name="%(action_lunch_order_cancel)d"
|
||||
string="Cancel Order"
|
||||
type="action" states="confirmed"
|
||||
icon="terp-gtk-stop" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Lunch order Search view -->
|
||||
|
||||
<record id="view_lunch_order_filter" model="ir.ui.view">
|
||||
<field name="name">lunch.order.list.select</field>
|
||||
<field name="model">lunch.order</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Lunch Order">
|
||||
<filter icon="terp-check" string="To Confirm" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=',('confirmed'))]"/>
|
||||
<filter icon="terp-go-today" name="Today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="Cashbox" icon="terp-dolar" domain="[]" context="{'group_by':'cashmove'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Lunch order Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_order_form">
|
||||
<field name="name">Lunch Orders</field>
|
||||
<field name="res_model">lunch.order</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_lunch_order_filter"/>
|
||||
<field name="context">{"search_default_Today":1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Lunch Order" parent="menu_lunch"
|
||||
@@ -133,20 +168,45 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="CashMove" editable="top">
|
||||
<field name="box" select="1"/>
|
||||
<field name="name" select="1" required="1"/>
|
||||
<field name="user_cashmove" select="1"/>
|
||||
<field name="amount" select="1" sum="Total amount"/>
|
||||
<field name="box" select="1"/>
|
||||
<field name="create_date"/>
|
||||
<field name="amount" select="1" sum="Total amount"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Cash Move Search View -->
|
||||
|
||||
<record id="view_lunch_cashmove_filter" model="ir.ui.view">
|
||||
<field name="name">lunch.cashmove.list.select</field>
|
||||
<field name="model">lunch.cashmove</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search CashMove">
|
||||
<filter icon="terp-go-today" name="Today" string="Today" domain="[('create_date','<=',time.strftime('%%Y-%%m-%%d 23:59:59'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_cashmove"/>
|
||||
<field name="create_date"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_cashmove'}"/>
|
||||
<filter string="Box" icon="terp-accessories-archiver+" domain="[]" context="{'group_by':'box'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Cash Move Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_cashmove_form">
|
||||
<field name="name">CashMove</field>
|
||||
<field name="res_model">lunch.cashmove</field>
|
||||
<field name="search_view_id" ref="view_lunch_cashmove_filter"/>
|
||||
<field name="context">{"search_default_Today":1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Cash Moves" parent="menu_lunch"
|
||||
|
||||
@@ -238,6 +238,7 @@ class pos_order(osv.osv):
|
||||
'invoice_id': False,
|
||||
'account_move': False,
|
||||
'picking_id': False,
|
||||
'statement_ids':[],
|
||||
'nb_print': 0,
|
||||
'pickings': []
|
||||
})
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<group colspan="4" col="7">
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total"/>
|
||||
<button name="%(action_pos_discount)d" string="D_iscount" type="action" states="draft"/>
|
||||
<button name="dummy_button" string="Compute" type="object" />
|
||||
<button name="%(action_pos_discount)d" string="D_iscount" icon="gtk-execute" type="action" states="draft"/>
|
||||
<button name="dummy_button" string="Compute" icon="gtk-execute" type="object" />
|
||||
</group>
|
||||
|
||||
<group colspan="4" col="9" groups="base.group_extended">
|
||||
@@ -95,8 +95,8 @@
|
||||
<field name="sale_journal" domain="[('type','=','sale'),('company_id','=',company_id)]"/>
|
||||
<field name="pricelist_id" domain="[('type','=','sale')]"/>
|
||||
<field name="invoice_id"/>
|
||||
<group colspan="2" col="3">
|
||||
<button name="invoice" string="Create _Invoice" states="paid"/>
|
||||
<group colspan="2" col="4">
|
||||
<button name="invoice" icon="gtk-execute" string="Create _Invoice" states="paid"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
|
||||
@@ -35,19 +35,19 @@ class pos_invoice(report_sxw.rml_parse):
|
||||
})
|
||||
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(objects, data, ids, report_type)
|
||||
def set_context(self, order, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(order, data, ids, report_type)
|
||||
iids = []
|
||||
nids = []
|
||||
|
||||
for order in objects:
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
self.cr.commit()
|
||||
data['ids'] = nids
|
||||
self.datas = data
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="balance_end"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Confirm" name="button_confirm" states="open" icon="terp-gtk-go-back-rtl"/>
|
||||
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="terp-gtk-stop"/>
|
||||
</tree>
|
||||
@@ -109,10 +109,10 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel" groups="base.group_extended"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -172,10 +172,10 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" icon="gtk-cancel" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -301,10 +301,11 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object" />
|
||||
<button name="button_confirm" states="open" string="Confirm" type="object" />
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" icon="gtk-cancel" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -14,7 +14,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -39,7 +39,7 @@ class res_partner_manufacturer(osv.osv):
|
||||
'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
|
||||
}
|
||||
_defaults = {
|
||||
'authorized': lambda *a: True,
|
||||
'authorized': True,
|
||||
}
|
||||
|
||||
res_partner_manufacturer()
|
||||
|
||||
@@ -42,7 +42,7 @@ class product_product(osv.osv):
|
||||
invoice_types=()
|
||||
states=()
|
||||
if invoice_state=='paid':
|
||||
states=('paid')
|
||||
states=('paid',)
|
||||
elif invoice_state=='open_paid':
|
||||
states=('open','paid')
|
||||
elif invoice_state=='draft_open_paid':
|
||||
|
||||
@@ -46,6 +46,25 @@ class sale_order_line(osv.osv):
|
||||
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
|
||||
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
|
||||
|
||||
def get_real_price(res_dict, product_id, pricelist):
|
||||
item_obj = self.pool.get('product.pricelist.item')
|
||||
price_type_obj = self.pool.get('product.price.type')
|
||||
product_obj = self.pool.get('product.product')
|
||||
template_obj = self.pool.get('product.template')
|
||||
field_name = 'list_price'
|
||||
|
||||
if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False):
|
||||
item = res_dict['item_id'].get(pricelist,False)
|
||||
item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base']
|
||||
if item_base > 0:
|
||||
field_name = price_type_obj.browse(cr, uid, item_base).field
|
||||
|
||||
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
|
||||
|
||||
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
|
||||
return product_read[field_name]
|
||||
|
||||
|
||||
res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
|
||||
uom, qty_uos, uos, name, partner_id,
|
||||
lang, update_tax,date_order,fiscal_position=fiscal_position,flag=flag)
|
||||
@@ -68,15 +87,16 @@ class sale_order_line(osv.osv):
|
||||
# product_read = self.pool.get('product.template').read(cr, uid, product_tmpl_id, [field_name], context)
|
||||
# list_price = product_read[field_name]
|
||||
list_price = pricelist_obj.price_get(cr, uid, [pricelist],
|
||||
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })[pricelist]
|
||||
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
|
||||
|
||||
pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
|
||||
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
|
||||
|
||||
old_uom = product.uos_id or product.uom_id
|
||||
new_list_price = product_uom_obj._compute_price(cr,
|
||||
uid, old_uom.id, list_price, uom)
|
||||
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price != 0):
|
||||
discount=(new_list_price-price) / new_list_price * 100
|
||||
# new_list_price = product_uom_obj._compute_price(cr,
|
||||
# uid, old_uom.id, list_price, uom)
|
||||
new_list_price = get_real_price(list_price, product.id, pricelist)
|
||||
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
|
||||
discount = (new_list_price - price) / new_list_price * 100
|
||||
result['price_unit'] = new_list_price
|
||||
result['discount'] = discount
|
||||
else:
|
||||
|
||||
@@ -349,7 +349,8 @@ class product_product(osv.osv):
|
||||
if location_info.usage == 'inventory':
|
||||
if fields.get('virtual_available'):
|
||||
res['fields']['virtual_available']['string'] = _('Future P&L')
|
||||
res['fields']['qty_available']['string'] = _('P&L Qty')
|
||||
if fields.get('qty_available'):
|
||||
res['fields']['qty_available']['string'] = _('P&L Qty')
|
||||
|
||||
if location_info.usage == 'procurement':
|
||||
if fields.get('virtual_available'):
|
||||
|
||||
+17
-15
@@ -559,7 +559,7 @@ class stock_picking(osv.osv):
|
||||
}
|
||||
new_id = super(stock_picking, self).create(cr, user, vals, context)
|
||||
if not vals.get('auto_picking', False):
|
||||
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.")
|
||||
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.")
|
||||
self.log(cr, user, new_id, message)
|
||||
return new_id
|
||||
|
||||
@@ -687,6 +687,8 @@ class stock_picking(osv.osv):
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if not pick.move_lines:
|
||||
raise osv.except_osv(_('Error !'),_('You can not process picking without stock moves'))
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id,
|
||||
'button_confirm', cr)
|
||||
#move_ids = [x.id for x in pick.move_lines]
|
||||
@@ -1385,9 +1387,9 @@ class stock_move(osv.osv):
|
||||
'price_unit': fields.float('Unit Price',
|
||||
digits_compute= dp.get_precision('Account')),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=1),
|
||||
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
|
||||
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True),
|
||||
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order"),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin",store=True),
|
||||
'scraped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scraped'),
|
||||
}
|
||||
_constraints = [
|
||||
@@ -1701,7 +1703,7 @@ class stock_move(osv.osv):
|
||||
tracking_id = tracking_obj.search(cr, uid, ['name','=', tracking])
|
||||
if prodlot_id:
|
||||
update_val['prodlot_id'] = prodlot_id
|
||||
else:
|
||||
else:
|
||||
tracking_id = tracking_obj.create(cr, uid, {'name': tracking}, {'product_id': self.browse(cr, uid, ids)[0].product_id.id})
|
||||
update_val['tracking_id'] = tracking_id
|
||||
else:
|
||||
@@ -2191,17 +2193,17 @@ class stock_move(osv.osv):
|
||||
|
||||
for move in complete:
|
||||
self.action_done(cr, uid, [move.id], context)
|
||||
|
||||
# TOCHECK : Done picking if all moves are done
|
||||
cr.execute("""
|
||||
SELECT move.id FROM stock_picking pick
|
||||
RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
|
||||
WHERE pick.id = %s""",
|
||||
('done', move.picking_id.id))
|
||||
res = cr.fetchall()
|
||||
if len(res) == len(move.picking_id.move_lines):
|
||||
picking_obj.action_move(cr, uid, [move.picking_id.id])
|
||||
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
|
||||
if move.picking_id.id :
|
||||
# TOCHECK : Done picking if all moves are done
|
||||
cr.execute("""
|
||||
SELECT move.id FROM stock_picking pick
|
||||
RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
|
||||
WHERE pick.id = %s""",
|
||||
('done', move.picking_id.id))
|
||||
res = cr.fetchall()
|
||||
if len(res) == len(move.picking_id.move_lines):
|
||||
picking_obj.action_move(cr, uid, [move.picking_id.id])
|
||||
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
|
||||
|
||||
ref = {}
|
||||
done_move_ids = []
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<data>
|
||||
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Future Stock Forecast"/>
|
||||
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking list" rml="stock/report/picking.rml"/>
|
||||
<report id="report_packing_list" model="stock.picking" name="stock.packing.list" string="Packing list" rml="stock/report/packing.rml"/>
|
||||
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
|
||||
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml" groups="base.group_extended"/>
|
||||
<report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>
|
||||
|
||||
@@ -1254,12 +1254,9 @@
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
<group col="7" colspan="4">
|
||||
<label colspan="5"/>
|
||||
<button name="%(act_stock_picking_move_wizard)d" string="Unreceived Products" type="action" states="draft" icon="gtk-redo"/>
|
||||
</group>
|
||||
<group col="10" colspan="4">
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="%(act_stock_picking_move_wizard)d" string="Unreceived Products" type="action" states="draft" icon="gtk-redo"/>
|
||||
<button name="draft_force_assign" states="draft" string="Process Later" type="object" icon="gtk-ok"/>
|
||||
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-media-play"/>
|
||||
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
|
||||
@@ -1354,7 +1351,6 @@
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<field name="name">cancel</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_cancel_inventary()</field>
|
||||
<field name="action">action_cancel()</field>
|
||||
</record>
|
||||
|
||||
<record id="act_cancel" model="workflow.activity">
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
<field name="model">stock.inventory.merge</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Merge inventories">
|
||||
<separator colspan="4" string="Merge inventories" />
|
||||
<label string="Do you want to merge theses inventories ?"/>
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_merge" string="Yes" type="object" icon="gtk-apply"/>
|
||||
<form string="Merge inventories">
|
||||
<separator colspan="4" string="Merge inventories" />
|
||||
<label string="Do you want to merge theses inventories ?"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_merge" string="Yes" type="object" icon="gtk-apply"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -176,15 +176,16 @@ class split_in_production_lot(osv.osv_memory):
|
||||
"""
|
||||
|
||||
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
|
||||
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': move.product_id.id})
|
||||
if 'product_uom' in fields:
|
||||
res.update({'product_uom': move.product_uom.id})
|
||||
if 'qty' in fields:
|
||||
res.update({'qty': move.product_qty})
|
||||
if 'use_exist' in fields:
|
||||
res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
|
||||
if context.get('active_id'):
|
||||
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': move.product_id.id})
|
||||
if 'product_uom' in fields:
|
||||
res.update({'product_uom': move.product_uom.id})
|
||||
if 'qty' in fields:
|
||||
res.update({'qty': move.product_qty})
|
||||
if 'use_exist' in fields:
|
||||
res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -44,7 +44,9 @@ class stock_partial_move(osv.osv_memory):
|
||||
moveids = []
|
||||
for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
|
||||
if m.state in ('done', 'cancel'):
|
||||
continue
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delivery products which are already delivered !'))
|
||||
|
||||
|
||||
if 'move%s_product_id'%(m.id) not in self._columns:
|
||||
self._columns['move%s_product_id'%(m.id)] = fields.many2one('product.product',string="Product")
|
||||
if 'move%s_product_qty'%(m.id) not in self._columns:
|
||||
@@ -66,7 +68,8 @@ class stock_partial_move(osv.osv_memory):
|
||||
move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
|
||||
_moves_arch_lst = """<form string="Deliver Products">
|
||||
<separator colspan="4" string="Delivery Information"/>
|
||||
<field name="date" colspan="4" />
|
||||
<field name="date" />
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','=','in')]}">
|
||||
<field name="partner_id" attrs="{'required':[('type','!=','in')]}" />
|
||||
<field name="address_id" attrs="{'required':[('type','!=','in')]}"/>
|
||||
|
||||
@@ -62,7 +62,8 @@ class stock_partial_picking(osv.osv_memory):
|
||||
picking_ids = context.get('active_ids', False)
|
||||
_moves_arch_lst = """<form string="Deliver Products">
|
||||
<separator colspan="4" string="Delivery Information"/>
|
||||
<field name="date" colspan="4" />
|
||||
<field name="date" />
|
||||
<separator colspan="4"/>
|
||||
<separator colspan="4" string="Move Detail"/>
|
||||
"""
|
||||
_moves_fields = result['fields']
|
||||
|
||||
@@ -32,7 +32,7 @@ class procurement_order(osv.osv):
|
||||
def check_buy(self, cr, uid, ids, context=None):
|
||||
for procurement in self.browse(cr, uid, ids):
|
||||
for line in procurement.product_id.flow_pull_ids:
|
||||
print line.location_src_id.name, line.location_id.name, line.type_proc
|
||||
|
||||
if line.location_id==procurement.location_id:
|
||||
return line.type_proc=='buy'
|
||||
return super(procurement_order, self).check_buy(cr, uid, ids)
|
||||
@@ -58,7 +58,6 @@ class procurement_order(osv.osv):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
for proc in proc_obj.browse(cr, uid, ids, context=context):
|
||||
line = None
|
||||
for line in proc.product_id.flow_pull_ids:
|
||||
@@ -79,7 +78,7 @@ class procurement_order(osv.osv):
|
||||
move_id = self.pool.get('stock.move').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'picking_id': picking_id,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'product_id': proc.product_id.id,
|
||||
'date_planned': proc.date_planned,
|
||||
'product_qty': proc.product_qty,
|
||||
@@ -104,7 +103,7 @@ class procurement_order(osv.osv):
|
||||
proc_id = self.pool.get('procurement.order').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'origin': origin,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'date_planned': proc.date_planned,
|
||||
'product_id': proc.product_id.id,
|
||||
'product_qty': proc.product_qty,
|
||||
|
||||
@@ -80,18 +80,19 @@ class product_pulled_flow(osv.osv):
|
||||
required=True,),
|
||||
}
|
||||
_defaults = {
|
||||
'cancel_cascade': lambda *arg: False,
|
||||
'procure_method': lambda *args: 'make_to_stock',
|
||||
'type_proc': lambda *args: 'move',
|
||||
'picking_type':lambda *args:'out',
|
||||
'invoice_state': lambda *args: 'none',
|
||||
'cancel_cascade': False,
|
||||
'procure_method': 'make_to_stock',
|
||||
'type_proc': 'move',
|
||||
'picking_type': 'out',
|
||||
'invoice_state': 'none',
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'product.pulled.flow', context=c),
|
||||
}
|
||||
product_pulled_flow()
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit = 'product.product'
|
||||
_columns = {
|
||||
'flow_pull_ids': fields.one2many('product.pulled.flow', 'product_id', 'Pulled Flows'),
|
||||
'flow_pull_ids': fields.one2many('product.pulled.flow', 'product_id', 'Pulled Flows'),
|
||||
'path_ids': fields.one2many('stock.location.path', 'product_id',
|
||||
'Pushed Flow',
|
||||
help="These rules set the right path of the product in the "\
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -28,7 +28,7 @@ class product(osv.osv):
|
||||
'auto_pick': fields.boolean('Auto Picking', help="Auto picking for raw materials of production orders.")
|
||||
}
|
||||
_defaults = {
|
||||
'auto_pick': lambda *args: True
|
||||
'auto_pick': True
|
||||
}
|
||||
product()
|
||||
|
||||
|
||||
@@ -346,12 +346,13 @@ class stock_sale_forecast(osv.osv):
|
||||
|
||||
def product_amt_change(self, cr, uid, ids, product_amt = 0.0, product_uom=False):
|
||||
ret={}
|
||||
round_value = 1
|
||||
if product_amt:
|
||||
coeff_def2uom = 1
|
||||
val1 = self.browse(cr, uid, ids)
|
||||
val = val1[0]
|
||||
if (product_uom != val.product_id.uom_id.id):
|
||||
coeff_def2uom, rounding = self._from_default_uom_factor( cr, uid, val, product_uom, {})
|
||||
coeff_def2uom, round_value = self._from_default_uom_factor( cr, uid, val, product_uom, {})
|
||||
ret['product_qty'] = rounding(coeff_def2uom * product_amt/(val.product_id.product_tmpl_id.list_price), round_value)
|
||||
res = {'value': ret}
|
||||
return res
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<separator colspan ="4" string="Forecast lines creation"/>
|
||||
<label colspan ="4" string="Creates forecast lines for selected warehouse and period. Doesn't duplicate existing lines created by you."/>
|
||||
<group colspan="4">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-execute" name="create_forecast" string="Create Forecasts" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
@@ -152,7 +152,7 @@
|
||||
<field name="product_amt" on_change="product_amt_change( product_amt, product_uom)" />
|
||||
<field name="product_qty" />
|
||||
<field name="state"/>
|
||||
<button name="action_validate" string="Validate" states="draft" type="object" colspan = "2"/>
|
||||
<button name="action_validate" icon="gtk-apply" string="Validate" states="draft" type="object" colspan = "2"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator colspan ="4" string="Sales history"/>
|
||||
@@ -209,11 +209,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Stock and Sales Forecasts" editable="bottom">
|
||||
<field name="warehouse_id"/>
|
||||
<field name ="company_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id)" />
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom" />
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -238,14 +240,20 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Stock and Sales Forecast">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-camera_test" string="Validated" domain="[('state','=','validated')]" separator="1"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="warehouse_id" widget="selection"/>
|
||||
<field name="period_id" widget="selection"/>
|
||||
<field name="company_id"/>
|
||||
<field name="warehouse_id" />
|
||||
<field name="period_id" />
|
||||
<field name="product_id"/>
|
||||
<field name="create_uid"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Company" icon="terp-personal" domain="[]" context="{'group_by':'company_id'}"/>
|
||||
<filter string="Warehouse " icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string='Default UOM' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -351,7 +359,7 @@
|
||||
<field name="to_procure"/>
|
||||
<field name="incoming"/>
|
||||
<field name="incoming_left"/>
|
||||
<button name="calculate_planning" string="Calculate Planning" type="object" colspan="2"/>
|
||||
<button name="calculate_planning" string="Calculate Planning" type="object" icon="gtk-execute" colspan="2"/>
|
||||
<field name="stock_only"/>
|
||||
</group>
|
||||
<group colspan ="2" col="2">
|
||||
@@ -362,10 +370,10 @@
|
||||
<field name="outgoing_before"/>
|
||||
<field name="incoming_before"/>
|
||||
<field name="stock_simulation"/>
|
||||
<button name="procure_incomming_left" string="Procure Incoming Left" type="object" colspan="2"/>
|
||||
<button name="procure_incomming_left" icon="gtk-convert" string="Procure Incoming Left" type="object" colspan="2"/>
|
||||
<field name="procure_to_stock"/>
|
||||
<separator colspan ="2" string = "Internal Supply"/>
|
||||
<button name="internal_supply" string="Supply from Another Warehouse" type="object" colspan="2"/>
|
||||
<button name="internal_supply" string="Supply from Another Warehouse" icon="gtk-convert" type="object" colspan="2"/>
|
||||
<field name="supply_warehouse_id" domain = "[('company_id','=',company_id)] "/>
|
||||
<field name="stock_supply_location"/>
|
||||
</group>
|
||||
@@ -382,14 +390,18 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Stock Planning">
|
||||
<group col='10' colspan='4'>
|
||||
<!-- Doesn't work ! <filter icon="terp-purchase" string="Current" domain="[('line_time','=','Future')]" separator="1"/> -->
|
||||
<filter icon="terp-purchase" string="No Requisition" domain="[('history','=',False)]" separator="1"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="warehouse_id" widget="selection"/>
|
||||
<field name="period_id" widget="selection"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Company" icon="terp-personal" domain="[]" context="{'group_by':'company_id'}"/>
|
||||
<filter string="Warehouse " icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -152,6 +152,9 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="document_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_document_form" id="menu_action_document_form" parent="subscription.next_id_45"/>
|
||||
<menuitem name="Configuration" parent="base.menu_tools"
|
||||
id="base.menu_lunch_survey_root" sequence="20" />
|
||||
<menuitem id="config_recuuring_event" name="Recurring Events" parent="base.menu_lunch_survey_root" sequence="4"/>
|
||||
<menuitem action="action_document_form" id="menu_action_document_form" parent="config_recuuring_event"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user