From 43794fa5cb2fbfae504f07d0266aec86fd20fac0 Mon Sep 17 00:00:00 2001
From: "diego.barreto" <diego.barreto@eynes.com.ar>
Date: Thu, 30 May 2024 10:54:48 -0300
Subject: [PATCH 1/2] [ADD] autoprinter config

---
 tecnitower_custom/__manifest__.py             |  1 +
 tecnitower_custom/i18n/es_AR.po               | 36 +++++++++++++++++++
 tecnitower_custom/models/__init__.py          |  4 ++-
 tecnitower_custom/models/res_company.py       |  9 +++++
 .../models/res_config_settings.py             | 32 +++++++++++++++++
 .../views/res_config_settigs_views.xml        | 28 +++++++++++++++
 6 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 tecnitower_custom/models/res_company.py
 create mode 100644 tecnitower_custom/models/res_config_settings.py
 create mode 100644 tecnitower_custom/views/res_config_settigs_views.xml

diff --git a/tecnitower_custom/__manifest__.py b/tecnitower_custom/__manifest__.py
index bf2c9bc..69383ae 100644
--- a/tecnitower_custom/__manifest__.py
+++ b/tecnitower_custom/__manifest__.py
@@ -29,6 +29,7 @@
     ],
     'data': [
         'views/stock_picking_view.xml',
+        'views/res_config_settigs_views.xml',
     ],
     'installable': True,
     'application': True,
diff --git a/tecnitower_custom/i18n/es_AR.po b/tecnitower_custom/i18n/es_AR.po
index e69de29..2b9a225 100644
--- a/tecnitower_custom/i18n/es_AR.po
+++ b/tecnitower_custom/i18n/es_AR.po
@@ -0,0 +1,36 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# 	* tecnitower_custom
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2023-11-23 19:06+0000\n"
+"PO-Revision-Date: 2024-04-22 16:46+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: tecnitower_custom
+#: model:ir.model.fields,field_description:tecnitower_custom.field_res_config_settings__autoprinter_num
+msgid "Autoprinter Number"
+msgstr "Numero Autorizado Autoimpresor"
+
+#. module: tecnitower_custom
+#: model:ir.model.fields,field_description:tecnitower_custom.field_res_config_settings__autoprinter_code
+msgid "Autoprinter Code"
+msgstr "Codigo Autorizado Autoimpresor"
+
+#. module: tecnitower_custom
+#: model:ir.model.fields,field_description:tecnitower_custom.field_res_config_settings__autoprinter_due_date
+msgid "Autoprinter Due Date"
+msgstr "Fecha de Vencimiento Autorizado Autoimpresor"
+
+#. module: tecnitower_custom
+#: model_terms:ir.ui.view,arch_db:tecnitower_custom.res_config_settings_view_form_inherit_tecnitower_custom
+msgid "Auto Print Configuration"
+msgstr "Configuracion Autorizado Autoimpresor"
diff --git a/tecnitower_custom/models/__init__.py b/tecnitower_custom/models/__init__.py
index f08450e..23c2788 100644
--- a/tecnitower_custom/models/__init__.py
+++ b/tecnitower_custom/models/__init__.py
@@ -1 +1,3 @@
-from . import stock_picking
\ No newline at end of file
+from . import stock_picking
+from . import res_company
+from . import res_config_settings
diff --git a/tecnitower_custom/models/res_company.py b/tecnitower_custom/models/res_company.py
new file mode 100644
index 0000000..683ea8a
--- /dev/null
+++ b/tecnitower_custom/models/res_company.py
@@ -0,0 +1,9 @@
+from odoo import fields, models
+
+class ResCompany(models.Model):
+    _inherit = "res.company"
+    _description = "Res Company Tecnitower"
+
+    autoprinter_num = fields.Char(string="Autoprinter Number")
+    autoprinter_code = fields.Integer(string="Autoprinter Code")
+    autoprinter_due_date = fields.Date(string="Autoprinter Due Date")
diff --git a/tecnitower_custom/models/res_config_settings.py b/tecnitower_custom/models/res_config_settings.py
new file mode 100644
index 0000000..bbda354
--- /dev/null
+++ b/tecnitower_custom/models/res_config_settings.py
@@ -0,0 +1,32 @@
+from odoo import api, fields, models
+
+class ResConfigSettings(models.TransientModel):
+    _inherit = 'res.config.settings'
+    _description = "Res Config Settings Tecnitower"
+
+    autoprinter_num = fields.Char(
+        related='company_id.autoprinter_num',
+        string="Autoprinter Number",
+        readonly=False,
+    )
+
+    autoprinter_code = fields.Integer(
+        related='company_id.autoprinter_code',
+        string="Autoprinter Code",
+        readonly=False,
+    )
+
+    autoprinter_due_date = fields.Date(
+        related='company_id.autoprinter_due_date',
+        string="Autoprinter Due Date",
+        readonly=False,
+    )
+
+    def set_values(self):
+        res = super().set_values()
+        return res
+
+    @api.model
+    def get_values(self):
+        res = super().get_values()
+        return res
diff --git a/tecnitower_custom/views/res_config_settigs_views.xml b/tecnitower_custom/views/res_config_settigs_views.xml
new file mode 100644
index 0000000..7c51486
--- /dev/null
+++ b/tecnitower_custom/views/res_config_settigs_views.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+    <record id="res_config_settings_view_form_inherit_tecnitower_custom" model="ir.ui.view">
+        <field name="name">res.config.settings.view.form.inherit.tecnitower</field>
+        <field name="model">res.config.settings</field>
+        <field name="inherit_id" ref="account.res_config_settings_view_form" />
+        <field name="arch" type="xml">
+
+            <xpath expr="//div[@id='production_lot_info']" position="after">
+                <h2>Auto Print Configuration</h2>
+                <group>
+                    <group>
+                        <field name="autoprinter_num" class="oe_inline" />
+                    </group>
+                    <group>
+                        <field name="autoprinter_code" class="oe_inline" />
+                    </group>
+                    <group>
+                        <field name="autoprinter_due_date" class="oe_inline" />
+                    </group>
+                </group>
+            </xpath>
+
+        </field>
+    </record>
+
+</odoo>
-- 
GitLab


From 0ebcd7ca2cf4f901d7bdec4fc4693720385bc349 Mon Sep 17 00:00:00 2001
From: "diego.barreto" <diego.barreto@eynes.com.ar>
Date: Thu, 30 May 2024 10:58:44 -0300
Subject: [PATCH 2/2] [FIX] conflicts

---
 tecnitower_custom/__manifest__.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tecnitower_custom/__manifest__.py b/tecnitower_custom/__manifest__.py
index 69383ae..2a7d041 100644
--- a/tecnitower_custom/__manifest__.py
+++ b/tecnitower_custom/__manifest__.py
@@ -29,6 +29,7 @@
     ],
     'data': [
         'views/stock_picking_view.xml',
+        'report/stock_picking_qweb.xml',
         'views/res_config_settigs_views.xml',
     ],
     'installable': True,
-- 
GitLab