[MERGE]: Merged with trunk-dev-addons1.
bzr revid: uco@tinyerp.com-20100505121031-oae2ng0eagp02y0x
This commit is contained in:
commit
17fdcb5392
|
@ -21,6 +21,7 @@
|
|||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
|
||||
class account_invoice_confirm(osv.osv_memory):
|
||||
"""
|
||||
|
@ -34,7 +35,12 @@ class account_invoice_confirm(osv.osv_memory):
|
|||
wf_service = netsvc.LocalService('workflow')
|
||||
if context is None:
|
||||
context = {}
|
||||
for id in context['active_ids']:
|
||||
pool_obj = pooler.get_pool(cr.dbname)
|
||||
data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
|
||||
for record in data_inv:
|
||||
if record['state'] not in ('draft','proforma','proforma2'):
|
||||
raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!"))
|
||||
wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr)
|
||||
return {}
|
||||
|
||||
|
@ -47,14 +53,19 @@ class account_invoice_cancel(osv.osv_memory):
|
|||
"""
|
||||
|
||||
_name = "account.invoice.cancel"
|
||||
_description = "Cancel the selected invoices"
|
||||
_description = "Cancel the Selected Invoices"
|
||||
|
||||
def invoice_cancel(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
if context is None:
|
||||
context = {}
|
||||
for id in context['active_ids']:
|
||||
wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
pool_obj = pooler.get_pool(cr.dbname)
|
||||
data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
|
||||
for record in data_inv:
|
||||
if record['state'] in ('cancel','paid'):
|
||||
raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state!"))
|
||||
wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_cancel', cr)
|
||||
return {}
|
||||
|
||||
account_invoice_cancel()
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
<field name="model">account.invoice.confirm</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Confirm draft invoices">
|
||||
<separator string="Confirm draft invoices" colspan="4"/>
|
||||
<form string="Confirm Draft Invoices">
|
||||
<separator string="Confirm Draft Invoices" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Close"/>
|
||||
<button icon="gtk-execute" string="Confirm Invoices" name="invoice_confirm" type="object" default_focus="1"/>
|
||||
</group>
|
||||
</form>
|
||||
|
@ -17,7 +17,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_account_invoice_confirm" model="ir.actions.act_window">
|
||||
<field name="name">Confirm draft invoices</field>
|
||||
<field name="name">Confirm Draft Invoices</field>
|
||||
<field name="res_model">account.invoice.confirm</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<record model="ir.values" id="action_account_invoice_confirm_values">
|
||||
<field name="model_id" ref="account.model_account_invoice" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Confirm draft invoices</field>
|
||||
<field name="name">Confirm Draft Invoices</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_confirm'))" />
|
||||
<field name="key">action</field>
|
||||
|
@ -40,18 +40,18 @@
|
|||
<field name="model">account.invoice.cancel</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Cancel selected invoices">
|
||||
<separator string="Cancel selected invoices" colspan="4"/>
|
||||
<form string="Cancel Selected Invoices">
|
||||
<separator string="Cancel Selected Invoices" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-execute" string="Cancel selected invoices" name="invoice_cancel" type="object" default_focus="1"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Close"/>
|
||||
<button icon="gtk-execute" string="Cancel Invoices" name="invoice_cancel" type="object" default_focus="1"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_invoice_cancel" model="ir.actions.act_window">
|
||||
<field name="name">Cancel selected invoices</field>
|
||||
<field name="name">Cancel Selected Invoices</field>
|
||||
<field name="res_model">account.invoice.cancel</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<record model="ir.values" id="action_account_invoice_cancel_values">
|
||||
<field name="model_id" ref="account.model_account_invoice" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Cancel selected invoices</field>
|
||||
<field name="name">Cancel Selected Invoices</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_cancel'))" />
|
||||
<field name="key">action</field>
|
||||
|
|
|
@ -27,7 +27,5 @@ import stock
|
|||
import wizard
|
||||
import report
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ class pos_order(osv.osv):
|
|||
'date_payment': fields.function(_get_date_payment2, method=True, string='Payment Date', type='date', store=True),
|
||||
'date_validity': fields.date('Validity Date', required=True),
|
||||
'user_id': fields.many2one('res.users', 'Connected Salesman', readonly=True),
|
||||
'user_saleman': fields.many2one('res.users', 'Salesman', required=True),
|
||||
'user_salesman_id': fields.many2one('res.users', 'Salesman', required=True),
|
||||
'sale_manager': fields.many2one('res.users', 'Salesman Manager'),
|
||||
'amount_tax': fields.function(_amount_all, method=True, string='Taxes',digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
|
||||
'amount_total': fields.function(_amount_total, method=True, string='Total'),
|
||||
|
@ -703,7 +703,7 @@ class pos_order(osv.osv):
|
|||
inv_ids = []
|
||||
|
||||
for order in self.browse(cr, uid, ids, context):
|
||||
curr_c = order.user_saleman.company_id
|
||||
curr_c = order.user_salesman_id.company_id
|
||||
if order.invoice_id:
|
||||
inv_ids.append(order.invoice_id.id)
|
||||
continue
|
||||
|
@ -980,8 +980,8 @@ class pos_order(osv.osv):
|
|||
create_contract_nb = True
|
||||
break
|
||||
if create_contract_nb:
|
||||
seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_saleman.login)
|
||||
vals['contract_number'] ='%s-%s' % (pos.user_saleman.login, seq)
|
||||
seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_salesman_id.login)
|
||||
vals['contract_number'] ='%s-%s' % (pos.user_salesman_id.login, seq)
|
||||
self.write(cr, uid, ids, vals)
|
||||
|
||||
def action_paid(self, cr, uid, ids, context=None):
|
||||
|
@ -1328,4 +1328,4 @@ class product_product(osv.osv):
|
|||
'disc_controle': lambda *a: True,
|
||||
}
|
||||
product_product()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<field name="shop_id" ref="sale.shop"/>
|
||||
<field eval=""""2009-05-29"""" name="date_order"/>
|
||||
<field name="partner_id" ref="base.res_partner_5"/>
|
||||
<field name="user_saleman" ref="base.user_root"/>
|
||||
<field name="user_salesman_id" ref="base.user_root"/>
|
||||
<field name="sale_manager" ref="base.user_root"/>
|
||||
<field eval=""""POS/001"""" name="name"/>
|
||||
<field name="company_id" ref="res_company_tinyshop0"/>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<field name="shop_id" ref="sale.shop"/>
|
||||
<field eval=""""2009-05-29"""" name="date_order"/>
|
||||
<field name="partner_id" ref="base.res_partner_3"/>
|
||||
<field name="user_saleman" ref="res_users_sofia0"/>
|
||||
<field name="user_salesman_id" ref="res_users_sofia0"/>
|
||||
<field name="sale_manager" ref="base.user_root"/>
|
||||
<field eval=""""POS/002"""" name="name"/>
|
||||
<field name="company_id" ref="res_company_shop0"/>
|
||||
|
@ -135,7 +135,7 @@
|
|||
<field eval=""""2009-11-29"""" name="date_validity"/>
|
||||
<field eval=""""2009-05-29"""" name="date_order"/>
|
||||
<field name="partner_id" ref="base.res_partner_3"/>
|
||||
<field name="user_saleman" ref="res_users_sofia0"/>
|
||||
<field name="user_salesman_id" ref="res_users_sofia0"/>
|
||||
<field name="sale_manager" ref="base.user_root"/>
|
||||
<field eval=""""POS/0012"""" name="name"/>
|
||||
<field name="company_id" ref="res_company_shop0"/>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<notebook >
|
||||
<page string="Order lines">
|
||||
<group colspan="4" col="6">
|
||||
<field name="user_saleman" />
|
||||
<field name="user_salesman_id" />
|
||||
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
|
||||
<field name="contract_number" select="1" groups="base.group_extended"/>
|
||||
</group>
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
<para style="terp_default_Centre_9">Tel : [[ address and address.phone ]]</para>
|
||||
<para style="terp_default_Centre_9">E-mail : [[ address and address.email ]]</para>
|
||||
<para style="terp_default_Centre_9">Shop : [[ o.shop_id.name ]]</para>
|
||||
<para style="terp_default_Centre_9">Vendeur : [[ o.user_saleman.name ]]</para>
|
||||
<para style="terp_default_Centre_9">Vendeur : [[ o.user_salesman_id.name ]]</para>
|
||||
<para style="terp_default_Centre_9">Date : [[ formatLang(o.date_order,date = True) ]]</para>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
|
|
|
@ -29,7 +29,6 @@ import lot_overview_all
|
|||
import report_stock
|
||||
import report_stock_move
|
||||
import report_stock_picking
|
||||
import report_stock_move
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class stock_location(osv.osv):
|
|||
'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock"),
|
||||
'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
|
||||
'scraped': fields.boolean('Scraped'),
|
||||
'scrap_location': fields.boolean('Scrap Location', help='Check this box if the current location is a place for destroyed items'),
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
|
@ -195,7 +195,7 @@ class stock_location(osv.osv):
|
|||
'posy': lambda *a: 0,
|
||||
'posz': lambda *a: 0,
|
||||
'icon': lambda *a: False,
|
||||
'scraped': lambda *a: False,
|
||||
'scrap_location': lambda *a: False,
|
||||
}
|
||||
|
||||
def chained_location_get(self, cr, uid, location, partner=None, product=None, context={}):
|
||||
|
@ -1214,7 +1214,7 @@ class stock_move(osv.osv):
|
|||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
|
||||
'move_stock_return_history': fields.many2many('stock.move', 'stock_move_return_history', 'move_id', 'return_move_id', 'Move Return History',readonly=True),
|
||||
'delivered_id': fields.many2one('stock.delivery', 'Product delivered'),
|
||||
'scraped': fields.related('location_dest_id','scraped',type='boolean',relation='stock.location',string='Scraped'),
|
||||
'scraped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scraped'),
|
||||
}
|
||||
_constraints = [
|
||||
(_check_tracking,
|
||||
|
|
|
@ -404,7 +404,7 @@
|
|||
<field name="location_id"/>
|
||||
<field name="address_id" context="{'contact_display':'partner'}"/>
|
||||
<field name="icon"/>
|
||||
<field name="scraped"/>
|
||||
<field name="scrap_location"/>
|
||||
<newline/>
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<separator string="Chained Locations" colspan="2"/>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<form string="Scrap Move">
|
||||
<separator string="Scrap Products" colspan="4"/>
|
||||
<field name="product_id" colspan="4" readonly="1"/>
|
||||
<field name="location_id" colspan="4" widget="selection" string="Dest. Location" domain="[('usage','<>','view'),('scraped','=',True)]"/>
|
||||
<field name="location_id" colspan="4" string="Dest. Location" domain="[('usage','<>','view'),('scrap_location','=',True)]" widget="selection"/>
|
||||
<field name="product_qty" colspan="2"/>
|
||||
<field name="product_uom" nolabel="1" readonly="1"/>
|
||||
<newline/>
|
||||
|
|
Loading…
Reference in New Issue