diff --git a/purchase_reference_name/__init__.py b/purchase_reference_name/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_reference_name/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_reference_name/__manifest__.py b/purchase_reference_name/__manifest__.py new file mode 100644 index 0000000..dcc376d --- /dev/null +++ b/purchase_reference_name/__manifest__.py @@ -0,0 +1,10 @@ +{ + "name": "Purchase Reference Name", + "summary": """ + Concatenate Purchase Order Partner Reference with name""", + "author": "José López, OPTIC", + "website": "https://optic.gob.do", + "version": "14.0.0.0.1", + "depends": ["purchase_stock"], + "data": ["views/purchase_views.xml"], +} diff --git a/purchase_reference_name/i18n/es_DO.po b/purchase_reference_name/i18n/es_DO.po new file mode 100644 index 0000000..4c010b6 --- /dev/null +++ b/purchase_reference_name/i18n/es_DO.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_reference_name +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-03-01 20:18+0000\n" +"PO-Revision-Date: 2022-03-01 15:18-0500\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es_DO\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 3.0.1\n" + +#. module: purchase_reference_name +#: model_terms:ir.ui.view,arch_db:purchase_reference_name.purchase_order_tree_inherited +msgid "DGCP Reference" +msgstr "No. Referencia DGCP" diff --git a/purchase_reference_name/models/__init__.py b/purchase_reference_name/models/__init__.py new file mode 100644 index 0000000..370f577 --- /dev/null +++ b/purchase_reference_name/models/__init__.py @@ -0,0 +1 @@ +from . import purchase diff --git a/purchase_reference_name/models/purchase.py b/purchase_reference_name/models/purchase.py new file mode 100644 index 0000000..d680130 --- /dev/null +++ b/purchase_reference_name/models/purchase.py @@ -0,0 +1,10 @@ +from odoo import models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + def _prepare_picking(self): + result = super(PurchaseOrder, self)._prepare_picking() + result["origin"] = self.partner_ref or self.name + return result diff --git a/purchase_reference_name/views/purchase_views.xml b/purchase_reference_name/views/purchase_views.xml new file mode 100644 index 0000000..142f36c --- /dev/null +++ b/purchase_reference_name/views/purchase_views.xml @@ -0,0 +1,15 @@ + + + + + purchase.order.tree.inherited + purchase.order + + + + + + + + +