Improvements

bzr revid: fp@tinyerp.com-20080923205651-fz3o7sgm704qndkt
This commit is contained in:
Fabien Pinckaers 2008-09-23 22:56:51 +02:00
parent 88a6b3780c
commit 23c9ff49a0
9 changed files with 44 additions and 29 deletions

View File

@ -175,15 +175,14 @@
</field>
</group>
<group col="4" colspan="2">
<label colspan="2"/>
<field name="amount_untaxed"/>
<button colspan="2" name="button_reset_taxes" states="draft" string="Reset taxes" type="object"/>
<field name="amount_tax"/>
<field name="amount_untaxed"/>
<button colspan="2" name="button_compute" states="draft" string="Compute" type="object"/>
<field name="amount_total"/>
<field name="amount_tax"/>
<field name="reconciled"/>
<field name="residual"/>
<field name="amount_total"/>
<field name="state" select="2"/>
<field name="residual"/>
<group col="3" colspan="4">
<button name="invoice_open" states="draft,proforma" string="Validate"/>
<button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel"/>
@ -258,15 +257,14 @@
</field>
</group>
<group col="4" colspan="2">
<label colspan="2"/>
<field name="amount_untaxed"/>
<button colspan="2" name="button_reset_taxes" states="draft" string="Reset taxes" type="object"/>
<field name="amount_tax"/>
<field name="amount_untaxed"/>
<button colspan="2" name="button_compute" states="draft" string="Compute" type="object"/>
<field name="amount_total"/>
<field name="amount_tax"/>
<field name="reconciled"/>
<field name="residual"/>
<field name="amount_total"/>
<field name="state" select="2"/>
<field name="residual"/>
<group col="3" colspan="4">
<button name="invoice_proforma" states="draft" string="PRO-FORMA"/>
<button name="invoice_open" states="draft,proforma" string="Create"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<wizard string="Formatted Inv. + Message"
<wizard string="Invoice + Message"
model="account.invoice"
name="wizard.notify_message"
id="wizard_notify_message"
@ -9,7 +9,7 @@
/>
<report id="account_invoices_1"
string="Formatted Inv."
string="Invoice"
model="account.invoice"
name="account.invoice.layout"
rml="account_invoice_layout/report/report_account_invoice_layout.rml"

View File

@ -58,13 +58,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Delivery grids">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="carrier_id" select="1"/>
<field name="sequence" select="1"/>
<notebook>
<page string="Grid definition">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="carrier_id" select="1"/>
<field name="sequence" select="1"/>
<separator colspan="4" string="Grid Lines"/>
<field colspan="4" name="line_ids" nolabel="1" select="1"/>
</page>
<page string="Destination">

View File

@ -169,9 +169,9 @@
<form string="Purchase Order Line">
<notebook>
<page string="Order Line">
<field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
<field name="product_qty"/>
<field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
<field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
<field colspan="4" name="name"/>
<field name="date_planned"/>
<field name="price_unit"/>

View File

@ -214,7 +214,8 @@ class sale_order(osv.osv):
'partner_shipping_id':fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft':[('readonly',False)]}),
'incoterm': fields.selection(_incoterm_get, 'Incoterm',size=3),
'picking_policy': fields.selection([('direct','Partial Delivery'),('one','Complete Delivery')], 'Packing Policy', required=True),
'picking_policy': fields.selection([('direct','Partial Delivery'),('one','Complete Delivery')],
'Packing Policy', required=True, help="""If you don't have enough stock available to deliver all at once, do you accept partial shippings or not."""),
'order_policy': fields.selection([
('prepaid','Payment before delivery'),
('manual','Shipping & Manual Invoice'),
@ -928,15 +929,27 @@ class sale_config_picking_policy(osv.osv_memory):
_name='sale.config.picking_policy'
_columns = {
'name':fields.char('Name', size=64),
'picking_policy': fields.selection([('direct','Direct Delivery'),('one','All at once')], 'Packing Policy', required=True ),
'picking_policy': fields.selection([
('direct','Direct Delivery'),
('one','All at once')
], 'Packing Policy', required=True ),
'order_policy': fields.selection([
('manual','Invoice based on Sales Orders'),
('picking','Invoice based on Deliveries'),
], 'Shipping Policy', required=True, readonly=True, states={'draft':[('readonly',False)]}),
}
_defaults={
'picking_policy': lambda *a: 'direct',
'order_policy': lambda *a: 'picking'
}
def set_default(self, cr, uid, ids, context=None):
if 'name' in context:
print context
for o in self.browse(cr, uid, ids, context=context):
print o.picking_policy, o.order_policy
ir_values_obj = self.pool.get('ir.values')
ir_values_obj.set(cr,uid,'default',False,'picking_policy',['sale.order'],context['picking_policy'])
ir_values_obj.set(cr,uid,'default',False,'picking_policy',['sale.order'],o.picking_policy)
ir_values_obj = self.pool.get('ir.values')
ir_values_obj.set(cr,uid,'default',False,'order_policy',['sale.order'],o.order_policy)
return {
'view_type': 'form',
"view_mode": 'form',

View File

@ -39,6 +39,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.shop</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_shop_tree"/>
</record>
<menuitem id="menu_shop_configuration" name="Configuration" parent="sale.menu_sale_root" sequence="1"/>
@ -221,6 +222,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
</record>
<menuitem action="action_order_form" id="menu_sale_order" parent="sale.menu_sale_root"/>
@ -453,10 +455,12 @@
<field name="model">sale.config.picking_policy</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Configure Picking Policy for Sale Order">
<separator col="4" colspan="4" string="Configure Picking Policy for Sale Order"/>
<form string="Sales Configuration">
<separator colspan="4" string="Configure Sale Order Logistic"/>
<newline/>
<field name="picking_policy"/>
<newline/>
<field name="order_policy"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
<button icon="gtk-ok" name="set_default" string="Set Default" type="object"/>

View File

@ -32,7 +32,7 @@ from osv import fields, osv
class product_product(osv.osv):
_inherit = "product.product"
def view_header_get(self, cr, user, view_id, view_type, context):
def __old_view_header_get(self, cr, user, view_id, view_type, context):
res = super(product_product, self).view_header_get(cr, user, view_id, view_type, context)
if res: return res
if (context.get('location', False)):
@ -156,7 +156,7 @@ class product_product(osv.osv):
'track_incoming' : fields.boolean('Track Incomming Lots', help="Force to use a Production Lot during receptions"),
'track_outgoing' : fields.boolean('Track Outging Lots', help="Force to use a Production Lot during deliveries"),
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False):
def __old_fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar)
if ('location' in context) and context['location']:
location_info = self.pool.get('stock.location').browse(cr, uid, context['location'])

View File

@ -62,7 +62,7 @@
<field name="arch" type="xml">
<group name="status" position="after">
<group colspan="2" col="2">
<separator string="Stocks" colspan="4"/>
<separator string="Stocks" colspan="4"/>
<field name="qty_available"/>
<field name="virtual_available"/>
<field name="incoming_qty"/>

View File

@ -773,6 +773,7 @@
<field name="name"/>
<field name="address_id"/>
<field name="backorder_id"/>
<field name="origin"/>
<field name="date"/>
<field name="min_date"/>
<field name="state"/>
@ -940,8 +941,8 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree color="red:state=='cancel'" string="Packing list">
<field colspan="4" name="name"/>
<field name="address_id" select="1"/>
<field name="name"/>
<field name="address_id"/>
<field name="invoice_state"/>
<field name="origin"/>
<field name="backorder_id"/>