bzr revid: christophe@tinyerp.com-20080826080541-nv7a6iqyak36uz8m
This commit is contained in:
Christophe Simonis 2008-08-26 10:05:41 +02:00
commit 04d097ed47
24 changed files with 319 additions and 248 deletions

View File

@ -423,7 +423,7 @@ class account_journal(osv.osv):
'user_id': fields.many2one('res.users', 'User', help="The responsible user of this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State of Created Entries', help='Check this box if you don\'t want that new account moves pass through the draft state'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want that new account moves pass through the \'draft\' state and goes direclty to the \'posted state\' without any manual validation.'),
}
_defaults = {
'active': lambda *a: 1,

View File

@ -404,7 +404,11 @@ class account_move_line(osv.osv):
account_id = line['account_id']['id']
partner_id = (line['partner_id'] and line['partner_id']['id']) or False
writeoff = debit - credit
date = time.strftime('%Y-%m-%d')
# Ifdate_p in context => take this date
if context.has_key('date_p') and context['date_p']:
date=context['date_p']
else:
date = time.strftime('%Y-%m-%d')
cr.execute('SELECT account_id, reconcile_id \
FROM account_move_line \
@ -435,9 +439,15 @@ class account_move_line(osv.osv):
self_credit = 0.0
self_debit = -writeoff
# If comment exist in context, take it
if context['comment']:
libelle=context['comment']
else:
libelle='Write-Off'
writeoff_lines = [
(0, 0, {
'name':'Write-Off',
'name':libelle,
'debit':self_debit,
'credit':self_credit,
'account_id':account_id,
@ -447,7 +457,7 @@ class account_move_line(osv.osv):
'amount_currency': account.currency_id.id and -currency or 0.0
}),
(0, 0, {
'name':'Write-Off',
'name':libelle,
'debit':debit,
'credit':credit,
'account_id':writeoff_acc_id,
@ -488,6 +498,11 @@ class account_move_line(osv.osv):
return r_id
def view_header_get(self, cr, user, view_id, view_type, context):
if context.get('account_id', False):
cr.execute('select code from account_account where id=%d', (context['account_id'],))
res = cr.fetchone()
res = _('Entries: ')+ (res[0] or '')
return res
if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
return False
cr.execute('select code from account_journal where id=%d', (context['journal_id'],))
@ -495,8 +510,8 @@ class account_move_line(osv.osv):
cr.execute('select code from account_period where id=%d', (context['period_id'],))
p = cr.fetchone()[0] or ''
if j or p:
return j+':'+p
return 'Journal'
return j+(p and (':'+p) or '')
return False
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context)
@ -709,7 +724,6 @@ class account_move_line(osv.osv):
tax_id=tax_obj.browse(cr,uid,vals['account_tax_id'])
total = vals['credit'] or (-vals['debit'])
for tax in tax_obj.compute(cr,uid,[tax_id],total,1.00):
print 'Processing Tax', tax
self.write(cr, uid,[result], {
'tax_code_id': tax['base_code_id'],
'tax_amount': tax['base_sign'] * total
@ -729,7 +743,6 @@ class account_move_line(osv.osv):
'credit': tax['amount']>0 and tax['amount'] or 0.0,
'debit': tax['amount']<0 and -tax['amount'] or 0.0,
}
print data
self.create(cr, uid, data, context)
if check:
tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)

View File

@ -888,7 +888,7 @@
<menuitem action="action_move_line_search" id="menu_action_move_line_search" parent="account.next_id_29"/>
<menuitem id="menu_finance_charts" name="Charts" parent="account.menu_finance" sequence="7"/>
<wizard id="wizard_account_chart" menu="False" model="account.account" name="account.chart" string="Accounts Charts"/>
<wizard id="wizard_account_chart" menu="False" model="account.account" name="account.chart" string="Chart of Accounts"/>
<menuitem action="wizard_account_chart" id="menu_action_account_tree2" parent="account.menu_finance_charts" type="wizard"/>
@ -1319,17 +1319,18 @@
</record>
<record id="action_move_line_tree1" model="ir.actions.act_window">
<field name="name">Move line select</field>
<field name="name">Entries</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('account_id','child_of', [active_id]),('state','&lt;&gt;','draft')]</field>
<field name="context">{'account_id':active_id}</field>
</record>
<wizard id="wizard_move_line_select" menu="False" model="account.move.line" name="account.move.line.select" string="Move line select"/>
<record id="ir_open_account_account" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>
<field eval="'account.account'" name="model"/>
<field name="name">Open all entries lines</field>
<field name="name">Account Entries</field>
<field eval="'ir.actions.wizard,%d'%wizard_move_line_select" name="value"/>
<field eval="True" name="object"/>
</record>
@ -1514,14 +1515,14 @@
<menuitem id="account_account_template_menu" name="Templates" parent="account.menu_finance_configuration"/>
<menuitem action="action_account_template_form" id="menu_action_account_template_form" parent="account_account_template_menu"/>
<!-- Account Chart Templates -->
<!-- Chart of Accounts Templates -->
<record id="view_account_chart_template_form" model="ir.ui.view">
<field name="name">account.chart.template.form</field>
<field name="model">account.chart.template</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account Chart Template">
<form string="Chart of Accounts Template">
<field colspan="4" name="name" select="1"/>
<newline/>
<field name="account_root_id" select="1"/>
@ -1538,7 +1539,7 @@
<field name="model">account.chart.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Account Chart Template">
<tree string="Chart of Accounts Template">
<field name="name"/>
<field name="account_root_id"/>
<field name="bank_account_view_id"/>
@ -1546,7 +1547,7 @@
</field>
</record>
<record id="action_account_chart_template_form" model="ir.actions.act_window">
<field name="name">Account Chart Templates</field>
<field name="name">Chart of Accounts Templates</field>
<field name="res_model">account.chart.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -1598,7 +1599,7 @@
<field name="model">wizard.account.chart.duplicate</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Duplicate Account Chart">
<form string="Duplicate Chart of Accounts">
<field name="account_id"/>
<field name="company_id"/>
<newline/>
@ -1611,7 +1612,7 @@
</record>
<record id="action_wizard_account_duplicate_chart_form" model="ir.actions.act_window">
<field name="name">Duplicate Account Chart</field>
<field name="name">Duplicate Chart of Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.account.chart.duplicate</field>
<field name="view_type">form</field>

View File

@ -685,20 +685,30 @@ class account_invoice(osv.osv):
invoice = self.browse(cr, uid, ids[0])
src_account_id = invoice.account_id.id
journal = self.pool.get('account.journal').browse(cr, uid, pay_journal_id)
if not name:
if journal.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
if journal.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
# Take the seq as name for move
if journal.sequence_id:
seq = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
raise osv.except_osv('No piece number !', 'Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')
types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
direction = types[invoice.type]
#take the choosen date
if context.has_key('date_p') and context['date_p']:
date=context['date_p']
else:
date=time.strftime('%Y-%m-%d')
l1 = {
'name': name,
'debit': direction * pay_amount>0 and direction * pay_amount,
'credit': direction * pay_amount<0 and - direction * pay_amount,
'account_id': src_account_id,
'partner_id': invoice.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date': date,
'ref':invoice.number,
}
l2 = {
'name':name,
@ -706,11 +716,12 @@ class account_invoice(osv.osv):
'credit': direction * pay_amount>0 and direction * pay_amount,
'account_id': pay_account_id,
'partner_id': invoice.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date': date,
'ref':invoice.number,
}
lines = [(0, 0, l1), (0, 0, l2)]
move = {'name': name, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id}
move = {'name': seq, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id}
move_id = self.pool.get('account.move').create(cr, uid, move)
line_ids = []

View File

@ -5,20 +5,6 @@
Partners Extension
-->
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.form.inherit</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="credit" select="2"/>
<field name="debit" select="2"/>
<newline/>
</field>
</field>
</record>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.property.form.inherit</field>
<field name="model">res.partner</field>
@ -26,16 +12,56 @@
<field name="priority">2</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Properties" position="inside">
<newline/>
<separator string="Customer Accounting Properties" colspan="2"/>
<separator string="Supplier Accounting Properties" colspan="2"/>
<field name="property_account_receivable"/>
<field name="property_account_payable"/>
<field name="property_account_tax"/>
<field name="property_account_supplier_tax"/>
<field name="property_payment_term"/>
</page>
<notebook>
<page string="Accounting" position="inside">
<group col="2" colspan="2">
<separator string="Customer Accounting Properties" colspan="2"/>
<field name="property_account_receivable"/>
<field name="property_account_tax"/>
<field name="property_payment_term"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Accounting Properties" colspan="2"/>
<field name="property_account_payable"/>
<field name="property_account_supplier_tax"/>
</group>
<group col="2" colspan="2">
<separator string="Customer Credit" colspan="2"/>
<field name="credit" select="2"/>
<field name="credit_limit" select="2"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Debit" colspan="2"/>
<field name="debit" select="2"/>
</group>
<field colspan="4" context="address=address" name="bank_ids" nolabel="1">
<form string="Bank account">
<field name="state" select="2"/>
<newline/>
<field name="acc_number" select="1"/>
<newline/>
<field name="bank"/>
<newline/>
<field name="sequence"/>
<field colspan="4" name="name" select="2"/>
<separator colspan="4" string="Bank account owner"/>
<field colspan="4" name="owner_name"/>
<field colspan="4" name="street"/>
<newline/>
<field name="zip"/>
<field name="city"/>
<newline/>
<field completion="1" name="country_id"/>
<field name="state_id"/>
</form>
<tree string="Bank Details">
<field name="state"/>
<field name="owner_name"/>
<field name="acc_number"/>
</tree>
</field>
</page>
</notebook>
</field>
</record>

View File

@ -50,10 +50,13 @@
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<group string="Properties" position="inside">
<field name="property_account_income_categ"/>
<field name="property_account_expense_categ"/>
</group>
<form position="inside">
<group col="2" colspan="2">
<separator string="Accounting Properties" colspan="2"/>
<field name="property_account_income_categ"/>
<field name="property_account_expense_categ"/>
</group>
</form>
</field>
</record>

View File

@ -78,7 +78,7 @@
<menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" parent="next_id_39"/>
<record id="action_account_analytic_account_tree2" model="ir.actions.act_window">
<field name="name">Analytic Charts of Accounts</field>
<field name="name">Analytic Chart of Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
<field name="domain">[('parent_id','=',False)]</field>

View File

@ -52,7 +52,10 @@ class wizard_move_line_select(wizard.interface):
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_tree1')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
result['context'] = str({'fiscalyear': context.get('fiscalyear', False)})
result['context'] = {
'fiscalyear': context.get('fiscalyear', False),
'account_id': data['id']
}
result['domain']=result['domain'][0:-1]+','+domain+result['domain'][-1]
return result

View File

@ -68,6 +68,13 @@ def _pay_and_reconcile(self, cr, uid, data, context):
ctx = {'date':data['form']['date']}
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
# Take the choosen date
if form.has_key('comment'):
context={'date_p':form['date'],'comment':form['comment']}
else:
context={'date_p':form['date'],'comment':False}
acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
if not acc_id:
raise wizard.except_wizard(_('Error !'), _('Your journal must have a default credit and debit account.'))
@ -80,7 +87,7 @@ def _wo_check(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context)
if invoice.company_id.currency_id.id<>journal.currency.id:
if invoice.company_id.currency_id.id<>journal.currency.id or journal.currency.id <> invoice.currency_id.id:
return 'addendum'
if pool.get('res.currency').is_zero(cr, uid, invoice.currency_id,
(data['form']['amount'] - invoice.amount_total)):
@ -92,11 +99,13 @@ _transaction_add_form = '''<?xml version="1.0"?>
<separator string="Write-Off Move" colspan="4"/>
<field name="writeoff_acc_id"/>
<field name="writeoff_journal_id"/>
<field name="comment"/>
</form>'''
_transaction_add_fields = {
'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True},
'writeoff_journal_id': {'string': 'Write-Off journal', 'type': 'many2one', 'relation':'account.journal', 'required':True},
'comment': {'string': 'Entry Name', 'type':'char', 'size': 64, 'required':True},
}
def _get_value_addendum(self, cr, uid, data, context={}):

View File

@ -124,10 +124,9 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="client_order_ref" position="after">
<separator string="Notes" position="before">
<field name="carrier_id"/>
</field>
</separator>
</field>
</record>
@ -195,4 +194,4 @@
</data>
</terp>
</terp>

View File

@ -318,7 +318,7 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Extra Info" position="after">
<notebook position="inside">
<page string="Membership">
<field name="membership_state" select="2"/>
<field name="membership_amount" select="2"/>
@ -341,7 +341,7 @@
</form>
</field>
</page>
</page>
</notebook>
</field>
</record>

View File

@ -7,9 +7,12 @@
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Properties" position="inside">
<separator string="Sales" colspan="4"/>
<field name="property_product_pricelist"/>
<page string="Sales &amp; Purchases" position="inside">
<newline/>
<group col="2" colspan="2">
<separator string="Sales" colspan="2"/>
<field name="property_product_pricelist"/>
</group>
</page>
</field>
</record>

View File

@ -328,6 +328,13 @@ class product_template(osv.osv):
product_template()
class product_product(osv.osv):
def view_header_get(self, cr, uid, view_id, view_type, context):
res = super(product_product, self).view_header_get(cr, uid, view_id, view_type, context)
if res: return res
if (not context.get('categ_id', False)):
return False
return _('Products: ')+self.pool.get('product.category').browse(cr, uid, context['categ_id'], context).name
def _product_price(self, cr, uid, ids, name, arg, context={}):
res = {}
quantity = context.get('quantity', 1)

View File

@ -46,64 +46,64 @@
</group>
<notebook>
<page string="Information">
<group colspan="2" col="2">
<separator string="Procurement" colspan="2"/>
<field name="type" select="2"/>
<field name="procure_method"/>
<field name="supply_method"/>
</group>
<group colspan="2" col="2">
<separator string="Procurement" colspan="2"/>
<field name="type" select="2"/>
<field name="procure_method"/>
<field name="supply_method"/>
</group>
<group colspan="2" col="2">
<separator string="Weigths" colspan="2"/>
<field digits="(14, 3)" groups="base.group_extended" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" groups="base.group_extended" name="weight" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" groups="base.group_extended" name="weight_net" attrs="{'readonly':[('type','=','service')]}"/>
</group>
<group colspan="2" col="2">
<separator string="Weigths" colspan="2"/>
<field digits="(14, 3)" groups="base.group_extended" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" groups="base.group_extended" name="weight" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" groups="base.group_extended" name="weight_net" attrs="{'readonly':[('type','=','service')]}"/>
</group>
<group colspan="2" col="2" name="status">
<separator string="Status" colspan="2"/>
<field name="categ_id" select="1"/>
<field name="state" select="2"/>
<field groups="base.group_extended" name="product_manager" select="2"/>
</group>
<group colspan="2" col="2" name="status">
<separator string="Status" colspan="2"/>
<field name="categ_id" select="1"/>
<field name="state" select="2"/>
<field groups="base.group_extended" name="product_manager" select="2"/>
</group>
<group colspan="2" col="2" name="uom">
<separator string="Lots" colspan="2"/>
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)"/>
<field name="uom_po_id"/>
<field name="tracking"/>
</group>
<group colspan="2" col="2" name="uom">
<separator string="Lots" colspan="2"/>
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)"/>
<field name="uom_po_id"/>
<field name="tracking"/>
</group>
<group colspan="2" col="2" name="uom">
<separator string="Second UoM" colspan="2"/>
<field name="uos_id"/>
<field name="uos_coeff"/>
<field name="mes_type"/>
</group>
<group colspan="2" col="2" name="uom">
<separator string="Second UoM" colspan="2"/>
<field name="uos_id"/>
<field name="uos_coeff"/>
<field name="mes_type"/>
</group>
</page>
<page string="Procurement &amp; Locations">
<group colspan="2" col="2" name="delay">
<separator string="Delays" colspan="2"/>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',0)]}"/>
<field name="produce_delay"/>
<field name="warranty"/>
</group>
<group colspan="2" col="2" name="store">
<separator string="Storage Localisation" colspan="2"/>
<field name="loc_rack"/>
<field name="loc_row"/>
<field name="loc_case"/>
</group>
<group colspan="2" col="2" name="delay">
<separator string="Delays" colspan="2"/>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',0)]}"/>
<field name="produce_delay"/>
<field name="warranty"/>
</group>
<group colspan="2" col="2" name="store">
<separator string="Storage Localisation" colspan="2"/>
<field name="loc_rack"/>
<field name="loc_row"/>
<field name="loc_case"/>
</group>
<group colspan="2" col="2" name="misc">
<separator string="Miscelleanous" colspan="2"/>
<field name="active" select="2"/>
</group>
<group colspan="2" col="2" name="misc">
<separator string="Miscelleanous" colspan="2"/>
<field name="active" select="2"/>
</group>
</page>
<page string="Prices">
<separator string="Base Prices" colspan="4"/>
<separator string="Base Prices" colspan="4"/>
<field name="standard_price"/>
<field name="list_price"/>
<field groups="base.group_extended" name="cost_method"/>
@ -162,8 +162,7 @@
<field name="name" select="1"/>
<field name="parent_id"/>
<field name="sequence"/>
<group string="Properties" colspan="4" groups="base.group_extended">
</group>
<newline/>
</form>
</field>
</record>
@ -199,12 +198,13 @@
<record id="product_normal_action_tree" model="ir.actions.act_window">
<field name="name">product.normal.action.tree</field>
<field name="name" eval="False"/>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('categ_id','child_of',[active_id])]</field>
<field name="context">{'categ_id':active_id}</field>
</record>
<record id="ir_product_category_open" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>

