Merge with trunk-addons

bzr revid: vir@tinyerp.com-20100202090637-v5jvkjdudpwm3vey
This commit is contained in:
Vir (Open ERP)
2010-02-02 14:36:37 +05:30
90 changed files with 4401 additions and 1138 deletions
+1
View File
@@ -818,6 +818,7 @@ class account_move(osv.osv):
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Type', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
}
_defaults = {
+12
View File
@@ -349,6 +349,18 @@
<field name="context">{'type':'out_invoice'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
</record>
<record id="action_invoice_tree_panding_invoice" model="ir.actions.act_window">
<field name="name">Panding Invoice</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="view_id" ref="invoice_tree"/>
<field name="context">{'type':'out_invoice'}</field>
<field name="domain">[('state','=','draft')]</field>
<!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
</record>
<record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
+2 -1
View File
@@ -917,7 +917,8 @@
<field name="reconcile_partial_id" groups="base.group_extended"/>
</tree>
</field>
<separator colspan="4" string="Narration"/>
<field name="narration" select="2" colspan="4" nolabel="1"/>
<separator colspan="4" string="State"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
+5 -5
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-12-11 12:37+0000\n"
"Last-Translator: Pieter J. Kersten (EduSense BV) <Unknown>\n"
"PO-Revision-Date: 2010-02-01 15:46+0000\n"
"Last-Translator: Jan Verlaan (Veritos) <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:16+0000\n"
"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
@@ -191,7 +191,7 @@ msgstr "Berekend met de formule: gefactureerd bedrag - totale kosten."
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_managed
msgid "My Accounts"
msgstr "Mijn rekeningen"
msgstr "Mijn kostenplaatsen"
#. module: account_analytic_analysis
#: model:ir.module.module,description:account_analytic_analysis.module_meta_information
@@ -335,7 +335,7 @@ msgstr "Kostenplaats"
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_overpassed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_action_account_analytic_managed_overpassed
msgid "Overpassed Accounts"
msgstr "Overbrugde Kostenplaatsen"
msgstr "Overgehevelde kostenplaatsen"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_hr_tree_invoiced_all
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -19,5 +18,8 @@
#
##############################################################################
import document_caldav
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import product
import stock
import purchase
import invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+39
View File
@@ -0,0 +1,39 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Stock Account",
"version" : "1.1",
"author" : "Tiny",
"website" : "http://tinyerp.com",
"description" : """This module will support the Anglo-Saxons accounting methodology by
changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries
and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales.
Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.
This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account
when the invoice is created to transfer this amount to the debtor or creditor account.""",
"depends" : ["product", "account", "sale", "purchase"],
"category" : "Generic Modules/Inventory Control",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : ["product_view.xml",],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,54 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_anglo_saxon
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-24 12:50:50+0000\n"
"PO-Revision-Date: 2009-11-24 12:50:50+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_anglo_saxon
#: view:product.category:0
msgid " Accounting Property"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
msgid "This module will support the Anglo-Saxons accounting methodology by \n"
" changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries \n"
" and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
" Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.\n"
" This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account \n"
" when the invoice is created to transfer this amount to the debtor or creditor account."
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
msgid "Stock Account"
msgstr ""
#. module: account_anglo_saxon
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr ""
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid "This account will be used to value price difference between purchase price and cost price."
msgstr ""
+54
View File
@@ -0,0 +1,54 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_anglo_saxon
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-24 12:50:50+0000\n"
"PO-Revision-Date: 2009-11-24 12:50:50+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_anglo_saxon
#: view:product.category:0
msgid " Accounting Property"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
msgid "This module will support the Anglo-Saxons accounting methodology by \n"
" changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries \n"
" and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
" Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.\n"
" This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account \n"
" when the invoice is created to transfer this amount to the debtor or creditor account."
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
msgid "Stock Account"
msgstr ""
#. module: account_anglo_saxon
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr ""
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid "This account will be used to value price difference between purchase price and cost price."
msgstr ""
+66
View File
@@ -0,0 +1,66 @@
# Polish translation for openobject-addons
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 12:50+0000\n"
"PO-Revision-Date: 2010-01-06 01:42+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-22 04:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_anglo_saxon
#: view:product.category:0
msgid " Accounting Property"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
msgid ""
"This module will support the Anglo-Saxons accounting methodology by \n"
" changing the accounting logic with stock transactions. The difference "
"between the Anglo-Saxon accounting countries \n"
" and the Rhine or also called Continental accounting countries is the "
"moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
" Anglo-Saxons accounting does take the cost when sales invoice is "
"created, Continental accounting will take the cost at he moment the goods "
"are shipped.\n"
" This module will add this functionality by using a interim account, to "
"store the value of shipped goods and will contra book this interim account \n"
" when the invoice is created to transfer this amount to the debtor or "
"creditor account."
msgstr ""
#. module: account_anglo_saxon
#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
msgid "Stock Account"
msgstr ""
#. module: account_anglo_saxon
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML niewłaściwy dla tej architektury wyświetlania!"
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr "Konto różnic cenowych"
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid ""
"This account will be used to value price difference between purchase price "
"and cost price."
msgstr ""
"To konto będzie stosowane do rejestrowania różnic cenowych między ceną "
"zakupu a kosztem."
+158
View File
@@ -0,0 +1,158 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class account_invoice_line(osv.osv):
_inherit = "account.invoice.line"
def move_line_get(self, cr, uid, invoice_id, context=None):
res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context)
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id)
if inv.type in ('out_invoice','out_refund'):
for i_line in inv.invoice_line:
if i_line.product_id:
if inv.type == 'out_invoice':
dacc = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
else:
dacc = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
cacc = i_line.product_id.product_tmpl_id.property_account_expense and i_line.product_id.product_tmpl_id.property_account_expense.id
if not cacc:
cacc = i_line.product_id.categ_id.property_account_expense_categ and i_line.product_id.categ_id.property_account_expense_categ.id
if dacc and cacc:
res.append({
'type':'src',
'name': i_line.name[:64],
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
'quantity':i_line.quantity,
'price':i_line.product_id.product_tmpl_id.standard_price * i_line.quantity,
'account_id':dacc,
'product_id':i_line.product_id.id,
'uos_id':i_line.uos_id.id,
'account_analytic_id':i_line.account_analytic_id.id,
'taxes':i_line.invoice_line_tax_id,
})
res.append({
'type':'src',
'name': i_line.name[:64],
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
'quantity':i_line.quantity,
'price': -1 * i_line.product_id.product_tmpl_id.standard_price * i_line.quantity,
'account_id':cacc,
'product_id':i_line.product_id.id,
'uos_id':i_line.uos_id.id,
'account_analytic_id':i_line.account_analytic_id.id,
'taxes':i_line.invoice_line_tax_id,
})
elif inv.type in ('in_invoice','in_refund'):
for i_line in inv.invoice_line:
if i_line.product_id:
if i_line.product_id.product_tmpl_id.type != 'service':
acc = i_line.product_id.product_tmpl_id.property_account_creditor_price_difference and i_line.product_id.product_tmpl_id.property_account_creditor_price_difference.id
if not acc:
acc = i_line.product_id.categ_id.property_account_creditor_price_difference_categ and i_line.product_id.categ_id.property_account_creditor_price_difference_categ.id
a = None
if inv.type == 'in_invoice':
oa = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
else:
oa = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
if oa:
fpos = i_line.invoice_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
diff_res = []
for line in res:
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
uom = i_line.product_id.uos_id or i_line.product_id.uom_id
standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id)
if standard_price != i_line.price_unit and line['price'] == i_line.price_unit and acc:
price_diff = i_line.price_unit - standard_price
line.update({'price':standard_price * line['quantity']})
diff_res.append({
'type':'src',
'name': i_line.name[:64],
'price_unit':price_diff,
'quantity':line['quantity'],
'price': price_diff * line['quantity'],
'account_id':acc,
'product_id':line['product_id'],
'uos_id':line['uos_id'],
'account_analytic_id':line['account_analytic_id'],
'taxes':line.get('taxes',[]),
})
res += diff_res
return res
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None):
if not product:
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context)
else:
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context)
if type in ('in_invoice','in_refund'):
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
if type == 'in_invoice':
oa = product_obj.product_tmpl_id.property_stock_account_input and product_obj.product_tmpl_id.property_stock_account_input.id
if not oa:
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
else:
oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
if not oa:
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
if oa:
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
res['value'].update({'account_id':a})
return res
account_invoice_line()
class account_invoice(osv.osv):
_inherit = "account.invoice"
def _refund_cleanup_lines(self, cr, uid, lines):
for line in lines:
inv_id = line['invoice_id']
inv_obj = self.browse(cr,uid,inv_id[0])
if inv_obj.type == 'in_invoice':
if line.get('product_id',False):
product_obj = self.pool.get('product.product').browse(cr,uid,line['product_id'][0])
oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
if not oa:
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
if oa:
fpos = inv_obj.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
account_data = self.pool.get('account.account').read(cr,uid,[a],['name'])[0]
line.update({'account_id': (account_data['id'],account_data['name'])})
res = super(account_invoice,self)._refund_cleanup_lines(cr, uid, lines)
return res
account_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+55
View File
@@ -0,0 +1,55 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class product_category(osv.osv):
_inherit = "product.category"
_columns = {
'property_account_creditor_price_difference_categ': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Price Difference Account",
method=True,
view_load=True,
help="This account will be used to value price difference between purchase price and cost price."),
}
product_category()
class product_template(osv.osv):
_inherit = "product.template"
_columns = {
'property_account_creditor_price_difference': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Price Difference Account",
method=True,
view_load=True,
help="This account will be used to value price difference between purchase price and cost price."),
}
product_template()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit.stock</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='property_account_expense']" position="after">
<field name="property_account_creditor_price_difference" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<newline/>
<!-- <field name="property_account_sending_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</xpath>
</field>
</record>
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.product.form.inherit</field>
<field name="model">product.template</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='property_account_expense']" position="after">
<field name="property_account_creditor_price_difference" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<newline/>
<!-- <field name="property_account_sending_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</xpath>
</field>
</record>
<record id="view_category_property_form" model="ir.ui.view">
<field name="name">product.category.property.form.inherit.stock</field>
<field name="model">product.category</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<form position="inside">
<group col="2" colspan="2">
<separator string=" Accounting Property" colspan="2"/>
<field name="property_account_creditor_price_difference_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<!-- <field name="property_account_sending_goods_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</group>
</form>
</field>
</record>
</data>
</openerp>
+41
View File
@@ -0,0 +1,41 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class purchase_order(osv.osv):
_name = "purchase.order"
_inherit = "purchase.order"
_description = "Purchase order"
def inv_line_create(self, cr, uid, a, ol):
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
if ol.product_id:
oa = ol.product_id.product_tmpl_id.property_stock_account_input and ol.product_id.product_tmpl_id.property_stock_account_input.id
if not oa:
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
if oa:
fpos = ol.order_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
line[2].update({'account_id': a})
return line
purchase_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+43
View File
@@ -0,0 +1,43 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
#class sale_order_line(osv.osv):
# _name = 'sale.order.line'
# _description = 'Sale Order line'
# _inherit = 'sale.order.line'
#
# def invoice_line_create(self, cr, uid, ids, context={}):
# line_ids = super('sale_order_line',self).invoice_line_create(cr, uid, ids, context)
# invoice_line_obj = self.pool.get('account.invoice.line')
# for line in invoice_line_obj.browse(cr, uid, line_ids):
# if line.product_id:
# a = line.product_id.product_tmpl_id.property_stock_account_output and line.product_id.product_tmpl_id.property_stock_account_output.id
# if not a:
# a = line.product_id.categ_id.property_stock_account_output_categ and line.product_id.categ_id.property_stock_account_output_categ.id
# if a:
# a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
# invoice_line_obj.write(cr, uid, line.id, {'account_id':a})
#
#sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+51
View File
@@ -0,0 +1,51 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields,osv
#----------------------------------------------------------
# Stock Picking
#----------------------------------------------------------
class stock_picking(osv.osv):
_inherit = "stock.picking"
_description = "Packing List"
def action_invoice_create(self, cr, uid, ids, journal_id=False,
group=False, type='out_invoice', context=None):
'''Return ids of created invoices for the pickings'''
res = super(stock_picking,self).action_invoice_create(cr, uid, ids, journal_id, group, type, context)
if type == 'in_refund':
for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context):
for ol in inv.invoice_line:
if ol.product_id:
oa = ol.product_id.product_tmpl_id.property_stock_account_output and ol.product_id.product_tmpl_id.property_stock_account_output.id
if not oa:
oa = ol.product_id.categ_id.property_stock_account_output_categ and ol.product_id.categ_id.property_stock_account_output_categ.id
if oa:
fpos = ol.invoice_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a})
return res
stock_picking()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+6 -6
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-12-11 13:00+0000\n"
"Last-Translator: Pieter J. Kersten (EduSense BV) <Unknown>\n"
"PO-Revision-Date: 2010-02-01 15:48+0000\n"
"Last-Translator: Jan Verlaan (Veritos) <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:10+0000\n"
"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
@@ -55,7 +55,7 @@ msgstr "Bedrag in valuta"
#. module: account_followup
#: rml:account_followup.followup.print:0
msgid "Due"
msgstr "Tot"
msgstr "Bedrag"
#. module: account_followup
#: view:account.move.line:0
@@ -97,7 +97,7 @@ msgstr "Soort rekening"
#. module: account_followup
#: rml:account_followup.followup.print:0
msgid "Ref"
msgstr "Ref"
msgstr "Factuur"
#. module: account_followup
#: wizard_view:account_followup.followup.print.all,next:0
@@ -253,7 +253,7 @@ msgstr ""
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"De objectnaam moet beginnen met x_ en mag geen speciale karakters bevatten !"
"De objectnaam moet beginnen met x_ en mag geen speciale tekens bevatten !"
#. module: account_followup
#: wizard_button:account_followup.followup.print.all,summary,end:0
+1 -4
View File
@@ -56,7 +56,6 @@ class account_account(osv.osv):
return ids2
_columns = {
'journal_id':fields.many2one('account.journal', 'Journal',domain=[('type','=','situation')]),
'open_bal' : fields.float('Opening Balance',digits=(16,2)),
'level': fields.function(_get_level, string='Level', method=True, store=True, type='integer'),
@@ -219,9 +218,7 @@ class account_move(osv.osv):
_inherit = "account.move"
_columns = {
'name':fields.char('Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, select=True, states={'draft':[('readonly',False)]}),
}
account_move()
class res_currency(osv.osv):
@@ -245,4 +242,4 @@ class account_account_template(osv.osv):
account_account_template()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-55
View File
@@ -1,61 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="account_move_inherit_new">
<field name="name">account.move.type.form.inherit2</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="model">account.move</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="line_id" position="replace">
<field colspan="4" default_get="{'lines':line_id ,'journal':journal_id }" name="line_id" nolabel="1" widget="one2many_list" height="250">
<form string="Account Entry Line">
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/>
<field name="debit" select="1"/>
<field name="credit" select="1"/>
<separator colspan="4" string="Optional Information"/>
<field name="currency_id"/>
<field name="amount_currency"/>
<field name="quantity" select="1"/>
<newline/>
<field name="date_maturity"/>
<field name="date_created"/>
<separator colspan="4" string="State"/>
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
<field name="statement_id"/>
<field name="state"/>
</form>
<tree editable="top" string="Account Entry Line">
<field name="ref"/>
<field name="invoice"/>
<field name="name"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="date_maturity"/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="analytic_account_id"/>
<field groups="base.group_extended" name="amount_currency"/>
<field groups="base.group_extended" name="currency_id"/>
<field name="tax_code_id"/>
<field name="tax_amount"/>
<field name="state"/>
<field name="reconcile_id"/>
<field groups="base.group_extended" name="reconcile_partial_id"/>
</tree>
</field>
<separator colspan="4" string="Narration"/>
<field name="narration" select="2" colspan="4" nolabel="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="account_form1">
<field name="name">account.form1</field>
+118 -113
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-01-23 02:16+0000\n"
"PO-Revision-Date: 2010-02-01 18:21+0000\n"
"Last-Translator: Holverat Bortolossi <holverat@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-24 04:50+0000\n"
"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
@@ -150,74 +150,74 @@ msgstr "Antigo/pequeno produto de cobre ou estanho"
#. module: auction
#: field:auction.lots,paid_ach:0
msgid "Buyer invoice reconciled"
msgstr ""
msgstr "Fatura do comprador foi reconciliada"
#. module: auction
#: model:ir.actions.wizard,name:auction.auction_wizard_able_taken
msgid "Mark as taken away"
msgstr ""
msgstr "Marcar como retirado"
#. module: auction
#: xsl:report.auction.seller.list:0
msgid "Inv."
msgstr ""
msgstr "Inv."
#. module: auction
#: field:auction.deposit.cost,amount:0
msgid "Amount"
msgstr ""
msgstr "Valor"
#. module: auction
#: model:ir.actions.act_window,name:auction.action_deposit_border
#: model:ir.ui.menu,name:auction.menu_auction_deposit_border
msgid "Deposit border"
msgstr ""
msgstr "Limite de Depósito"
#. module: auction
#: xsl:report.auction.deposit:0
msgid "VAT"
msgstr ""
msgstr "Imposto sobre Valor Agregado"
#. module: auction
#: view:auction.lots:0
msgid "Statements"
msgstr ""
msgstr "Demonstrações"
#. module: auction
#: xsl:flagey.huissier:0
msgid "Adjudication"
msgstr ""
msgstr "Conceder"
#. module: auction
#: field:auction.dates,account_analytic_id:0
msgid "Analytic Account"
msgstr ""
msgstr "Conta analítica"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Unclassifieds"
msgstr ""
msgstr "Não classificados"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_auction_dates_next_by_auction
msgid "Objects by Auction"
msgstr ""
msgstr "Objetos em leilão"
#. module: auction
#: field:auction.lots,lot_num:0
#: field:report.unclassified.objects,lot_num:0
msgid "List Number"
msgstr ""
msgstr "Número de lista"
#. module: auction
#: field:auction.deposit.cost,name:0
msgid "Cost Name"
msgstr ""
msgstr "Nome do custo"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antiques"
msgstr ""
msgstr "Antiguidades"
#. module: auction
#: view:auction.dates:0
@@ -227,17 +227,17 @@ msgstr ""
#. module: auction
#: field:report.auction.estimation.adj.category,lot_type:0
msgid "Object Type"
msgstr ""
msgstr "Tipo de objeto"
#. module: auction
#: wizard_field:auction.lots.sms_send,init,text:0
msgid "SMS Message"
msgstr ""
msgstr "Mensagem SMS"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Contemporary Art"
msgstr ""
msgstr "Arte contemporânea"
#. module: auction
#: view:auction.lots:0
@@ -248,7 +248,7 @@ msgstr ""
#. module: auction
#: field:report.auction.view,nseller:0
msgid "No of sellers"
msgstr ""
msgstr "Nenhum vendedor"
#. module: auction
#: selection:auction.lots.send.aie,date_ask,lang:0
@@ -269,7 +269,7 @@ msgstr ""
#. module: auction
#: field:report.auction.view2,obj_margin_procent:0
msgid "Net margin (%)"
msgstr ""
msgstr "Margem líquida (%)"
#. module: auction
#: selection:auction.lots,state:0
@@ -277,12 +277,12 @@ msgstr ""
#: selection:report.seller.auction,state:0
#: selection:report.unclassified.objects,state:0
msgid "Unsold"
msgstr ""
msgstr "Não vendidos"
#. module: auction
#: view:auction.dates:0
msgid "Dates"
msgstr ""
msgstr "Datas"
#. module: auction
#: constraint:product.template:0
@@ -294,13 +294,13 @@ msgstr ""
#. module: auction
#: rml:auction.total.rml:0
msgid "Items"
msgstr ""
msgstr "Itens"
#. module: auction
#: model:account.tax,name:auction.auction_tax5
#: field:auction.dates,seller_costs:0
msgid "Seller Costs"
msgstr ""
msgstr "Custos do Vendedor"
#. module: auction
#: view:auction.bid:0
@@ -310,22 +310,22 @@ msgstr ""
#: model:ir.actions.report.xml,name:auction.bid_auction
#: model:ir.ui.menu,name:auction.menu_action_bid_open
msgid "Bids"
msgstr ""
msgstr "Lances"
#. module: auction
#: model:ir.ui.menu,name:auction.auction_all_objects_menu
msgid "All objects"
msgstr ""
msgstr "Todos Objetos"
#. module: auction
#: model:ir.actions.act_window,name:auction.action_auction_buyer_reporting_all2
msgid "Buyer's auction for all months"
msgstr ""
msgstr "Leilão do comprador para todos os meses"
#. module: auction
#: field:auction.bid,contact_tel:0
msgid "Contact"
msgstr ""
msgstr "Contato"
#. module: auction
#: field:report.auction.view,obj_ret:0
@@ -337,7 +337,7 @@ msgstr ""
#. module: auction
#: wizard_button:auction.lots.sms_send,init,send:0
msgid "Send SMS"
msgstr ""
msgstr "Enviar SMS"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
@@ -347,38 +347,38 @@ msgstr ""
#. module: auction
#: field:auction.lots,sel_inv_id:0
msgid "Seller Invoice"
msgstr ""
msgstr "Fatura do Vendedor"
#. module: auction
#: view:auction.dates:0
msgid "Commissions"
msgstr ""
msgstr "Comissões"
#. module: auction
#: wizard_button:auction.lots.numerotate,search,init:0
msgid "Back"
msgstr ""
msgstr "Voltar"
#. module: auction
#: model:ir.actions.act_window,name:auction.action_all_objects_unsold
msgid "Unsold objects"
msgstr ""
msgstr "Objetos não vendidos"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_all_objects_sold1
msgid "Sold Objects"
msgstr ""
msgstr "Objetos vendidos"
#. module: auction
#: view:report.buyer.auction2:0
#: view:report.seller.auction2:0
msgid "Sum net margin"
msgstr ""
msgstr "Somar margem líquida"
#. module: auction
#: view:auction.deposit:0
msgid "Deposit Border Form"
msgstr ""
msgstr "Formuálio de Limite de Depósito"
#. module: auction
#: field:auction.bid,bid_lines:0
@@ -386,12 +386,12 @@ msgstr ""
#: rml:bids.lots:0
#: model:ir.model,name:auction.model_auction_bid_line
msgid "Bid"
msgstr ""
msgstr "Lance"
#. module: auction
#: wizard_field:auction.lots.send.aie,date_ask,lang:0
msgid "Langage"
msgstr ""
msgstr "Idioma"
#. module: auction
#: field:auction.bid_line,lot_id:0
@@ -399,7 +399,7 @@ msgstr ""
#: view:auction.lots:0
#: model:ir.model,name:auction.model_auction_lots
msgid "Object"
msgstr ""
msgstr "Objeto"
#. module: auction
#: model:ir.actions.wizard,name:auction.wizard_map_user
@@ -409,7 +409,7 @@ msgstr ""
#. module: auction
#: wizard_field:auction.lots.numerotate,search,lot_num:0
msgid "Inventory Number"
msgstr ""
msgstr "Número de inventário"
#. module: auction
#: wizard_button:auction.lots.buyer_map,check,end:0
@@ -417,12 +417,12 @@ msgstr ""
#: wizard_button:auction.lots.numerotate,search,end:0
#: wizard_button:auction.lots.numerotate_cont,init,end:0
msgid "Exit"
msgstr ""
msgstr "Sair"
#. module: auction
#: field:report.buyer.auction2,net_revenue:0
msgid "Net Revenue"
msgstr ""
msgstr "Receita Líquida"
#. module: auction
#: view:report.buyer.auction:0
@@ -437,17 +437,17 @@ msgstr ""
#: field:report.seller.auction,state:0
#: field:report.unclassified.objects,state:0
msgid "Status"
msgstr ""
msgstr "Situação"
#. module: auction
#: model:ir.actions.wizard,name:auction.wizard_sms
msgid "SMS Send"
msgstr ""
msgstr "Enviar SMS"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Cartoons"
msgstr ""
msgstr "Antigo/Desenhos"
#. module: auction
#: view:auction.lots:0
@@ -455,42 +455,42 @@ msgstr ""
#: selection:report.seller.auction,state:0
#: selection:report.unclassified.objects,state:0
msgid "Sold"
msgstr ""
msgstr "Vendido"
#. module: auction
#: constraint:hr.employee:0
msgid "Error ! You cannot create recursive Hierarchy of Employees."
msgstr ""
msgstr "Erro! Você não pode criar hierarquia recursiva de funcionários."
#. module: auction
#: field:auction.bid_line,name:0
msgid "Bid date"
msgstr ""
msgstr "Data do lance"
#. module: auction
#: field:auction.dates,acc_expense:0
msgid "Expense Account"
msgstr ""
msgstr "Conta de despesas"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_wizard_emporte
msgid "Deliveries Management"
msgstr ""
msgstr "Gerenciamento de entregas"
#. module: auction
#: field:auction.lots,obj_desc:0
msgid "Object Description"
msgstr ""
msgstr "Descrição do objeto"
#. module: auction
#: selection:auction.deposit,method:0
msgid "Contact the Seller"
msgstr ""
msgstr "Entre em contato com o vendedor"
#. module: auction
#: view:auction.lots:0
msgid "Auction Objects"
msgstr ""
msgstr "Leilão de Objetos"
#. module: auction
#: field:auction.lots,gross_revenue:0
@@ -498,12 +498,12 @@ msgstr ""
#: field:report.object.encoded.manager,gross_revenue:0
#: field:report.seller.auction2,gross_revenue:0
msgid "Gross revenue"
msgstr ""
msgstr "Receita bruta"
#. module: auction
#: view:report.seller.auction2:0
msgid "Auction reporting2 form view"
msgstr ""
msgstr "Relatório2 de formulário de Leilão"
#. module: auction
#: model:ir.actions.wizard,name:auction.wizard_pay
@@ -513,45 +513,45 @@ msgstr ""
#. module: auction
#: view:report.deposit.border:0
msgid "Depositer's statistics"
msgstr ""
msgstr "Estatísticas dos Depositantes"
#. module: auction
#: view:auction.lots:0
msgid "Buyer information"
msgstr ""
msgstr "Informações do Comprador"
#. module: auction
#: model:ir.model,name:auction.model_report_seller_auction
msgid "Auction Reporting on seller view"
msgstr ""
msgstr "Relatório Leilão na visão do Vendedor"
#. module: auction
#: field:auction.lots,name2:0
msgid "Short Description (2)"
msgstr ""
msgstr "Descrição resumida (2)"
#. module: auction
#: model:ir.model,name:auction.model_auction_dates
msgid "auction.dates"
msgstr ""
msgstr "leilão.datas"
#. module: auction
#: rml:auction.total.rml:0
#: model:ir.ui.menu,name:auction.auction_buyers_menu
msgid "Buyers"
msgstr ""
msgstr "Vendedores"
#. module: auction
#: wizard_field:auction.pay.buy,init,amount:0
#: wizard_field:auction.pay.buy,init,amount2:0
#: wizard_field:auction.pay.buy,init,amount3:0
msgid "Amount paid"
msgstr ""
msgstr "Valor pago"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_report_latest_doposit_tree
msgid "My Latest Deposits"
msgstr ""
msgstr "Meus Últimos Depósitos"
#. module: auction
#: field:auction.lots,lot_est1:0
@@ -560,32 +560,32 @@ msgstr ""
#: field:report.auction.view,min_est:0
#: field:report.unclassified.objects,lot_est1:0
msgid "Minimum Estimation"
msgstr ""
msgstr "Estimativa mínima"
#. module: auction
#: view:auction.dates:0
msgid "Accounting"
msgstr ""
msgstr "Contabilidade"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_buyer_allmonth_view2
msgid "Buyer's Revenues"
msgstr ""
msgstr "Receitas do comprador"
#. module: auction
#: model:ir.model,name:auction.model_report_auction_adjudication
msgid "report_auction_adjudication"
msgstr ""
msgstr "relatório_leilão_concedido"
#. module: auction
#: field:auction.bid_line,price:0
msgid "Maximum Price"
msgstr ""
msgstr "Preço máximo"
#. module: auction
#: selection:auction.lots.send.aie,date_ask,lang:0
msgid "eng"
msgstr ""
msgstr "Inglês"
#. module: auction
#: view:report.buyer.auction2:0
@@ -595,17 +595,17 @@ msgstr ""
#. module: auction
#: wizard_view:auction.lots.sms_send,init:0
msgid "Bulk SMS send"
msgstr ""
msgstr "Enviar SMS em massa"
#. module: auction
#: wizard_view:auction.taken,init:0
msgid "Select lots which are Sold"
msgstr ""
msgstr "Selecione lotes que são vendidos"
#. module: auction
#: field:auction.lots,statement_id:0
msgid "Payment"
msgstr ""
msgstr "Pagamento"
#. module: auction
#: selection:auction.lots.send.aie,date_ask,lang:0
@@ -615,50 +615,50 @@ msgstr ""
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Old weapons and militaria"
msgstr ""
msgstr "Antiguidade/Armas antigas e militares"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Oriental Arts/Chineese furnitures"
msgstr ""
msgstr "Antiguidade/Arte Orientas/Mobiliário Chinês"
#. module: auction
#: selection:auction.deposit,method:0
msgid "Keep until sold"
msgstr ""
msgstr "Manter até vender"
#. module: auction
#: wizard_button:auction.lots.numerotate,init,choice:0
#: wizard_button:auction.lots.send.aie,init,date_ask:0
#: wizard_button:auction.lots.send.aie.results,init,date_ask:0
msgid "Continue"
msgstr ""
msgstr "Continuar"
#. module: auction
#: field:report.object.encoded,obj_num:0
#: field:report.object.encoded.manager,obj_num:0
msgid "# of Encoded obj."
msgstr ""
msgstr "# do Objeto Codificado"
#. module: auction
#: xsl:report.auction.vnd_bordereau:0
msgid "List N."
msgstr ""
msgstr "Lista N."
#. module: auction
#: field:report.deposit.border,moy_est:0
msgid "Avg. Est"
msgstr ""
msgstr "Média Estimada"
#. module: auction
#: rml:auction.total.rml:0
msgid "# of sellers:"
msgstr ""
msgstr "# dos vendedores:"
#. module: auction
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Error: código EAN invalido"
msgstr "Erro: Código EAN inválido"
#. module: auction
#: model:ir.module.module,description:auction.module_meta_information
@@ -669,26 +669,31 @@ msgid ""
" Delivery Management. \n"
" "
msgstr ""
"Este módulo fornece funcionalidade para \n"
" gerenciar artistas, artigos, vendedores, compradores e leilão.\n"
" Gerenciar ofertas, registro de objetos vendidos, pagos e não pagos.\n"
" A administração das entregas. \n"
" "
#. module: auction
#: rml:auction.total.rml:0
msgid "# of items taken away:"
msgstr ""
msgstr "# de itens retirados:"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_auction_allmonth_view1
msgid "Auction's Summary"
msgstr ""
msgstr "Resumo do Leilão"
#. module: auction
#: rml:buyer.list:0
msgid "%)"
msgstr ""
msgstr "%)"
#. module: auction
#: wizard_view:auction.lots.able,init:0
msgid "Confirmation set taken away"
msgstr ""
msgstr "Confirmação marcada como retirada"
#. module: auction
#: wizard_field:auction.lots.make_invoice,init,objects:0
@@ -697,7 +702,7 @@ msgstr ""
#: wizard_field:auction.lots.send.aie.results,date_ask,objects:0
#: field:report.deposit.border,nb_obj:0
msgid "# of objects"
msgstr ""
msgstr "# dos Objetos"
#. module: auction
#: field:auction.lots,lot_est2:0
@@ -706,12 +711,12 @@ msgstr ""
#: field:report.auction.view,max_est:0
#: field:report.unclassified.objects,lot_est2:0
msgid "Maximum Estimation"
msgstr ""
msgstr "Estimativa Máxima"
#. module: auction
#: field:auction.lots,buyer_price:0
msgid "Buyer price"
msgstr ""
msgstr "Preço Comprador"
#. module: auction
#: model:ir.actions.wizard,name:auction.auction_wizard_payer_sel
@@ -721,17 +726,17 @@ msgstr ""
#. module: auction
#: model:ir.actions.report.xml,name:auction.seller_form_id
msgid "Seller List"
msgstr ""
msgstr "Lista de Vendedor"
#. module: auction
#: field:auction.lots,is_ok:0
msgid "Buyer's payment"
msgstr ""
msgstr "Pagamento do Comprador"
#. module: auction
#: view:auction.dates:0
msgid "Close + Create all invoices"
msgstr ""
msgstr "Fechar + Criar todas as Faturas"
#. module: auction
#: model:ir.actions.wizard,name:auction.auction_catalog_flagy
@@ -741,48 +746,48 @@ msgstr ""
#. module: auction
#: field:auction.lot.history,price:0
msgid "Withdrawn price"
msgstr ""
msgstr "Preço de retirada"
#. module: auction
#: model:account.tax,name:auction.auction_tax4
msgid "Seller Costs1"
msgstr ""
msgstr "Custo1 do Venderor"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Verreries"
msgstr ""
msgstr "Antiguidade/Cristais"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Toys"
msgstr ""
msgstr "Antiguidade/Briquedos"
#. module: auction
#: field:auction.deposit,create_uid:0
#: field:auction.lots,create_uid:0
msgid "Created by"
msgstr ""
msgstr "Criado por"
#. module: auction
#: xsl:report.auction.ach_bordereau:0
msgid "Buyer form"
msgstr ""
msgstr "Formulário do comprador"
#. module: auction
#: xsl:report.auction.deposit:0
msgid "Estimate"
msgstr ""
msgstr "Estimativa"
#. module: auction
#: rml:auction.total.rml:0
msgid "# of buyers:"
msgstr ""
msgstr "# dos compradores:"
#. module: auction
#: field:auction.lots,costs:0
msgid "Indirect costs"
msgstr ""
msgstr "Custos indiretos"
#. module: auction
#: xsl:report.auction.ach_bordereau:0
@@ -792,12 +797,12 @@ msgstr ""
#. module: auction
#: constraint:account.tax.code:0
msgid "Error ! You can not create recursive accounts."
msgstr ""
msgstr "Erro ! Você não pode criar contas repetidas."
#. module: auction
#: model:ir.ui.menu,name:auction.auction_menu_root
msgid "Auction Management"
msgstr ""
msgstr "Gerenciamento de leilão"
#. module: auction
#: field:auction.dates,journal_seller_id:0
@@ -807,23 +812,23 @@ msgstr ""
#. module: auction
#: view:report.buyer.auction:0
msgid "Auction buyer reporting tree view"
msgstr ""
msgstr "Relatório de compra do leilão exibição em árvore"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_auction_artist
msgid "Define Artists"
msgstr ""
msgstr "Definir artistas"
#. module: auction
#: field:auction.lot.category,name:0
msgid "Category Name"
msgstr ""
msgstr "Nome da Categoria"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_report_auction_estimation_adj_category_manager
#: model:ir.ui.menu,name:auction.menu_report_auction_estimation_adj_category_member
msgid "Comparison of estimations"
msgstr ""
msgstr "Comparação das estimativas"
#. module: auction
#: model:ir.actions.report.xml,name:auction.v_report_barcode_lot
@@ -833,34 +838,34 @@ msgstr ""
#. module: auction
#: wizard_button:auction.lots.numerotate,not_exist,init:0
msgid "Retry"
msgstr ""
msgstr "Repetir"
#. module: auction
#: field:auction.artists,birth_death_dates:0
msgid "Birth / Death dates"
msgstr ""
msgstr "Datas de Nascimento / Morte"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Jewelry"
msgstr ""
msgstr "Antiguidade/Jóias"
#. module: auction
#: model:ir.model,name:auction.model_report_unclassified_objects
msgid "Unclassified objects "
msgstr ""
msgstr "objetos não classificados "
#. module: auction
#: wizard_button:auction.lots.numerotate_cont,init,set_number:0
#: wizard_field:auction.lots.send.aie,date_ask,numerotation:0
#: wizard_field:auction.lots.send.aie,init,numerotation:0
msgid "Numerotation"
msgstr ""
msgstr "Numerotation"
#. module: auction
#: model:ir.actions.act_window,name:auction.act_auction_lot_open_deposit
msgid "Bordereau de dépôt"
msgstr ""
msgstr "Comprovante de depósito"
#. module: auction
#: xsl:report.auction.deposit:0
@@ -0,0 +1,99 @@
#!/usr/bin/env python
"""
Buffering HTTP Server
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from utils import VERSION, AUTHOR
__version__ = VERSION
__author__ = AUTHOR
from BaseHTTPServer import BaseHTTPRequestHandler
import os
class BufferedHTTPRequestHandler(BaseHTTPRequestHandler):
"""
Buffering HTTP Request Handler
This class is an extension to the BaseHTTPRequestHandler
class which buffers the whole output and sends it at once
after the processing if the request is finished.
This makes it possible to work together with some clients
which otherwise would break (e.g. cadaver)
"""
def _init_buffer(self):
"""initialize the buffer.
If you override the handle() method remember to call
this (see below)
"""
self.__buffer=""
self.__outfp=os.tmpfile()
def _append(self,s):
""" append a string to the buffer """
self.__buffer=self.__buffer+s
def _flush(self):
""" flush the buffer to wfile """
self.wfile.write(self.__buffer)
self.__outfp.write(self.__buffer)
self.__outfp.flush()
self.wfile.flush()
self.__buffer=""
def handle(self):
""" Handle a HTTP request """
self._init_buffer()
BaseHTTPRequestHandler.handle(self)
self._flush()
def send_header(self, keyword, value):
"""Send a MIME header."""
if self.request_version != 'HTTP/0.9':
self._append("%s: %s\r\n" % (keyword, value))
def end_headers(self):
"""Send the blank line ending the MIME headers."""
if self.request_version != 'HTTP/0.9':
self._append("\r\n")
def send_response(self, code, message=None):
self.log_request(code)
if message is None:
if self.responses.has_key(code):
message = self.responses[code][0]
else:
message = ''
if self.request_version != 'HTTP/0.9':
self._append("%s %s %s\r\n" %
(self.protocol_version, str(code), message))
self.send_header('Server', self.version_string())
self.send_header('Connection', 'close')
self.send_header('Date', self.date_time_string())
protocol_version="HTTP/1.1"
+379
View File
@@ -0,0 +1,379 @@
"""
Python WebDAV Server.
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This module builds on AuthServer by implementing the standard DAV
methods.
Subclass this class and specify an IFACE_CLASS. See example.
"""
DEBUG=None
from utils import VERSION, AUTHOR
__version__ = VERSION
__author__ = AUTHOR
import os
import sys
import time
import socket
import string
import posixpath
import base64
import urlparse
import urllib
from propfind import PROPFIND
from delete import DELETE
from davcopy import COPY
from davmove import MOVE
from string import atoi,split
from status import STATUS_CODES
from errors import *
import BaseHTTPServer
class DAVRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Simple DAV request handler with
- GET
- HEAD
- PUT
- OPTIONS
- PROPFIND
- PROPPATCH
- MKCOL
It uses the resource/collection classes for serving and
storing content.
"""
server_version = "DAV/" + __version__
protocol_version = 'HTTP/1.1'
### utility functions
def _log(self, message):
pass
def _append(self,s):
""" write the string to wfile """
self.wfile.write(s)
def send_body(self,DATA,code,msg,desc,ctype='application/octet-stream',headers=None):
""" send a body in one part """
if not headers:
headers = {}
self.send_response(code,message=msg)
self.send_header("Connection", "keep-alive")
self.send_header("Accept-Ranges", "bytes")
for a,v in headers.items():
self.send_header(a,v)
if DATA:
self.send_header("Content-Length", str(len(DATA)))
self.send_header("Content-Type", ctype)
else:
self.send_header("Content-Length", "0")
self.end_headers()
if DATA:
self._append(DATA)
def send_body_chunks(self,DATA,code,msg,desc,ctype='text/xml; encoding="utf-8"'):
""" send a body in chunks """
self.responses[207]=(msg,desc)
self.send_response(code,message=msg)
self.send_header("Content-type", ctype)
self.send_header("Connection", "keep-alive")
self.send_header("Transfer-Encoding", "chunked")
self.end_headers()
self._append(hex(len(DATA))[2:]+"\r\n")
self._append(DATA)
self._append("\r\n")
self._append("0\r\n")
self._append("\r\n")
### HTTP METHODS
def do_OPTIONS(self):
"""return the list of capabilities """
self.send_response(200)
self.send_header("Allow", "GET, HEAD, COPY, MOVE, POST, PUT, PROPFIND, PROPPATCH, OPTIONS, MKCOL, DELETE, TRACE")
self.send_header("Content-Type", "text/plain")
self.send_header("Connection", "keep-alive")
self.send_header("DAV", "1")
self.end_headers()
def do_PROPFIND(self):
dc=self.IFACE_CLASS
# read the body
body=None
if self.headers.has_key("Content-Length"):
l=self.headers['Content-Length']
body=self.rfile.read(atoi(l))
alt_body = """<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:"><prop>
<getcontentlength xmlns="DAV:"/>
<getlastmodified xmlns="DAV:"/>
<getcreationdate xmlns="DAV:"/>
<checked-in xmlns="DAV:"/>
<executable xmlns="http://apache.org/dav/props/"/>
<displayname xmlns="DAV:"/>
<resourcetype xmlns="DAV:"/>
<checked-out xmlns="DAV:"/>
</prop></propfind>"""
#self.wfile.write(body)
# which Depth?
if self.headers.has_key('Depth'):
d=self.headers['Depth']
else:
d="infinity"
uri=self.geturi()
pf=PROPFIND(uri,dc,d)
if body:
pf.read_propfind(body)
try:
DATA=pf.createResponse()
DATA=DATA+"\n"
# print "Data:", DATA
except DAV_NotFound,(ec,dd):
return self.send_notFound(dd, uri)
except DAV_Error, (ec,dd):
return self.send_error(ec,dd)
self.send_body_chunks(DATA,207,"Multi-Status","Multiple responses")
def geturi(self):
buri = self.IFACE_CLASS.baseuri
if buri[-1] == '/':
return urllib.unquote(buri[:-1]+self.path)
else:
return urllib.unquote(buri+self.path)
def do_GET(self):
"""Serve a GET request."""
dc=self.IFACE_CLASS
uri=self.geturi()
# get the last modified date
try:
lm=dc.get_prop(uri,"DAV:","getlastmodified")
except:
lm="Sun, 01 Dec 2014 00:00:00 GMT" # dummy!
headers={"Last-Modified":lm , "Connection": "keep-alive"}
# get the content type
try:
ct=dc.get_prop(uri,"DAV:","getcontenttype")
except:
ct="application/octet-stream"
# get the data
try:
data=dc.get_data(uri)
except DAV_Error, (ec,dd):
self.send_status(ec)
return
# send the data
self.send_body(data,200,"OK","OK",ct,headers)
def do_HEAD(self):
""" Send a HEAD response """
dc=self.IFACE_CLASS
uri=self.geturi()
# get the last modified date
try:
lm=dc.get_prop(uri,"DAV:","getlastmodified")
except:
lm="Sun, 01 Dec 2014 00:00:00 GMT" # dummy!
headers={"Last-Modified":lm, "Connection": "keep-alive"}
# get the content type
try:
ct=dc.get_prop(uri,"DAV:","getcontenttype")
except:
ct="application/octet-stream"
try:
data=dc.get_data(uri)
headers["Content-Length"]=str(len(data))
except DAV_NotFound:
self.send_body(None,404,"Not Found","")
return
self.send_body(None,200,"OK","OK",ct,headers)
def do_POST(self):
self.send_error(404,"File not found")
def do_MKCOL(self):
""" create a new collection """
dc=self.IFACE_CLASS
uri=self.geturi()
try:
res = dc.mkcol(uri)
if res:
self.send_body(None,201,"Created",'')
else:
self.send_body(None,415,"Cannot create",'')
#self.send_header("Connection", "keep-alive")
# Todo: some content, too
except DAV_Error, (ec,dd):
self.send_body(None,int(ec),dd,dd)
def do_DELETE(self):
""" delete an resource """
dc=self.IFACE_CLASS
uri=self.geturi()
dl=DELETE(uri,dc)
if dc.is_collection(uri):
res=dl.delcol()
else:
res=dl.delone()
if res:
self.send_status(207,body=res)
else:
self.send_status(204)
def do_PUT(self):
dc=self.IFACE_CLASS
# read the body
body=None
if self.headers.has_key("Content-Length"):
l=self.headers['Content-Length']
body=self.rfile.read(atoi(l))
uri=self.geturi()
ct=None
if self.headers.has_key("Content-Type"):
ct=self.headers['Content-Type']
try:
dc.put(uri,body,ct)
except DAV_Error, (ec,dd):
self.send_status(ec)
return
self.send_status(201)
def do_COPY(self):
""" copy one resource to another """
try:
self.copymove(COPY)
except DAV_Error, (ec,dd):
self.send_status(ec)
def do_MOVE(self):
""" move one resource to another """
try:
self.copymove(MOVE)
except DAV_Error, (ec,dd):
self.send_status(ec)
def copymove(self,CLASS):
""" common method for copying or moving objects """
dc=self.IFACE_CLASS
# get the source URI
source_uri=self.geturi()
# get the destination URI
dest_uri=self.headers['Destination']
dest_uri=urllib.unquote(dest_uri)
# Overwrite?
overwrite=1
result_code=204
if self.headers.has_key("Overwrite"):
if self.headers['Overwrite']=="F":
overwrite=None
result_code=201
# instanciate ACTION class
cp=CLASS(dc,source_uri,dest_uri,overwrite)
# Depth?
d="infinity"
if self.headers.has_key("Depth"):
d=self.headers['Depth']
if d!="0" and d!="infinity":
self.send_status(400)
return
if d=="0":
res=cp.single_action()
self.send_status(res)
return
# now it only can be "infinity" but we nevertheless check for a collection
if dc.is_collection(source_uri):
try:
res=cp.tree_action()
except DAV_Error, (ec,dd):
self.send_status(ec)
return
else:
try:
res=cp.single_action()
except DAV_Error, (ec,dd):
self.send_status(ec)
return
if res:
self.send_body_chunks(res,207,STATUS_CODES[207],STATUS_CODES[207],
ctype='text/xml; charset="utf-8"')
else:
self.send_status(result_code)
def get_userinfo(self,user,pw):
""" Dummy method which lets all users in """
return 1
def send_status(self,code=200,mediatype='text/xml; charset="utf-8"', \
msg=None,body=None):
if not msg: msg=STATUS_CODES[code]
self.send_body(body,code,STATUS_CODES[code],msg,mediatype)
def send_notFound(self,descr,uri):
body = """<?xml version="1.0" encoding="utf-8" ?>
<D:response xmlns:D="DAV:">
<D:href>%s</D:href>
<D:error/>
<D:responsedescription>%s</D:responsedescription>
</D:response>
"""
return self.send_status(404,descr, body=body % (uri,descr))
+20
View File
@@ -0,0 +1,20 @@
"""
python davserver
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
+18
View File
@@ -0,0 +1,18 @@
"""
constants definition
"""
# definition for resourcetype
COLLECTION=1
OBJECT=None
DAV_PROPS=['creationdate', 'displayname', 'getcontentlanguage', 'getcontentlength', 'getcontenttype', 'getetag', 'getlastmodified', 'lockdiscovery', 'resourcetype', 'source', 'supportedlock']
# Request classes in propfind
RT_ALLPROP=1
RT_PROPNAME=2
RT_PROP=3
+218
View File
@@ -0,0 +1,218 @@
"""
davcmd.py
---------
containts commands like copy, move, delete for normal
resources and collections
"""
from string import split,replace,joinfields
import urlparse
from utils import create_treelist, is_prefix
from errors import *
def deltree(dc,uri,exclude={}):
""" delete a tree of resources
dc -- dataclass to use
uri -- root uri to delete
exclude -- an optional list of uri:error_code pairs which should not
be deleted.
returns dict of uri:error_code tuples from which
another method can create a multistatus xml element.
Also note that we only know Depth=infinity thus we don't have
to test for it.
"""
tlist=create_treelist(dc,uri)
result={}
for i in range(len(tlist),0,-1):
problem_uris=result.keys()
element=tlist[i-1]
# test here, if an element is a prefix of an uri which
# generated an error before.
# note that we walk here from childs to parents, thus
# we cannot delete a parent if a child made a problem.
# (see example in 8.6.2.1)
ok=1
for p in problem_uris:
if is_prefix(element,p):
ok=None
break
if not ok: continue
# here we test for the exclude list which is the other way round!
for p in exclude.keys():
if is_prefix(p,element):
ok=None
break
if not ok: continue
# now delete stuff
try:
delone(dc,element)
except DAV_Error, (ec,dd):
result[element]=ec
return result
def delone(dc,uri):
""" delete a single object """
if dc.is_collection(uri):
dc.rmcol(uri) # should be empty
else:
dc.rm(uri)
###
### COPY
###
# helper function
def copy(dc,src,dst):
""" only copy the element
This is just a helper method factored out from copy and
copytree. It will not handle the overwrite or depth header.
"""
# destination should have been deleted before
if dc.exists(dst): raise DAV_Error, 412
# source should exist also
if not dc.exists(src): raise DAV_NotFound
if dc.is_collection(src):
dc.copycol(src,dst) # an exception will be passed thru
else:
dc.copy(src,dst) # an exception will be passed thru
# the main functions
def copyone(dc,src,dst,overwrite=None):
""" copy one resource to a new destination """
if overwrite and dc.exists(dst):
delres=deltree(dc,dst)
else:
delres={}
# if we cannot delete everything, then do not copy!
if delres: return delres
try:
copy(dc,src,dst) # pass thru exceptions
except DAV_Error, (ec,dd):
return ec
def copytree(dc,src,dst,overwrite=None):
""" copy a tree of resources to another location
dc -- dataclass to use
src -- src uri from where to copy
dst -- dst uri
overwrite -- if 1 then delete dst uri before
returns dict of uri:error_code tuples from which
another method can create a multistatus xml element.
"""
# first delete the destination resource
if overwrite and dc.exists(dst):
delres=deltree(dc,dst)
else:
delres={}
# if we cannot delete everything, then do not copy!
if delres: return delres
# get the tree we have to copy
tlist=create_treelist(dc,src)
result={}
# prepare destination URIs (get the prefix)
dpath=urlparse.urlparse(dst)[2]
for element in tlist:
problem_uris=result.keys()
# now URIs get longer and longer thus we have
# to test if we had a parent URI which we were not
# able to copy in problem_uris which is the prefix
# of the actual element. If it is, then we cannot
# copy this as well but do not generate another error.
ok=1
for p in problem_uris:
if is_prefix(p,element):
ok=None
break
if not ok: continue
# now create the destination URI which corresponds to
# the actual source URI. -> actual_dst
# ("subtract" the base src from the URI and prepend the
# dst prefix to it.)
esrc=replace(element,src,"")
actual_dst=dpath+esrc
# now copy stuff
try:
copy(dc,element,actual_dst)
except DAV_Error, (ec,dd):
result[element]=ec
return result
###
### MOVE
###
def moveone(dc,src,dst,overwrite=None):
""" move a single resource
This is done by first copying it and then deleting
the original.
"""
# first copy it
copyone(dc,src,dst,overwrite)
# then delete it
dc.rm(src)
def movetree(dc,src,dst,overwrite=None):
""" move a collection
This is done by first copying it and then deleting
the original.
PROBLEM: if something did not copy then we have a problem
when deleting as the original might get deleted!
"""
# first copy it
res=copytree(dc,src,dst,overwrite)
# then delete it
res=deltree(dc,src,exclude=res)
return res
+133
View File
@@ -0,0 +1,133 @@
#!/usr/bin/env python
"""
python davserver
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from xml.dom import ext
from xml.dom.Document import Document
import sys
import string
import urlparse
import urllib
from StringIO import StringIO
import utils
from constants import COLLECTION, OBJECT, DAV_PROPS, RT_ALLPROP, RT_PROPNAME, RT_PROP
from errors import *
from utils import create_treelist, quote_uri, gen_estring
class COPY:
""" copy resources and eventually create multistatus responses
This module implements the COPY class which is responsible for
copying resources. Usually the normal copy work is done in the
interface class. This class only creates error messages if error
occur.
"""
def __init__(self,dataclass,src_uri,dst_uri,overwrite):
self.__dataclass=dataclass
self.__src=src_uri
self.__dst=dst_uri
self.__overwrite=overwrite
def single_action(self):
""" copy a normal resources.
We try to copy it and return the result code.
This is for Depth==0
"""
dc=self.__dataclass
base=self.__src
### some basic tests
# test if dest exists and overwrite is false
if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error, 412
# test if src and dst are the same
# (we assume that both uris are on the same server!)
ps=urlparse.urlparse(self.__src)[2]
pd=urlparse.urlparse(self.__dst)[2]
if ps==pd: raise DAV_Error, 403
return dc.copyone(self.__src,self.__dst,self.__overwrite)
#return copyone(dc,self.__src,self.__dst,self.__overwrite)
def tree_action(self):
""" copy a tree of resources (a collection)
Here we return a multistatus xml element.
"""
dc=self.__dataclass
base=self.__src
### some basic tests
# test if dest exists and overwrite is false
if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error, 412
# test if src and dst are the same
# (we assume that both uris are on the same server!)
ps=urlparse.urlparse(self.__src)[2]
pd=urlparse.urlparse(self.__dst)[2]
if ps==pd: raise DAV_Error, 403
result=dc.copytree(self.__src,self.__dst,self.__overwrite)
#result=copytree(dc,self.__src,self.__dst,self.__overwrite)
if not result: return None
###
### create the multistatus XML element
### (this is also the same as in delete.py.
### we might make a common method out of it)
###
doc = Document(None)
ms=doc.createElement("D:multistatus")
ms.setAttribute("xmlns:D","DAV:")
doc.appendChild(ms)
for el,ec in result.items():
re=doc.createElement("D:response")
hr=doc.createElement("D:href")
st=doc.createElement("D:status")
huri=doc.createTextNode(quote_uri(el))
t=doc.createTextNode(gen_estring(ec))
st.appendChild(t)
hr.appendChild(huri)
re.appendChild(hr)
re.appendChild(st)
ms.appendChild(re)
sfile=StringIO()
ext.PrettyPrint(doc,stream=sfile)
s=sfile.getvalue()
sfile.close()
return s
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env python
"""
python davserver
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
import sys
import string
import urlparse
import urllib
from StringIO import StringIO
import utils
from constants import COLLECTION, OBJECT, DAV_PROPS
from constants import RT_ALLPROP, RT_PROPNAME, RT_PROP
from errors import *
from utils import create_treelist, quote_uri, gen_estring, make_xmlresponse
from davcmd import moveone, movetree
class MOVE:
""" move resources and eventually create multistatus responses
This module implements the MOVE class which is responsible for
moving resources.
MOVE is implemented by a COPY followed by a DELETE of the old
resource.
"""
def __init__(self,dataclass,src_uri,dst_uri,overwrite):
self.__dataclass=dataclass
self.__src=src_uri
self.__dst=dst_uri
self.__overwrite=overwrite
def single_action(self):
""" move a normal resources.
We try to move it and return the result code.
This is for Depth==0
"""
dc=self.__dataclass
base=self.__src
### some basic tests
# test if dest exists and overwrite is false
if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error, 412
# test if src and dst are the same
# (we assume that both uris are on the same server!)
ps=urlparse.urlparse(self.__src)[2]
pd=urlparse.urlparse(self.__dst)[2]
if ps==pd: raise DAV_Error, 403
return dc.moveone(self.__src,self.__dst,self.__overwrite)
def tree_action(self):
""" move a tree of resources (a collection)
Here we return a multistatus xml element.
"""
dc=self.__dataclass
base=self.__src
### some basic tests
# test if dest exists and overwrite is false
if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error, 412
# test if src and dst are the same
# (we assume that both uris are on the same server!)
ps=urlparse.urlparse(self.__src)[2]
pd=urlparse.urlparse(self.__dst)[2]
if ps==pd: raise DAV_Error, 403
result=dc.movetree(self.__src,self.__dst,self.__overwrite)
if not result: return None
# create the multistatus XML element
return make_xmlresponse(result)
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env python
"""
python davserver
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
import os
import string
import urllib
from StringIO import StringIO
from status import STATUS_CODES
from utils import gen_estring, quote_uri, make_xmlresponse
from davcmd import deltree
class DELETE:
def __init__(self,uri,dataclass):
self.__dataclass=dataclass
self.__uri=uri
def delcol(self):
""" delete a collection """
dc=self.__dataclass
result=dc.deltree(self.__uri)
if not len(result.items()):
return None # everything ok
# create the result element
return make_xmlresponse(result)
def delone(self):
""" delete a resource """
dc=self.__dataclass
result=dc.delone(self.__uri)
if not result: return None
if not len(result.items()):
return None # everything ok
# create the result element
return make_xmlresponse(result)
+56
View File