summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2008-12-23 07:34:58 +0100
committerFabien Pinckaers <fp@tinyerp.com>2008-12-23 07:34:58 +0100
commitf48e9d4b0576dbd3b4ecee12664ca807a10fbc55 (patch)
tree9a08c0e482906f4f797c46ad96d1d3edcf7b143f
parentbbf26a2dfc9b67d12f564c61e16d354fa0ac694a (diff)
parent7fcf65d7c545b1f966cac1496545a69312ffde4f (diff)
merge
bzr revid: fp@tinyerp.com-20081223063458-cafhu07hjxe0r6ak
-rw-r--r--addons/account/account.py2
-rw-r--r--addons/account_analytic_analysis/account_analytic_analysis.py3
-rw-r--r--addons/analytic_user_function/analytic_user_function.py2
-rw-r--r--addons/crm_configuration/report/crm_report.py10
-rw-r--r--addons/l10n_be/l10n_be_wizard.xml2
-rw-r--r--addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml2
-rwxr-xr-xaddons/l10n_fr/fr_wizard.xml2
-rw-r--r--addons/l10n_lu/l10n_lu_wizard.xml2
-rw-r--r--addons/mrp_repair/report/order.rml170
-rw-r--r--addons/point_of_sale/i18n/point_of_sale.pot73
-rw-r--r--addons/point_of_sale/pos.py72
-rw-r--r--addons/point_of_sale/pos_view.xml10
-rw-r--r--addons/point_of_sale/pos_wizard.xml3
-rw-r--r--addons/point_of_sale/wizard/__init__.py1
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_payment.py22
-rw-r--r--addons/point_of_sale/wizard/wizard_scan_product.py70
-rw-r--r--addons/project/wizard/close_task.py4
-rw-r--r--addons/report_timesheet/report_timesheet.py3
18 files changed, 256 insertions, 197 deletions
diff --git a/addons/account/account.py b/addons/account/account.py
index 997fe2b3c59..86d7ac16c68 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -179,7 +179,7 @@ class account_account(osv.osv):
def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''):
#compute the balance/debit/credit accordingly to the value of field_name for the given account ids
mapping = {
- 'balance': "COALESCE(SUM(l.debit) - SUM(l.credit), 0) as balance ",
+ 'balance': "COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance ",
'debit': "COALESCE(SUM(l.debit), 0) as debit ",
'credit': "COALESCE(SUM(l.credit), 0) as credit "
}
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 60b3d9c2920..c37b1e2b4c8 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -22,6 +22,7 @@
import operator
from osv import osv, fields
from osv.orm import intersect
+import tools.sql
from tools.translate import _
@@ -619,7 +620,7 @@ class account_analytic_account_summary_month(osv.osv):
}
def init(self, cr):
- cr.drop_view_if_exists('account_analytic_analysis_summary_month')
+ tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_month')
cr.execute('CREATE VIEW account_analytic_analysis_summary_month AS (' \
'SELECT ' \
'(TO_NUMBER(TO_CHAR(d.month, \'YYYYMM\'), \'999999\') + (d.account_id * 1000000))::integer AS id, ' \
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py
index 46924169a37..442405afeed 100644
--- a/addons/analytic_user_function/analytic_user_function.py
+++ b/addons/analytic_user_function/analytic_user_function.py
@@ -98,7 +98,7 @@ class hr_analytic_timesheet(osv.osv):
'There is no expense account define ' \
'for this product: "%s" (id:%d)' % \
(r.product_id.name, r.product_id.id,))
- amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
+ amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid,
r.product_id.uom_id.id, r.product_id.standard_price, False)
res ['value']['amount']= - round(amount, 2)
res ['value']['general_account_id']= a
diff --git a/addons/crm_configuration/report/crm_report.py b/addons/crm_configuration/report/crm_report.py
index 772a5c3c7a8..4395973dc17 100644
--- a/addons/crm_configuration/report/crm_report.py
+++ b/addons/crm_configuration/report/crm_report.py
@@ -21,6 +21,8 @@
##############################################################################
from osv import fields,osv
+import tools.sql
+
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
@@ -47,7 +49,7 @@ class report_crm_case_section_categ2(osv.osv):
_order = 'category2_id, section_id'
def init(self, cr):
- cr.drop_view_if_exists("report_crm_case_section_categ2")
+ tools.sql.drop_view_if_exists(cr, "report_crm_case_section_categ2")
cr.execute("""
create view report_crm_case_section_categ2 as (
select
@@ -86,7 +88,7 @@ class report_crm_case_section_stage(osv.osv):
_order = 'stage_id, section_id'
def init(self, cr):
- cr.drop_view_if_exists("report_crm_case_section_stage")
+ tools.sql.drop_view_if_exists(cr, "report_crm_case_section_stage")
cr.execute("""
create view report_crm_case_section_stage as (
select
@@ -123,7 +125,7 @@ class report_crm_case_section_categ_stage(osv.osv):
_order = 'stage_id, section_id, categ_id'
def init(self, cr):
- cr.drop_view_if_exists("report_crm_case_section_categ_stage")
+ tools.sql.drop_view_if_exists(cr, "report_crm_case_section_categ_stage")
cr.execute("""
create view report_crm_case_section_categ_stage as (
select
@@ -161,7 +163,7 @@ class report_crm_case_section_categ_categ2(osv.osv):
_order = 'section_id, categ_id, category2_id'
def init(self, cr):
- cr.drop_view_if_exists("report_crm_case_section_categ_categ2")
+ tools.sql.drop_view_if_exists(cr, "report_crm_case_section_categ_categ2")
cr.execute("""
create view report_crm_case_section_categ_categ2 as (
select
diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml
index e4b5a6d6fd9..12e38eba2ea 100644
--- a/addons/l10n_be/l10n_be_wizard.xml
+++ b/addons/l10n_be/l10n_be_wizard.xml
@@ -29,7 +29,7 @@
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
-This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
+This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
</record>
diff --git a/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml b/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml
index 2ba2fa7478a..b45012c87be 100644
--- a/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml
+++ b/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml
@@ -5,7 +5,7 @@
<record id="config_call_account_template_uk_minimal" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
- This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
+ This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="state">open</field>
</record>
diff --git a/addons/l10n_fr/fr_wizard.xml b/addons/l10n_fr/fr_wizard.xml
index b656642deb9..b6468872879 100755
--- a/addons/l10n_fr/fr_wizard.xml
+++ b/addons/l10n_fr/fr_wizard.xml
@@ -9,7 +9,7 @@
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
-This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
+This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
</record>
diff --git a/addons/l10n_lu/l10n_lu_wizard.xml b/addons/l10n_lu/l10n_lu_wizard.xml
index bb7da6a631f..6987cf931f5 100644
--- a/addons/l10n_lu/l10n_lu_wizard.xml
+++ b/addons/l10n_lu/l10n_lu_wizard.xml
@@ -5,7 +5,7 @@
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to select the company, the chart template, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
-This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
+This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
</record>
diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml
index acc6a2aa437..4151811f0ea 100644
--- a/addons/mrp_repair/report/order.rml
+++ b/addons/mrp_repair/report/order.rml
@@ -67,22 +67,9 @@
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
</blockTableStyle>
- <blockTableStyle id="Table6">
+ <blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
-<<<<<<< TREE
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,1" stop="-1,-1"/>
-=======
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
@@ -99,7 +86,6 @@
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,2" stop="3,2"/>
->>>>>>> MERGE-SOURCE
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
@@ -125,30 +111,7 @@
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
-<<<<<<< TREE
- <paraStyle name="P18" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P19" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P21" fontName="Helvetica-Oblique" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P22" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P23" fontName="Helvetica"/>
- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P25" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P26" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P27" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P28" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P29" fontName="Times-Roman"/>
- <paraStyle name="P30" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P31" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P32" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P33" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P34" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P35" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P36" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P37" fontName="Helvetica-Oblique" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P38" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
-=======
- <paraStyle name="P18" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="P18" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="P19" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Helvetica-Oblique" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
@@ -161,7 +124,6 @@
<paraStyle name="P28" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P29" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P30" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
->>>>>>> MERGE-SOURCE
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
@@ -315,32 +277,17 @@
</tr>
</blockTable>
<section>
-<<<<<<< TREE
- <para style="P28"/>
- <para style="P27">Operation Line(s)</para>
- <blockTable colWidths="26.0,142.0,153.0,95.0,52.0,69.0" style="Table5">
-=======
<para style="P30">
<font color="white"> </font>
</para>
<para style="P29">Operation Line(s)</para>
<blockTable colWidths="28.0,145.0,150.0,96.0,51.0,69.0" style="Table5">
->>>>>>> MERGE-SOURCE
<tr>
<td>
<para style="P4"><font face="Times-Roman" size="2.0">[[ repeatIn(o.operations,'line') ]]</font>Add [[ ((line.type == 'add') or removeParentNode('para')) and '' ]] </para>
<para style="P4">Remove [[ ((line.type == 'remove') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
-<<<<<<< TREE
- <para style="P3">[[ line.name ]]</para>
- </td>
- <td>
- <para style="P6">[[ ','.join(map( lambda x: x.name, line.tax_id)) or '0.00' ]]</para>
- </td>
- <td>
- <para style="P20">[[ line.product_uom_qty or '0.00' ]] [[ line.product_uom.name ]] </para>
-=======
<para style="P3">[[ line.name ]][[ (line.to_invoice==True) or removeParentNode('tr') ]]</para>
</td>
<td>
@@ -348,7 +295,7 @@
</td>
<td>
<para style="P20">[[ line.product_uom_qty or '0.00' ]] [[ line.product_uom.name ]]</para>
->>>>>>> MERGE-SOURCE
+
</td>
<td>
<para style="P1">[[ line.price_unit ]]</para>
@@ -359,30 +306,11 @@
</tr>
</blockTable>
</section>
-<<<<<<< TREE
- <para style="P22">Fees Line(s)</para>
- <para style="P21">
- <font color="white"> </font>
- </para>
-=======
<para style="P23">Fees Line(s)</para>
<para style="P21"/>
->>>>>>> MERGE-SOURCE
<blockTable colWidths="28.0,145.0,150.0,96.0,51.0,69.0" style="Table6">
<tr>
<td>
-<<<<<<< TREE
- <para style="P21">[[ repeatIn(o.fees_lines,'fees') ]]</para>
- </td>
- <td>
- <para style="P3">[[ fees.name ]]</para>
- </td>
- <td>
- <para style="P6">[[ ','.join(map( lambda x: x.name, fees.tax_id)) or '0.00' ]]</para>
- </td>
- <td>
- <para style="P20">[[ fees.product_uom_qty or '0.00' ]] [[ fees.product_uom.name ]] </para>
-=======
<para style="P21">[[ repeatIn(o.fees_lines,'fees') ]]</para>
</td>
<td>
@@ -393,7 +321,6 @@
</td>
<td>
<para style="P20">[[ fees.product_uom_qty or '0.00' ]] [[ fees.product_uom.name ]] </para>
->>>>>>> MERGE-SOURCE
</td>
<td>
<para style="P1">[[ fees.price_unit ]]</para>
@@ -403,92 +330,6 @@
</td>
</tr>
</blockTable>
-<<<<<<< TREE
- <blockTable colWidths="90.0,90.0,221.0,57.0,54.0,28.0" style="Table7">
- <tr>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P24">Net Total :</para>
- </td>
- <td>
- <para style="P25">[[ o.amount_untaxed or '0.00' ]]</para>
- </td>
- <td>
- <para style="P25">[[ o.pricelist_id.currency_id.name ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P24">Taxes:</para>
- </td>
- <td>
- <para style="P25">[[ o.amount_tax or '0.00']]</para>
- </td>
- <td>
- <para style="P25">[[ o.pricelist_id.currency_id.name ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="Table Contents">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P24">Total :</para>
- </td>
- <td>
- <para style="P26">[[ total(o) ]]</para>
- </td>
- <td>
- <para style="P25">[[ o.pricelist_id.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P29">
- <font color="white"> </font>
- </para>
- <para style="P29">
-=======
<para style="P22">
<font color="white"> </font>
</para>
@@ -549,7 +390,6 @@
<font color="white"> </font>
</para>
<para style="Standard">
->>>>>>> MERGE-SOURCE
<font color="white"> </font>
</para>
<blockTable colWidths="534.0" style="Table8">
@@ -559,12 +399,8 @@
</td>
</tr>
</blockTable>
-<<<<<<< TREE
- <para style="P23"/>
-=======
<para style="P24">
<font color="white"> </font>
</para>
->>>>>>> MERGE-SOURCE
</story>
</document> \ No newline at end of file
diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot
index 524c6a4549c..0b548ce2891 100644
--- a/addons/point_of_sale/i18n/point_of_sale.pot
+++ b/addons/point_of_sale/i18n/point_of_sale.pot
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: OpenERP Server 5.0.0-rc1\n"
+"Project-Id-Version: OpenERP Server 5.0.0_rc1\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2008-11-28 17:09:36+0000\n"
-"PO-Revision-Date: 2008-11-28 17:09:36+0000\n"
+"POT-Creation-Date: 2008-12-20 19:51:31+0000\n"
+"PO-Revision-Date: 2008-12-20 19:51:31+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -43,11 +43,22 @@ msgid "Discount :"
msgstr ""
#. module: point_of_sale
+#: wizard_field:pos.payment,ask_pay,payment_nb:0
+#: field:pos.payment,payment_nb:0
+msgid "Piece number"
+msgstr ""
+
+#. module: point_of_sale
#: field:pos.order,name:0
msgid "Order Description"
msgstr ""
#. module: point_of_sale
+#: model:ir.actions.wizard,name:point_of_sale.pos_scan_product
+msgid "Scan Product"
+msgstr ""
+
+#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Document"
msgstr ""
@@ -88,6 +99,11 @@ msgid "Base"
msgstr ""
#. module: point_of_sale
+#: wizard_view:pos.scan_product,init:0
+msgid "Scan product"
+msgstr ""
+
+#. module: point_of_sale
#: field:pos.order.line,price_subtotal:0
msgid "Subtotal"
msgstr ""
@@ -113,6 +129,11 @@ msgid "Ok"
msgstr ""
#. module: point_of_sale
+#: wizard_view:pos.scan_product,init:0
+msgid "Scan gencod"
+msgstr ""
+
+#. module: point_of_sale
#: field:pos.order,last_out_picking:0
msgid "Last output picking"
msgstr ""
@@ -152,6 +173,7 @@ msgid "Number of transaction"
msgstr ""
#. module: point_of_sale
+#: model:ir.actions.act_window,name:point_of_sale.action_pos_order_line
#: model:ir.actions.act_window,name:point_of_sale.action_pos_order_line_day
msgid "Sale line"
msgstr ""
@@ -284,6 +306,26 @@ msgid "Sum of subtotals"
msgstr ""
#. module: point_of_sale
+#: wizard_field:pos.payment,ask_pay,payment_date:0
+#: field:pos.payment,payment_date:0
+msgid "Payment date"
+msgstr ""
+
+#. module: point_of_sale
+#: wizard_field:pos.payment,ask_pay,payment_name:0
+#: field:pos.payment,payment_name:0
+msgid "Payment name"
+msgstr ""
+
+#. module: point_of_sale
+#: selection:pos.payment,ask_pay,journal:0
+#: selection:pos.config.journal,init,default_journal_rebate:0
+#: selection:pos.config.journal,init,default_journal_gift:0
+#: selection:pos.config.journal,init,default_journal:0
+msgid "x Bank Journal"
+msgstr ""
+
+#. module: point_of_sale
#: field:pos.order,lines:0
msgid "Order Lines"
msgstr ""
@@ -458,6 +500,16 @@ msgid "Disc :"
msgstr ""
#. module: point_of_sale
+#: wizard_field:pos.scan_product,init,gencod:0
+msgid "Gencod"
+msgstr ""
+
+#. module: point_of_sale
+#: wizard_button:pos.scan_product,init,add:0
+msgid "Add"
+msgstr ""
+
+#. module: point_of_sale
#: selection:pos.order,state:0
msgid "Draft"
msgstr ""
@@ -488,6 +540,14 @@ msgid "E-mail :"
msgstr ""
#. module: point_of_sale
+#: selection:pos.payment,ask_pay,journal:0
+#: selection:pos.config.journal,init,default_journal_rebate:0
+#: selection:pos.config.journal,init,default_journal_gift:0
+#: selection:pos.config.journal,init,default_journal:0
+msgid "x Checks Journal"
+msgstr ""
+
+#. module: point_of_sale
#: rml:pos.details_summary:0
#: rml:pos.details:0
msgid "Total invoiced"
@@ -679,6 +739,7 @@ msgstr ""
#: wizard_button:pos.payment,ask_pay,end:0
#: wizard_button:pos.refund_order,init,end:0
#: wizard_button:pos.sale.get,init,end:0
+#: wizard_button:pos.scan_product,init,end:0
#: wizard_button:pos.config.journal,init,end:0
#: selection:pos.order,state:0
#: view:pos.order:0
@@ -864,6 +925,12 @@ msgid "Account Entry"
msgstr ""
#. module: point_of_sale
+#: wizard_field:pos.payment,ask_pay,payment_id:0
+#: field:pos.payment,payment_id:0
+msgid "Payment Term"
+msgstr ""
+
+#. module: point_of_sale
#: rml:pos.invoice:0
#: wizard_field:pos.payment,ask_pay,amount:0
#: field:pos.payment,amount:0
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index d3f1e3a9b1b..18f37db8806 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -24,6 +24,7 @@ import time
import netsvc
from osv import fields, osv
from mx import DateTime
+from tools.translate import _
class pos_config_journal(osv.osv):
@@ -408,18 +409,28 @@ class pos_order(osv.osv):
return True
- def add_payment(self, cr, uid, order_id, amount, journal, context=None):
+ def add_payment(self, cr, uid, order_id, data, context=None):
"""Create a new payment for the order"""
order = self.browse(cr, uid, order_id, context)
if order.invoice_wanted and not order.partner_id:
raise osv.except_osv("Error", "Cannot create invoice without a partner.")
- payment_id = self.pool.get('pos.payment').create(cr, uid, {
+ args = {
'order_id': order_id,
- 'journal_id': journal,
- 'amount': amount,
- })
+ 'journal_id': data['journal'],
+ 'amount': data['amount'],
+ 'payment_id': data['payment_id'],
+ }
+
+ if 'payment_date' in data.keys():
+ args['payment_date'] = data['payment_date']
+ if 'payment_name' in data.keys():
+ args['payment_name'] = data['payment_name']
+ if 'payment_nb' in data.keys():
+ args['payment_nb'] = data['payment_nb']
+
+ payment_id = self.pool.get('pos.payment').create(cr, uid, args )
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'pos.order', order_id, 'payment', cr)
@@ -801,6 +812,52 @@ class pos_order_line(osv.osv):
return False
return super(pos_order_line, self).write(cr, user, ids, values, context)
+ def _scan_product(self, cr, uid, ean, qty, order):
+ # search pricelist_id
+ pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] )
+ if not pricelist_id:
+ return False
+
+ new_line = True
+
+ product_id = self.pool.get('product.product').search(cr, uid, [('ean13','=', ean)])
+ if not product_id:
+ return false
+
+ # search price product
+ product = self.pool.get('product.product').read(cr, uid, product_id)
+ product_name = product[0]['name']
+ price = self.price_by_product(cr, uid, 0, pricelist_id[0]['pricelist_id'][0], product_id[0], 1)
+
+ order_line_ids = self.search(cr, uid, [('name','=',product_name),('order_id','=',order)])
+ if order_line_ids:
+ new_line = False
+ order_line_id = order_line_ids[0]
+ qty += self.read(cr, uid, order_line_ids[0], ['qty'])['qty']
+
+ if new_line:
+ vals = {'product_id': product_id[0],
+ 'price_unit': price,
+ 'qty': qty,
+ 'name': product_name,
+ 'order_id': order,
+ }
+ line_id = self.create(cr, uid, vals)
+ if not line_id:
+ raise wizard.except_wizard(_('Error'), _('Create line failed !'))
+ else:
+ vals = {
+ 'qty': qty,
+ 'price_unit': price
+ }
+ line_id = self.write(cr, uid, order_line_id, vals)
+ if not line_id:
+ raise wizard.except_wizard(_('Error'), _('Modify line failed !'))
+ line_id = order_line_id
+
+ price_line = float(qty)*float(price)
+ return {'name': product_name, 'product_id': product_id[0], 'price': price, 'price_line': price_line ,'qty': qty }
+
pos_order_line()
@@ -826,11 +883,16 @@ class pos_payment(osv.osv):
'name': fields.char('Description', size=64),
'order_id': fields.many2one('pos.order', 'Order Ref', required=True, ondelete='cascade'),
'journal_id': fields.many2one('account.journal', "Journal", required=True),
+ 'payment_id': fields.many2one('account.payment.term','Payment Term', select=True),
+ 'payment_nb': fields.char('Piece number', size=32),
+ 'payment_name': fields.char('Payment name', size=32),
+ 'payment_date': fields.date('Payment date', required=True),
'amount': fields.float('Amount', required=True),
}
_defaults = {
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.payment'),
'journal_id': _journal_default,
+ 'payment_date': lambda *a: time.strftime('%Y-%m-%d'),
}
def create(self, cr, user, vals, context={}):
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index 4c6510f4abb..68eb8ebf3ed 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -9,6 +9,8 @@
<form string="Sales Order POS">
<notebook >
<page string="Order lines">
+ <field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
+ <field name="pricelist_id" domain="[('type','=','sale')]"/>
<field name="lines" colspan="4" nolabel="1">
<tree string="Order lines" editable="bottom">
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275"/>
@@ -73,15 +75,16 @@
<page string="Payment">
<field name="payments" colspan="4" nolabel="1">
<tree string="Payments" editable="bottom">
- <field name="journal_id" select="1" width="200"/>
+ <field name="payment_id" />
+ <field name="payment_nb" />
+ <field name="payment_name" width="200" />
+ <field name="payment_date" />
<field name="amount" />
</tree>
</field>
<separator string="Invoicing" colspan="4"/>
<field name="nb_print"/>
<newline/>
- <field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
- <newline/>
<field name="invoice_id"/>
<label/>
<button name="invoice" string="Create _Invoice" states="paid"/>
@@ -91,7 +94,6 @@
</page>
<page string="Other">
- <field name="pricelist_id" domain="[('type','=','sale')]"/>
<field name="shop_id" />
<field name="name" select="1"/>
<field name="date_order" select="1"/>
diff --git a/addons/point_of_sale/pos_wizard.xml b/addons/point_of_sale/pos_wizard.xml
index 67ff7069ae0..afef00eb17f 100644
--- a/addons/point_of_sale/pos_wizard.xml
+++ b/addons/point_of_sale/pos_wizard.xml
@@ -26,5 +26,8 @@
<wizard string="Get From Order" model="pos.order"
name="pos.sale.get" id="pos_sale_get"/>
+ <wizard string="Scan Product" model="pos.order"
+ name="pos.scan_product" id="pos_scan_product"/>
+
</data>
</openerp>
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 466b2ad22b3..858ea4a474a 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -27,5 +27,6 @@ import wizard_add_product
import wizard_confirm
import wizard_discount
import wizard_get_sale
+import wizard_scan_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment.py b/addons/point_of_sale/wizard/wizard_pos_payment.py
index f3629994e92..b1bb0d3af1e 100644
--- a/addons/point_of_sale/wizard/wizard_pos_payment.py
+++ b/addons/point_of_sale/wizard/wizard_pos_payment.py
@@ -23,6 +23,7 @@
import pooler
import netsvc
import wizard
+import time
def _get_journal(self, cr, uid, context):
@@ -38,6 +39,10 @@ payment_form = """<?xml version="1.0"?>
<form string="Add payment :">
<field name="amount" />
<field name="journal"/>
+ <field name="payment_id" />
+ <field name="payment_date" />
+ <field name="payment_nb" />
+ <field name="payment_name" />
<field name="invoice_wanted" />
</form>
"""
@@ -50,6 +55,10 @@ payment_fields = {
'selection': _get_journal,
'required': True,
},
+ 'payment_id': {'string': 'Payment Term', 'type': 'many2one', 'relation': 'account.payment.term', 'required': True},
+ 'payment_date': {'string': 'Payment date', 'type': 'date', 'required': True},
+ 'payment_name': {'string': 'Payment name', 'type': 'char', 'size': '32'},
+ 'payment_nb': {'string': 'Piece number', 'type': 'char', 'size': '32'},
}
@@ -95,20 +104,23 @@ def _pre_init(self, cr, uid, data, context):
#invoice_wanted_checked = not not order.partner_id # not not -> boolean
invoice_wanted_checked = False
- return {'journal': journal, 'amount': amount, 'invoice_wanted': invoice_wanted_checked}
+ # select the current date
+ current_date = time.strftime('%Y-%m-%d')
+
+ return {'journal': journal, 'amount': amount, 'invoice_wanted': invoice_wanted_checked, 'payment_date': current_date}
def _add_pay(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
order_obj = pool.get('pos.order')
- amount = data['form']['amount']
- journal = data['form']['journal']
- invoice_wanted = data['form']['invoice_wanted'] == 1
+ result = data['form']
+
+ invoice_wanted = data['form']['invoice_wanted']
# add 'invoice_wanted' in 'pos.order'
order_obj.write(cr, uid, [data['id']], {'invoice_wanted': invoice_wanted})
- order_obj.add_payment(cr, uid, data['id'], amount, journal, context=context)
+ order_obj.add_payment(cr, uid, data['id'], result, context=context)
return {}
diff --git a/addons/point_of_sale/wizard/wizard_scan_product.py b/addons/point_of_sale/wizard/wizard_scan_product.py
new file mode 100644
index 00000000000..9320b4ffb6f
--- /dev/null
+++ b/addons/point_of_sale/wizard/wizard_scan_product.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 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
+from osv import osv
+
+form_gencod = """<?xml version="1.0"?>
+<form string="Scan product">
+<label string="Scan gencod" colspan="4"/>
+<field name="gencod" colspan="4" nolabel="1"/>
+</form>
+"""
+
+fields_gencod = {
+ 'gencod': {'string': 'Gencod',
+ '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')
+
diff --git a/addons/project/wizard/close_task.py b/addons/project/wizard/close_task.py
index d4b36b9e47c..ecd209fa217 100644
--- a/addons/project/wizard/close_task.py
+++ b/addons/project/wizard/close_task.py
@@ -44,7 +44,7 @@ def email_send(cr, uid, ids, to_adr, description, context={}):
from_adr = task.user_id.address_id.email
signature = task.user_id.signature
else:
- raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
+ raise wizard.except_wizard(_('Error'), _("Couldn't send mail because your email address is not configured!"))
if to_adr:
val = {
@@ -60,7 +60,7 @@ def email_send(cr, uid, ids, to_adr, description, context={}):
body = u'%s\n%s\n%s\n\n-- \n%s' % (header, description, footer, signature)
email(from_adr, [to_adr], subject, body.encode('utf-8'), email_bcc=[from_adr])
else:
- raise osv.except_osv(_('Error'), _("Couldn't send mail because the contact for this task (%s) has no email address!") % contact.name)
+ raise wizard.except_wizard(_('Error'), _("Couldn't send mail because the contact for this task (%s) has no email address!") % contact.name)
class wizard_close(wizard.interface):
def _check_complete(self, cr, uid, data, context):
diff --git a/addons/report_timesheet/report_timesheet.py b/addons/report_timesheet/report_timesheet.py
index 24600652389..4b05d0ef38c 100644
--- a/addons/report_timesheet/report_timesheet.py
+++ b/addons/report_timesheet/report_timesheet.py
@@ -22,6 +22,8 @@
from osv import fields,osv
+import tools.sql
+
class report_timesheet_user(osv.osv):
_name = "report_timesheet.user"
_description = "Timesheet per day"
@@ -34,6 +36,7 @@ class report_timesheet_user(osv.osv):
}
_order = 'name desc,user_id desc'
def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'report_timesheet_user')
cr.execute("""
create or replace view report_timesheet_user as (
select