View File

@ -7,9 +7,11 @@
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Properties" position="inside">
<separator string="Purchases" colspan="4"/>
<field name="property_product_pricelist_purchase"/>
<page string="Sales &amp; Purchases" position="inside">
<group colspan="2" col="2">
<separator string="Purchases" colspan="2"/>
<field name="property_product_pricelist_purchase"/>
</group>
</page>
</field>
</record>

View File

@ -99,10 +99,10 @@ class purchase_order(osv.osv):
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}),
'location_id': fields.many2one('stock.location', 'Delivery destination', required=True),
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Confirmed'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Order State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True),
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order State', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'notes': fields.text('Notes'),
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
@ -331,7 +331,7 @@ class purchase_order_line(osv.osv):
}
_table = 'purchase_order_line'
_name = 'purchase.order.line'
_description = 'Purchase Order line'
_description = 'Purchase Order lines'
def copy(self, cr, uid, id, default=None,context={}):
if not default:
default = {}

View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<terp>
<data>
<record id="category_supplier" model="res.partner.category">
<field name="name">Suppliers</field>
</record>
<menuitem icon="terp-purchase" id="menu_purchase_root" name="Purchase Management"/>
<record id="purchase_order_form" model="ir.ui.view">
@ -13,23 +9,23 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Purchase Order">
<notebook>
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="shipped" select="2"/>
<field name="invoiced" select="2"/>
<newline/>
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)"/>
<field name="origin" select="2"/>
<field name="date_order" select="2"/>
</group>
<notebook colspan="4">
<page string="Purchase Order">
<field name="name" select="1"/>
<group col="4" colspan="2">
<field name="shipped" select="2"/>
<field name="invoiced" select="2"/>
</group>
<newline/>
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)"/>
<field name="date_order" select="2"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" domain="[('category_id','child_of', [%(category_supplier)d])]"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" domain="[('supplier','=', 1)]"/>
<field name="partner_address_id"/>
<field domain="[('type','=','purchase')]" name="pricelist_id"/>
<field name="partner_ref" select="2"/>
<newline/>
<field colspan="4" name="order_line" nolabel="1" widget="one2many_list"/>
<separator colspan="4" select="2" string="Document State"/>
<group col="7" colspan="4">
<field name="amount_untaxed" sum="Untaxed amount"/>
<field name="amount_tax"/>
@ -53,7 +49,6 @@
<field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
<field name="location_id"/>
<field name="invoice_method"/>
<field name="origin" select="2"/>
<newline/>
<field name="validator"/>
<field name="date_approve"/>

