[FIX] point of sale addons
bzr revid: fp@tinyerp.com-20111218183339-itucpnld6lxjypen
This commit is contained in:
@@ -325,7 +325,11 @@ class pos_order(osv.osv):
|
||||
}
|
||||
return abs
|
||||
|
||||
def action_invoice_state(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state':'invoiced'}, context=context)
|
||||
|
||||
def action_invoice(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
inv_ref = self.pool.get('account.invoice')
|
||||
inv_line_ref = self.pool.get('account.invoice.line')
|
||||
product_obj = self.pool.get('product.product')
|
||||
@@ -341,7 +345,7 @@ class pos_order(osv.osv):
|
||||
|
||||
acc = order.partner_id.property_account_receivable.id
|
||||
inv = {
|
||||
'name': 'Invoice from POS: '+order.name,
|
||||
'name': order.name,
|
||||
'origin': order.name,
|
||||
'account_id': acc,
|
||||
'journal_id': order.sale_journal.id or None,
|
||||
@@ -379,6 +383,7 @@ class pos_order(osv.osv):
|
||||
and [(6, 0, inv_line['invoice_line_tax_id'])] or []
|
||||
inv_line_ref.create(cr, uid, inv_line, context=context)
|
||||
inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
|
||||
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
|
||||
|
||||
if not inv_ids: return {}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<group col="7" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="date_order"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_customer':1}"/>
|
||||
<button name="invoice" string="Invoice" icon="gtk-apply" type="workflow" states="paid" attrs="{'invisible': ['|',('partner_id','=',False),('state','<>','paid')]}"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_customer':1}" attrs="{'readonly': [('state','=','invoiced')]}"/>
|
||||
<button name="action_invoice" string="Invoice" icon="gtk-apply" type="object" states="paid" attrs="{'readonly': [('partner_id','=',False)]}"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Sale Order">
|
||||
@@ -587,9 +587,12 @@
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="categ_id" position="after">
|
||||
<field name="pos_categ_id"/>
|
||||
</field>
|
||||
<group name="status" position="after">
|
||||
<group colspan="2" col="2" name="pos">
|
||||
<separator string="Point-of-Sale" colspan="2"/>
|
||||
<field name="pos_categ_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="wkf_id" ref="wkf_pos"/>
|
||||
<field name="name">invoiced</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="action">action_invoice()</field>
|
||||
<field name="action">action_invoice_state()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<field name="virtual_available"/>
|
||||
<field name="lst_price"/>
|
||||
<field name="price" invisible="not context.get('pricelist',False)"/>
|
||||
<field name="standard_price"/>
|
||||
<field name="standard_price" groups="base.group_extended"/>
|
||||
<field name="state" groups="base.group_extended"/>
|
||||
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
|
||||
</tree>
|
||||
@@ -100,9 +100,10 @@
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Base Prices" colspan="2"/>
|
||||
<field groups="base.group_extended" name="cost_method"/>
|
||||
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
|
||||
<field name="list_price"/>
|
||||
<field groups="base.group_extended" name="cost_method"/>
|
||||
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"
|
||||
groups="base.group_extended"/>
|
||||
<newline/>
|
||||
<field name="price_margin" groups="product.group_product_variant"/>
|
||||
<field name="price_extra" groups="product.group_product_variant"/>
|
||||
@@ -637,8 +638,9 @@
|
||||
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Base Prices" colspan="2"/>
|
||||
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
|
||||
<field name="list_price"/>
|
||||
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"
|
||||
groups="base.group_extended"/>
|
||||
<field groups="base.group_extended" name="cost_method"/>
|
||||
</group>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user