[IMP] useability improvement: remove check_total, min stock rule in product

bzr revid: fp@tinyerp.com-20120104063807-ip57axpgkkph4a6g
This commit is contained in:
Fabien Pinckaers 2012-01-04 07:38:07 +01:00
parent 52e0383f2c
commit daaf80d8d3
4 changed files with 39 additions and 5 deletions

View File

@ -824,8 +824,9 @@ class account_invoice(osv.osv):
compute_taxes = ait_obj.compute(cr, uid, inv.id, context=ctx)
self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
# I disabled the check_total feature
#if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
# raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
if inv.payment_term:
total_fixed = total_percent = 0
@ -1267,7 +1268,7 @@ class account_invoice_line(osv.osv):
def _price_unit_default(self, cr, uid, context=None):
if context is None:
context = {}
if 'check_total' in context:
if context.get('check_total', False):
t = context['check_total']
for l in context.get('invoice_line', {}):
if isinstance(l, (list, tuple)) and len(l) >= 3 and l[2]:

View File

@ -168,7 +168,7 @@
<field name="reference_type" nolabel="1" size="0"/>
<field name="reference" nolabel="1"/>
<field name="date_due"/>
<field name="check_total" required="2"/>
<field name="check_total" invisible="1"/>
<field colspan="4" default_get="{'check_total': check_total, 'invoice_line': invoice_line, 'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" name="invoice_line" context="{'type': type}" nolabel="1">
<tree string="Invoice lines">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)"/>
@ -179,7 +179,7 @@
<field name="price_unit"/>
<!-- Removed if subtotal is set -->
<field name="price_subtotal"/>
<field name="name"/>
<field invisible="True" name="name"/>
<field invisible="True" name="uos_id"/>
</tree>
</field>

View File

@ -567,4 +567,12 @@ class stock_warehouse_orderpoint(osv.osv):
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context=context)
stock_warehouse_orderpoint()
class product_product(osv.osv):
_inherit="product.product"
_columns = {
'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rule')
}
product_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -275,5 +275,30 @@
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
<menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="menu_stock_procurement" sequence="10"/>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.orderpoint.inherit</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<group name="misc" position="after">
<group col="2" colspan="2" attrs="{'invisible':[('type', '=', 'service')]}">
<separator string="Minimum Stock Rules" colspan="2"/>
<field name="orderpoint_ids" context="{'default_product_uom': uom_id}" nolabel="1">
<tree string="Minimum Stock Rule" editable="bottom">
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
<field name="location_id" groups="base.group_extended"/>
<field name="product_min_qty"/>
<field name="product_max_qty"/>
<field name="product_uom" groups="base.group_extended"/>
</tree>
</field>
</group>
</group>
</field>
</record>
</data>
</openerp>