[MERGE]: Merge with lp:openobject-addons
bzr revid: rpa@tinyerp.com-20100402051455-ytooke4xf1gtw0t5
This commit is contained in:
@@ -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-03-28 20:40+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 22:39+0000\n"
|
||||
"Last-Translator: mitev.dmitry <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: 2010-03-30 04:01+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -45,7 +45,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_confirmstatementfromdraft0
|
||||
msgid "Confirm statement from draft"
|
||||
msgstr ""
|
||||
msgstr "Potvrdit výpis z návrhu"
|
||||
|
||||
#. module: account
|
||||
#: model:account.account.type,name:account.account_type_asset
|
||||
|
||||
@@ -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-02-28 09:03+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 17:22+0000\n"
|
||||
"Last-Translator: Ferdinand @ ChriCar <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: 2010-03-30 04:02+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -3802,7 +3802,7 @@ msgstr "Wähle Kontenplan"
|
||||
#: selection:account.chart,init,target_move:0
|
||||
#: model:ir.actions.report.xml,name:account.account_move_line_list
|
||||
msgid "All Entries"
|
||||
msgstr "Gebucht"
|
||||
msgstr "Alle Einträge"
|
||||
|
||||
#. module: account
|
||||
#: model:process.node,name:account.process_node_draftinvoices0
|
||||
@@ -4947,7 +4947,7 @@ msgstr "Konto OP Ausgleich"
|
||||
#: view:account.bank.statement:0
|
||||
#: selection:account.bank.statement,state:0
|
||||
msgid "Confirm"
|
||||
msgstr "Gebucht"
|
||||
msgstr "Bestätigen"
|
||||
|
||||
#. module: account
|
||||
#: wizard_view:account.account.balance.report,account_selection:0
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-01-05 05:59+0000\n"
|
||||
"PO-Revision-Date: 2010-03-31 14:33+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 15:06+0000\n"
|
||||
"Last-Translator: smii <Unknown>\n"
|
||||
"Language-Team: Finnish <fi@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-04-01 03:41+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: crm
|
||||
@@ -2868,12 +2868,12 @@ msgstr "Tässä kuussa"
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
msgid "Availability (weeks)"
|
||||
msgstr ""
|
||||
msgstr "Saatavuus (viikoissa)"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.opportunity:0
|
||||
msgid "Opportunities Tree"
|
||||
msgstr ""
|
||||
msgstr "Mahdollisuuksien puu"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.case,state:0
|
||||
@@ -2895,7 +2895,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: selection:crm.email.add.cc,name:0
|
||||
msgid "Email Address"
|
||||
msgstr ""
|
||||
msgstr "Sähköpostiosoite"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.segmentation,som_interval_max:0
|
||||
@@ -2909,17 +2909,17 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: field:crm.case,case_id:0
|
||||
msgid "Related Case"
|
||||
msgstr ""
|
||||
msgstr "Liittyvä tapahtuma"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.rule,server_action_id:0
|
||||
msgid "Server Action"
|
||||
msgstr ""
|
||||
msgstr "Palvelintoiminto"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.actions.act_window,name:crm.crm_case_categ_claim0
|
||||
msgid "All Claims"
|
||||
msgstr ""
|
||||
msgstr "Kaikki vaateet"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.log,user_id:0
|
||||
|
||||
@@ -62,6 +62,7 @@ Main features :
|
||||
'wizard/pos_payment_report_user.xml',
|
||||
'wizard/pos_payment_report.xml',
|
||||
'wizard/pos_payment.xml',
|
||||
'wizard/pos_scan_product_view.xml',
|
||||
'pos_report.xml',
|
||||
'pos_wizard.xml',
|
||||
'pos_view.xml',
|
||||
|
||||
@@ -64,7 +64,7 @@ class pos_company_discount(osv.osv):
|
||||
'company_discount': fields.float('Max Discount(%)', digits=(16,2)),
|
||||
'max_diff': fields.float('Max Difference for Cashboxes', digits=(16,2)),
|
||||
'account_receivable': fields.many2one('account.account',
|
||||
'Default Receivable', required=True, states={'draft': [('readonly', False)]}),
|
||||
'Default Receivable', states={'draft': [('readonly', False)]}),
|
||||
}
|
||||
|
||||
pos_company_discount()
|
||||
@@ -1360,7 +1360,7 @@ class report_sales_by_margin_pos(osv.osv):
|
||||
# 'pos_name': fields.char('POS Order', size=64, readonly=True),
|
||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||
'date_order': fields.date('Order Date',required=True, select=True),
|
||||
'amount': fields.float('Total', readonly=True, select=True),
|
||||
# 'amount': fields.float('Total', readonly=True, select=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||
'qty': fields.float('Qty', readonly=True, select=True),
|
||||
'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
|
||||
@@ -1409,7 +1409,7 @@ class report_sales_by_margin_pos_month(osv.osv):
|
||||
# 'pos_name': fields.char('POS Order', size=64, readonly=True),
|
||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||
'date_order': fields.date('Order Date',required=True, select=True),
|
||||
'amount': fields.float('Total', readonly=True, select=True),
|
||||
#'amount': fields.float('Total', readonly=True, select=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||
'qty': fields.float('Qty', readonly=True, select=True),
|
||||
'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
|
||||
|
||||
@@ -663,7 +663,7 @@ invoiced
|
||||
<page string="Other">
|
||||
<field name="company_discount" colspan="4"/>
|
||||
<field name="max_diff" colspan="4"/>
|
||||
<field name="account_receivable" colspan="4"/>
|
||||
<field name="account_receivable" required="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
|
||||
@@ -27,4 +27,14 @@
|
||||
"access_pos_open_statement","pos.close.statement","model_pos_close_statement","point_of_sale.group_pos_user",1,0,0,0
|
||||
"acess_pos_box_entries ","pos.box.entries ","model_pos_box_entries","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_box_out","pos.box.out","model_pos_box_out","point_of_sale.group_pos_user",1,0,0,0
|
||||
"acess_pos_details ","pos.details ","model_pos_details","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_details ","pos.details ","model_pos_details","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_details ","pos.details ","model_pos_details","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_sale_user","pos.sale.user","model_pos_sale_user","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_sale_user","pos.sales.user.today","model_pos_sales_user_today","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_sales_user_today_current_user","pos.sales.user.today.current_user","model_pos_sales_user_today_current_user","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_all_closed_cashbox_of_the_day","all.closed.cashbox.of.the.day","model_all_closed_cashbox_of_the_day","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_receipt","pos.receipt ","model_pos_receipt","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_payment_report_user","pos.payment.report.user","model_pos_payment_report_user","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_payment_report_date ","pos.payment.report.date ","model_pos_payment_report_date","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_make_payment","pos.make.payment","model_pos_make_payment","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_scan_product","pos.scan.product","model_pos_scan_product","point_of_sale.group_pos_user",1,0,0,0
|
||||
|
||||
|
@@ -20,11 +20,8 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#import wizard_pos_payment
|
||||
import wizard_default_journal
|
||||
import wizard_scan_product
|
||||
import wizard_return
|
||||
#import wizard_open_statement
|
||||
|
||||
import pos_add_product
|
||||
import pos_confirm
|
||||
import pos_discount
|
||||
@@ -43,6 +40,7 @@ import pos_payment_report_user
|
||||
import pos_payment_report_date
|
||||
import pos_payment_report
|
||||
import pos_payment
|
||||
import pos_scan_product
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -53,15 +53,16 @@ class pos_make_payment(osv.osv_memory):
|
||||
else:
|
||||
journal = None
|
||||
|
||||
order = self.pool.get('pos.order').browse(cr, uid, record_id, context)
|
||||
order_obj=self.pool.get('pos.order')
|
||||
order = order_obj.browse(cr, uid, record_id, context)
|
||||
#get amount to pay
|
||||
amount = order.amount_total - order.amount_paid
|
||||
|
||||
if amount <= 0.0:
|
||||
context.update({'flag': True})
|
||||
self.pool.get('pos.order').action_paid(cr, uid, [record_id], context)
|
||||
order_obj.action_paid(cr, uid, [record_id], context)
|
||||
elif order.amount_paid > 0.0:
|
||||
self.pool.get('pos.order').write(cr, uid, [record_id], {'state': 'advance'})
|
||||
order_obj.write(cr, uid, [record_id], {'state': 'advance'})
|
||||
|
||||
invoice_wanted_checked = False
|
||||
|
||||
@@ -111,7 +112,7 @@ class pos_make_payment(osv.osv_memory):
|
||||
<label string="Do you want to print the Receipt?" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="No" readonly="0"/>
|
||||
<button name="print_report" string="Print Receipt" type="object" icon="gtk-ok"/>
|
||||
<button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/>
|
||||
</group>
|
||||
</form>
|
||||
"""
|
||||
@@ -143,7 +144,11 @@ class pos_make_payment(osv.osv_memory):
|
||||
if order.partner_id and order.invoice_wanted:
|
||||
return self.create_invoice(cr, uid, ids, context)
|
||||
else:
|
||||
return self.print_report(cr, uid, ids, context)
|
||||
order_obj.write(cr, uid, [record_id],{'state':'paid'})
|
||||
return self.print_report(cr, uid, ids, context)
|
||||
if order.amount_paid > 0.0:
|
||||
self.pool.get('pos.order').write(cr, uid, [record_id],{'state':'advance'})
|
||||
return self.print_report(cr, uid, ids, context)
|
||||
return {}
|
||||
|
||||
def create_invoice(self, cr, uid, ids, context):
|
||||
@@ -179,12 +184,6 @@ class pos_make_payment(osv.osv_memory):
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
def trigger_wkf(self, cr, uid, data, context):
|
||||
record_id = context and context.get('active_id', False)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'pos.order', record_id, 'payment', cr)
|
||||
return {}
|
||||
|
||||
_columns = {
|
||||
'journal': fields.selection(pos_box_entries.get_journal, "Journal", required=True),
|
||||
'product_id': fields.many2one('product.product', "Acompte"),
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator orientation="vertical"/>
|
||||
<button icon='gtk-cancel' special="cancel" string="Cancel" />
|
||||
<button name="trigger_wkf" string="Finish" colspan="1" type="object" icon="gtk-ok"/>
|
||||
<button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-ok"/>
|
||||
<group col="2" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel" string="Cancel" />
|
||||
<button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
<field name="model">pos.payment.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="POS Details :">
|
||||
<form string="Payment Report">
|
||||
<group col="2" colspan="4">
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="print_report" string="Print Report"
|
||||
@@ -24,7 +22,7 @@
|
||||
<record id="action_pos_payment_report" model="ir.actions.act_window">
|
||||
<field name="name">Payment Report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.details</field>
|
||||
<field name="res_model">pos.payment.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
||||
@@ -2,37 +2,30 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- pos.details -->
|
||||
<!-- Pos Receipt -->
|
||||
|
||||
<record id="view_pos_receipt" model="ir.ui.view">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="model">pos.receipt</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt :">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="print_report" string="Print Report"
|
||||
colspan="1" type="object" icon="gtk-ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_pos_receipt" model="ir.ui.view">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="model">pos.receipt</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt :">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="print_report" string="Print Report"
|
||||
colspan="1" type="object" icon="gtk-print" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Print Receipt"
|
||||
res_model="pos.receipt"
|
||||
src_model="pos.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_report_pos_receipt"/>
|
||||
|
||||
<!--record id="action_report_pos_receipt" model="ir.actions.act_window">
|
||||
<record id="action_report_pos_receipt" model="ir.actions.act_window">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="res_model">pos.receipt</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record-->
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 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 osv,fields
|
||||
from tools.translate import _
|
||||
|
||||
class pos_scan_product(osv.osv_memory):
|
||||
_name = 'pos.scan.product'
|
||||
_description = 'Scan product'
|
||||
_columns = {
|
||||
'gencod': fields.char('Barcode',size=13,required= True)
|
||||
}
|
||||
def scan(self, cr, uid, ids, context):
|
||||
"""
|
||||
To get the gencod and scan product
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return : retrun gencod
|
||||
"""
|
||||
|
||||
data=self.read(cr, uid, ids)[0]
|
||||
record_id = context and context.get('active_id',False)
|
||||
result =self. pool.get('pos.order.line')._scan_product(cr, uid, data['gencod'], 1, record_id)
|
||||
return {'gencod': False}
|
||||
|
||||
pos_scan_product()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_pos_scan_product" model="ir.ui.view">
|
||||
<field name="name">Scan product</field>
|
||||
<field name="model">pos.scan.product</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Scan product">
|
||||
<group col="2" colspan="4">
|
||||
<label string="Scan Barcode" colspan="4"/>
|
||||
<field name="gencod" colspan="4" nolabel="1"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="scan" string="Add"
|
||||
colspan="1" type="object" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_pos_scan_product" model="ir.actions.act_window">
|
||||
<field name="name">Scan product</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.scan.product</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,128 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
|
||||
def _get_default_journal_selection(self, cr, uid, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
obj = pool.get('account.journal')
|
||||
ids = obj.search(cr, uid, [('type', '=', 'cash')])
|
||||
res = obj.read(cr, uid, ids, ['id', 'name'], context)
|
||||
res = [(r['id'], r['name']) for r in res]
|
||||
res.insert(0, ('', ''))
|
||||
return res
|
||||
|
||||
default_journal_form = '''<?xml version="1.0"?>
|
||||
<form string="Select default journals">
|
||||
<field name="default_journal" />
|
||||
<newline />
|
||||
<field name="default_journal_rebate" />
|
||||
<newline />
|
||||
<field name="default_journal_gift" />
|
||||
<newline />
|
||||
</form>'''
|
||||
|
||||
default_journal_fields = {
|
||||
'default_journal': {'string': 'Default journal', 'type': 'selection',
|
||||
'selection': _get_default_journal_selection,
|
||||
},
|
||||
'default_journal_rebate': {'string': 'Default rebate journal', 'type': 'selection',
|
||||
'selection': _get_default_journal_selection,
|
||||
},
|
||||
'default_journal_gift': {'string': 'Default gift journal', 'type': 'selection',
|
||||
'selection': _get_default_journal_selection,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
class wizard_default_journal(wizard.interface):
|
||||
|
||||
def _set_default_journal(self, cr, uid, data, context):
|
||||
|
||||
def _update_default_journal_config(journal_type, journal_code, journal_descr, journal_codes, data):
|
||||
default_journal_id = data.get('form', {}).get(journal_type) or None
|
||||
dico = dict(name=journal_descr, code=journal_code, journal_id=default_journal_id)
|
||||
if default_journal_id:
|
||||
if journal_code in journal_codes:
|
||||
ids = [obj.id for obj in objs if obj.code == journal_code]
|
||||
pos_config_journal.write(cr, uid, ids, dico, context)
|
||||
else:
|
||||
pos_config_journal.create(cr, uid, dico, context)
|
||||
else:
|
||||
ids = [obj.id for obj in objs if obj.code == journal_code]
|
||||
pos_config_journal.write(cr, uid, ids, dico, context)
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pos_config_journal = pool.get('pos.config.journal')
|
||||
ids = pos_config_journal.search(cr, uid, [])
|
||||
objs = pos_config_journal.browse(cr, uid, ids)
|
||||
journal_codes = [str(obj.code) for obj in objs]
|
||||
|
||||
_update_default_journal_config('default_journal', 'DEFAULT', 'Default journal', journal_codes, data)
|
||||
_update_default_journal_config('default_journal_rebate', 'REBATE', 'Default rebate journal', journal_codes, data)
|
||||
_update_default_journal_config('default_journal_gift', 'GIFT', 'Default gift journal', journal_codes, data)
|
||||
|
||||
return {}
|
||||
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pos_config_journal = pool.get('pos.config.journal')
|
||||
ids = pos_config_journal.search(cr, uid, [])
|
||||
objs = pos_config_journal.browse(cr, uid, ids)
|
||||
journal_codes = {}
|
||||
for obj in objs:
|
||||
journal_codes[obj.code] = int(obj.journal_id.id)
|
||||
|
||||
form = data['form']
|
||||
form['default_journal'] = journal_codes.get('DEFAULT') or False
|
||||
form['default_journal_rebate'] = journal_codes.get('REBATE') or False
|
||||
form['default_journal_gift'] = journal_codes.get('GIFT') or False
|
||||
|
||||
return form
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {
|
||||
'type': 'form',
|
||||
'arch': default_journal_form,
|
||||
'fields': default_journal_fields,
|
||||
'state': [
|
||||
('end', 'Cancel'),
|
||||
('set_default_journal', 'Define default journals')
|
||||
]
|
||||
}
|
||||
},
|
||||
'set_default_journal': {
|
||||
'actions': [_set_default_journal],
|
||||
'result': {
|
||||
'type': 'state',
|
||||
'state': "end",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
wizard_default_journal('pos.config.journal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,72 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# Copyright (c) 2008 Sylëam Info Services. (http://www.syleam.fr) All Rights Reserved.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import pooler
|
||||
import wizard
|
||||
|
||||
form_gencod = """<?xml version="1.0"?>
|
||||
<form string="Scan product">
|
||||
<label string="Scan Barcode" colspan="4"/>
|
||||
<field name="gencod" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
fields_gencod = {
|
||||
'gencod': {'string': 'Barcode',
|
||||
'type': 'char',
|
||||
'size': 13,
|
||||
'required': True}
|
||||
}
|
||||
|
||||
|
||||
def _scan(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
result = pool.get('pos.order.line')._scan_product(cr, uid, data['form']['gencod'], 1, data['id'])
|
||||
return {'gencod': False}
|
||||
|
||||
|
||||
def _pre_init(self, cr, uid, data, context):
|
||||
return {'gencod': False}
|
||||
|
||||
|
||||
class pos_scan_product(wizard.interface):
|
||||
states = {
|
||||
'init': {'actions' : [_pre_init],
|
||||
'result': {
|
||||
'type': 'form',
|
||||
'arch': form_gencod,
|
||||
'fields': fields_gencod,
|
||||
'state': [('end', 'Cancel','gtk-cancel'),
|
||||
('add', 'Add', 'gtk-ok', True)],
|
||||
}
|
||||
},
|
||||
'add': {'actions' : [_scan],
|
||||
'result': {
|
||||
'type': 'state',
|
||||
'state': 'init',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pos_scan_product('pos.scan_product')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
+12
-12
@@ -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: 2010-03-31 08:48+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 14:53+0000\n"
|
||||
"Last-Translator: Boris <boris.t.ivanov@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-04-01 03:41+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: sale
|
||||
@@ -268,7 +268,7 @@ msgstr "Нетна цена"
|
||||
#: model:ir.actions.act_window,name:sale.action_order_tree9
|
||||
#: model:ir.ui.menu,name:sale.menu_action_order_tree9
|
||||
msgid "My sales order in progress"
|
||||
msgstr "Мойте активни поръчки за продажба"
|
||||
msgstr "Мои активни поръчки за продажба"
|
||||
|
||||
#. module: sale
|
||||
#: field:sale.order.line,product_uos_qty:0
|
||||
@@ -382,7 +382,7 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:sale.action_order_tree8
|
||||
#: model:ir.ui.menu,name:sale.menu_action_order_tree8
|
||||
msgid "My sales order waiting Invoice"
|
||||
msgstr "Мойте поръчки за продажба очакващи фактура"
|
||||
msgstr "Мои поръчки за продажба, очакващи фактура"
|
||||
|
||||
#. module: sale
|
||||
#: rml:sale.order:0
|
||||
@@ -536,7 +536,7 @@ msgstr "Групиране на фактури"
|
||||
#: model:ir.actions.act_window,name:sale.action_order_tree5
|
||||
#: model:ir.ui.menu,name:sale.menu_action_order_tree5
|
||||
msgid "All Quotations"
|
||||
msgstr "Всички запитвания"
|
||||
msgstr "Всички оферти"
|
||||
|
||||
#. module: sale
|
||||
#: field:sale.order.line,discount:0
|
||||
@@ -563,7 +563,7 @@ msgstr "Снабдяване за всеки ред"
|
||||
#: model:ir.actions.act_window,name:sale.action_order_tree10
|
||||
#: model:ir.ui.menu,name:sale.menu_action_order_tree10
|
||||
msgid "My Quotations"
|
||||
msgstr "Моите запитвания"
|
||||
msgstr "Мои оферти"
|
||||
|
||||
#. module: sale
|
||||
#: wizard_view:sale.advance_payment_inv,create:0
|
||||
@@ -758,7 +758,7 @@ msgstr "Продажба на продукти"
|
||||
#. module: sale
|
||||
#: rml:sale.order:0
|
||||
msgid "Our Salesman"
|
||||
msgstr "Нашия търговец"
|
||||
msgstr "Лице за контакт"
|
||||
|
||||
#. module: sale
|
||||
#: wizard_button:sale.advance_payment_inv,init,create:0
|
||||
@@ -797,7 +797,7 @@ msgstr "Свойства"
|
||||
#: model:process.node,name:sale.process_node_quotation0
|
||||
#: selection:sale.order,state:0
|
||||
msgid "Quotation"
|
||||
msgstr "Запитване"
|
||||
msgstr "Оферта"
|
||||
|
||||
#. module: sale
|
||||
#: model:product.template,name:sale.advance_product_0_product_template
|
||||
@@ -876,7 +876,7 @@ msgstr ""
|
||||
#. module: sale
|
||||
#: rml:sale.order:0
|
||||
msgid "Your Reference"
|
||||
msgstr "Вашата отпратка"
|
||||
msgstr "Ваш референтен номер"
|
||||
|
||||
#. module: sale
|
||||
#: selection:sale.config.picking_policy,step:0
|
||||
@@ -1054,7 +1054,7 @@ msgstr "Поръчка за продажба"
|
||||
#. module: sale
|
||||
#: model:process.node,note:sale.process_node_quotation0
|
||||
msgid "Quotation (A sale order in draft state)"
|
||||
msgstr "Запитване (проект на поръчка за продажба)"
|
||||
msgstr "Оферта (поръчка за продажба в етап на проект)"
|
||||
|
||||
#. module: sale
|
||||
#: model:process.transition,name:sale.process_transition_saleinvoice0
|
||||
@@ -1101,7 +1101,7 @@ msgstr "Доставка"
|
||||
#. module: sale
|
||||
#: model:ir.actions.report.xml,name:sale.report_sale_order
|
||||
msgid "Quotation / Order"
|
||||
msgstr "Запитване / Поръчка"
|
||||
msgstr "Оферта / Поръчка"
|
||||
|
||||
#. module: sale
|
||||
#: rml:sale.order:0
|
||||
@@ -1111,7 +1111,7 @@ msgstr "Тел. :"
|
||||
#. module: sale
|
||||
#: rml:sale.order:0
|
||||
msgid "Quotation N°"
|
||||
msgstr "Запитване N°"
|
||||
msgstr "Оферта №"
|
||||
|
||||
#. module: sale
|
||||
#: field:stock.move,sale_line_id:0
|
||||
|
||||
Reference in New Issue
Block a user