pos_order_view.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="view_pos_pos_form" model="ir.ui.view">
  4. <field name="name">pos.order.form</field>
  5. <field name="model">pos.order</field>
  6. <field name="arch" type="xml">
  7. <form string="Point of Sale Orders" create="0">
  8. <header>
  9. <button name="%(action_pos_payment)d" string="Payment" class="oe_highlight" type="action" states="draft" />
  10. <button name="action_pos_order_invoice" string="Invoice" type="object"
  11. attrs="{'invisible': [('state','!=','paid')]}"/>
  12. <button name="refund" string="Return Products" type="object"
  13. attrs="{'invisible':['|', ('state','=','draft'), ('has_refundable_lines', '=', False)]}"/>
  14. <field name="state" widget="statusbar" statusbar_visible="draft,paid,done" />
  15. <field name="has_refundable_lines" invisible="1" />
  16. <field name="refunded_orders_count" invisible="1" />
  17. </header>
  18. <sheet>
  19. <field name="failed_pickings" invisible="1"/>
  20. <field name="is_refunded" invisible="1"/>
  21. <div class="oe_button_box" name="button_box">
  22. <button name="action_stock_picking"
  23. type="object"
  24. class="oe_stat_button"
  25. icon="fa-truck"
  26. attrs="{'invisible':[('picking_count', '=', 0)]}">
  27. <field name="picking_count" widget="statinfo" string="Pickings" attrs="{'invisible': [('failed_pickings', '!=', False)]}"/>
  28. <field name="picking_count" widget="statinfo" string="Pickings" class="text-danger" attrs="{'invisible': [('failed_pickings', '=', False)]}"/>
  29. </button>
  30. <button name="action_view_invoice"
  31. string="Invoice"
  32. type="object"
  33. class="oe_stat_button"
  34. icon="fa-pencil-square-o"
  35. attrs="{'invisible':[('state','!=','invoiced')]}">
  36. </button>
  37. <button name="action_view_refund_orders"
  38. type="object"
  39. class="oe_stat_button"
  40. icon="fa-undo"
  41. attrs="{'invisible':[('is_refunded', '=', False)]}">
  42. <field name="refund_orders_count" widget="statinfo" string="Refunds" />
  43. </button>
  44. <button name="action_view_refunded_orders"
  45. type="object"
  46. class="oe_stat_button"
  47. icon="fa-shopping-cart "
  48. attrs="{'invisible':[('refunded_orders_count', '=', 0)]}">
  49. <field name="refunded_orders_count" widget="statinfo" string="Refunded Orders" />
  50. </button>
  51. </div>
  52. <group col="4" colspan="4" name="order_fields">
  53. <field name="name"/>
  54. <field name="date_order"/>
  55. <field name="session_id" />
  56. <field string="User" name="user_id"/>
  57. <field name="partner_id" context="{'res_partner_search_mode': 'customer'}" attrs="{'readonly': [('state','=','invoiced')]}"/>
  58. <field name="fiscal_position_id" options="{'no_create': True}"/>
  59. </group>
  60. <notebook colspan="4">
  61. <page string="Products" name="products">
  62. <field name="lines" colspan="4" nolabel="1">
  63. <tree string="Order lines" editable="bottom">
  64. <field name="full_product_name"/>
  65. <field name="pack_lot_ids" widget="many2many_tags" groups="stock.group_production_lot"/>
  66. <field name="qty"/>
  67. <field name="customer_note" optional="hide"/>
  68. <field name="product_uom_id" string="UoM" groups="uom.group_uom"/>
  69. <field name="price_unit" widget="monetary"/>
  70. <field name="is_total_cost_computed" invisible="1"/>
  71. <field name="total_cost" attrs="{'invisible': [('is_total_cost_computed','=', False)]}" optional="hide" widget="monetary"/>
  72. <field name="margin" attrs="{'invisible': [('is_total_cost_computed','=', False)]}" optional="hide" widget="monetary"/>
  73. <field name="margin_percent" attrs="{'invisible': [('is_total_cost_computed','=', False)]}" optional="hide" widget="percentage"/>
  74. <field name="discount" string="Disc.%"/>
  75. <field name="tax_ids_after_fiscal_position" widget="many2many_tags" string="Taxes"/>
  76. <field name="tax_ids" widget="many2many_tags" invisible="1"/>
  77. <field name="price_subtotal" widget="monetary" force_save="1"/>
  78. <field name="price_subtotal_incl" widget="monetary" force_save="1"/>
  79. <field name="currency_id" invisible="1"/>
  80. <field name="refunded_qty" optional="hide" />
  81. </tree>
  82. <form string="Order lines">
  83. <group col="4">
  84. <field name="full_product_name"/>
  85. <field name="qty"/>
  86. <field name="discount"/>
  87. <field name="price_unit" widget="monetary"/>
  88. <field name="price_subtotal" invisible="1" widget="monetary" force_save="1"/>
  89. <field name="price_subtotal_incl" invisible="1" widget="monetary" force_save="1"/>
  90. <field name="tax_ids_after_fiscal_position" widget="many2many_tags" string="Taxes"/>
  91. <field name="tax_ids" widget="many2many_tags" invisible="1"/>
  92. <field name="pack_lot_ids" widget="many2many_tags" groups="stock.group_production_lot"/>
  93. <field name="notice"/>
  94. <field name="currency_id" invisible="1"/>
  95. </group>
  96. </form>
  97. </field>
  98. <group class="oe_subtotal_footer oe_right" colspan="2" name="order_total">
  99. <field name="amount_tax"
  100. force_save="1"
  101. widget="monetary"/>
  102. <div class="oe_subtotal_footer_separator oe_inline o_td_label">
  103. <label for="amount_total" />
  104. <button name="button_dummy"
  105. states="draft" string="(update)" class="oe_edit_only oe_link"/>
  106. </div>
  107. <field name="amount_total"
  108. force_save="1"
  109. nolabel="1"
  110. class="oe_subtotal_footer_separator"
  111. widget="monetary"/>
  112. <field name="amount_paid"
  113. string="Total Paid (with rounding)"
  114. class="oe_subtotal_footer_separator"
  115. widget="monetary"
  116. attrs="{'invisible': [('amount_paid','=', 'amount_total')]}"/>
  117. <label for="margin"/>
  118. <div class="text-nowrap">
  119. <field name="margin" class="oe_inline" attrs="{'invisible': [('is_total_cost_computed','=', False)]}"/>
  120. <span class="oe_inline" attrs="{'invisible': [('is_total_cost_computed','=', False)]}">
  121. (<field name="margin_percent" nolabel="1" class="oe_inline" widget="percentage"/>)
  122. </span>
  123. <span attrs="{'invisible': [('is_total_cost_computed','=', True)]}">TBD</span>
  124. </div>
  125. <field name="is_total_cost_computed" invisible="1"/>
  126. <field name="currency_id" invisible="1"/>
  127. </group>
  128. <div class="clearfix"/>
  129. </page>
  130. <page string="Payments" name="payments">
  131. <field name="payment_ids" colspan="4" nolabel="1">
  132. <tree string="Payments">
  133. <field name="currency_id" invisible="1" />
  134. <field name="payment_date"/>
  135. <field name="payment_method_id"/>
  136. <field name="amount"/>
  137. </tree>
  138. </field>
  139. </page>
  140. <page name="extra" string="Extra Info">
  141. <group >
  142. <group
  143. string="Accounting"
  144. groups="account.group_account_manager"
  145. attrs="{'invisible':['|', ('session_move_id','=', False), ('state', '=', 'invoiced')]}"
  146. >
  147. <field name="session_move_id" readonly="1" />
  148. </group>
  149. <group string="Other Information">
  150. <field name="pos_reference"/>
  151. <field name="company_id" groups="base.group_multi_company"/>
  152. <field name="pricelist_id" groups="product.group_product_pricelist"/>
  153. </group>
  154. </group>
  155. </page>
  156. <page string="Notes" name="notes">
  157. <field name="note"/>
  158. </page>
  159. </notebook>
  160. </sheet>
  161. </form>
  162. </field>
  163. </record>
  164. <record model="ir.ui.view" id="view_pos_order_kanban">
  165. <field name="name">pos.order.kanban</field>
  166. <field name="model">pos.order</field>
  167. <field name="arch" type="xml">
  168. <kanban class="o_kanban_mobile" create="0" sample="1">
  169. <field name="name"/>
  170. <field name="partner_id"/>
  171. <field name="amount_total"/>
  172. <field name="date_order"/>
  173. <field name="state"/>
  174. <field name="pos_reference"/>
  175. <field name="partner_id"/>
  176. <field name="currency_id"/>
  177. <templates>
  178. <t t-name="kanban-box">
  179. <div t-attf-class="oe_kanban_card oe_kanban_global_click">
  180. <div class="o_kanban_record_top">
  181. <div class="o_kanban_record_headings">
  182. <strong class="o_kanban_record_title">
  183. <span t-if="record.partner_id.value">
  184. <t t-esc="record.partner_id.value"/>
  185. </span>
  186. <span t-else="">
  187. <t t-esc="record.name.value"/>
  188. </span>
  189. </strong>
  190. </div>
  191. <strong><field name="amount_total" widget="monetary"/></strong>
  192. </div>
  193. <div class="row">
  194. <div class="col-12">
  195. <span><t t-esc="record.pos_reference.value"/></span>
  196. </div>
  197. </div>
  198. <div class="row">
  199. <div class="col-8 text-muted">
  200. <span><t t-esc="record.date_order.value"/></span>
  201. </div>
  202. <div class="col-4">
  203. <span class="float-end text-end">
  204. <field name="state" widget="label_selection" options="{'classes': {'draft': 'default',
  205. 'invoiced': 'success', 'cancel': 'danger'}}"/>
  206. </span>
  207. </div>
  208. </div>
  209. </div>
  210. </t>
  211. </templates>
  212. </kanban>
  213. </field>
  214. </record>
  215. <record model="ir.ui.view" id="view_pos_order_pivot">
  216. <field name="name">pos.order.pivot</field>
  217. <field name="model">pos.order</field>
  218. <field name="arch" type="xml">
  219. <pivot string="PoS Orders" sample="1">
  220. <field name="date_order" type="row"/>
  221. <field name="margin"/>
  222. <field name="margin_percent" invisible="1"/>
  223. <field name="amount_total" type="measure"/>
  224. </pivot>
  225. </field>
  226. </record>
  227. <record id="action_pos_pos_form" model="ir.actions.act_window">
  228. <field name="name">Orders</field>
  229. <field name="type">ir.actions.act_window</field>
  230. <field name="res_model">pos.order</field>
  231. <field name="view_mode">tree,form,kanban,pivot</field>
  232. <field name="view_id" eval="False"/>
  233. <field name="domain">[]</field>
  234. <field name="help" type="html">
  235. <p class="o_view_nocontent_empty_folder">
  236. No orders found
  237. </p><p>
  238. To record new orders, start a new session.
  239. </p>
  240. </field>
  241. </record>
  242. <record id="action_pos_sale_graph" model="ir.actions.act_window">
  243. <field name="name">Orders</field>
  244. <field name="type">ir.actions.act_window</field>
  245. <field name="res_model">pos.order</field>
  246. <field name="view_mode">graph,tree,form,kanban,pivot</field>
  247. <field name="domain">[('state', 'not in', ['draft', 'cancel', 'invoiced'])]</field>
  248. <field name="help" type="html">
  249. <p class="o_view_nocontent_smiling_face">
  250. No data yet!
  251. </p><p>
  252. Create a new POS order
  253. </p>
  254. </field>
  255. </record>
  256. <record id="view_pos_order_tree" model="ir.ui.view">
  257. <field name="name">pos.order.tree</field>
  258. <field name="model">pos.order</field>
  259. <field name="arch" type="xml">
  260. <tree string="POS Orders" create="0" sample="1" decoration-info="state == 'draft'" decoration-muted="state == 'cancel'">
  261. <field name="currency_id" invisible="1"/>
  262. <field name="name" decoration-bf="1"/>
  263. <field name="session_id" />
  264. <field name="date_order"/>
  265. <field name="pos_reference"/>
  266. <field name="partner_id"/>
  267. <field string="Cashier" name="user_id" widget="many2one_avatar_user"/>
  268. <field name="amount_total" sum="Amount total" widget="monetary" decoration-bf="1"/>
  269. <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state not in ('draft','cancel')"/>
  270. </tree>
  271. </field>
  272. </record>
  273. <record id="view_pos_order_tree_no_session_id" model="ir.ui.view">
  274. <field name="name">pos.order.tree_no_session_id</field>
  275. <field name="model">pos.order</field>
  276. <field name="mode">primary</field>
  277. <field name="priority">1000</field>
  278. <field name="inherit_id" ref="point_of_sale.view_pos_order_tree"/>
  279. <field name="arch" type="xml">
  280. <xpath expr="//field[@name='session_id']" position="replace"></xpath>
  281. </field>
  282. </record>
  283. <record id="view_pos_order_search" model="ir.ui.view">
  284. <field name="name">pos.order.search.view</field>
  285. <field name="model">pos.order</field>
  286. <field name="arch" type="xml">
  287. <search string="Point of Sale Orders">
  288. <field name="name"/>
  289. <field name="config_id"/>
  290. </search>
  291. </field>
  292. </record>
  293. <menuitem id="menu_point_ofsale" parent="menu_point_of_sale" action="action_pos_pos_form" sequence="2" groups="group_pos_manager,group_pos_user"/>
  294. <record id="view_pos_order_line" model="ir.ui.view">
  295. <field name="name">pos.order.line.tree</field>
  296. <field name="model">pos.order.line</field>
  297. <field name="arch" type="xml">
  298. <tree string="POS Order lines">
  299. <field name="product_id" readonly="1"/>
  300. <field name="qty" readonly="1" sum="Total qty"/>
  301. <field name="discount" readonly="1"/>
  302. <field name="price_unit" readonly="1" widget="monetary"/>
  303. <field name="price_subtotal" readonly="1" sum="Sum of subtotals" widget="monetary"/>
  304. <field name="price_subtotal_incl" readonly="1" sum="Sum of subtotals" widget="monetary"/>
  305. <field name="create_date" readonly="1"/>
  306. <field name="currency_id" invisible="1"/>
  307. </tree>
  308. </field>
  309. </record>
  310. <record id="view_pos_order_line_form" model="ir.ui.view">
  311. <field name="name">pos.order.line.form</field>
  312. <field name="model">pos.order.line</field>
  313. <field name="arch" type="xml">
  314. <form string="POS Order line">
  315. <group col="4">
  316. <field name="product_id" />
  317. <field name="qty" />
  318. <field name="discount"/>
  319. <field name="price_unit" widget="monetary"/>
  320. <field name="create_date" />
  321. <field name="currency_id"/>
  322. </group>
  323. </form>
  324. </field>
  325. </record>
  326. <record id="action_pos_order_line" model="ir.actions.act_window">
  327. <field name="name">Sale line</field>
  328. <field name="type">ir.actions.act_window</field>
  329. <field name="res_model">pos.order.line</field>
  330. <field name="view_mode">tree</field>
  331. <field name="view_id" ref="view_pos_order_line"/>
  332. </record>
  333. <record id="action_pos_order_line_form" model="ir.actions.act_window">
  334. <field name="name">Sale line</field>
  335. <field name="type">ir.actions.act_window</field>
  336. <field name="res_model">pos.order.line</field>
  337. <field name="view_mode">form,tree</field>
  338. <field name="view_id" ref="view_pos_order_line_form"/>
  339. </record>
  340. <record id="action_pos_order_line_day" model="ir.actions.act_window">
  341. <field name="name">Sale line</field>
  342. <field name="type">ir.actions.act_window</field>
  343. <field name="res_model">pos.order.line</field>
  344. <field name="view_mode">tree</field>
  345. <field name="view_id" ref="view_pos_order_line"/>
  346. <field name="domain">[('create_date', '&gt;=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '&lt;=', time.strftime('%Y-%m-%d 23:59:59'))]</field>
  347. </record>
  348. <record id="view_pos_order_tree_all_sales_lines" model="ir.ui.view">
  349. <field name="name">pos.order.line.all.sales.tree</field>
  350. <field name="model">pos.order.line</field>
  351. <field name="arch" type="xml">
  352. <tree string="POS Orders lines">
  353. <field name="order_id" />
  354. <field name="create_date" />
  355. <field name="product_id" />
  356. <field name="qty" />
  357. <field name="price_unit" widget="monetary"/>
  358. <field name="currency_id" invisible="1"/>
  359. </tree>
  360. </field>
  361. </record>
  362. <record id="action_pos_all_sales_lines" model="ir.actions.act_window">
  363. <field name="name">All sales lines</field>
  364. <field name="type">ir.actions.act_window</field>
  365. <field name="res_model">pos.order.line</field>
  366. <field name="view_id" ref="view_pos_order_tree_all_sales_lines" />
  367. </record>
  368. <record id="view_pos_order_filter" model="ir.ui.view">
  369. <field name="name">pos.order.list.select</field>
  370. <field name="model">pos.order</field>
  371. <field name="arch" type="xml">
  372. <search string="Search Sales Order">
  373. <field name="name"/>
  374. <field name="pos_reference"/>
  375. <field name="date_order"/>
  376. <field name="user_id"/>
  377. <field name="partner_id"/>
  378. <field name="session_id"/>
  379. <filter string="Invoiced" name="invoiced" domain="[('state', '=', 'invoiced')]"/>
  380. <filter string="Posted" name="posted" domain="[('state', '=', 'done')]"/>
  381. <separator/>
  382. <filter string="Order Date" name="order_date" date="date_order"/>
  383. <group expand="0" string="Group By">
  384. <filter string="Session" name="session" domain="[]" context="{'group_by': 'session_id'}"/>
  385. <filter string="User" name="user_id" domain="[]" context="{'group_by': 'user_id'}"/>
  386. <filter string="Customer" name="customer" domain="[]" context="{'group_by': 'partner_id'}"/>
  387. <filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
  388. <filter string="Order Date" name="order_month" domain="[]" context="{'group_by': 'date_order'}"/>
  389. </group>
  390. </search>
  391. </field>
  392. </record>
  393. <record id="pos_rounding_form_view_inherited" model="ir.ui.view">
  394. <field name="name">pos.cash.rounding.form.inherited</field>
  395. <field name="model">account.cash.rounding</field>
  396. <field name="inherit_id" ref="account.rounding_form_view"/>
  397. <field name="arch" type="xml">
  398. <xpath expr="//div[hasclass('oe_title')]" position="before">
  399. <div class="o_notification_alert alert alert-warning" role="alert">
  400. The Point of Sale only supports the "add a rounding line" rounding strategy.
  401. </div>
  402. </xpath>
  403. </field>
  404. </record>
  405. </odoo>