← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge into lp:account-invoicing

 

Maxime Chambreuil (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge into lp:account-invoicing.

Commit message:
[ADD] account_invoice_purchase_origin module

Requested reviews:
  Account Core Editors (account-core-editors)

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge/+merge/216327

[ADD] account_invoice_purchase_origin module
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge/+merge/216327
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge.
=== added directory 'account_invoice_purchase_origin'
=== added file 'account_invoice_purchase_origin/__init__.py'
--- account_invoice_purchase_origin/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/__init__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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/>.
+#
+##############################################################################
+
+import purchase

=== added file 'account_invoice_purchase_origin/__openerp__.py'
--- account_invoice_purchase_origin/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/__openerp__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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': 'Account Invoice Purchase Origin',
+    'version': '1.1',
+    'category': 'Finance',
+    'description': """
+    This module displays the origin field of account invoice lines and populate
+    them when an invoice is created from a purchase order
+    """,
+    'author': 'Savoir-faire Linux',
+    'website': 'http://www.savoirfairelinux.com/',
+    'depends': ['account', 'purchase'],
+    'data': [
+        'account_invoice_view.xml',
+    ],
+    'test': [
+    ],
+    'demo': [],
+    'installable': True,
+    'active': False,
+    'certificate': False,
+}

=== added file 'account_invoice_purchase_origin/account_invoice_view.xml'
--- account_invoice_purchase_origin/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/account_invoice_view.xml	2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+    <record id="view_invoice_line_tree" model="ir.ui.view">
+      <field name="model">account.invoice</field>
+      <field name="inherit_id" ref="account.invoice_supplier_form" />
+      <field name="arch" type="xml">
+        <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
+          <field name="origin" readonly="1" />
+        </xpath>
+      </field>
+    </record>
+  </data>
+</openerp>

=== added file 'account_invoice_purchase_origin/purchase.py'
--- account_invoice_purchase_origin/purchase.py	1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/purchase.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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 openerp.osv import orm
+
+
+class purchase_order(orm.Model):
+
+    _inherit = 'purchase.order'
+
+    def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
+
+        return {
+            'name': order_line.name,
+            'account_id': account_id,
+            'price_unit': order_line.price_unit or 0.0,
+            'origin': order_line.order_id.name,
+            'quantity': order_line.product_qty,
+            'product_id': order_line.product_id.id or False,
+            'uos_id': order_line.product_uom.id or False,
+            'invoice_line_tax_id': [(6, 0, [x.id\
+                                            for x in order_line.taxes_id])],
+            'account_analytic_id': order_line.account_analytic_id.id or False,
+        }

=== added directory 'account_invoice_sale_origin'
=== added file 'account_invoice_sale_origin/__init__.py'
--- account_invoice_sale_origin/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/__init__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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/>.
+#
+##############################################################################
+
+import sale

=== added file 'account_invoice_sale_origin/__openerp__.py'
--- account_invoice_sale_origin/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/__openerp__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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': 'Account Invoice Sale Origin',
+    'version': '1.1',
+    'category': 'Finance',
+    'description': """
+    
+    This module displays the origin field of account invoice lines and populate
+    them when a customer invoice is create from a delivery order
+    """,
+    'author': 'Savoir-faire Linux',
+    'website': 'http://www.savoirfairelinux.com/',
+    'depends': ['account', 'sale'],
+    'data': [
+        'account_invoice_view.xml',
+    ],
+    'test': [
+    ],
+    'demo': [],
+    'installable': True,
+    'active': False,
+    'certificate': False,
+}

=== added directory 'account_invoice_sale_origin/account_invoice_purchase_origin'
=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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/>.
+#
+##############################################################################
+
+import purchase

=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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': 'Account Invoice Purchase Origin',
+    'version': '1.1',
+    'category': 'Finance',
+    'description': """
+    This module displays the origin field of account invoice lines and populate
+    them when an invoice is created from a purchase order
+    """,
+    'author': 'Savoir-faire Linux',
+    'website': 'http://www.savoirfairelinux.com/',
+    'depends': ['account', 'purchase'],
+    'data': [
+        'account_invoice_view.xml',
+    ],
+    'test': [
+    ],
+    'demo': [],
+    'installable': True,
+    'active': False,
+    'certificate': False,
+}

=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml'
--- account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml	2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+    <record id="view_invoice_line_tree" model="ir.ui.view">
+      <field name="model">account.invoice</field>
+      <field name="inherit_id" ref="account.invoice_supplier_form" />
+      <field name="arch" type="xml">
+        <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
+          <field name="origin" readonly="1" />
+        </xpath>
+      </field>
+    </record>
+  </data>
+</openerp>

=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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 openerp.osv import orm
+
+
+class purchase_order(orm.Model):
+
+    _inherit = 'purchase.order'
+
+    def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
+
+        return {
+            'name': order_line.name,
+            'account_id': account_id,
+            'price_unit': order_line.price_unit or 0.0,
+            'origin': order_line.order_id.name,
+            'quantity': order_line.product_qty,
+            'product_id': order_line.product_id.id or False,
+            'uos_id': order_line.product_uom.id or False,
+            'invoice_line_tax_id': [(6, 0, [x.id\
+                                            for x in order_line.taxes_id])],
+            'account_analytic_id': order_line.account_analytic_id.id or False,
+        }

=== added file 'account_invoice_sale_origin/account_invoice_view.xml'
--- account_invoice_sale_origin/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_view.xml	2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+    <record id="view_invoice_line_tree" model="ir.ui.view">
+      <field name="model">account.invoice</field>
+      <field name="inherit_id" ref="account.invoice_supplier_form" />
+      <field name="arch" type="xml">
+        <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
+          <field name="origin" readonly="1" />
+        </xpath>
+      </field>
+    </record>
+  </data>
+</openerp>

=== added file 'account_invoice_sale_origin/purchase.py'
--- account_invoice_sale_origin/purchase.py	1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/purchase.py	2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
+#
+#    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 openerp.osv import orm
+
+
+class purchase_order(orm.Model):
+
+    _inherit = 'purchase.order'
+
+    def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
+
+        return {
+            'name': order_line.name,
+            'account_id': account_id,
+            'price_unit': order_line.price_unit or 0.0,
+            'origin': order_line.order_id.name,
+            'quantity': order_line.product_qty,
+            'product_id': order_line.product_id.id or False,
+            'uos_id': order_line.product_uom.id or False,
+            'invoice_line_tax_id': [(6, 0, [x.id\
+                                            for x in order_line.taxes_id])],
+            'account_analytic_id': order_line.account_analytic_id.id or False,
+        }


Follow ups