View File

@ -228,7 +228,7 @@ class sale_order(osv.osv):
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft':[('readonly',False)]}),
'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoice', help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."),
'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Packing List', readonly=True, help="This is the list of picking list that have been generated for this invoice"),
'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Packings', readonly=True, help="This is the list of picking list that have been generated for this invoice"),
'shipped':fields.boolean('Picked', readonly=True),
'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'),
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),

View File

@ -51,7 +51,7 @@
<field name="arch" type="xml">
<tree string="Sales orders">
<field name="date_order"/>
<field name="name"/>
<field name="name" string="Reference"/>
<field name="partner_id"/>
<field name="partner_shipping_id"/>
<field name="picked_rate" widget="progressbar"/>
@ -68,16 +68,17 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales order">
<notebook>
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="client_order_ref"/>
<field name="shipped" select="2"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2"/>
<field name="date_order" select="1"/>
<field name="invoiced" select="2"/>
</group>
<notebook colspan="4">
<page string="Sale Order">
<field name="name" select="1"/>
<group col="4" colspan="2">
<field name="shipped" select="2"/>
<field name="invoiced" select="2"/>
</group>
<newline/>
<field name="date_order" select="1"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" required="1" select="1"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_order_id"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id"/>
@ -166,7 +167,6 @@
<field name="order_policy"/>
<field groups="base.group_extended" name="origin"/>
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','picking')]}"/>
<field name="client_order_ref"/>
<field name="payment_term"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
@ -174,7 +174,6 @@
<page groups="base.group_extended" string="History">
<separator colspan="4" string="Related invoices"/>
<field colspan="4" name="invoice_ids" nolabel="1"/>
<separator colspan="4" string="Related packings"/>
<field colspan="4" name="picking_ids" nolabel="1"/>
</page>
</notebook>

