[IMP] sale:-hide the button create invoice and cancel button when SO line invoiced,

filtering on 'uninvoiced lines',pikcing policy field-readonly when picking created,
solved the error in Partial Invoice

bzr revid: mtr@mtr-20100709135732-n6seq6iw39xcf3wd
This commit is contained in:
mtr 2010-07-09 19:27:32 +05:30
parent 6d24e06b26
commit 8f733ccb94
3 changed files with 10 additions and 5 deletions

View File

@ -233,7 +233,7 @@ class sale_order(osv.osv):
'incoterm': fields.selection(_incoterm_get, 'Incoterm', size=3, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction"),
'picking_policy': fields.selection([('direct', 'Partial Delivery'), ('one', 'Complete Delivery')],
'Picking Policy', required=True, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""),
'Picking Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""),
'order_policy': fields.selection([
('prepaid', 'Payment Before Delivery'),
('manual', 'Shipping & Manual Invoice'),

View File

@ -399,17 +399,21 @@
<group col="3" colspan="2">
<button colspan="1"
name="call_make_invoices"
states="confirmed"
string="Create Invoice"
type="object"
icon="terp-document-new" />
icon="terp-document-new"
attrs="{'invisible': [('invoiced', '=', 1)]}" />
<button name="button_done"
states="confirmed,exception"
string="Done" type="object"
icon="gtk-jump-to" />
icon="gtk-jump-to"
attrs="{'invisible': [('invoiced', '=', 0)]}"/>
<button name="button_cancel"
states="confirmed,exception"
string="Cancel" type="object"
icon="gtk-cancel" />
icon="gtk-cancel"
attrs="{'invisible': [('invoiced', '=', 1)]}" />
</group>
</page>
<!-- <page string="Properties" groups="base.group_extended">-->
@ -492,6 +496,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter" />
<field name="context">{"search_default_uninvoiced":1}</field>
<field name="filter" eval="True"/>
</record>

View File

@ -64,7 +64,7 @@ class sale_advance_payment_inv(osv.osv_memory):
_("You cannot make an advance on a sale order \
that is defined as 'Automatic Invoice after delivery'."))
val = obj_lines.product_id_change(cr, uid, [], sale_adv_obj.product_id.id,
uom = False, partner_id = sale.partner_id.id, fiscal_position = sale.fiscal_position.id)
uom = False, partner_id = sale.partner_id.id, fposition_id = sale.fiscal_position.id)
line_id =obj_lines.create(cr, uid, {
'name': val['value']['name'],
'account_id': val['value']['account_id'],