View File

@ -43,7 +43,8 @@
"stock_report.xml",
"stock_sequence.xml",
"product_data.xml",
"product_view.xml"
"product_view.xml",
"partner_view.xml"
],
"active": False,
"installable": True

View File

@ -11,10 +11,12 @@
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Properties" position="inside">
<separator string="Stock Properties" colspan="2"/>
<field name="property_stock_customer"/>
<field name="property_stock_supplier"/>
<page string="Sales &amp; Purchases" position="inside">
<group colspan="2" col="2">
<separator string="Stock Properties" colspan="2"/>
<field name="property_stock_customer"/>
<field name="property_stock_supplier"/>
</group>
</page>
</field>
</record>

View File

@ -8,12 +8,14 @@
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<group string="Properties" position="inside">
<separator string="Stock Accounting" colspan="4"/>
<field name="property_stock_account_input_categ"/>
<field name="property_stock_account_output_categ"/>
<field name="property_stock_journal"/>
</group>
<form position="inside">
<group col="2" colspan="2">
<separator string="Accounting Stock Properties" colspan="2"/>
<field name="property_stock_account_input_categ"/>
<field name="property_stock_account_output_categ"/>
<field name="property_stock_journal"/>
</group>
</form>
</field>
</record>
@ -48,8 +50,8 @@
<field name="property_stock_account_input"/>
<field name="property_stock_account_output"/>
</field>
</field>
</record>
</field>
</record>
<record id="view_normal_stock_property_form" model="ir.ui.view">
<field name="name">product.normal.stock.form.inherit</field>
@ -58,13 +60,13 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<group name="status" position="after">
<group colspan="2" col="2">
<group colspan="2" col="2">
<separator string="Stocks" colspan="4"/>
<field name="qty_available"/>
<field name="virtual_available"/>
<field name="incoming_qty"/>
<field name="outgoing_qty"/>
</group>
<field name="qty_available"/>
<field name="virtual_available"/>
<field name="incoming_qty"/>
<field name="outgoing_qty"/>
</group>
</group>
</field>
</record>
@ -76,12 +78,12 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<group name="store" position="after">
<group col="2" colspan="2" name="store">
<separator string="Counter-Part Locations" colspan="2"/>
<field name="property_stock_procurement"/>
<field name="property_stock_production"/>
<field name="property_stock_inventory"/>
</group>
<group col="2" colspan="2" name="store">
<separator string="Counter-Part Locations" colspan="2"/>
<field name="property_stock_procurement"/>
<field name="property_stock_production"/>
<field name="property_stock_inventory"/>
</group>
</group>
</field>
</record>

View File

@ -1135,6 +1135,8 @@ class product_product(osv.osv):
# Utiliser browse pour limiter les queries !
#
def 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 (not context.get('location', False)):
return False
cr.execute('select name from stock_location where id=%d', (context['location'],))

View File

@ -55,20 +55,19 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Lot Inventory">
<notebook>
<page string="General Informations">
<field name="name" select="1"/>
<field name="date" select="1"/>
<field colspan="4" name="inventory_line_id" nolabel="1" widget="one2many_list"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
<button name="action_done" states="draft" string="Confirm Inventory" type="object"/>
<button name="action_cancel" states="done" string="Cancel Inventory" type="object"/>
</group>
</page>
<page string="Posted Inventory">
<field colspan="4" name="move_ids" nolabel="1"/>
</page>
<field name="name" select="1"/>
<field name="date" select="1"/>
<notebook colspan="4">
<page string="General Informations">
<field colspan="4" name="inventory_line_id" nolabel="1" widget="one2many_list"/>
</page><page string="Posted Inventory">
<field colspan="4" name="move_ids" nolabel="1"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
<button name="action_done" states="draft" string="Confirm Inventory" type="object"/>
<button name="action_cancel" states="done" string="Cancel Inventory" type="object"/>
</group>
</page>
</notebook>
</form>
</field>
@ -185,7 +184,6 @@
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="date" select="1"/>
<separator colspan="4" string="Revisions"/>
<field colspan="4" name="revisions" nolabel="1" widget="one2many_list"/>
</form>
</field>
@ -310,27 +308,27 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stock location">
<notebook>
<page string="General Informations">
<field name="name" select="1"/>
<field name="active" select="2"/>
<field name="usage" select="1"/>
<field name="account_id" select="1"/>
<field name="location_id"/>
<field name="address_id"/>
<field name="chained_location_type"/>
<field name="chained_location_id"/>
<field name="chained_auto_packing"/>
<field name="chained_delay"/>
<newline/>
<field colspan="4" name="comment"/>
</page>
<page string="Localisation">
<field name="posx"/>
<field name="posy"/>
<field name="posz"/>
</page>
</notebook>
<field name="name" select="1"/>
<field name="active" select="2"/>
<field name="usage" select="1"/>
<field name="account_id" select="1"/>
<field name="location_id"/>
<field name="address_id"/>
<group col="2" colspan="2">
<separator string="Chained Locations" colspan="2"/>
<field name="chained_location_type"/>
<field name="chained_location_id"/>
<field name="chained_auto_packing"/>
<field name="chained_delay"/>
</group>
<group col="2" colspan="2">
<separator string="Localisation" colspan="2"/>>
<field name="posx"/>
<field name="posy"/>
<field name="posz"/>
</group>
<separator string="Additional Information" colspan="4"/>
<field colspan="4" name="comment" nolabel="1"/>
</form>
</field>
</record>
@ -538,12 +536,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Packing list">
<notebook>
<field name="name" select="1"/>
<field name="date" select="1"/>
<newline/>
<field name="address_id" select="2"/>
<notebook colspan="4">
<page string="General Information">
<field name="name" select="1"/>
<field name="date" select="1"/>
<newline/>
<field name="address_id" select="2"/>
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list">
<form string="Stock Moves">
<separator colspan="4" string="Move Information"/>
@ -693,12 +691,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Packing list">
<notebook>
<field name="name" select="1"/>
<field name="date" select="1"/>
<newline/>
<field name="address_id" select="2"/>
<notebook colspan="4">
<page string="General Information">
<field name="name" select="1"/>
<field name="date" select="1"/>
<newline/>
<field name="address_id" select="2"/>
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list">
<form string="Stock Moves">
<separator colspan="4" string="Move Information"/>
@ -845,15 +843,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Input Packing List">
<notebook>
<field name="address_id" on_change="onchange_partner_in(address_id)" select="2"/>
<field name="name" readonly="1" select="1"/>
<field name="location_id"/>
<field domain="[('usage','=','internal')]" name="location_dest_id"/>
<field name="invoice_state" select="2" string="Supplier Invoice Control"/>
<field name="origin" select="2"/>
<notebook colspan="4">
<page string="General Information">
<field name="address_id" on_change="onchange_partner_in(address_id)" select="2"/>
<field name="name" readonly="1" select="1"/>
<field name="location_id"/>
<field domain="[('usage','=','internal')]" name="location_dest_id"/>
<field name="invoice_state" select="2" string="Supplier Invoice Control"/>
<field name="origin" select="2"/>
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list">
<tree string="Stock Moves">
<field name="product_id"/>
@ -884,7 +881,6 @@
<newline/>
<label/>
<button groups="base.group_extended" name="%(track_line)d" string="Split in production lots" type="action"/>
<separator colspan="4" string="Move State"/>
<field name="state" select="1"/>
<group>
@ -896,7 +892,6 @@
<group col="7" colspan="4">
<label colspan="5"/>
<button name="llk" string="Fill From Unreceived Products" type="action"/>
<button groups="base.group_extended" name="%(move_split)d" string="Split move lines in two" type="action"/>
</group>
<group col="8" colspan="4">
<field name="state" readonly="1"/>
@ -1186,32 +1181,30 @@
<field eval="True" name="object"/>
</record>
<record id="stock_picking_move_wizard_form" model="ir.ui.view">
<record id="stock_picking_move_wizard_form" model="ir.ui.view">
<field name="name">stock.picking.move.wizard.form</field>
<field name="model">stock.picking.move.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Move Lines">
<form string="Move Lines">
<field name="address_id" invisible="True"/>
<field name="picking_id" invisible="True"/>
<field name="picking_id" invisible="True"/>
<field domain="[('picking_id','&lt;&gt;',picking_id),('address_id','=',address_id),('state','in',['confirmed','assigned'])]" name="move_ids" select="1"/><newline/>
<group colspan="4">
<button special="cancel" string="Cancel"/>
<button name="action_move" string="Add" type="object"/>
</group>
<group colspan="4">
<button special="cancel" string="Cancel"/>
<button name="action_move" string="Add" type="object"/>
</group>
</form>
</field>
</record>
<act_window name="Get move lines"
context="{'action_id': active_id}"
res_model="stock.picking.move.wizard"
src_model="stock.picking"
view_mode="form"
target="new"
id="act_stock_picking_move_wizard"/>
<act_window name="Get move lines"
context="{'action_id': active_id}"
res_model="stock.picking.move.wizard"
src_model="stock.picking"
view_mode="form"
target="new"
id="act_stock_picking_move_wizard"/>
</data>
</terp>